Aric Stewart : comctl32: rebar: Prevent unnecessary triggering of RBBIM_CHILDSIZE changes.

Alexandre Julliard julliard at winehq.org
Thu Jul 17 06:37:42 CDT 2008


Module: wine
Branch: master
Commit: 11f09f3aa03694053a1dbea8beb4d0cd5cb0c59c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=11f09f3aa03694053a1dbea8beb4d0cd5cb0c59c

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu Jul 10 11:30:15 2008 +0900

comctl32: rebar: Prevent unnecessary triggering of RBBIM_CHILDSIZE changes.

---

 dlls/comctl32/rebar.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index dcbbf1f..16f6b9c 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -1647,7 +1647,7 @@ static UINT
 REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
      /* Function:  This routine copies the supplied values from   */
      /*  user input (lprbbi) to the internal band structure.      */
-     /*  It returns true if something changed and false if not.   */
+     /*  It returns the mask of what changed.   */
 {
     UINT uChanged = 0x0;
 
@@ -1699,7 +1699,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
     if( (lprbbi->fMask & RBBIM_CHILDSIZE) &&
         ( (lpBand->cxMinChild != lprbbi->cxMinChild) ||
           (lpBand->cyMinChild != lprbbi->cyMinChild ) ||
-          ( (lprbbi->cbSize >= sizeof (REBARBANDINFOA)) &&
+          ( (lprbbi->cbSize >= sizeof (REBARBANDINFOA) && (lpBand->fStyle & RBBS_VARIABLEHEIGHT)) &&
             ( (lpBand->cyChild    != lprbbi->cyChild ) ||
               (lpBand->cyMaxChild != lprbbi->cyMaxChild ) ||
               (lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) ||
@@ -2422,6 +2422,14 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnico
     lpBand->iImage = -1;
 
     REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
+
+    /* Make sure the defaults for these are correct */
+    if (lprbbi->cbSize < sizeof (REBARBANDINFOA) || !(lpBand->fStyle & RBBS_VARIABLEHEIGHT)) {
+        lpBand->cyChild    = lpBand->cyMinChild;
+        lpBand->cyMaxChild = 0x7fffffff;
+        lpBand->cyIntegral = 0;
+    }
+
     if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
         if (bUnicode)
             Str_SetPtrW(&lpBand->lpText, lprbbi->lpText);




More information about the wine-cvs mailing list