- Make row number be zero-based.
authorRobert Shearman <rob@codeweavers.com>
Tue, 1 Mar 2005 10:44:15 +0000 (10:44 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 1 Mar 2005 10:44:15 +0000 (10:44 +0000)
- Improvements to dumping functions to not dump out fields that may
  not have been filled in.

dlls/comctl32/rebar.c

index 82062c6db94be3e5b41ea49bf8bc6cc3c0a85e6e..c93430586618c92359751bde6d0865ee66752304 100644 (file)
@@ -134,7 +134,7 @@ typedef struct
 
     SIZE    offChild;       /* x,y offset if child is not FIXEDSIZE */
     UINT    uMinHeight;
-    INT     iRow;           /* row this band assigned to */
+    INT     iRow;           /* zero-based index of the row this band assigned to */
     UINT    fStatus;        /* status flags, reset only by _Validate */
     UINT    fDraw;          /* drawing flags, reset only by _Layout */
     UINT    uCDret;         /* last return from NM_CUSTOMDRAW */
@@ -360,8 +360,14 @@ static VOID
 REBAR_DumpBandInfo( LPREBARBANDINFOA pB)
 {
     if( !TRACE_ON(rebar) ) return;
-    TRACE("band info: ID=%u, size=%u, child=%p, clrF=0x%06lx, clrB=0x%06lx\n",
-         pB->wID, pB->cbSize, pB->hwndChild, pB->clrFore, pB->clrBack);
+    TRACE("band info: ");
+    if (pB->fMask & RBBIM_ID);
+        TRACE("ID=%u, ", pB->wID);
+    TRACE("size=%u, child=%p", pB->cbSize, pB->hwndChild);
+    if (pB->fMask & RBBIM_COLORS)
+        TRACE(", clrF=0x%06lx, clrB=0x%06lx", pB->clrFore, pB->clrBack);
+    TRACE("\n");
+
     TRACE("band info: mask=0x%08x (%s)\n", pB->fMask, REBAR_FmtMask(pB->fMask));
     if (pB->fMask & RBBIM_STYLE)
        TRACE("band info: style=0x%08x (%s)\n", pB->fStyle, REBAR_FmtStyle(pB->fStyle));
@@ -403,8 +409,14 @@ REBAR_DumpBand (REBAR_INFO *iP)
          (iP->NtfUnicode)?"TRUE":"FALSE", (iP->DoRedraw)?"TRUE":"FALSE");
     for (i = 0; i < iP->uNumBands; i++) {
        pB = &iP->bands[i];
-       TRACE("band # %u: ID=%u, child=%p, row=%u, clrF=0x%06lx, clrB=0x%06lx\n",
-             i, pB->wID, pB->hwndChild, pB->iRow, pB->clrFore, pB->clrBack);
+       TRACE("band # %u:", i);
+       if (pB->fMask & RBBIM_ID);
+           TRACE(" ID=%u", pB->wID);
+       if (pB->fMask & RBBIM_CHILD)
+           TRACE(" child=%p", pB->hwndChild);
+       if (pB->fMask & RBBIM_COLORS)
+           TRACE(" clrF=0x%06lx clrB=0x%06lx", pB->clrFore, pB->clrBack);
+       TRACE("\n");
        TRACE("band # %u: mask=0x%08x (%s)\n", i, pB->fMask, REBAR_FmtMask(pB->fMask));
        if (pB->fMask & RBBIM_STYLE)
            TRACE("band # %u: style=0x%08x (%s)\n",
@@ -1419,7 +1431,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
          clientcx, clientcy, adjcx, adjcy);
     x = initx;
     y = inity;
-    row = 1;
+    row = 0;
     cx = 0;
     mcy = 0;
     rowstart = 0;
@@ -1560,7 +1572,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient)
     }
 
     if (infoPtr->uNumBands)
-        infoPtr->uNumRows = row;
+        infoPtr->uNumRows = row + 1;
 
     /* ******* End Phase 1 - all bands on row at minimum size ******* */