comctl32: rebar[4/4]: store the oldSize as a local variable

Mikołaj Zalewski mikolaj at zalewski.pl
Sat Feb 17 15:33:54 CST 2007


  There is no need to store it in REBAR_INFO. The old size in now not 
displayed in REBAR_ForceResize but it displayed in REBAR_Layout just 
before the call to REBAR_ForceResize.
-------------- next part --------------
From 3335d501daf89bb1476e5053297bffe8605b5f2c Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Sat, 17 Feb 2007 19:49:21 +0100
Subject: [PATCH] comctl32: rebar: store the oldSize as a local variable

---
 dlls/comctl32/rebar.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index 96be52c..2ad2155 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -175,7 +175,6 @@ typedef struct
     DWORD    dwStyle;     /* window style */
     DWORD    orgStyle;    /* original style (dwStyle may change) */
     SIZE     calcSize;    /* calculated rebar size - coordinates swapped for CCS_VERT */
-    SIZE     oldSize;     /* previous calculated rebar size */
     BOOL     bUnicode;    /* TRUE if parent wants notify in W format */
     BOOL     DoRedraw;    /* TRUE to acutally draw bands */
     UINT     fStatus;     /* Status flags (see below)  */
@@ -937,9 +936,7 @@ REBAR_ForceResize (REBAR_INFO *infoPtr)
     INT xedge = 0, yedge = 0;
     RECT rcSelf;
 
-    TRACE( "old [%d x %d], new [%d x %d]\n",
-	   infoPtr->oldSize.cx, infoPtr->oldSize.cy,
-	   infoPtr->calcSize.cx, infoPtr->calcSize.cy);
+    TRACE("new size [%d x %d]\n", infoPtr->calcSize.cx, infoPtr->calcSize.cy);
 
     if (infoPtr->dwStyle & CCS_NORESIZE)
         return;
@@ -1328,6 +1325,7 @@ REBAR_Layout(REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify)
 {
     REBAR_BAND *lpBand;
     RECT rcAdj;
+    SIZE oldSize;
     INT adjcx, adjcy, i;
     INT rowstart = 0;
     INT row = 0;
@@ -1359,7 +1357,7 @@ REBAR_Layout(REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify)
 
     if (infoPtr->uNumBands == 0) {
         TRACE("No bands - setting size to (0,%d), vert: %lx\n", adjcx, infoPtr->dwStyle & CCS_VERT);
-        infoPtr->oldSize = infoPtr->calcSize;
+        /* TODO: send a notify if height changed */
         infoPtr->calcSize.cx = adjcx;
         infoPtr->calcSize.cy = 0;
         infoPtr->uNumRows = 0;
@@ -1399,16 +1397,16 @@ REBAR_Layout(REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify)
     else
         REBAR_CalcHorzBand(infoPtr, 0, infoPtr->uNumBands);
     /* now compute size of Rebar itself */
-    infoPtr->oldSize = infoPtr->calcSize;
+    oldSize = infoPtr->calcSize;
 
     infoPtr->calcSize.cx = adjcx;
     infoPtr->calcSize.cy = yPos;
-    if (notify && (infoPtr->oldSize.cy != infoPtr->calcSize.cy))
+    if (notify && (oldSize.cy != infoPtr->calcSize.cy))
         infoPtr->fStatus |= NTF_HGHTCHG;
 
     TRACE("calcsize notify=%d, size=(%d, %d), origheight=(%d,%d)\n", notify,
             infoPtr->calcSize.cx, infoPtr->calcSize.cy,
-	    infoPtr->oldSize.cx, infoPtr->oldSize.cy);
+	    oldSize.cx, oldSize.cy);
 
     REBAR_DumpBand (infoPtr);
     REBAR_MoveChildWindows (infoPtr, 0, infoPtr->uNumBands);
-- 
1.4.4.2


More information about the wine-patches mailing list