gnumeric r16426 - in branches/gnumeric-1-8: . src



Author: mortenw
Date: Sat Mar  1 14:57:11 2008
New Revision: 16426
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16426&view=rev

Log:
2008-03-01  Morten Welinder  <terra gnome org>

	* src/sheet-autofill.c (afm_teach_cell): Fix end-of-month problem.
	Fixes #519680.
	(auto_filler_month): Initialize ->end_of_month.



Modified:
   branches/gnumeric-1-8/ChangeLog
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/src/sheet-autofill.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Sat Mar  1 14:57:11 2008
@@ -29,6 +29,7 @@
 	* Fix sylk importer's format handling.
 	* Fix memory allocation failure for huge .gnumeric files.  [#519319]
 	* Fix mstyle problem.  [#519451]
+	* Fix auto-fill problem.  [#519680]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.1

Modified: branches/gnumeric-1-8/src/sheet-autofill.c
==============================================================================
--- branches/gnumeric-1-8/src/sheet-autofill.c	(original)
+++ branches/gnumeric-1-8/src/sheet-autofill.c	Sat Mar  1 14:57:11 2008
@@ -508,7 +508,7 @@
 /*
  * Month sequences:
  *
- * 1-Jan-2009, 1-Feb-2009, 3-Mar-2009, ...
+ * 1-Jan-2009, 1-Feb-2009, 1-Mar-2009, ...
  * 31-Jan-2009, 28-Feb-2009, 31-Mar-2009, ...
  * 1-Jan-2009, 1-Jan-2010, 1-Jan-2011, ...
  */
@@ -520,7 +520,7 @@
 	GDate base;
 	GOFormat *format;
 	int nmonths;
-	gboolean end_of_month;
+	gboolean end_of_month, same_of_month;
 } AutoFillerMonth;
 
 static void
@@ -567,8 +567,10 @@
 		int day = g_date_get_day (&d);
 		int nmonths;
 
-		if (day != g_date_get_day (&afm->base) &&
-		    day != g_date_get_days_in_month (month, year))
+		if (day != g_date_get_day (&afm->base))
+			afm->same_of_month = FALSE;
+
+		if (!afm->same_of_month && !afm->end_of_month)
 			goto bad;
 
 		nmonths = 12 * (year - g_date_get_year (&afm->base)) +
@@ -651,6 +653,8 @@
 	res->filler.hint = afm_hint;
 	res->format = NULL;
 	res->dateconv = NULL;
+	res->end_of_month = TRUE;
+	res->same_of_month = TRUE;
 
 	return &res->filler;
 }



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