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
57226607
Commit
57226607
authored
Nov 09, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Simplify some code.
parent
f288ed99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
menu.c
dlls/user32/menu.c
+9
-9
No files found.
dlls/user32/menu.c
View file @
57226607
...
@@ -703,18 +703,17 @@ static MENUITEM *MENU_FindItemByCoords( const POPUPMENU *menu,
...
@@ -703,18 +703,17 @@ static MENUITEM *MENU_FindItemByCoords( const POPUPMENU *menu,
{
{
MENUITEM
*
item
;
MENUITEM
*
item
;
UINT
i
;
UINT
i
;
RECT
wrect
;
RECT
rect
;
RECT
rect
;
if
(
!
GetWindowRect
(
menu
->
hWnd
,
&
wrect
))
return
NULL
;
if
(
!
GetWindowRect
(
menu
->
hWnd
,
&
rect
))
return
NULL
;
pt
.
x
-=
wrect
.
left
;
pt
.
y
-=
wrect
.
top
;
pt
.
x
-=
rect
.
left
;
pt
.
y
-=
rect
.
top
;
item
=
menu
->
items
;
item
=
menu
->
items
;
for
(
i
=
0
;
i
<
menu
->
nItems
;
i
++
,
item
++
)
for
(
i
=
0
;
i
<
menu
->
nItems
;
i
++
,
item
++
)
{
{
rect
=
item
->
rect
;
rect
=
item
->
rect
;
MENU_AdjustMenuItemRect
(
menu
,
&
rect
);
MENU_AdjustMenuItemRect
(
menu
,
&
rect
);
if
((
pt
.
x
>=
rect
.
left
)
&&
(
pt
.
x
<
rect
.
right
)
&&
if
(
PtInRect
(
&
rect
,
pt
))
(
pt
.
y
>=
rect
.
top
)
&&
(
pt
.
y
<
rect
.
bottom
))
{
{
if
(
pos
)
*
pos
=
i
;
if
(
pos
)
*
pos
=
i
;
return
item
;
return
item
;
...
@@ -1109,7 +1108,7 @@ MENU_GetMaxPopupHeight(LPPOPUPMENU lppop)
...
@@ -1109,7 +1108,7 @@ MENU_GetMaxPopupHeight(LPPOPUPMENU lppop)
*
*
* Calculate the size of a popup menu.
* Calculate the size of a popup menu.
*/
*/
static
void
MENU_PopupMenuCalcSize
(
LPPOPUPMENU
lppop
,
HWND
hwndOwner
)
static
void
MENU_PopupMenuCalcSize
(
LPPOPUPMENU
lppop
)
{
{
MENUITEM
*
lpitem
;
MENUITEM
*
lpitem
;
HDC
hdc
;
HDC
hdc
;
...
@@ -1143,7 +1142,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner )
...
@@ -1143,7 +1142,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner )
if
((
i
!=
start
)
&&
if
((
i
!=
start
)
&&
(
lpitem
->
fType
&
(
MF_MENUBREAK
|
MF_MENUBARBREAK
)))
break
;
(
lpitem
->
fType
&
(
MF_MENUBREAK
|
MF_MENUBARBREAK
)))
break
;
MENU_CalcItemSize
(
hdc
,
lpitem
,
hwndOwner
,
orgX
,
orgY
,
FALSE
,
lppop
);
MENU_CalcItemSize
(
hdc
,
lpitem
,
lppop
->
hwndOwner
,
orgX
,
orgY
,
FALSE
,
lppop
);
maxX
=
max
(
maxX
,
lpitem
->
rect
.
right
);
maxX
=
max
(
maxX
,
lpitem
->
rect
.
right
);
orgY
=
lpitem
->
rect
.
bottom
;
orgY
=
lpitem
->
rect
.
bottom
;
if
(
IS_STRING_ITEM
(
lpitem
->
fType
)
&&
lpitem
->
xTab
)
if
(
IS_STRING_ITEM
(
lpitem
->
fType
)
&&
lpitem
->
xTab
)
...
@@ -1792,7 +1791,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
...
@@ -1792,7 +1791,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
menu
->
hwndOwner
=
hwndOwner
;
menu
->
hwndOwner
=
hwndOwner
;
menu
->
nScrollPos
=
0
;
menu
->
nScrollPos
=
0
;
MENU_PopupMenuCalcSize
(
menu
,
hwndOwner
);
MENU_PopupMenuCalcSize
(
menu
);
/* adjust popup menu pos so that it fits within the desktop */
/* adjust popup menu pos so that it fits within the desktop */
...
@@ -3657,7 +3656,7 @@ INT WINAPI GetMenuStringA(
...
@@ -3657,7 +3656,7 @@ INT WINAPI GetMenuStringA(
if
(
!
str
||
!
nMaxSiz
)
return
strlenW
(
item
->
text
);
if
(
!
str
||
!
nMaxSiz
)
return
strlenW
(
item
->
text
);
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
item
->
text
,
-
1
,
str
,
nMaxSiz
,
NULL
,
NULL
))
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
item
->
text
,
-
1
,
str
,
nMaxSiz
,
NULL
,
NULL
))
str
[
nMaxSiz
-
1
]
=
0
;
str
[
nMaxSiz
-
1
]
=
0
;
TRACE
(
"returning
'%s'
\n
"
,
str
);
TRACE
(
"returning
%s
\n
"
,
debugstr_a
(
str
)
);
return
strlen
(
str
);
return
strlen
(
str
);
}
}
...
@@ -3682,6 +3681,7 @@ INT WINAPI GetMenuStringW( HMENU hMenu, UINT wItemID,
...
@@ -3682,6 +3681,7 @@ INT WINAPI GetMenuStringW( HMENU hMenu, UINT wItemID,
return
0
;
return
0
;
}
}
lstrcpynW
(
str
,
item
->
text
,
nMaxSiz
);
lstrcpynW
(
str
,
item
->
text
,
nMaxSiz
);
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
str
));
return
strlenW
(
str
);
return
strlenW
(
str
);
}
}
...
...
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