Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
ab575718
Commit
ab575718
authored
Aug 16, 2010
by
Gerald Pfeifer
Committed by
Alexandre Julliard
Aug 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Merge is_textT and is_textW into a single is_text.
parent
a0e75874
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
listview.c
dlls/comctl32/listview.c
+14
-20
No files found.
dlls/comctl32/listview.c
View file @
ab575718
...
...
@@ -474,20 +474,14 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *, INT, INT);
* W: Unicode, T: ANSI/Unicode - function of isW
*/
static
inline
BOOL
is_text
W
(
LPCWSTR
text
)
static
inline
BOOL
is_text
(
LPCWSTR
text
)
{
return
text
!=
NULL
&&
text
!=
LPSTR_TEXTCALLBACKW
;
}
static
inline
BOOL
is_textT
(
LPCWSTR
text
,
BOOL
isW
)
{
/* we can ignore isW since LPSTR_TEXTCALLBACKW == LPSTR_TEXTCALLBACKA */
return
is_textW
(
text
);
}
static
inline
int
textlenT
(
LPCWSTR
text
,
BOOL
isW
)
{
return
!
is_text
T
(
text
,
isW
)
?
0
:
return
!
is_text
(
text
)
?
0
:
isW
?
lstrlenW
(
text
)
:
lstrlenA
((
LPCSTR
)
text
);
}
...
...
@@ -505,7 +499,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW)
{
LPWSTR
wstr
=
(
LPWSTR
)
text
;
if
(
!
isW
&&
is_text
T
(
text
,
isW
))
if
(
!
isW
&&
is_text
(
text
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPCSTR
)
text
,
-
1
,
NULL
,
0
);
wstr
=
Alloc
(
len
*
sizeof
(
WCHAR
));
...
...
@@ -517,7 +511,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW)
static
inline
void
textfreeT
(
LPWSTR
wstr
,
BOOL
isW
)
{
if
(
!
isW
&&
is_text
T
(
wstr
,
isW
))
Free
(
wstr
);
if
(
!
isW
&&
is_text
(
wstr
))
Free
(
wstr
);
}
/*
...
...
@@ -530,7 +524,7 @@ static BOOL textsetptrT(LPWSTR *dest, LPCWSTR src, BOOL isW)
if
(
src
==
LPSTR_TEXTCALLBACKW
)
{
if
(
is_text
W
(
*
dest
))
Free
(
*
dest
);
if
(
is_text
(
*
dest
))
Free
(
*
dest
);
*
dest
=
LPSTR_TEXTCALLBACKW
;
}
else
...
...
@@ -946,7 +940,7 @@ static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT notificationCode
UINT
realNotifCode
;
LPWSTR
pszTempBuf
=
NULL
,
savPszText
=
NULL
;
if
((
pdi
->
item
.
mask
&
LVIF_TEXT
)
&&
is_text
T
(
pdi
->
item
.
pszText
,
isW
))
if
((
pdi
->
item
.
mask
&
LVIF_TEXT
)
&&
is_text
(
pdi
->
item
.
pszText
))
{
convertToAnsi
=
(
isW
&&
infoPtr
->
notifyFormat
==
NFR_ANSI
);
convertToUnicode
=
(
!
isW
&&
infoPtr
->
notifyFormat
==
NFR_UNICODE
);
...
...
@@ -2325,7 +2319,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW
/* we need the text in non owner draw mode */
assert
(
lpLVItem
->
mask
&
LVIF_TEXT
);
if
(
is_text
T
(
lpLVItem
->
pszText
,
TRUE
))
if
(
is_text
(
lpLVItem
->
pszText
))
{
HFONT
hFont
=
infoPtr
->
hFont
?
infoPtr
->
hFont
:
infoPtr
->
hDefaultFont
;
HDC
hdc
=
GetDC
(
infoPtr
->
hwndSelf
);
...
...
@@ -4320,7 +4314,7 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL is
return
FALSE
;
/* For efficiency, we transform the lpLVItem->pszText to Unicode here */
if
((
lpLVItem
->
mask
&
LVIF_TEXT
)
&&
is_text
W
(
lpLVItem
->
pszText
))
if
((
lpLVItem
->
mask
&
LVIF_TEXT
)
&&
is_text
(
lpLVItem
->
pszText
))
{
pszText
=
lpLVItem
->
pszText
;
lpLVItem
->
pszText
=
textdupTtoW
(
lpLVItem
->
pszText
,
isW
);
...
...
@@ -5309,7 +5303,7 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
for
(
j
=
0
;
j
<
DPA_GetPtrCount
(
hdpaSubItems
);
j
++
)
{
hdrItem
=
DPA_GetPtr
(
hdpaSubItems
,
j
);
if
(
is_text
W
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
if
(
is_text
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
Free
(
hdrItem
);
}
DPA_Destroy
(
hdpaSubItems
);
...
...
@@ -5451,7 +5445,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
if
(
nSubItem
>
0
)
{
/* free string */
if
(
is_text
W
(
lpDelItem
->
hdr
.
pszText
))
if
(
is_text
(
lpDelItem
->
hdr
.
pszText
))
Free
(
lpDelItem
->
hdr
.
pszText
);
/* free item */
...
...
@@ -5600,7 +5594,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem)
for
(
i
=
0
;
i
<
DPA_GetPtrCount
(
hdpaSubItems
);
i
++
)
{
hdrItem
=
DPA_GetPtr
(
hdpaSubItems
,
i
);
if
(
is_text
W
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
if
(
is_text
(
hdrItem
->
pszText
))
Free
(
hdrItem
->
pszText
);
Free
(
hdrItem
);
}
DPA_Destroy
(
hdpaSubItems
);
...
...
@@ -6600,7 +6594,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
/* Apps depend on calling back for text if it is NULL or LPSTR_TEXTCALLBACKW */
if
((
lpLVItem
->
mask
&
LVIF_TEXT
)
&&
!
(
lpLVItem
->
mask
&
LVIF_NORECOMPUTE
)
&&
!
is_text
W
(
pItemHdr
->
pszText
))
!
is_text
(
pItemHdr
->
pszText
))
{
dispInfo
.
item
.
mask
|=
LVIF_TEXT
;
dispInfo
.
item
.
pszText
=
lpLVItem
->
pszText
;
...
...
@@ -6648,7 +6642,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem,
else
if
(
lpLVItem
->
mask
&
LVIF_TEXT
)
{
/* if LVN_GETDISPINFO's disabled with LVIF_NORECOMPUTE return callback placeholder */
if
(
isW
||
!
is_text
W
(
pItemHdr
->
pszText
))
lpLVItem
->
pszText
=
pItemHdr
->
pszText
;
if
(
isW
||
!
is_text
(
pItemHdr
->
pszText
))
lpLVItem
->
pszText
=
pItemHdr
->
pszText
;
else
textcpynT
(
lpLVItem
->
pszText
,
isW
,
pItemHdr
->
pszText
,
TRUE
,
lpLVItem
->
cchTextMax
);
}
...
...
@@ -7355,7 +7349,7 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszTe
SIZE
stringSize
;
stringSize
.
cx
=
0
;
if
(
is_text
T
(
lpszText
,
isW
))
if
(
is_text
(
lpszText
))
{
HFONT
hFont
=
infoPtr
->
hFont
?
infoPtr
->
hFont
:
infoPtr
->
hDefaultFont
;
HDC
hdc
=
GetDC
(
infoPtr
->
hwndSelf
);
...
...
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