Module: wine Branch: master Commit: 0768a62f2c909bef8e27961b01f20c0510c6652c URL: http://source.winehq.org/git/wine.git/?a=commit;h=0768a62f2c909bef8e27961b01...
Author: Alex Henrie alexhenrie24@gmail.com Date: Thu May 14 01:37:56 2015 -0600
user32: Simplify GCLP_HICON and GCLP_HICONSM boolean logic.
---
dlls/user32/class.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/class.c b/dlls/user32/class.c index bc1e623..0b3582e 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -977,7 +977,7 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval, break; case GCLP_HICON: retval = (ULONG_PTR)class->hIcon; - if (retval && class->hIconSmIntern) + if (class->hIconSmIntern) { DestroyIcon(class->hIconSmIntern); class->hIconSmIntern = NULL; @@ -990,12 +990,11 @@ static ULONG_PTR CLASS_SetClassLong( HWND hwnd, INT offset, LONG_PTR newval, break; case GCLP_HICONSM: retval = (ULONG_PTR)class->hIconSm; - if (retval && !newval) - class->hIconSmIntern = class->hIcon ? CopyImage( class->hIcon, IMAGE_ICON, - GetSystemMetrics( SM_CXSMICON ), - GetSystemMetrics( SM_CYSMICON ), - LR_COPYFROMRESOURCE ) : NULL; - else if (!retval && newval && class->hIconSmIntern) + if (retval && !newval && class->hIcon) + class->hIconSmIntern = CopyImage( class->hIcon, IMAGE_ICON, + GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), + LR_COPYFROMRESOURCE ); + else if (newval && class->hIconSmIntern) { DestroyIcon(class->hIconSmIntern); class->hIconSmIntern = NULL;