Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
74e9b904
Commit
74e9b904
authored
Mar 03, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Replace nonprintable characters with spaces on SB_SETTEXT.
parent
6655d3f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
status.c
dlls/comctl32/status.c
+11
-0
status.c
dlls/comctl32/tests/status.c
+20
-10
No files found.
dlls/comctl32/status.c
View file @
74e9b904
...
...
@@ -762,6 +762,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
part
->
text
=
(
LPWSTR
)
text
;
}
else
{
LPWSTR
ntext
;
WCHAR
*
idx
;
if
(
text
&&
!
isW
)
{
LPCSTR
atxt
=
(
LPCSTR
)
text
;
...
...
@@ -775,6 +776,16 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
strcpyW
(
ntext
,
text
);
}
else
ntext
=
0
;
/* replace nonprintable characters with spaces */
if
(
ntext
)
{
idx
=
ntext
;
while
(
*
idx
)
{
if
(
!
isprintW
(
*
idx
))
*
idx
=
' '
;
idx
++
;
}
}
/* check if text is unchanged -> no need to redraw */
if
(
text
)
{
if
(
!
changed
&&
part
->
text
&&
!
lstrcmpW
(
ntext
,
part
->
text
))
{
...
...
dlls/comctl32/tests/status.c
View file @
74e9b904
...
...
@@ -258,6 +258,8 @@ static void test_status_control(void)
RECT
rc
;
CHAR
charArray
[
20
];
HICON
hIcon
;
char
ch
;
char
chstr
[
10
]
=
"Inval id"
;
hWndStatus
=
create_status_control
(
WS_VISIBLE
,
0
);
...
...
@@ -307,7 +309,7 @@ static void test_status_control(void)
/* Test resetting text with different characters */
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
0
,
(
LPARAM
)
"First@Again"
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
1
,
(
LPARAM
)
"InvalidChars
\\
7
\7
"
);
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
1
,
(
LPARAM
)
"Invalid
\t
Chars
\\
7
\7
"
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
2
,
(
LPARAM
)
"InvalidChars
\\
n
\n
"
);
expect
(
TRUE
,
r
);
...
...
@@ -318,20 +320,28 @@ static void test_status_control(void)
expect
(
11
,
LOWORD
(
r
));
expect
(
0
,
HIWORD
(
r
));
r
=
SendMessage
(
hWndStatus
,
SB_GETTEXT
,
1
,
(
LPARAM
)
charArray
);
todo_wine
{
ok
(
strcmp
(
charArray
,
"InvalidChars
\\
7 "
)
==
0
,
"Expected InvalidChars
\\
7 , got %s
\n
"
,
charArray
);
}
expect
(
15
,
LOWORD
(
r
));
ok
(
strcmp
(
charArray
,
"Invalid
\t
Chars
\\
7 "
)
==
0
,
"Expected Invalid
\t
Chars
\\
7 , got %s
\n
"
,
charArray
);
expect
(
16
,
LOWORD
(
r
));
expect
(
0
,
HIWORD
(
r
));
r
=
SendMessage
(
hWndStatus
,
SB_GETTEXT
,
2
,
(
LPARAM
)
charArray
);
todo_wine
{
ok
(
strcmp
(
charArray
,
"InvalidChars
\\
n "
)
==
0
,
"Expected InvalidChars
\\
n , got %s
\n
"
,
charArray
);
}
ok
(
strcmp
(
charArray
,
"InvalidChars
\\
n "
)
==
0
,
"Expected InvalidChars
\\
n , got %s
\n
"
,
charArray
);
expect
(
15
,
LOWORD
(
r
));
expect
(
0
,
HIWORD
(
r
));
/* test more nonprintable chars */
for
(
ch
=
0x00
;
ch
<
0x7F
;
ch
++
)
{
chstr
[
5
]
=
ch
;
r
=
SendMessage
(
hWndStatus
,
SB_SETTEXT
,
0
,
(
LPARAM
)
chstr
);
expect
(
TRUE
,
r
);
r
=
SendMessage
(
hWndStatus
,
SB_GETTEXT
,
0
,
(
LPARAM
)
charArray
);
/* substitution with single space */
if
(
ch
>
0x00
&&
ch
<
0x20
&&
ch
!=
'\t'
)
chstr
[
5
]
=
' '
;
ok
(
strcmp
(
charArray
,
chstr
)
==
0
,
"Expected %s, got %s
\n
"
,
chstr
,
charArray
);
}
/* Set background color */
r
=
SendMessage
(
hWndStatus
,
SB_SETBKCOLOR
,
0
,
RGB
(
255
,
0
,
0
));
ok
(
r
==
CLR_DEFAULT
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment