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
e4e2e8e5
Commit
e4e2e8e5
authored
May 29, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54bd7e65
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
157 additions
and
189 deletions
+157
-189
Makefile.in
dlls/comctl32/Makefile.in
+2
-0
combo.c
dlls/comctl32/combo.c
+0
-1
comboex.c
dlls/comctl32/comboex.c
+5
-6
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+5
-8
commctrl.c
dlls/comctl32/commctrl.c
+1
-2
datetime.c
dlls/comctl32/datetime.c
+10
-11
edit.c
dlls/comctl32/edit.c
+18
-21
header.c
dlls/comctl32/header.c
+0
-1
ipaddress.c
dlls/comctl32/ipaddress.c
+6
-7
listbox.c
dlls/comctl32/listbox.c
+18
-19
listview.c
dlls/comctl32/listview.c
+3
-7
monthcal.c
dlls/comctl32/monthcal.c
+13
-14
propsheet.c
dlls/comctl32/propsheet.c
+5
-6
rebar.c
dlls/comctl32/rebar.c
+0
-1
status.c
dlls/comctl32/status.c
+12
-13
string.c
dlls/comctl32/string.c
+16
-20
syslink.c
dlls/comctl32/syslink.c
+9
-10
taskdialog.c
dlls/comctl32/taskdialog.c
+4
-5
toolbar.c
dlls/comctl32/toolbar.c
+10
-11
tooltips.c
dlls/comctl32/tooltips.c
+7
-8
trackbar.c
dlls/comctl32/trackbar.c
+1
-1
treeview.c
dlls/comctl32/treeview.c
+11
-15
updown.c
dlls/comctl32/updown.c
+1
-2
No files found.
dlls/comctl32/Makefile.in
View file @
e4e2e8e5
...
...
@@ -4,6 +4,8 @@ IMPORTLIB = comctl32
IMPORTS
=
uuid user32 gdi32 advapi32 usp10 imm32
DELAYIMPORTS
=
winmm uxtheme
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
animate.c
\
button.c
\
...
...
dlls/comctl32/combo.c
View file @
e4e2e8e5
...
...
@@ -32,7 +32,6 @@
#include "uxtheme.h"
#include "vssym32.h"
#include "commctrl.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
dlls/comctl32/comboex.c
View file @
e4e2e8e5
...
...
@@ -30,7 +30,6 @@
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
comboex
);
...
...
@@ -632,14 +631,14 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if
(
item
->
mask
&
CBEIF_TEXT
)
{
INT
len
=
0
;
if
(
is_textW
(
cit
->
pszText
))
len
=
strlenW
(
cit
->
pszText
);
if
(
is_textW
(
cit
->
pszText
))
len
=
l
strlenW
(
cit
->
pszText
);
if
(
len
>
0
)
{
item
->
pszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
item
->
pszText
)
{
Free
(
item
);
return
-
1
;
}
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
l
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
}
else
if
(
cit
->
pszText
==
LPSTR_TEXTCALLBACKW
)
item
->
pszText
=
LPSTR_TEXTCALLBACKW
;
...
...
@@ -765,11 +764,11 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit)
INT
len
=
0
;
COMBOEX_FreeText
(
item
);
if
(
is_textW
(
cit
->
pszText
))
len
=
strlenW
(
cit
->
pszText
);
if
(
is_textW
(
cit
->
pszText
))
len
=
l
strlenW
(
cit
->
pszText
);
if
(
len
>
0
)
{
item
->
pszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
item
->
pszText
)
return
FALSE
;
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
l
strcpyW
(
item
->
pszText
,
cit
->
pszText
);
}
else
if
(
cit
->
pszText
==
LPSTR_TEXTCALLBACKW
)
item
->
pszText
=
LPSTR_TEXTCALLBACKW
;
item
->
cchTextMax
=
cit
->
cchTextMax
;
...
...
@@ -1404,7 +1403,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
str
=
COMBOEX_GetText
(
infoPtr
,
item
);
if
(
!
str
)
str
=
nil
;
len
=
strlenW
(
str
);
len
=
l
strlenW
(
str
);
GetTextExtentPoint32W
(
dis
->
hDC
,
str
,
len
,
&
txtsize
);
if
(
dis
->
itemAction
&
(
ODA_SELECT
|
ODA_DRAWENTIRE
))
{
...
...
dlls/comctl32/comctl32undoc.c
View file @
e4e2e8e5
...
...
@@ -26,8 +26,6 @@
* COMCTL32.DLL (internally).
*
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
...
...
@@ -47,7 +45,6 @@
#include "objbase.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "comctl32.h"
#include "wine/debug.h"
...
...
@@ -311,7 +308,7 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp )
if
(
mp
->
wineFlags
&
WMRUF_CHANGED
)
{
mp
->
wineFlags
&=
~
WMRUF_CHANGED
;
err
=
RegSetValueExW
(
newkey
,
strMRUList
,
0
,
REG_SZ
,
(
LPBYTE
)
mp
->
realMRU
,
(
strlenW
(
mp
->
realMRU
)
+
1
)
*
sizeof
(
WCHAR
));
(
l
strlenW
(
mp
->
realMRU
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
err
)
{
ERR
(
"error saving MRUList, err=%d
\n
"
,
err
);
}
...
...
@@ -470,7 +467,7 @@ INT WINAPI AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
if
((
replace
=
FindMRUData
(
hList
,
lpData
,
cbData
,
NULL
))
>=
0
)
{
/* Item exists, just move it to the front */
LPWSTR
pos
=
strchrW
(
mp
->
realMRU
,
replace
+
'a'
);
LPWSTR
pos
=
wcschr
(
mp
->
realMRU
,
replace
+
'a'
);
while
(
pos
>
mp
->
realMRU
)
{
pos
[
0
]
=
pos
[
-
1
];
...
...
@@ -555,7 +552,7 @@ INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString)
}
return
AddMRUData
(
hList
,
lpszString
,
(
strlenW
(
lpszString
)
+
1
)
*
sizeof
(
WCHAR
));
(
l
strlenW
(
lpszString
)
+
1
)
*
sizeof
(
WCHAR
));
}
/**************************************************************************
...
...
@@ -747,8 +744,8 @@ HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *infoW, DWORD dwParam2,
mp
=
Alloc
(
sizeof
(
WINEMRULIST
));
memcpy
(
&
mp
->
extview
,
infoW
,
sizeof
(
MRUINFOW
));
mp
->
extview
.
lpszSubKey
=
Alloc
((
strlenW
(
infoW
->
lpszSubKey
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
mp
->
extview
.
lpszSubKey
,
infoW
->
lpszSubKey
);
mp
->
extview
.
lpszSubKey
=
Alloc
((
l
strlenW
(
infoW
->
lpszSubKey
)
+
1
)
*
sizeof
(
WCHAR
));
l
strcpyW
(
mp
->
extview
.
lpszSubKey
,
infoW
->
lpszSubKey
);
mp
->
isUnicode
=
TRUE
;
return
create_mru_list
(
mp
);
...
...
dlls/comctl32/commctrl.c
View file @
e4e2e8e5
...
...
@@ -69,7 +69,6 @@
#include "shlwapi.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
commctrl
);
...
...
@@ -136,7 +135,7 @@ BOOL WINAPI RegisterClassNameW(const WCHAR *class)
while
(
min
<=
max
)
{
int
res
,
pos
=
(
min
+
max
)
/
2
;
if
(
!
(
res
=
strcmpiW
(
class
,
classes
[
pos
].
nameW
)))
if
(
!
(
res
=
wcsicmp
(
class
,
classes
[
pos
].
nameW
)))
{
classes
[
pos
].
fn_register
();
return
TRUE
;
...
...
dlls/comctl32/datetime.c
View file @
e4e2e8e5
...
...
@@ -44,7 +44,6 @@
#include "commctrl.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
datetime
);
...
...
@@ -251,7 +250,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, LPCWSTR formattxt)
*
nrFields
=
0
;
infoPtr
->
fieldspec
[
*
nrFields
]
=
0
;
len
=
strlenW
(
allowedformatchars
);
len
=
l
strlenW
(
allowedformatchars
);
k
=
0
;
for
(
i
=
0
;
formattxt
[
i
];
i
++
)
{
...
...
@@ -715,7 +714,7 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
break
;
}
}
GetTextExtentPoint32W
(
hdc
,
bufptr
,
strlenW
(
bufptr
),
&
size
);
GetTextExtentPoint32W
(
hdc
,
bufptr
,
l
strlenW
(
bufptr
),
&
size
);
return
size
.
cx
;
}
...
...
@@ -735,14 +734,14 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
WCHAR
txt
[
80
];
DATETIME_ReturnTxt
(
infoPtr
,
0
,
txt
,
ARRAY_SIZE
(
txt
));
GetTextExtentPoint32W
(
hdc
,
txt
,
strlenW
(
txt
),
&
size
);
GetTextExtentPoint32W
(
hdc
,
txt
,
l
strlenW
(
txt
),
&
size
);
rcDraw
->
bottom
=
size
.
cy
+
2
;
prevright
=
infoPtr
->
checkbox
.
right
=
((
infoPtr
->
dwStyle
&
DTS_SHOWNONE
)
?
18
:
2
);
for
(
i
=
0
;
i
<
infoPtr
->
nrFields
;
i
++
)
{
DATETIME_ReturnTxt
(
infoPtr
,
i
,
txt
,
ARRAY_SIZE
(
txt
));
GetTextExtentPoint32W
(
hdc
,
txt
,
strlenW
(
txt
),
&
size
);
GetTextExtentPoint32W
(
hdc
,
txt
,
l
strlenW
(
txt
),
&
size
);
field
=
&
infoPtr
->
fieldRect
[
i
];
field
->
left
=
prevright
;
field
->
right
=
prevright
+
DATETIME_GetFieldWidth
(
infoPtr
,
hdc
,
i
);
...
...
@@ -762,7 +761,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
{
memcpy
(
txt
,
infoPtr
->
charsEntered
,
infoPtr
->
nCharsEntered
*
sizeof
(
WCHAR
));
txt
[
infoPtr
->
nCharsEntered
]
=
0
;
GetTextExtentPoint32W
(
hdc
,
txt
,
strlenW
(
txt
),
&
size
);
GetTextExtentPoint32W
(
hdc
,
txt
,
l
strlenW
(
txt
),
&
size
);
}
SetRect
(
&
selection
,
0
,
0
,
size
.
cx
,
size
.
cy
);
...
...
@@ -778,7 +777,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
oldTextColor
=
SetTextColor
(
hdc
,
comctl32_color
.
clrWindowText
);
/* draw the date text using the colour set above */
DrawTextW
(
hdc
,
txt
,
strlenW
(
txt
),
field
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
DrawTextW
(
hdc
,
txt
,
l
strlenW
(
txt
),
field
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
SetTextColor
(
hdc
,
oldTextColor
);
}
SetBkMode
(
hdc
,
oldBkMode
);
...
...
@@ -1460,7 +1459,7 @@ static BOOL DATETIME_GetIdealSize(DATETIME_INFO *infoPtr, SIZE *size)
/* Get text font height */
DATETIME_ReturnTxt
(
infoPtr
,
0
,
txt
,
ARRAY_SIZE
(
txt
));
GetTextExtentPoint32W
(
hdc
,
txt
,
strlenW
(
txt
),
&
field_size
);
GetTextExtentPoint32W
(
hdc
,
txt
,
l
strlenW
(
txt
),
&
field_size
);
size
->
cy
=
field_size
.
cy
;
/* Get text font width */
...
...
@@ -1572,11 +1571,11 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst)
for
(
i
=
0
;
i
<
infoPtr
->
nrFields
;
i
++
)
{
DATETIME_ReturnTxt
(
infoPtr
,
i
,
buf
,
ARRAY_SIZE
(
buf
));
if
((
strlenW
(
dst
)
+
strlenW
(
buf
))
<
count
)
strcatW
(
dst
,
buf
);
if
((
lstrlenW
(
dst
)
+
l
strlenW
(
buf
))
<
count
)
l
strcatW
(
dst
,
buf
);
else
break
;
}
return
strlenW
(
dst
);
return
l
strlenW
(
dst
);
}
...
...
dlls/comctl32/edit.c
View file @
e4e2e8e5
...
...
@@ -32,8 +32,6 @@
*
*/
#include "config.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
...
...
@@ -46,7 +44,6 @@
#include "commctrl.h"
#include "uxtheme.h"
#include "vsstyle.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -176,7 +173,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap);
*/
static
inline
BOOL
EDIT_EM_CanUndo
(
const
EDITSTATE
*
es
)
{
return
(
es
->
undo_insert_count
||
strlenW
(
es
->
undo_text
));
return
(
es
->
undo_insert_count
||
l
strlenW
(
es
->
undo_text
));
}
...
...
@@ -212,7 +209,7 @@ static HBRUSH EDIT_NotifyCtlColor(EDITSTATE *es, HDC hdc)
static
inline
UINT
get_text_length
(
EDITSTATE
*
es
)
{
if
(
es
->
text_length
==
(
UINT
)
-
1
)
es
->
text_length
=
strlenW
(
es
->
text
);
es
->
text_length
=
l
strlenW
(
es
->
text
);
return
es
->
text_length
;
}
...
...
@@ -520,7 +517,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
/* Mark type of line termination */
if
(
!
(
*
cp
))
{
current_line
->
ending
=
END_0
;
current_line
->
net_length
=
strlenW
(
current_position
);
current_line
->
net_length
=
l
strlenW
(
current_position
);
}
else
if
((
cp
>
current_position
)
&&
(
*
(
cp
-
1
)
==
'\r'
))
{
current_line
->
ending
=
END_SOFT
;
current_line
->
net_length
=
cp
-
current_position
-
1
;
...
...
@@ -2190,7 +2187,7 @@ static void EDIT_PaintLine(EDITSTATE *es, HDC dc, INT line, BOOL rev)
if
(
es
->
cue_banner_text
&&
es
->
text_length
==
0
&&
(
!
(
es
->
flags
&
EF_FOCUSED
)
||
es
->
cue_banner_draw_focused
))
{
SetTextColor
(
dc
,
GetSysColor
(
COLOR_GRAYTEXT
));
TextOutW
(
dc
,
x
,
y
,
es
->
cue_banner_text
,
strlenW
(
es
->
cue_banner_text
));
TextOutW
(
dc
,
x
,
y
,
es
->
cue_banner_text
,
l
strlenW
(
es
->
cue_banner_text
));
}
}
...
...
@@ -2480,7 +2477,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
memcpy
(
buf
,
es
->
text
+
s
,
bufl
*
sizeof
(
WCHAR
));
buf
[
bufl
]
=
0
;
/* ensure 0 termination */
/* now delete */
strcpyW
(
es
->
text
+
s
,
es
->
text
+
e
);
l
strcpyW
(
es
->
text
+
s
,
es
->
text
+
e
);
text_buffer_changed
(
es
);
}
if
(
strl
)
{
...
...
@@ -2508,7 +2505,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
/* if text is too long undo all changes */
if
(
honor_limit
&&
!
(
es
->
style
&
ES_AUTOVSCROLL
)
&&
(
es
->
line_count
>
vlc
))
{
if
(
strl
)
strcpyW
(
es
->
text
+
e
,
es
->
text
+
e
+
strl
);
l
strcpyW
(
es
->
text
+
e
,
es
->
text
+
e
+
strl
);
if
(
e
!=
s
)
for
(
i
=
0
,
p
=
es
->
text
;
i
<
e
-
s
;
i
++
)
p
[
i
+
s
]
=
buf
[
i
];
...
...
@@ -2528,7 +2525,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
/* remove chars that don't fit */
if
(
honor_limit
&&
!
(
es
->
style
&
ES_AUTOHSCROLL
)
&&
(
es
->
text_width
>
fw
))
{
while
((
es
->
text_width
>
fw
)
&&
s
+
strl
>=
s
)
{
strcpyW
(
es
->
text
+
s
+
strl
-
1
,
es
->
text
+
s
+
strl
);
l
strcpyW
(
es
->
text
+
s
+
strl
-
1
,
es
->
text
+
s
+
strl
);
strl
--
;
es
->
text_length
=
-
1
;
EDIT_InvalidateUniscribeData
(
es
);
...
...
@@ -2541,7 +2538,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
if
(
e
!=
s
)
{
if
(
can_undo
)
{
utl
=
strlenW
(
es
->
undo_text
);
utl
=
l
strlenW
(
es
->
undo_text
);
if
(
!
es
->
undo_insert_count
&&
(
*
es
->
undo_text
&&
(
s
==
es
->
undo_position
)))
{
/* undo-buffer is extended to the right */
EDIT_MakeUndoFit
(
es
,
utl
+
e
-
s
);
...
...
@@ -2880,11 +2877,11 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es)
if
(
es
->
style
&
ES_READONLY
)
return
!
(
es
->
style
&
ES_MULTILINE
);
ulength
=
strlenW
(
es
->
undo_text
);
ulength
=
l
strlenW
(
es
->
undo_text
);
utext
=
heap_alloc
((
ulength
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
utext
,
es
->
undo_text
);
l
strcpyW
(
utext
,
es
->
undo_text
);
TRACE
(
"before UNDO:insertion length = %d, deletion buffer = %s
\n
"
,
es
->
undo_insert_count
,
debugstr_w
(
utext
));
...
...
@@ -2935,9 +2932,9 @@ static void EDIT_WM_Paste(EDITSTATE *es)
OpenClipboard
(
es
->
hwndSelf
);
if
((
hsrc
=
GetClipboardData
(
CF_UNICODETEXT
)))
{
src
=
GlobalLock
(
hsrc
);
len
=
strlenW
(
src
);
len
=
l
strlenW
(
src
);
/* Protect single-line edit against pasting new line character */
if
(
!
(
es
->
style
&
ES_MULTILINE
)
&&
((
ptr
=
strchrW
(
src
,
'\n'
))))
{
if
(
!
(
es
->
style
&
ES_MULTILINE
)
&&
((
ptr
=
wcschr
(
src
,
'\n'
))))
{
len
=
ptr
-
src
;
if
(
len
&&
src
[
len
-
1
]
==
'\r'
)
--
len
;
...
...
@@ -3202,7 +3199,7 @@ static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst)
return
0
;
lstrcpynW
(
dst
,
es
->
text
,
count
);
return
strlenW
(
dst
);
return
l
strlenW
(
dst
);
}
/*********************************************************************
...
...
@@ -3808,7 +3805,7 @@ static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text)
if
(
text
)
{
TRACE
(
"%s
\n
"
,
debugstr_w
(
text
));
EDIT_EM_ReplaceSel
(
es
,
FALSE
,
text
,
strlenW
(
text
),
FALSE
,
FALSE
);
EDIT_EM_ReplaceSel
(
es
,
FALSE
,
text
,
l
strlenW
(
text
),
FALSE
,
FALSE
);
}
else
{
...
...
@@ -4209,9 +4206,9 @@ static LRESULT EDIT_EM_GetThumb(EDITSTATE *es)
static
inline
WCHAR
*
heap_strdupW
(
const
WCHAR
*
str
)
{
int
len
=
strlenW
(
str
)
+
1
;
int
len
=
l
strlenW
(
str
)
+
1
;
WCHAR
*
ret
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
strcpyW
(
ret
,
str
);
l
strcpyW
(
ret
,
str
);
return
ret
;
}
...
...
@@ -4536,7 +4533,7 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name)
if
(
name
&&
*
name
)
{
EDIT_EM_ReplaceSel
(
es
,
FALSE
,
name
,
strlenW
(
name
),
FALSE
,
FALSE
);
EDIT_EM_ReplaceSel
(
es
,
FALSE
,
name
,
l
strlenW
(
name
),
FALSE
,
FALSE
);
/* if we insert text to the editline, the text scrolls out
* of the window, as the caret is placed after the insert
* pos normally; thus we reset es->selection... to 0 and
...
...
@@ -4706,7 +4703,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
{
const
WCHAR
*
textW
=
(
const
WCHAR
*
)
lParam
;
EDIT_EM_ReplaceSel
(
es
,
(
BOOL
)
wParam
,
textW
,
strlenW
(
textW
),
TRUE
,
TRUE
);
EDIT_EM_ReplaceSel
(
es
,
(
BOOL
)
wParam
,
textW
,
l
strlenW
(
textW
),
TRUE
,
TRUE
);
result
=
1
;
break
;
}
...
...
dlls/comctl32/header.c
View file @
e4e2e8e5
...
...
@@ -33,7 +33,6 @@
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
...
...
dlls/comctl32/ipaddress.c
View file @
e4e2e8e5
...
...
@@ -38,7 +38,6 @@
#include "uxtheme.h"
#include "vsstyle.h"
#include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -83,12 +82,12 @@ static void IPADDRESS_UpdateText (const IPADDRESS_INFO *infoPtr)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
GetWindowTextW
(
infoPtr
->
Part
[
i
].
EditHwnd
,
field
,
4
))
strcatW
(
ip
,
field
);
l
strcatW
(
ip
,
field
);
else
/* empty edit treated as zero */
strcatW
(
ip
,
zero
);
l
strcatW
(
ip
,
zero
);
if
(
i
!=
3
)
strcatW
(
ip
,
dot
);
l
strcatW
(
ip
,
dot
);
}
SetWindowTextW
(
infoPtr
->
Self
,
ip
);
...
...
@@ -237,7 +236,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
hSysFont
=
GetStockObject
(
ANSI_VAR_FONT
);
GetObjectW
(
hSysFont
,
sizeof
(
LOGFONTW
),
&
logSysFont
);
SystemParametersInfoW
(
SPI_GETICONTITLELOGFONT
,
0
,
&
logFont
,
0
);
strcpyW
(
logFont
.
lfFaceName
,
logSysFont
.
lfFaceName
);
l
strcpyW
(
logFont
.
lfFaceName
,
logSysFont
.
lfFaceName
);
hFont
=
CreateFontIndirectW
(
&
logFont
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
...
@@ -336,7 +335,7 @@ static int IPADDRESS_GetAddress (const IPADDRESS_INFO *infoPtr, LPDWORD ip_addre
for
(
i
=
0
;
i
<
4
;
i
++
)
{
ip_addr
*=
256
;
if
(
GetWindowTextW
(
infoPtr
->
Part
[
i
].
EditHwnd
,
field
,
4
))
ip_addr
+=
atolW
(
field
);
ip_addr
+=
wcstol
(
field
,
NULL
,
10
);
else
invalid
++
;
}
...
...
@@ -418,7 +417,7 @@ static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int current
part
=
&
infoPtr
->
Part
[
currentfield
];
if
(
!
GetWindowTextW
(
part
->
EditHwnd
,
field
,
4
))
return
FALSE
;
curValue
=
atoiW
(
field
);
curValue
=
wcstol
(
field
,
NULL
,
10
);
TRACE
(
" curValue=%d
\n
"
,
curValue
);
newValue
=
IPADDRESS_IPNotify
(
infoPtr
,
currentfield
,
curValue
);
...
...
dlls/comctl32/listbox.c
View file @
e4e2e8e5
...
...
@@ -31,7 +31,6 @@
#include "commctrl.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/unicode.h"
#include "wine/exception.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -684,14 +683,14 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
else
if
(
!
(
descr
->
style
&
LBS_USETABSTOPS
))
ExtTextOutW
(
hdc
,
rect
->
left
+
1
,
rect
->
top
,
ETO_OPAQUE
|
ETO_CLIPPED
,
rect
,
item_str
,
strlenW
(
item_str
),
NULL
);
l
strlenW
(
item_str
),
NULL
);
else
{
/* Output empty string to paint background in the full width. */
ExtTextOutW
(
hdc
,
rect
->
left
+
1
,
rect
->
top
,
ETO_OPAQUE
|
ETO_CLIPPED
,
rect
,
NULL
,
0
,
NULL
);
TabbedTextOutW
(
hdc
,
rect
->
left
+
1
,
rect
->
top
,
item_str
,
strlenW
(
item_str
),
item_str
,
l
strlenW
(
item_str
),
descr
->
nb_tabs
,
descr
->
tabs
,
0
);
}
if
(
selected
)
...
...
@@ -857,14 +856,14 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL
WCHAR
*
str
=
get_item_string
(
descr
,
index
);
if
(
!
buffer
)
return
strlenW
(
str
);
return
l
strlenW
(
str
);
TRACE
(
"index %d (0x%04x) %s
\n
"
,
index
,
index
,
debugstr_w
(
str
));
__TRY
/* hide a Delphi bug that passes a read-only buffer */
{
strcpyW
(
buffer
,
str
);
len
=
strlenW
(
buffer
);
l
strcpyW
(
buffer
,
str
);
len
=
l
strlenW
(
buffer
);
}
__EXCEPT_PAGE_FAULT
{
...
...
@@ -1011,7 +1010,7 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
else
{
/* Special case for drives and directories: ignore prefix */
INT
len
=
strlenW
(
str
);
INT
len
=
l
strlenW
(
str
);
WCHAR
*
item_str
;
for
(
i
=
0
,
index
=
start
;
i
<
descr
->
nb_items
;
i
++
,
index
++
)
...
...
@@ -1019,11 +1018,11 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
if
(
index
==
descr
->
nb_items
)
index
=
0
;
item_str
=
get_item_string
(
descr
,
index
);
if
(
!
strncmpiW
(
str
,
item_str
,
len
))
return
index
;
if
(
!
wcsnicmp
(
str
,
item_str
,
len
))
return
index
;
if
(
item_str
[
0
]
==
'['
)
{
if
(
!
strncmpiW
(
str
,
item_str
+
1
,
len
))
return
index
;
if
(
item_str
[
1
]
==
'-'
&&
!
strncmpiW
(
str
,
item_str
+
2
,
len
))
return
index
;
if
(
!
wcsnicmp
(
str
,
item_str
+
1
,
len
))
return
index
;
if
(
item_str
[
1
]
==
'-'
&&
!
wcsnicmp
(
str
,
item_str
+
2
,
len
))
return
index
;
}
}
}
...
...
@@ -1688,12 +1687,12 @@ static LRESULT LISTBOX_InsertString( LB_DESCR *descr, INT index, LPCWSTR str )
{
static
const
WCHAR
empty_stringW
[]
=
{
0
};
if
(
!
str
)
str
=
empty_stringW
;
if
(
!
(
new_str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
new_str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
l
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
)
)))
{
SEND_NOTIFICATION
(
descr
,
LBN_ERRSPACE
);
return
LB_ERRSPACE
;
}
strcpyW
(
new_str
,
str
);
l
strcpyW
(
new_str
,
str
);
}
if
(
index
==
-
1
)
index
=
descr
->
nb_items
;
...
...
@@ -1880,13 +1879,13 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
static
const
WCHAR
bracketW
[]
=
{
']'
,
0
};
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
if
(
!
(
attrib
&
DDL_DIRECTORY
)
||
!
strcmpW
(
entry
.
cFileName
,
dotW
))
continue
;
!
l
strcmpW
(
entry
.
cFileName
,
dotW
))
continue
;
buffer
[
0
]
=
'['
;
if
(
!
long_names
&&
entry
.
cAlternateFileName
[
0
])
strcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
l
strcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
else
strcpyW
(
buffer
+
1
,
entry
.
cFileName
);
strcatW
(
buffer
,
bracketW
);
l
strcpyW
(
buffer
+
1
,
entry
.
cFileName
);
l
strcatW
(
buffer
,
bracketW
);
}
else
/* not a directory */
{
...
...
@@ -1898,9 +1897,9 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
continue
;
#undef ATTRIBS
if
(
!
long_names
&&
entry
.
cAlternateFileName
[
0
])
strcpyW
(
buffer
,
entry
.
cAlternateFileName
);
l
strcpyW
(
buffer
,
entry
.
cAlternateFileName
);
else
strcpyW
(
buffer
,
entry
.
cFileName
);
l
strcpyW
(
buffer
,
entry
.
cFileName
);
}
if
(
!
long_names
)
CharLowerW
(
buffer
);
pos
=
LISTBOX_FindFileStrPos
(
descr
,
buffer
);
...
...
@@ -2732,7 +2731,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
return
LB_ERR
;
}
if
(
!
HAS_STRINGS
(
descr
))
return
sizeof
(
ULONG_PTR
);
return
strlenW
(
get_item_string
(
descr
,
wParam
));
return
l
strlenW
(
get_item_string
(
descr
,
wParam
));
case
LB_GETCURSEL
:
if
(
descr
->
nb_items
==
0
)
...
...
dlls/comctl32/listview.c
View file @
e4e2e8e5
...
...
@@ -124,9 +124,6 @@
* -- LVGroupComparE
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
#include <string.h>
...
...
@@ -145,7 +142,6 @@
#include "uxtheme.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
listview
);
...
...
@@ -997,7 +993,7 @@ static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISP
}
else
if
(
return_unicode
&&
(
pdi
->
hdr
.
code
==
LVN_GETDISPINFOW
))
{
strcpyW
(
ret_text
,
pdi
->
item
.
pszText
);
l
strcpyW
(
ret_text
,
pdi
->
item
.
pszText
);
}
else
if
(
return_ansi
)
/* note : pointer can be changed by app ! */
{
...
...
@@ -1870,7 +1866,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
if
(
!
charCode
||
!
keyData
||
infoPtr
->
nItemCount
==
0
)
return
0
;
/* only allow the valid WM_CHARs through */
if
(
!
is
alnumW
(
charCode
)
&&
if
(
!
is
walnum
(
charCode
)
&&
charCode
!=
'.'
&&
charCode
!=
'`'
&&
charCode
!=
'!'
&&
charCode
!=
'@'
&&
charCode
!=
'#'
&&
charCode
!=
'$'
&&
charCode
!=
'%'
&&
charCode
!=
'^'
&&
charCode
!=
'&'
&&
...
...
@@ -6405,7 +6401,7 @@ again:
{
if
(
lpFindInfo
->
flags
&
(
LVFI_PARTIAL
|
LVFI_SUBSTRING
))
{
WCHAR
*
p
=
strstrW
(
lvItem
.
pszText
,
lpFindInfo
->
psz
);
WCHAR
*
p
=
wcsstr
(
lvItem
.
pszText
,
lpFindInfo
->
psz
);
if
(
!
p
||
p
!=
lvItem
.
pszText
)
continue
;
}
else
...
...
dlls/comctl32/monthcal.c
View file @
e4e2e8e5
...
...
@@ -45,7 +45,6 @@
#include "comctl32.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
@@ -885,18 +884,18 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
/* draw formatted date string */
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_YEARMONTH
,
st
,
NULL
,
strW
,
ARRAY_SIZE
(
strW
));
DrawTextW
(
hdc
,
strW
,
strlenW
(
strW
),
title
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
DrawTextW
(
hdc
,
strW
,
l
strlenW
(
strW
),
title
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_SYEARMONTH
,
fmtW
,
ARRAY_SIZE
(
fmtW
));
wsprintfW
(
yearW
,
fmtyearW
,
st
->
wYear
);
/* month is trickier as it's possible to have different format pictures, we'll
test for M, MM, MMM, and MMMM */
if
(
strstrW
(
fmtW
,
mmmmW
))
if
(
wcsstr
(
fmtW
,
mmmmW
))
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_SMONTHNAME1
+
st
->
wMonth
-
1
,
monthW
,
ARRAY_SIZE
(
monthW
));
else
if
(
strstrW
(
fmtW
,
mmmW
))
else
if
(
wcsstr
(
fmtW
,
mmmW
))
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_SABBREVMONTHNAME1
+
st
->
wMonth
-
1
,
monthW
,
ARRAY_SIZE
(
monthW
));
else
if
(
strstrW
(
fmtW
,
mmW
))
else
if
(
wcsstr
(
fmtW
,
mmW
))
wsprintfW
(
monthW
,
fmtmmW
,
st
->
wMonth
);
else
wsprintfW
(
monthW
,
fmtmW
,
st
->
wMonth
);
...
...
@@ -905,7 +904,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
yearoffset
=
0
;
while
(
strW
[
yearoffset
])
{
if
(
!
strncmpW
(
&
strW
[
yearoffset
],
yearW
,
strlenW
(
yearW
)))
if
(
!
wcsncmp
(
&
strW
[
yearoffset
],
yearW
,
l
strlenW
(
yearW
)))
break
;
yearoffset
++
;
}
...
...
@@ -913,7 +912,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
monthoffset
=
0
;
while
(
strW
[
monthoffset
])
{
if
(
!
strncmpW
(
&
strW
[
monthoffset
],
monthW
,
strlenW
(
monthW
)))
if
(
!
wcsncmp
(
&
strW
[
monthoffset
],
monthW
,
l
strlenW
(
monthW
)))
break
;
monthoffset
++
;
}
...
...
@@ -930,15 +929,15 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
infoPtr
->
calendars
[
calIdx
].
titlemonth
.
left
=
sz
.
cx
;
/* for right limits use actual string parts lengths */
GetTextExtentPoint32W
(
hdc
,
&
strW
[
yearoffset
],
strlenW
(
yearW
),
&
sz
);
GetTextExtentPoint32W
(
hdc
,
&
strW
[
yearoffset
],
l
strlenW
(
yearW
),
&
sz
);
infoPtr
->
calendars
[
calIdx
].
titleyear
.
right
=
infoPtr
->
calendars
[
calIdx
].
titleyear
.
left
+
sz
.
cx
;
GetTextExtentPoint32W
(
hdc
,
monthW
,
strlenW
(
monthW
),
&
sz
);
GetTextExtentPoint32W
(
hdc
,
monthW
,
l
strlenW
(
monthW
),
&
sz
);
infoPtr
->
calendars
[
calIdx
].
titlemonth
.
right
=
infoPtr
->
calendars
[
calIdx
].
titlemonth
.
left
+
sz
.
cx
;
/* Finally translate rectangles to match center aligned string,
hit rectangles are relative to title rectangle before translation. */
GetTextExtentPoint32W
(
hdc
,
strW
,
strlenW
(
strW
),
&
sz
);
GetTextExtentPoint32W
(
hdc
,
strW
,
l
strlenW
(
strW
),
&
sz
);
shiftX
=
(
title
->
right
-
title
->
left
-
sz
.
cx
)
/
2
+
title
->
left
;
OffsetRect
(
&
infoPtr
->
calendars
[
calIdx
].
titleyear
,
shiftX
,
0
);
OffsetRect
(
&
infoPtr
->
calendars
[
calIdx
].
titlemonth
,
shiftX
,
0
);
...
...
@@ -974,7 +973,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con
The first week of the year must contain only days of the new year
*/
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IFIRSTWEEKOFYEAR
,
buf
,
ARRAY_SIZE
(
buf
));
weeknum
=
atoiW
(
buf
);
weeknum
=
wcstol
(
buf
,
NULL
,
10
);
switch
(
weeknum
)
{
case
1
:
mindays
=
6
;
...
...
@@ -1205,7 +1204,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const
i
=
infoPtr
->
firstDay
;
for
(
j
=
0
;
j
<
7
;
j
++
)
{
get_localized_dayname
(
infoPtr
,
(
i
+
j
+
6
)
%
7
,
buf
,
ARRAY_SIZE
(
buf
));
DrawTextW
(
hdc
,
buf
,
strlenW
(
buf
),
&
r
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
DrawTextW
(
hdc
,
buf
,
l
strlenW
(
buf
),
&
r
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
OffsetRect
(
&
r
,
infoPtr
->
width_increment
,
0
);
}
...
...
@@ -1411,9 +1410,9 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day)
WCHAR
buf
[
80
];
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IFIRSTDAYOFWEEK
,
buf
,
ARRAY_SIZE
(
buf
));
TRACE
(
"%s %d
\n
"
,
debugstr_w
(
buf
),
strlenW
(
buf
));
TRACE
(
"%s %d
\n
"
,
debugstr_w
(
buf
),
l
strlenW
(
buf
));
new_day
=
atoiW
(
buf
);
new_day
=
wcstol
(
buf
,
NULL
,
10
);
infoPtr
->
firstDaySet
=
FALSE
;
}
...
...
dlls/comctl32/propsheet.c
View file @
e4e2e8e5
...
...
@@ -65,7 +65,6 @@
#include "uxtheme.h"
#include "wine/debug.h"
#include "wine/unicode.h"
/******************************************************************************
* Data structures
...
...
@@ -177,9 +176,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(propsheet);
static
WCHAR
*
heap_strdupW
(
const
WCHAR
*
str
)
{
int
len
=
strlenW
(
str
)
+
1
;
int
len
=
l
strlenW
(
str
)
+
1
;
WCHAR
*
ret
=
Alloc
(
len
*
sizeof
(
WCHAR
));
strcpyW
(
ret
,
str
);
l
strcpyW
(
ret
,
str
);
return
ret
;
}
...
...
@@ -2148,8 +2147,8 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
if
(
dwStyle
&
PSH_PROPTITLE
)
{
WCHAR
*
dest
;
int
lentitle
=
strlenW
(
lpszText
);
int
lenprop
=
strlenW
(
psInfo
->
strPropertiesFor
);
int
lentitle
=
l
strlenW
(
lpszText
);
int
lenprop
=
l
strlenW
(
psInfo
->
strPropertiesFor
);
dest
=
Alloc
(
(
lentitle
+
lenprop
+
1
)
*
sizeof
(
WCHAR
));
wsprintfW
(
dest
,
psInfo
->
strPropertiesFor
,
lpszText
);
...
...
@@ -2934,7 +2933,7 @@ static LPWSTR load_string( HINSTANCE instance, LPCWSTR str )
}
else
{
int
len
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
int
len
=
(
l
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
Alloc
(
len
);
if
(
ret
)
memcpy
(
ret
,
str
,
len
);
}
...
...
dlls/comctl32/rebar.c
View file @
e4e2e8e5
...
...
@@ -85,7 +85,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/unicode.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
...
...
dlls/comctl32/status.c
View file @
e4e2e8e5
...
...
@@ -36,7 +36,6 @@
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
...
...
@@ -486,10 +485,10 @@ STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
if
(
part
->
style
&
SBT_OWNERDRAW
)
result
=
(
LRESULT
)
part
->
text
;
else
{
result
=
part
->
text
?
strlenW
(
part
->
text
)
:
0
;
result
=
part
->
text
?
l
strlenW
(
part
->
text
)
:
0
;
result
|=
(
part
->
style
<<
16
);
if
(
part
->
text
&&
buf
)
strcpyW
(
buf
,
part
->
text
);
l
strcpyW
(
buf
,
part
->
text
);
}
return
result
;
}
...
...
@@ -512,7 +511,7 @@ STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
part
=
&
infoPtr
->
parts
[
nPart
];
if
((
~
part
->
style
&
SBT_OWNERDRAW
)
&&
part
->
text
)
result
=
strlenW
(
part
->
text
);
result
=
l
strlenW
(
part
->
text
);
else
result
=
0
;
...
...
@@ -736,16 +735,16 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
if
(
!
ntext
)
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
atxt
,
-
1
,
ntext
,
len
);
}
else
if
(
text
)
{
ntext
=
Alloc
(
(
strlenW
(
text
)
+
1
)
*
sizeof
(
WCHAR
)
);
ntext
=
Alloc
(
(
l
strlenW
(
text
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
!
ntext
)
return
FALSE
;
strcpyW
(
ntext
,
text
);
l
strcpyW
(
ntext
,
text
);
}
else
ntext
=
0
;
/* replace nonprintable characters with spaces */
if
(
ntext
)
{
idx
=
ntext
;
while
(
*
idx
)
{
if
(
!
is
printW
(
*
idx
))
if
(
!
is
wprint
(
*
idx
))
*
idx
=
' '
;
idx
++
;
}
...
...
@@ -926,11 +925,11 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
OpenThemeData
(
hwnd
,
themeClass
);
if
(
lpCreate
->
lpszName
&&
(
len
=
strlenW
((
LPCWSTR
)
lpCreate
->
lpszName
)))
if
(
lpCreate
->
lpszName
&&
(
len
=
l
strlenW
((
LPCWSTR
)
lpCreate
->
lpszName
)))
{
infoPtr
->
parts
[
0
].
text
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
infoPtr
->
parts
[
0
].
text
)
goto
create_fail
;
strcpyW
(
infoPtr
->
parts
[
0
].
text
,
(
LPCWSTR
)
lpCreate
->
lpszName
);
l
strcpyW
(
infoPtr
->
parts
[
0
].
text
,
(
LPCWSTR
)
lpCreate
->
lpszName
);
}
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
...
...
@@ -979,12 +978,12 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
if
(
!
(
infoPtr
->
parts
[
0
].
text
))
return
0
;
len
=
strlenW
(
infoPtr
->
parts
[
0
].
text
);
len
=
l
strlenW
(
infoPtr
->
parts
[
0
].
text
);
if
(
!
size
)
return
len
;
else
if
(
size
>
len
)
{
strcpyW
(
buf
,
infoPtr
->
parts
[
0
].
text
);
l
strcpyW
(
buf
,
infoPtr
->
parts
[
0
].
text
);
return
len
;
}
else
{
...
...
@@ -1065,10 +1064,10 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
Free
(
part
->
text
);
part
->
text
=
0
;
if
(
text
&&
(
len
=
strlenW
((
LPCWSTR
)
text
)))
{
if
(
text
&&
(
len
=
l
strlenW
((
LPCWSTR
)
text
)))
{
part
->
text
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
part
->
text
)
return
FALSE
;
strcpyW
(
part
->
text
,
(
LPCWSTR
)
text
);
l
strcpyW
(
part
->
text
,
(
LPCWSTR
)
text
);
}
InvalidateRect
(
infoPtr
->
Self
,
&
part
->
bound
,
FALSE
);
...
...
dlls/comctl32/string.c
View file @
e4e2e8e5
...
...
@@ -22,9 +22,6 @@
*
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
/* atoi */
...
...
@@ -36,7 +33,6 @@
#include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
@@ -208,7 +204,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
TRACE
(
"(%p %p %d)
\n
"
,
lpSrc
,
lpDest
,
nMaxLen
);
if
(
!
lpDest
&&
lpSrc
)
return
strlenW
(
lpSrc
);
return
l
strlenW
(
lpSrc
);
if
(
nMaxLen
==
0
)
return
0
;
...
...
@@ -218,7 +214,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
return
0
;
}
len
=
strlenW
(
lpSrc
);
len
=
l
strlenW
(
lpSrc
);
if
(
len
>=
nMaxLen
)
len
=
nMaxLen
-
1
;
...
...
@@ -238,11 +234,11 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
TRACE
(
"(%p %s)
\n
"
,
lppDest
,
debugstr_w
(
lpSrc
));
if
(
lpSrc
)
{
INT
len
=
strlenW
(
lpSrc
)
+
1
;
INT
len
=
l
strlenW
(
lpSrc
)
+
1
;
LPWSTR
ptr
=
ReAlloc
(
*
lppDest
,
len
*
sizeof
(
WCHAR
));
if
(
!
ptr
)
return
FALSE
;
strcpyW
(
ptr
,
lpSrc
);
l
strcpyW
(
ptr
,
lpSrc
);
*
lppDest
=
ptr
;
}
else
{
...
...
@@ -391,8 +387,8 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
iLen
=
strlenW
(
lpszSearch
);
end
=
lpszStr
+
strlenW
(
lpszStr
);
iLen
=
l
strlenW
(
lpszSearch
);
end
=
lpszStr
+
l
strlenW
(
lpszStr
);
while
(
lpszStr
+
iLen
<=
end
)
{
...
...
@@ -410,7 +406,7 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
*/
INT
WINAPI
StrToIntW
(
LPCWSTR
lpString
)
{
return
atoiW
(
lpString
);
return
wcstol
(
lpString
,
NULL
,
10
);
}
/*************************************************************************
...
...
@@ -472,7 +468,7 @@ LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
TRACE
(
"(%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
ch
);
if
(
lpszStr
)
lpszRet
=
strchrW
(
lpszStr
,
ch
);
lpszRet
=
wcschr
(
lpszStr
,
ch
);
return
lpszRet
;
}
...
...
@@ -558,7 +554,7 @@ LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch)
WCHAR
*
ret
=
NULL
;
if
(
!
str
)
return
NULL
;
if
(
!
end
)
end
=
str
+
strlenW
(
str
);
if
(
!
end
)
end
=
str
+
l
strlenW
(
str
);
while
(
str
<
end
)
{
if
(
*
str
==
ch
)
ret
=
(
WCHAR
*
)
str
;
...
...
@@ -594,7 +590,7 @@ LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch)
LPWSTR
WINAPI
StrStrW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszSearch
)
{
if
(
!
lpszStr
||
!
lpszSearch
)
return
NULL
;
return
strstrW
(
lpszStr
,
lpszSearch
);
return
wcsstr
(
lpszStr
,
lpszSearch
);
}
/*************************************************************************
...
...
@@ -638,10 +634,10 @@ LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch)
if
(
lpszStr
)
{
ch
=
to
upperW
(
ch
);
ch
=
to
wupper
(
ch
);
while
(
*
lpszStr
)
{
if
(
to
upperW
(
*
lpszStr
)
==
ch
)
if
(
to
wupper
(
*
lpszStr
)
==
ch
)
return
(
LPWSTR
)
lpszStr
;
lpszStr
++
;
}
...
...
@@ -713,10 +709,10 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch)
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
iLen
=
strlenW
(
lpszSearch
);
iLen
=
l
strlenW
(
lpszSearch
);
if
(
!
lpszEnd
)
lpszEnd
=
lpszStr
+
strlenW
(
lpszStr
);
lpszEnd
=
lpszStr
+
l
strlenW
(
lpszStr
);
else
/* reproduce the broken behaviour on Windows */
lpszEnd
+=
min
(
iLen
-
1
,
lstrlenW
(
lpszEnd
));
...
...
@@ -826,7 +822,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch)
WCHAR
*
ret
=
NULL
;
if
(
!
str
)
return
NULL
;
if
(
!
end
)
end
=
str
+
strlenW
(
str
);
if
(
!
end
)
end
=
str
+
l
strlenW
(
str
);
while
(
str
<
end
)
{
if
(
!
COMCTL32_ChrCmpIW
(
*
str
,
ch
))
ret
=
(
WCHAR
*
)
str
;
...
...
@@ -843,7 +839,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch)
int
WINAPI
StrCSpnW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszMatch
)
{
if
(
!
lpszStr
||
!
lpszMatch
)
return
0
;
return
strcspnW
(
lpszStr
,
lpszMatch
);
return
wcscspn
(
lpszStr
,
lpszMatch
);
}
/*************************************************************************
...
...
dlls/comctl32/syslink.c
View file @
e4e2e8e5
...
...
@@ -27,7 +27,6 @@
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/list.h"
...
...
@@ -124,7 +123,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
{
PDOC_ITEM
Item
;
textlen
=
min
(
textlen
,
strlenW
(
Text
));
textlen
=
min
(
textlen
,
l
strlenW
(
Text
));
Item
=
Alloc
(
FIELD_OFFSET
(
DOC_ITEM
,
Text
[
textlen
+
1
]));
if
(
Item
==
NULL
)
{
...
...
@@ -183,7 +182,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
{
if
(
*
current
==
'<'
)
{
if
(
!
strncmpiW
(
current
,
SL_LINKOPEN
,
ARRAY_SIZE
(
SL_LINKOPEN
))
&&
(
CurrentType
==
slText
))
if
(
!
wcsnicmp
(
current
,
SL_LINKOPEN
,
ARRAY_SIZE
(
SL_LINKOPEN
))
&&
(
CurrentType
==
slText
))
{
BOOL
ValidParam
=
FALSE
,
ValidLink
=
FALSE
;
...
...
@@ -211,14 +210,14 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
CheckParameter:
/* compare the current position with all known parameters */
if
(
!
strncmpiW
(
tmp
,
SL_HREF
,
ARRAY_SIZE
(
SL_HREF
)))
if
(
!
wcsnicmp
(
tmp
,
SL_HREF
,
ARRAY_SIZE
(
SL_HREF
)))
{
taglen
+=
6
;
ValidParam
=
TRUE
;
CurrentParameter
=
&
lpUrl
;
CurrentParameterLen
=
&
lenUrl
;
}
else
if
(
!
strncmpiW
(
tmp
,
SL_ID
,
ARRAY_SIZE
(
SL_ID
)))
else
if
(
!
wcsnicmp
(
tmp
,
SL_ID
,
ARRAY_SIZE
(
SL_ID
)))
{
taglen
+=
4
;
ValidParam
=
TRUE
;
...
...
@@ -292,7 +291,7 @@ CheckParameter:
}
}
}
else
if
(
!
strncmpiW
(
current
,
SL_LINKCLOSE
,
ARRAY_SIZE
(
SL_LINKCLOSE
))
&&
(
CurrentType
==
slLink
)
&&
firsttag
)
else
if
(
!
wcsnicmp
(
current
,
SL_LINKCLOSE
,
ARRAY_SIZE
(
SL_LINKCLOSE
))
&&
(
CurrentType
==
slLink
)
&&
firsttag
)
{
/* there's a <a...> tag opened, first add the previous text, if present */
if
(
textstart
!=
NULL
&&
textlen
>
0
&&
firsttag
>
textstart
)
...
...
@@ -330,7 +329,7 @@ CheckParameter:
/* Copy the tag parameters */
if
(
lpID
!=
NULL
)
{
nc
=
min
(
lenId
,
strlenW
(
lpID
));
nc
=
min
(
lenId
,
l
strlenW
(
lpID
));
nc
=
min
(
nc
,
MAX_LINKID_TEXT
-
1
);
Last
->
u
.
Link
.
szID
=
Alloc
((
nc
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szID
!=
NULL
)
...
...
@@ -342,7 +341,7 @@ CheckParameter:
Last
->
u
.
Link
.
szID
=
NULL
;
if
(
lpUrl
!=
NULL
)
{
nc
=
min
(
lenUrl
,
strlenW
(
lpUrl
));
nc
=
min
(
lenUrl
,
l
strlenW
(
lpUrl
));
nc
=
min
(
nc
,
L_MAX_URL_LENGTH
-
1
);
Last
->
u
.
Link
.
szUrl
=
Alloc
((
nc
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szUrl
!=
NULL
)
...
...
@@ -408,7 +407,7 @@ CheckParameter:
/* Copy the tag parameters */
if
(
lpID
!=
NULL
)
{
nc
=
min
(
lenId
,
strlenW
(
lpID
));
nc
=
min
(
lenId
,
l
strlenW
(
lpID
));
nc
=
min
(
nc
,
MAX_LINKID_TEXT
-
1
);
Last
->
u
.
Link
.
szID
=
Alloc
((
nc
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szID
!=
NULL
)
...
...
@@ -420,7 +419,7 @@ CheckParameter:
Last
->
u
.
Link
.
szID
=
NULL
;
if
(
lpUrl
!=
NULL
)
{
nc
=
min
(
lenUrl
,
strlenW
(
lpUrl
));
nc
=
min
(
lenUrl
,
l
strlenW
(
lpUrl
));
nc
=
min
(
nc
,
L_MAX_URL_LENGTH
-
1
);
Last
->
u
.
Link
.
szUrl
=
Alloc
((
nc
+
1
)
*
sizeof
(
WCHAR
));
if
(
Last
->
u
.
Link
.
szUrl
!=
NULL
)
...
...
dlls/comctl32/taskdialog.c
View file @
e4e2e8e5
...
...
@@ -35,7 +35,6 @@
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
taskdialog
);
...
...
@@ -134,8 +133,8 @@ static WCHAR *taskdialog_get_exe_name(WCHAR *name, DWORD length)
if
(
len
&&
len
<
length
)
{
WCHAR
*
p
;
if
((
p
=
strrchrW
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'\\'
)))
name
=
p
+
1
;
if
((
p
=
wcsrchr
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
wcsrchr
(
name
,
'\\'
)))
name
=
p
+
1
;
return
name
;
}
else
...
...
@@ -164,7 +163,7 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
titleW
=
taskconfig
->
pszWindowTitle
;
if
(
!
titleW
)
titleW
=
emptyW
;
title_size
=
(
strlenW
(
titleW
)
+
1
)
*
sizeof
(
WCHAR
);
title_size
=
(
l
strlenW
(
titleW
)
+
1
)
*
sizeof
(
WCHAR
);
size
=
sizeof
(
DLGTEMPLATE
)
+
2
*
sizeof
(
WORD
);
size
+=
title_size
;
...
...
@@ -359,7 +358,7 @@ static WCHAR *taskdialog_gettext(struct taskdialog_info *dialog_info, BOOL user_
else
{
textW
=
text
;
length
=
strlenW
(
textW
);
length
=
l
strlenW
(
textW
);
}
ret
=
Alloc
((
length
+
1
)
*
sizeof
(
WCHAR
));
...
...
dlls/comctl32/toolbar.c
View file @
e4e2e8e5
...
...
@@ -76,7 +76,6 @@
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
...
...
@@ -1227,7 +1226,7 @@ TOOLBAR_MeasureString(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr,
if
(
lpText
!=
NULL
)
{
/* first get size of all the text */
GetTextExtentPoint32W
(
hdc
,
lpText
,
strlenW
(
lpText
),
lpSize
);
GetTextExtentPoint32W
(
hdc
,
lpText
,
l
strlenW
(
lpText
),
lpSize
);
/* feed above size into the rectangle for DrawText */
SetRect
(
&
myrect
,
0
,
0
,
lpSize
->
cx
,
lpSize
->
cy
);
...
...
@@ -2957,7 +2956,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
delimiter
=
*
szString
;
p
=
szString
+
1
;
while
((
next_delim
=
strchrW
(
p
,
delimiter
))
!=
NULL
)
{
while
((
next_delim
=
wcschr
(
p
,
delimiter
))
!=
NULL
)
{
*
next_delim
=
0
;
if
(
next_delim
+
1
>=
szString
+
len
)
{
...
...
@@ -2981,7 +2980,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
return
-
1
;
TRACE
(
"adding string(s) from array
\n
"
);
while
(
*
p
)
{
len
=
strlenW
(
p
);
len
=
l
strlenW
(
p
);
TRACE
(
"len=%d %s
\n
"
,
len
,
debugstr_w
(
p
));
infoPtr
->
strings
=
ReAlloc
(
infoPtr
->
strings
,
sizeof
(
LPWSTR
)
*
(
infoPtr
->
nNumStrings
+
1
));
...
...
@@ -3436,8 +3435,8 @@ TOOLBAR_GetButtonText (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr, BOOL i
{
if
(
lpText
)
{
ret
=
strlenW
(
lpText
);
if
(
lpStr
)
strcpyW
(
lpStr
,
lpText
);
ret
=
l
strlenW
(
lpText
);
if
(
lpStr
)
l
strcpyW
(
lpStr
,
lpText
);
}
}
else
...
...
@@ -3848,7 +3847,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt
if
(
!
(
btnPtr
->
fsStyle
&
BTNS_NOPREFIX
)
&&
!
(
btnPtr
->
fsState
&
TBSTATE_HIDDEN
))
{
int
iLen
=
strlenW
(
wszAccel
);
int
iLen
=
l
strlenW
(
wszAccel
);
LPCWSTR
lpszStr
=
TOOLBAR_GetText
(
infoPtr
,
btnPtr
);
if
(
!
lpszStr
)
...
...
@@ -3861,7 +3860,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt
lpszStr
+=
2
;
continue
;
}
if
(
!
strncmpiW
(
lpszStr
,
wszAccel
,
iLen
))
if
(
!
wcsnicmp
(
lpszStr
,
wszAccel
,
iLen
))
{
*
pIDButton
=
btnPtr
->
idCommand
;
return
TRUE
;
...
...
@@ -5141,7 +5140,7 @@ TOOLBAR_GetStringW (const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPWSTR str)
if
(
iString
<
infoPtr
->
nNumStrings
)
{
len
=
min
(
len
,
strlenW
(
infoPtr
->
strings
[
iString
]));
len
=
min
(
len
,
l
strlenW
(
infoPtr
->
strings
[
iString
]));
ret
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
if
(
str
)
{
...
...
@@ -6150,7 +6149,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
TRACE
(
"TBN_GETINFOTIPW - got string %s
\n
"
,
debugstr_w
(
tbgit
.
pszText
));
len
=
strlenW
(
tbgit
.
pszText
);
len
=
l
strlenW
(
tbgit
.
pszText
);
if
(
len
>
ARRAY_SIZE
(
lpnmtdi
->
szText
)
-
1
)
{
/* need to allocate temporary buffer in infoPtr as there
...
...
@@ -6214,7 +6213,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
!
(
infoPtr
->
buttons
[
index
].
fsStyle
&
BTNS_SHOWTEXT
))
{
LPWSTR
pszText
=
TOOLBAR_GetText
(
infoPtr
,
&
infoPtr
->
buttons
[
index
]);
len
=
pszText
?
strlenW
(
pszText
)
:
0
;
len
=
pszText
?
l
strlenW
(
pszText
)
:
0
;
TRACE
(
"using button hidden text %s
\n
"
,
debugstr_w
(
pszText
));
...
...
dlls/comctl32/tooltips.c
View file @
e4e2e8e5
...
...
@@ -96,7 +96,6 @@
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
...
...
@@ -502,7 +501,7 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
if
(
!
(
GetWindowLongW
(
infoPtr
->
hwndSelf
,
GWL_STYLE
)
&
TTS_NOPREFIX
))
{
WCHAR
*
ptrW
;
if
((
ptrW
=
strchrW
(
buffer
,
'\t'
)))
if
((
ptrW
=
wcschr
(
buffer
,
'\t'
)))
*
ptrW
=
0
;
}
...
...
@@ -963,7 +962,7 @@ TOOLTIPS_CopyInfoT (const TOOLTIPS_INFO *infoPtr, INT index, TTTOOLINFOW *ti, BO
toolPtr
->
lpszText
==
LPSTR_TEXTCALLBACKW
)
ti
->
lpszText
=
toolPtr
->
lpszText
;
else
if
(
isW
)
strcpyW
(
ti
->
lpszText
,
toolPtr
->
lpszText
);
l
strcpyW
(
ti
->
lpszText
,
toolPtr
->
lpszText
);
else
/* ANSI version, the buffer is maximum 80 bytes without null. */
WideCharToMultiByte
(
CP_ACP
,
0
,
toolPtr
->
lpszText
,
-
1
,
...
...
@@ -1090,7 +1089,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
INT
len
=
lstrlenW
(
ti
->
lpszText
);
TRACE
(
"add text %s
\n
"
,
debugstr_w
(
ti
->
lpszText
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
ti
->
lpszText
);
l
strcpyW
(
toolPtr
->
lpszText
,
ti
->
lpszText
);
}
else
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
ti
->
lpszText
,
-
1
,
NULL
,
0
);
...
...
@@ -1167,7 +1166,7 @@ static void TOOLTIPS_SetToolText(TTTOOL_INFO *toolPtr, WCHAR *text, BOOL is_unic
len
=
lstrlenW
(
text
);
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
toolPtr
->
lpszText
)
strcpyW
(
toolPtr
->
lpszText
,
text
);
l
strcpyW
(
toolPtr
->
lpszText
,
text
);
}
else
{
...
...
@@ -1640,7 +1639,7 @@ TOOLTIPS_SetTitleT (TOOLTIPS_INFO *infoPtr, UINT_PTR uTitleIcon, LPCWSTR pszTitl
{
if
(
isW
)
{
size
=
(
strlenW
(
pszTitle
)
+
1
)
*
sizeof
(
WCHAR
);
size
=
(
l
strlenW
(
pszTitle
)
+
1
)
*
sizeof
(
WCHAR
);
infoPtr
->
pszTitle
=
Alloc
(
size
);
if
(
!
infoPtr
->
pszTitle
)
return
FALSE
;
...
...
@@ -1977,7 +1976,7 @@ TOOLTIPS_SetFont (TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw)
static
inline
LRESULT
TOOLTIPS_GetTextLength
(
const
TOOLTIPS_INFO
*
infoPtr
)
{
return
strlenW
(
infoPtr
->
szTipText
);
return
l
strlenW
(
infoPtr
->
szTipText
);
}
/******************************************************************
...
...
@@ -1999,7 +1998,7 @@ TOOLTIPS_OnWMGetText (const TOOLTIPS_INFO *infoPtr, WPARAM size, LPWSTR pszText)
if
(
!
size
)
return
0
;
res
=
min
(
strlenW
(
infoPtr
->
szTipText
)
+
1
,
size
);
res
=
min
(
l
strlenW
(
infoPtr
->
szTipText
)
+
1
,
size
);
memcpy
(
pszText
,
infoPtr
->
szTipText
,
res
*
sizeof
(
WCHAR
));
pszText
[
res
-
1
]
=
'\0'
;
return
res
-
1
;
...
...
dlls/comctl32/trackbar.c
View file @
e4e2e8e5
...
...
@@ -1121,7 +1121,7 @@ TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
}
static
int
comp_tics
(
const
void
*
ap
,
const
void
*
bp
)
static
int
__cdecl
comp_tics
(
const
void
*
ap
,
const
void
*
bp
)
{
const
DWORD
a
=
*
(
const
DWORD
*
)
ap
;
const
DWORD
b
=
*
(
const
DWORD
*
)
bp
;
...
...
dlls/comctl32/treeview.c
View file @
e4e2e8e5
...
...
@@ -40,9 +40,6 @@
* Scroll (instead of repaint) as much as possible.
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
...
...
@@ -61,7 +58,6 @@
#include "comctl32.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "wine/heap.h"
...
...
@@ -766,7 +762,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item,
if
(
newText
)
{
item
->
pszText
=
newText
;
strcpyW
(
item
->
pszText
,
callback
.
item
.
pszText
);
l
strcpyW
(
item
->
pszText
,
callback
.
item
.
pszText
);
item
->
cchTextMax
=
len
;
}
/* If realloc fails we have nothing to do, but keep original text */
...
...
@@ -901,7 +897,7 @@ TREEVIEW_ComputeTextWidth(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, HDC
hOldFont
=
SelectObject
(
hdc
,
TREEVIEW_FontForItem
(
infoPtr
,
item
));
}
GetTextExtentPoint32W
(
hdc
,
item
->
pszText
,
strlenW
(
item
->
pszText
),
&
sz
);
GetTextExtentPoint32W
(
hdc
,
item
->
pszText
,
l
strlenW
(
item
->
pszText
),
&
sz
);
item
->
textWidth
=
sz
.
cx
;
if
(
hDC
==
0
)
...
...
@@ -2674,7 +2670,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
debugstr_w
(
item
->
pszText
),
wine_dbgstr_rect
(
&
rcText
));
/* Draw it */
GetTextExtentPoint32W
(
hdc
,
item
->
pszText
,
strlenW
(
item
->
pszText
),
&
sz
);
GetTextExtentPoint32W
(
hdc
,
item
->
pszText
,
l
strlenW
(
item
->
pszText
),
&
sz
);
align
=
SetTextAlign
(
hdc
,
TA_LEFT
|
TA_TOP
);
ExtTextOutW
(
hdc
,
rcText
.
left
+
2
,
(
rcText
.
top
+
rcText
.
bottom
-
sz
.
cy
)
/
2
,
...
...
@@ -3845,7 +3841,7 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
hOldFont
=
SelectObject
(
hdc
,
hFont
);
}
if
(
GetTextExtentPoint32W
(
hdc
,
buffer
,
strlenW
(
buffer
),
&
sz
))
if
(
GetTextExtentPoint32W
(
hdc
,
buffer
,
l
strlenW
(
buffer
),
&
sz
))
{
TEXTMETRICW
textMetric
;
...
...
@@ -3925,7 +3921,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
/* Get string length in pixels */
if
(
hItem
->
pszText
)
GetTextExtentPoint32W
(
hdc
,
hItem
->
pszText
,
strlenW
(
hItem
->
pszText
),
GetTextExtentPoint32W
(
hdc
,
hItem
->
pszText
,
l
strlenW
(
hItem
->
pszText
),
&
sz
);
else
GetTextExtentPoint32A
(
hdc
,
""
,
0
,
&
sz
);
...
...
@@ -4041,7 +4037,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
iLength
=
len
-
1
;
}
if
(
strcmpW
(
newText
,
editedItem
->
pszText
)
!=
0
)
if
(
l
strcmpW
(
newText
,
editedItem
->
pszText
)
!=
0
)
{
WCHAR
*
ptr
=
heap_realloc
(
editedItem
->
pszText
,
sizeof
(
WCHAR
)
*
(
iLength
+
1
));
if
(
ptr
==
NULL
)
...
...
@@ -4057,7 +4053,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
{
editedItem
->
pszText
=
ptr
;
editedItem
->
cchTextMax
=
iLength
+
1
;
strcpyW
(
editedItem
->
pszText
,
newText
);
l
strcpyW
(
editedItem
->
pszText
,
newText
);
TREEVIEW_ComputeTextWidth
(
infoPtr
,
editedItem
,
0
);
}
}
...
...
@@ -4417,7 +4413,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam)
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
if
(
dragItem
->
pszText
)
GetTextExtentPoint32W
(
hdc
,
dragItem
->
pszText
,
strlenW
(
dragItem
->
pszText
),
GetTextExtentPoint32W
(
hdc
,
dragItem
->
pszText
,
l
strlenW
(
dragItem
->
pszText
),
&
size
);
else
GetTextExtentPoint32A
(
hdc
,
""
,
0
,
&
size
);
...
...
@@ -4445,7 +4441,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam)
SetRect
(
&
rc
,
cx
,
0
,
size
.
cx
,
size
.
cy
);
if
(
dragItem
->
pszText
)
DrawTextW
(
hdc
,
dragItem
->
pszText
,
strlenW
(
dragItem
->
pszText
),
&
rc
,
DrawTextW
(
hdc
,
dragItem
->
pszText
,
l
strlenW
(
dragItem
->
pszText
),
&
rc
,
DT_LEFT
);
SelectObject
(
hdc
,
hOldFont
);
...
...
@@ -4698,12 +4694,12 @@ static INT TREEVIEW_ProcessLetterKeys(TREEVIEW_INFO *infoPtr, WPARAM charCode, L
TREEVIEW_GetItemT
(
infoPtr
,
&
item
,
TRUE
);
/* check for a match */
if
(
strncmpiW
(
item
.
pszText
,
infoPtr
->
szSearchParam
,
infoPtr
->
nSearchParamLength
)
==
0
)
{
if
(
wcsnicmp
(
item
.
pszText
,
infoPtr
->
szSearchParam
,
infoPtr
->
nSearchParamLength
)
==
0
)
{
nItem
=
idx
;
break
;
}
else
if
(
(
charCode
!=
0
)
&&
(
nItem
==
NULL
)
&&
(
nItem
!=
infoPtr
->
selectedItem
)
&&
(
strncmpiW
(
item
.
pszText
,
infoPtr
->
szSearchParam
,
1
)
==
0
)
)
{
(
wcsnicmp
(
item
.
pszText
,
infoPtr
->
szSearchParam
,
1
)
==
0
)
)
{
/* This would work but we must keep looking for a longer match */
nItem
=
idx
;
}
...
...
dlls/comctl32/updown.c
View file @
e4e2e8e5
...
...
@@ -34,7 +34,6 @@
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/heap.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
updown
);
...
...
@@ -288,7 +287,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
*
dst
=
0
;
/* try to convert the number and validate it */
newVal
=
strtolW
(
txt
,
&
src
,
infoPtr
->
Base
);
newVal
=
wcstol
(
txt
,
&
src
,
infoPtr
->
Base
);
if
(
*
src
||
!
UPDOWN_InBounds
(
infoPtr
,
newVal
))
return
FALSE
;
}
...
...
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