Commit 0768a62f authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

user32: Simplify GCLP_HICON and GCLP_HICONSM boolean logic.

parent 2a94355c
...@@ -977,7 +977,7 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval, ...@@ -977,7 +977,7 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval,
break; break;
case GCLP_HICON: case GCLP_HICON:
retval = (ULONG_PTR)class->hIcon; retval = (ULONG_PTR)class->hIcon;
if (retval && class->hIconSmIntern) if (class->hIconSmIntern)
{ {
DestroyIcon(class->hIconSmIntern); DestroyIcon(class->hIconSmIntern);
class->hIconSmIntern = NULL; class->hIconSmIntern = NULL;
...@@ -990,12 +990,11 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval, ...@@ -990,12 +990,11 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval,
break; break;
case GCLP_HICONSM: case GCLP_HICONSM:
retval = (ULONG_PTR)class->hIconSm; retval = (ULONG_PTR)class->hIconSm;
if (retval && !newval) if (retval && !newval && class->hIcon)
class->hIconSmIntern = class->hIcon ? CopyImage( class->hIcon, IMAGE_ICON, class->hIconSmIntern = CopyImage( class->hIcon, IMAGE_ICON,
GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ),
GetSystemMetrics( SM_CYSMICON ), LR_COPYFROMRESOURCE );
LR_COPYFROMRESOURCE ) : NULL; else if (newval && class->hIconSmIntern)
else if (!retval && newval && class->hIconSmIntern)
{ {
DestroyIcon(class->hIconSmIntern); DestroyIcon(class->hIconSmIntern);
class->hIconSmIntern = NULL; class->hIconSmIntern = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment