gnumeric r17153 - in trunk: . src



Author: mortenw
Date: Sun Feb 22 00:35:05 2009
New Revision: 17153
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17153&view=rev

Log:
2009-02-21  Morten Welinder  <terra gnome org>

	* src/colrow.c (colrow_reset_defaults): Retry this mess.



Modified:
   trunk/ChangeLog
   trunk/src/colrow.c

Modified: trunk/src/colrow.c
==============================================================================
--- trunk/src/colrow.c	(original)
+++ trunk/src/colrow.c	Sun Feb 22 00:35:05 2009
@@ -1159,8 +1159,7 @@
  * and replace them with the default.
  **/
 void
-colrow_reset_defaults (Sheet *sheet, gboolean is_cols,
-		       int maxima)
+colrow_reset_defaults (Sheet *sheet, gboolean is_cols, int maxima)
 {
 	ColRowCollection *infos = is_cols ? &sheet->cols : &sheet->rows;
 	ColRowInfo const *default_cri = &infos->default_style;
@@ -1174,6 +1173,9 @@
 		maxima = end - 1;
 	}
 
+	/* From here on, maxima is the first unused.  */
+	maxima++;
+
 	i = COLROW_SEGMENT_START(maxima);
 	inner_start = maxima - i;
 	for ( ; i < end ; i += COLROW_SEGMENT_SIZE) {
@@ -1195,5 +1197,5 @@
 		}
 		inner_start = 0;
 	}
-	infos->max_used = maxima;
+	infos->max_used = maxima - 1;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]