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
93ff3fde
Commit
93ff3fde
authored
Dec 01, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledlg: Replace existing menu item in case of empty object too.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5c992f96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
oledlg_main.c
dlls/oledlg/oledlg_main.c
+1
-0
main.c
dlls/oledlg/tests/main.c
+67
-0
No files found.
dlls/oledlg/oledlg_main.c
View file @
93ff3fde
...
@@ -184,6 +184,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype,
...
@@ -184,6 +184,7 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype,
LoadStringW
(
OLEDLG_hInstance
,
IDS_VERBMENU_OBJECT
,
resstrW
,
sizeof
(
resstrW
)
/
sizeof
(
WCHAR
));
LoadStringW
(
OLEDLG_hInstance
,
IDS_VERBMENU_OBJECT
,
resstrW
,
sizeof
(
resstrW
)
/
sizeof
(
WCHAR
));
/* no object, or object without enumeration support */
/* no object, or object without enumeration support */
if
(
!
object
||
!
enumverbs
)
{
if
(
!
object
||
!
enumverbs
)
{
RemoveMenu
(
hMenu
,
uPos
,
MF_BYPOSITION
);
InsertMenuW
(
hMenu
,
uPos
,
MF_BYPOSITION
|
MF_STRING
|
MF_GRAYED
,
idmin
,
resstrW
);
InsertMenuW
(
hMenu
,
uPos
,
MF_BYPOSITION
|
MF_STRING
|
MF_GRAYED
,
idmin
,
resstrW
);
return
FALSE
;
return
FALSE
;
}
}
...
...
dlls/oledlg/tests/main.c
View file @
93ff3fde
...
@@ -303,6 +303,7 @@ static IOleObject oleobject = { &oleobjectvtbl };
...
@@ -303,6 +303,7 @@ static IOleObject oleobject = { &oleobjectvtbl };
static
void
test_OleUIAddVerbMenu
(
void
)
static
void
test_OleUIAddVerbMenu
(
void
)
{
{
static
const
WCHAR
cadabraW
[]
=
{
'c'
,
'a'
,
'd'
,
'a'
,
'b'
,
'r'
,
'a'
,
0
};
HMENU
hMenu
,
verbmenu
;
HMENU
hMenu
,
verbmenu
;
MENUITEMINFOW
info
;
MENUITEMINFOW
info
;
WCHAR
buffW
[
50
];
WCHAR
buffW
[
50
];
...
@@ -418,6 +419,72 @@ static void test_OleUIAddVerbMenu(void)
...
@@ -418,6 +419,72 @@ static void test_OleUIAddVerbMenu(void)
ok
(
count
==
5
,
"got %d
\n
"
,
count
);
ok
(
count
==
5
,
"got %d
\n
"
,
count
);
DestroyMenu
(
hMenu
);
DestroyMenu
(
hMenu
);
/* try to add verb menu repeatedly, with same id */
hMenu
=
CreatePopupMenu
();
count
=
GetMenuItemCount
(
hMenu
);
ok
(
count
==
0
,
"got %d
\n
"
,
count
);
verbmenu
=
NULL
;
ret
=
OleUIAddVerbMenuW
(
NULL
,
NULL
,
hMenu
,
0
,
5
,
10
,
TRUE
,
3
,
&
verbmenu
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
verbmenu
==
NULL
,
"got %p
\n
"
,
verbmenu
);
count
=
GetMenuItemCount
(
hMenu
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
verbmenu
=
NULL
;
ret
=
OleUIAddVerbMenuW
(
NULL
,
NULL
,
hMenu
,
0
,
5
,
10
,
TRUE
,
3
,
&
verbmenu
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
verbmenu
==
NULL
,
"got %p
\n
"
,
verbmenu
);
count
=
GetMenuItemCount
(
hMenu
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
/* same position, different id */
verbmenu
=
NULL
;
ret
=
OleUIAddVerbMenuW
(
NULL
,
NULL
,
hMenu
,
0
,
6
,
10
,
TRUE
,
3
,
&
verbmenu
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
verbmenu
==
NULL
,
"got %p
\n
"
,
verbmenu
);
count
=
GetMenuItemCount
(
hMenu
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
/* change added item string and state */
memset
(
&
info
,
0
,
sizeof
(
info
));
info
.
cbSize
=
sizeof
(
info
);
info
.
fMask
=
MIIM_STRING
|
MIIM_STATE
;
info
.
fState
=
MFS_ENABLED
;
info
.
dwTypeData
=
buffW
;
lstrcpyW
(
buffW
,
cadabraW
);
ret
=
SetMenuItemInfoW
(
hMenu
,
0
,
TRUE
,
&
info
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
buffW
[
0
]
=
0
;
GetMenuStringW
(
hMenu
,
0
,
buffW
,
sizeof
(
buffW
)
/
sizeof
(
buffW
[
0
]),
MF_BYPOSITION
);
ok
(
!
lstrcmpW
(
buffW
,
cadabraW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffW
));
verbmenu
=
NULL
;
ret
=
OleUIAddVerbMenuW
(
NULL
,
NULL
,
hMenu
,
0
,
5
,
10
,
TRUE
,
3
,
&
verbmenu
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
verbmenu
==
NULL
,
"got %p
\n
"
,
verbmenu
);
memset
(
&
info
,
0
,
sizeof
(
info
));
info
.
cbSize
=
sizeof
(
info
);
info
.
fMask
=
MIIM_STRING
|
MIIM_STATE
;
buffW
[
0
]
=
0
;
info
.
dwTypeData
=
buffW
;
info
.
cch
=
sizeof
(
buffW
)
/
sizeof
(
WCHAR
);
ret
=
GetMenuItemInfoW
(
hMenu
,
0
,
TRUE
,
&
info
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
lstrcmpW
(
buffW
,
cadabraW
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffW
));
ok
(
info
.
fState
==
MF_GRAYED
,
"got state 0x%08x
\n
"
,
info
.
fState
);
count
=
GetMenuItemCount
(
hMenu
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
DestroyMenu
(
hMenu
);
}
}
START_TEST
(
main
)
START_TEST
(
main
)
...
...
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