gnumeric r16425 - in trunk: . src



Author: mortenw
Date: Sat Mar  1 14:56:46 2008
New Revision: 16425
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16425&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:
   trunk/ChangeLog
   trunk/NEWS
   trunk/src/sheet-autofill.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sat Mar  1 14:56:46 2008
@@ -41,6 +41,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.0

Modified: trunk/src/sheet-autofill.c
==============================================================================
--- trunk/src/sheet-autofill.c	(original)
+++ trunk/src/sheet-autofill.c	Sat Mar  1 14:56:46 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]