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
66c9a73d
Commit
66c9a73d
authored
Aug 19, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/imagelist: Fail in ImageList_GetIconSize on null parameters.
parent
8bcdc9ad
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
15 deletions
+13
-15
imagelist.c
dlls/comctl32/imagelist.c
+3
-5
tab.c
dlls/comctl32/tab.c
+5
-3
imagelist.c
dlls/comctl32/tests/imagelist.c
+3
-5
fontdlg.c
dlls/comdlg32/fontdlg.c
+2
-2
No files found.
dlls/comctl32/imagelist.c
View file @
66c9a73d
...
...
@@ -1726,15 +1726,13 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle)
BOOL
WINAPI
ImageList_GetIconSize
(
HIMAGELIST
himl
,
INT
*
cx
,
INT
*
cy
)
{
if
(
!
is_valid
(
himl
))
if
(
!
is_valid
(
himl
)
||
!
cx
||
!
cy
)
return
FALSE
;
if
((
himl
->
cx
<=
0
)
||
(
himl
->
cy
<=
0
))
return
FALSE
;
if
(
cx
)
*
cx
=
himl
->
cx
;
if
(
cy
)
*
cy
=
himl
->
cy
;
*
cx
=
himl
->
cx
;
*
cy
=
himl
->
cy
;
return
TRUE
;
}
...
...
dlls/comctl32/tab.c
View file @
66c9a73d
...
...
@@ -1163,14 +1163,14 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
if
(
!
(
infoPtr
->
fHeightSet
))
{
int
item_height
;
int
icon_height
=
0
;
INT
icon_height
=
0
,
cx
;
/* Use the current font to determine the height of a tab. */
GetTextMetricsW
(
hdc
,
&
fontMetrics
);
/* Get the icon height */
if
(
infoPtr
->
himl
)
ImageList_GetIconSize
(
infoPtr
->
himl
,
0
,
&
icon_height
);
ImageList_GetIconSize
(
infoPtr
->
himl
,
&
cx
,
&
icon_height
);
/* Take the highest between font or icon */
if
(
fontMetrics
.
tmHeight
>
icon_height
)
...
...
@@ -1195,7 +1195,9 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr)
/* Get the icon width */
if
(
infoPtr
->
himl
)
{
ImageList_GetIconSize
(
infoPtr
->
himl
,
&
icon_width
,
0
);
INT
cy
;
ImageList_GetIconSize
(
infoPtr
->
himl
,
&
icon_width
,
&
cy
);
if
(
infoPtr
->
dwStyle
&
TCS_FIXEDWIDTH
)
icon_width
+=
4
;
...
...
dlls/comctl32/tests/imagelist.c
View file @
66c9a73d
...
...
@@ -1734,21 +1734,19 @@ static void test_iconsize(void)
himl
=
ImageList_Create
(
16
,
16
,
ILC_COLOR16
,
0
,
3
);
/* null pointers, not zero imagelist dimensions */
ret
=
ImageList_GetIconSize
(
himl
,
NULL
,
NULL
);
todo_wine
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
/* doesn't touch return pointers */
cx
=
0xdeadbeef
;
ret
=
ImageList_GetIconSize
(
himl
,
&
cx
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
cx
==
0xdeadbeef
,
"got %d
\n
"
,
cx
);
}
cy
=
0xdeadbeef
;
ret
=
ImageList_GetIconSize
(
himl
,
NULL
,
&
cy
);
todo_wine
{
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
cy
==
0xdeadbeef
,
"got %d
\n
"
,
cy
);
}
ImageList_Destroy
(
himl
);
}
...
...
dlls/comdlg32/fontdlg.c
View file @
66c9a73d
...
...
@@ -772,12 +772,12 @@ static LRESULT CFn_WMMeasureItem(HWND hDlg, LPARAM lParam)
HFONT
hfontprev
;
TEXTMETRICW
tm
;
LPMEASUREITEMSTRUCT
lpmi
=
(
LPMEASUREITEMSTRUCT
)
lParam
;
INT
height
=
0
;
INT
height
=
0
,
cx
;
if
(
!
himlTT
)
himlTT
=
ImageList_LoadImageW
(
COMDLG32_hInstance
,
MAKEINTRESOURCEW
(
38
),
TTBITMAP_XSIZE
,
0
,
CLR_DEFAULT
,
IMAGE_BITMAP
,
0
);
ImageList_GetIconSize
(
himlTT
,
0
,
&
height
);
ImageList_GetIconSize
(
himlTT
,
&
cx
,
&
height
);
lpmi
->
itemHeight
=
height
+
2
;
/* use MAX of bitmap height and tm.tmHeight .*/
hdc
=
GetDC
(
hDlg
);
...
...
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