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
12c06511
Commit
12c06511
authored
Dec 08, 2012
by
Daniel Jelinski
Committed by
Alexandre Julliard
Dec 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Convert header notifications to ANSI in place.
parent
70df1d58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
26 deletions
+23
-26
listview.c
dlls/comctl32/listview.c
+23
-24
listview.c
dlls/comctl32/tests/listview.c
+0
-2
No files found.
dlls/comctl32/listview.c
View file @
12c06511
...
...
@@ -774,13 +774,11 @@ static int get_ansi_notification(UINT unicodeNotificationCode)
}
/* forwards header notifications to listview parent */
static
LRESULT
notify_forward_header
(
const
LISTVIEW_INFO
*
infoPtr
,
const
NMHEADERW
*
lpnmh
)
static
LRESULT
notify_forward_header
(
const
LISTVIEW_INFO
*
infoPtr
,
NMHEADERW
*
lpnmhW
)
{
NMHEADERA
nmhA
;
HDITEMA
hditema
;
HD_TEXTFILTERA
textfilter
;
LPSTR
text
=
NULL
,
filter
=
NULL
;
LPCWSTR
text
=
NULL
,
filter
=
NULL
;
LRESULT
ret
;
NMHEADERA
*
lpnmh
=
(
NMHEADERA
*
)
lpnmhW
;
/* on unicode format exit earlier */
if
(
infoPtr
->
notifyFormat
==
NFR_UNICODE
)
...
...
@@ -789,37 +787,38 @@ static LRESULT notify_forward_header(const LISTVIEW_INFO *infoPtr, const NMHEADE
/* header always supplies unicode notifications,
all we have to do is to convert strings to ANSI */
nmhA
=
*
(
const
NMHEADERA
*
)
lpnmh
;
if
(
lpnmh
->
pitem
)
{
hditema
=
*
(
HDITEMA
*
)
lpnmh
->
pitem
;
nmhA
.
pitem
=
&
hditema
;
/* convert item text */
if
(
lpnmh
->
pitem
->
mask
&
HDI_TEXT
)
{
hditema
.
pszText
=
NULL
;
Str_SetPtrWtoA
(
&
hditema
.
pszText
,
lpnmh
->
pitem
->
pszText
);
text
=
hditema
.
pszText
;
text
=
(
LPCWSTR
)
lpnmh
->
pitem
->
pszText
;
Str_SetPtrWtoA
(
&
lpnmh
->
pitem
->
pszText
,
text
);
}
/* convert filter text */
if
((
lpnmh
->
pitem
->
mask
&
HDI_FILTER
)
&&
(
lpnmh
->
pitem
->
type
==
HDFT_ISSTRING
)
&&
lpnmh
->
pitem
->
pvFilter
)
{
hditema
.
pvFilter
=
&
textfilter
;
textfilter
=
*
(
HD_TEXTFILTERA
*
)(
lpnmh
->
pitem
->
pvFilter
);
textfilter
.
pszText
=
NULL
;
Str_SetPtrWtoA
(
&
textfilter
.
pszText
,
((
HD_TEXTFILTERW
*
)
lpnmh
->
pitem
->
pvFilter
)
->
pszText
);
filter
=
textfilter
.
pszText
;
filter
=
(
LPCWSTR
)((
HD_TEXTFILTERA
*
)
lpnmh
->
pitem
->
pvFilter
)
->
pszText
;
Str_SetPtrWtoA
(
&
((
HD_TEXTFILTERA
*
)
lpnmh
->
pitem
->
pvFilter
)
->
pszText
,
filter
);
}
}
nmhA
.
hdr
.
code
=
get_ansi_notification
(
lpnmh
->
hdr
.
code
);
lpnmh
->
hdr
.
code
=
get_ansi_notification
(
lpnmh
->
hdr
.
code
);
ret
=
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
nmhA
.
hdr
.
idFrom
,
(
LPARAM
)
&
nmhA
);
ret
=
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_NOTIFY
,
lpnmh
->
hdr
.
idFrom
,
(
LPARAM
)
lpnmh
);
/* cleanup */
Free
(
text
);
Free
(
filter
);
if
(
text
)
{
Free
(
lpnmh
->
pitem
->
pszText
);
lpnmh
->
pitem
->
pszText
=
(
LPSTR
)
text
;
}
if
(
filter
)
{
Free
(((
HD_TEXTFILTERA
*
)
lpnmh
->
pitem
->
pvFilter
)
->
pszText
);
((
HD_TEXTFILTERA
*
)
lpnmh
->
pitem
->
pvFilter
)
->
pszText
=
(
LPSTR
)
filter
;
}
return
ret
;
}
...
...
@@ -10238,9 +10237,9 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
* RETURN:
* Zero
*/
static
LRESULT
LISTVIEW_Notify
(
LISTVIEW_INFO
*
infoPtr
,
const
NMHDR
*
lpnmhdr
)
static
LRESULT
LISTVIEW_Notify
(
LISTVIEW_INFO
*
infoPtr
,
NMHDR
*
lpnmhdr
)
{
const
NMHEADERW
*
lpnmh
;
NMHEADERW
*
lpnmh
;
TRACE
(
"(lpnmhdr=%p)
\n
"
,
lpnmhdr
);
...
...
@@ -10248,7 +10247,7 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr)
/* remember: HDN_LAST < HDN_FIRST */
if
(
lpnmhdr
->
code
>
HDN_FIRST
||
lpnmhdr
->
code
<
HDN_LAST
)
return
0
;
lpnmh
=
(
const
NMHEADERW
*
)
lpnmhdr
;
lpnmh
=
(
NMHEADERW
*
)
lpnmhdr
;
if
(
lpnmh
->
iItem
<
0
||
lpnmh
->
iItem
>=
DPA_GetPtrCount
(
infoPtr
->
hdpaColumns
))
return
0
;
...
...
dlls/comctl32/tests/listview.c
View file @
12c06511
...
...
@@ -4988,7 +4988,6 @@ static void test_header_notification2(void)
ret
=
SendMessageW
(
list
,
WM_NOTIFY
,
0
,
(
LPARAM
)
&
nmhdr
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_header_click_seq
,
"header notify, parent"
,
FALSE
);
todo_wine
ok
(
nmhdr
.
hdr
.
code
==
HDN_ITEMCLICKA
,
"Expected ANSI notification code
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
nmhdr
.
hdr
.
code
=
HDN_ITEMDBLCLICKW
;
...
...
@@ -5001,7 +5000,6 @@ static void test_header_notification2(void)
ret
=
SendMessageW
(
list
,
WM_NOTIFY
,
0
,
(
LPARAM
)
&
nmhdr
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_header_divider_dclick_seq
,
"header notify, parent"
,
TRUE
);
todo_wine
ok
(
nmhdr
.
hdr
.
code
==
HDN_DIVIDERDBLCLICKA
,
"Expected ANSI notification code
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
nmhdr
.
hdr
.
code
=
HDN_BEGINTRACKW
;
...
...
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