https://git.reactos.org/?p=reactos.git;a=commitdiff;h=16d6c9b5e05ffd7a0fff29531f69e18b010124c0

commit 16d6c9b5e05ffd7a0fff29531f69e18b010124c0
Author:     Joachim Henze <[email protected]>
AuthorDate: Sat Jun 2 12:26:48 2018 +0200
Commit:     Joachim Henze <[email protected]>
CommitDate: Sat Jun 2 12:28:47 2018 +0200

    [COMCTL32] Fix regression CORE-14649
    
    Fixes a regression that was introduced by Wine Staging 3.3 Sync.
    Symptom was missing button text and icons for specific buttons
    in Delphi applications, e.g. Double-Commander, Lazarus, Peazip.
    The patch restores and ifdef-guards previous changes of Giannis.
---
 dll/win32/comctl32/button.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c
index c313aa81e8..514d5a7785 100644
--- a/dll/win32/comctl32/button.c
+++ b/dll/win32/comctl32/button.c
@@ -1177,7 +1177,7 @@ static UINT BUTTON_CalcLabelRect(const BUTTON_INFO 
*infoPtr, HDC hdc, RECT *rc)
    UINT        dtStyle = BUTTON_BStoDT( style, ex_style );
    RECT        r = *rc;
    INT         n;
-#ifdef __REACTOS__
+#if !defined(_USER32_) && defined(__REACTOS__)
     BOOL bHasIml = BUTTON_DrawIml(hdc, &infoPtr->imlData, &r, TRUE, 0);
 #endif
 
@@ -1229,12 +1229,16 @@ static UINT BUTTON_CalcLabelRect(const BUTTON_INFO 
*infoPtr, HDC hdc, RECT *rc)
 
       default:
       empty_rect:
+#if !defined(_USER32_) && defined(__REACTOS__)
+         if (bHasIml)
+             break;
+#endif
          rc->right = r.left;
          rc->bottom = r.top;
          return (UINT)-1;
    }
 
-#ifdef __REACTOS__
+#if !defined(_USER32_) && defined(__REACTOS__)
    if (bHasIml)
    {
      if (infoPtr->imlData.uAlign == BUTTON_IMAGELIST_ALIGN_LEFT)
@@ -1318,7 +1322,7 @@ static void BUTTON_DrawLabel(const BUTTON_INFO *infoPtr, 
HDC hdc, UINT dtFlags,
     * I don't have Win31 on hand to verify that, so I leave it as is.
     */
 
-#ifdef __REACTOS__
+#if !defined(_USER32_) && defined(__REACTOS__)
     RECT rcText = *rc;
     BUTTON_DrawIml(hdc, &infoPtr->imlData, &rcText, FALSE, 0);
 #endif

Reply via email to