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
96a6184c
Commit
96a6184c
authored
Jul 01, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Jul 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: All negative entries in the toolbar save state are special cases.
parent
77ed3733
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
17 deletions
+48
-17
toolbar.c
dlls/comctl32/tests/toolbar.c
+43
-9
toolbar.c
dlls/comctl32/toolbar.c
+5
-8
No files found.
dlls/comctl32/tests/toolbar.c
View file @
96a6184c
...
...
@@ -150,7 +150,7 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
NMTBSAVE
*
save
=
(
NMTBSAVE
*
)
lParam
;
if
(
save
->
iItem
==
-
1
)
{
save
->
cbData
=
save
->
cbData
*
2
+
sizeof
(
DWORD
);
save
->
cbData
=
save
->
cbData
*
2
+
11
*
sizeof
(
DWORD
);
save
->
pData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
save
->
cbData
);
save
->
pData
[
0
]
=
0xcafe
;
save
->
pCurrent
=
save
->
pData
+
1
;
...
...
@@ -160,6 +160,22 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
save
->
pCurrent
[
0
]
=
0xcafe0000
+
save
->
iItem
;
save
->
pCurrent
++
;
}
/* Add on 5 more pseudo buttons. */
if
(
save
->
iItem
==
save
->
cButtons
-
1
)
{
save
->
pCurrent
[
0
]
=
0xffffffff
;
save
->
pCurrent
[
1
]
=
0xcafe0007
;
save
->
pCurrent
[
2
]
=
0xfffffffe
;
save
->
pCurrent
[
3
]
=
0xcafe0008
;
save
->
pCurrent
[
4
]
=
0x80000000
;
save
->
pCurrent
[
5
]
=
0xcafe0009
;
save
->
pCurrent
[
6
]
=
0x7fffffff
;
save
->
pCurrent
[
7
]
=
0xcafe000a
;
save
->
pCurrent
[
8
]
=
0x100
;
save
->
pCurrent
[
9
]
=
0xcafe000b
;
}
/* Return value is ignored */
return
1
;
}
...
...
@@ -169,21 +185,37 @@ static LRESULT parent_wnd_notify(LPARAM lParam)
if
(
restore
->
iItem
==
-
1
)
{
ok
(
restore
->
cButtons
==
1
5
,
"got %d
\n
"
,
restore
->
cButtons
);
ok
(
restore
->
cButtons
==
2
5
,
"got %d
\n
"
,
restore
->
cButtons
);
ok
(
*
restore
->
pCurrent
==
0xcafe
,
"got %08x
\n
"
,
*
restore
->
pCurrent
);
/* Skip the last one */
restore
->
cButtons
=
6
;
restore
->
cButtons
=
11
;
restore
->
pCurrent
++
;
/* BytesPerRecord is ignored */
restore
->
cbBytesPerRecord
=
10
;
}
else
{
ok
(
*
restore
->
pCurrent
==
0xcafe0000
+
restore
->
iItem
,
"got %08x
\n
"
,
*
restore
->
pCurrent
);
ok
(
restore
->
tbButton
.
iBitmap
==
-
1
,
"got %08x
\n
"
,
restore
->
tbButton
.
iBitmap
);
ok
(
restore
->
tbButton
.
idCommand
==
restore
->
iItem
*
2
+
1
,
"got %08x
\n
"
,
restore
->
tbButton
.
idCommand
);
ok
(
restore
->
tbButton
.
fsState
==
0
,
"got %02x
\n
"
,
restore
->
tbButton
.
fsState
);
ok
(
restore
->
tbButton
.
fsStyle
==
0
,
"got %02x
\n
"
,
restore
->
tbButton
.
fsStyle
);
ok
(
*
restore
->
pCurrent
==
0xcafe0000
+
restore
->
iItem
,
"got %08x
\n
"
,
*
restore
->
pCurrent
);
if
(
restore
->
iItem
<
7
||
restore
->
iItem
==
10
)
{
if
(
restore
->
iItem
<
7
)
ok
(
restore
->
tbButton
.
idCommand
==
restore
->
iItem
*
2
+
1
,
"%d: got %08x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
idCommand
);
else
ok
(
restore
->
tbButton
.
idCommand
==
0x7fffffff
,
"%d: got %08x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
idCommand
);
ok
(
restore
->
tbButton
.
fsState
==
0
,
"%d: got %02x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
fsState
);
ok
(
restore
->
tbButton
.
fsStyle
==
0
,
"%d: got %02x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
fsStyle
);
}
else
{
ok
(
restore
->
tbButton
.
idCommand
==
0
,
"%d: got %08x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
idCommand
);
if
(
restore
->
iItem
==
7
)
ok
(
restore
->
tbButton
.
fsState
==
0
,
"%d: got %02x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
fsState
);
else
ok
(
restore
->
tbButton
.
fsState
==
TBSTATE_HIDDEN
,
"%d: got %02x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
fsState
);
ok
(
restore
->
tbButton
.
fsStyle
==
BTNS_SEP
,
"%d: got %02x
\n
"
,
restore
->
iItem
,
restore
->
tbButton
.
fsStyle
);
}
ok
(
restore
->
tbButton
.
dwData
==
0
,
"got %08lx
\n
"
,
restore
->
tbButton
.
dwData
);
ok
(
restore
->
tbButton
.
iString
==
0
,
"got %08lx
\n
"
,
restore
->
tbButton
.
iString
);
...
...
@@ -2176,7 +2208,9 @@ static void test_save(void)
{
0
,
13
,
TBSTATE_ENABLED
,
BTNS_BUTTON
,
{
0
},
0
,
-
1
}
};
static
const
DWORD
expect
[]
=
{
0xcafe
,
1
,
0xcafe0000
,
3
,
0xcafe0001
,
5
,
0xcafe0002
,
7
,
0xcafe0003
,
9
,
0xcafe0004
,
11
,
0xcafe0005
,
13
,
0xcafe0006
};
9
,
0xcafe0004
,
11
,
0xcafe0005
,
13
,
0xcafe0006
,
0xffffffff
,
0xcafe0007
,
0xfffffffe
,
0xcafe0008
,
0x80000000
,
0xcafe0009
,
0x7fffffff
,
0xcafe000a
,
0x100
,
0xcafe000b
};
params
.
hkr
=
HKEY_CURRENT_USER
;
params
.
pszSubKey
=
subkey
;
...
...
@@ -2206,7 +2240,7 @@ static void test_save(void)
res
=
SendMessageW
(
wnd
,
TB_SAVERESTOREW
,
FALSE
,
(
LPARAM
)
&
params
);
ok
(
res
,
"restoring failed
\n
"
);
res
=
SendMessageW
(
wnd
,
TB_BUTTONCOUNT
,
0
,
0
);
ok
(
res
==
6
,
"got %d
\n
"
,
res
);
ok
(
res
==
11
,
"got %d
\n
"
,
res
);
DestroyWindow
(
wnd
);
RegOpenKeyW
(
HKEY_CURRENT_USER
,
subkey
,
&
key
);
...
...
dlls/comctl32/toolbar.c
View file @
96a6184c
...
...
@@ -4195,18 +4195,15 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave)
nmtbr
.
tbButton
.
iBitmap
=
-
1
;
nmtbr
.
tbButton
.
fsState
=
0
;
nmtbr
.
tbButton
.
fsStyle
=
0
;
nmtbr
.
tbButton
.
idCommand
=
0
;
if
(
*
nmtbr
.
pCurrent
==
(
DWORD
)
-
1
)
if
(
*
nmtbr
.
pCurrent
&
0x80000000
)
{
/* separator */
nmtbr
.
tbButton
.
idCommand
=
0
;
nmtbr
.
tbButton
.
fsStyle
=
TBSTYLE_SEP
;
/* when inserting separators, iBitmap controls its size.
0 sets default size (width) */
nmtbr
.
tbButton
.
iBitmap
=
0
;
if
(
*
nmtbr
.
pCurrent
!=
(
DWORD
)
-
1
)
nmtbr
.
tbButton
.
fsState
=
TBSTATE_HIDDEN
;
}
else
if
(
*
nmtbr
.
pCurrent
==
(
DWORD
)
-
2
)
/* hidden button */
nmtbr
.
tbButton
.
fsState
=
TBSTATE_HIDDEN
;
else
nmtbr
.
tbButton
.
idCommand
=
(
int
)
*
nmtbr
.
pCurrent
;
...
...
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