Don't loose last band on insert

Vitaliy Margolen wine-patch at kievinfo.com
Thu Sep 30 08:03:46 CDT 2004


We were loosing last band when inserting a new one because of the wrong logic.
uNumBands gets incremented after the insert.

Vitaliy Margolen

changelog:
  dlls/comctl32/rebar.c
  Don't loose last band on isert
  
-------------- next part --------------
Index: rebar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/rebar.c,v
retrieving revision 1.95
diff -u -r1.95 rebar.c
--- rebar.c	2 Sep 2004 23:00:53 -0000	1.95
+++ rebar.c	30 Sep 2004 12:54:17 -0000
@@ -3131,9 +3131,9 @@
 	}
 
 	/* post copy */
-	if (uIndex < infoPtr->uNumBands - 1) {
+	if (uIndex < infoPtr->uNumBands) {
 	    memcpy (&infoPtr->bands[uIndex+1], &oldBands[uIndex],
-		    (infoPtr->uNumBands - uIndex - 1) * sizeof(REBAR_BAND));
+		    (infoPtr->uNumBands - uIndex) * sizeof(REBAR_BAND));
 	}
 
 	Free (oldBands);


More information about the wine-patches mailing list