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
e3467de9
Commit
e3467de9
authored
May 13, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
May 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: header: Move common code from SetItemT/InsertItemT into a new function.
parent
15e71a0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
75 deletions
+48
-75
header.c
dlls/comctl32/header.c
+48
-75
No files found.
dlls/comctl32/header.c
View file @
e3467de9
...
...
@@ -110,6 +110,51 @@ static void HEADER_DisposeItem(HEADER_ITEM *lpItem)
}
}
static
void
HEADER_StoreHDItemInHeader
(
HEADER_ITEM
*
lpItem
,
HDITEMW
*
phdi
,
BOOL
fUnicode
)
{
if
(
phdi
->
mask
&
HDI_BITMAP
)
lpItem
->
hbm
=
phdi
->
hbm
;
if
(
phdi
->
mask
&
HDI_FORMAT
)
lpItem
->
fmt
=
phdi
->
fmt
;
if
(
phdi
->
mask
&
HDI_LPARAM
)
lpItem
->
lParam
=
phdi
->
lParam
;
if
(
phdi
->
mask
&
HDI_WIDTH
)
lpItem
->
cxy
=
phdi
->
cxy
;
if
(
phdi
->
mask
&
HDI_IMAGE
)
{
lpItem
->
iImage
=
phdi
->
iImage
;
}
if
(
phdi
->
mask
&
HDI_TEXT
)
{
if
(
!
phdi
->
pszText
)
phdi
->
pszText
=
emptyString
;
/* null pointer check */
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
{
if
(
lpItem
->
pszText
)
{
if
(
lpItem
->
pszText
!=
emptyString
&&
lpItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
)
{
if
(
fUnicode
)
Str_SetPtrW
(
&
lpItem
->
pszText
,
phdi
->
pszText
);
else
Str_SetPtrAtoW
(
&
lpItem
->
pszText
,
(
LPSTR
)
phdi
->
pszText
);
}
}
else
{
lpItem
->
pszText
=
phdi
->
pszText
;
}
}
}
inline
static
LRESULT
HEADER_IndexToOrder
(
HWND
hwnd
,
INT
iItem
)
{
...
...
@@ -1085,44 +1130,11 @@ HEADER_InsertItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
}
lpItem
=
&
infoPtr
->
items
[
nItem
];
lpItem
->
bDown
=
FALSE
;
if
(
phdi
->
mask
&
HDI_WIDTH
)
lpItem
->
cxy
=
phdi
->
cxy
;
if
(
phdi
->
mask
&
HDI_FORMAT
)
lpItem
->
fmt
=
phdi
->
fmt
;
if
(
lpItem
->
fmt
==
0
)
lpItem
->
fmt
=
HDF_LEFT
;
if
(
phdi
->
mask
&
HDI_BITMAP
)
lpItem
->
hbm
=
phdi
->
hbm
;
if
(
phdi
->
mask
&
HDI_LPARAM
)
lpItem
->
lParam
=
phdi
->
lParam
;
if
(
phdi
->
mask
&
HDI_IMAGE
)
{
lpItem
->
iImage
=
phdi
->
iImage
;
}
ZeroMemory
(
lpItem
,
sizeof
(
HEADER_ITEM
));
HEADER_StoreHDItemInHeader
(
lpItem
,
phdi
,
bUnicode
);
if
(
phdi
->
mask
&
HDI_TEXT
)
{
if
(
!
phdi
->
pszText
)
phdi
->
pszText
=
emptyString
;
/* null pointer check */
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
{
if
(
bUnicode
)
Str_SetPtrW
(
&
lpItem
->
pszText
,
phdi
->
pszText
);
else
Str_SetPtrAtoW
(
&
lpItem
->
pszText
,
(
LPSTR
)
phdi
->
pszText
);
}
else
{
lpItem
->
pszText
=
phdi
->
pszText
;
}
lpItem
->
fmt
|=
HDF_STRING
;
}
lpItem
->
iOrder
=
iOrder
;
...
...
@@ -1221,46 +1233,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
}
lpItem
=
&
infoPtr
->
items
[
nItem
];
if
(
phdi
->
mask
&
HDI_BITMAP
)
lpItem
->
hbm
=
phdi
->
hbm
;
if
(
phdi
->
mask
&
HDI_FORMAT
)
lpItem
->
fmt
=
phdi
->
fmt
;
if
(
phdi
->
mask
&
HDI_LPARAM
)
lpItem
->
lParam
=
phdi
->
lParam
;
if
(
phdi
->
mask
&
HDI_WIDTH
)
lpItem
->
cxy
=
phdi
->
cxy
;
if
(
phdi
->
mask
&
HDI_IMAGE
)
{
lpItem
->
iImage
=
phdi
->
iImage
;
}
if
(
phdi
->
mask
&
HDI_TEXT
)
{
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
{
if
(
lpItem
->
pszText
)
{
if
(
lpItem
->
pszText
!=
emptyString
&&
lpItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
)
{
if
(
bUnicode
)
Str_SetPtrW
(
&
lpItem
->
pszText
,
phdi
->
pszText
);
else
Str_SetPtrAtoW
(
&
lpItem
->
pszText
,
(
LPSTR
)
phdi
->
pszText
);
}
}
else
{
lpItem
->
pszText
=
phdi
->
pszText
;
}
}
HEADER_StoreHDItemInHeader
(
lpItem
,
phdi
,
bUnicode
);
if
(
phdi
->
mask
&
HDI_ORDER
)
{
...
...
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