gnumeric r16612 - in trunk: . src



Author: mortenw
Date: Wed May 28 00:31:04 2008
New Revision: 16612
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16612&view=rev

Log:
2008-05-27  Morten Welinder  <terra gnome org>

	* src/stf-export.c (try_auto_date): Don't generate an invalid time
	format.  Fixes #534514.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/src/stf-export.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed May 28 00:31:04 2008
@@ -23,6 +23,7 @@
 	* Fix array evaluation problem.  [#533953]
 	* Fix COUNTBLANK crash.  [#534204]
 	* Fix TREND crash.  [#534587]
+	* Fix text export problem for times with fractional seconds.  [#534514]
 
 SeÃn de BÃrca:
 	* Move to tango based icons. [#450444]

Modified: trunk/src/stf-export.c
==============================================================================
--- trunk/src/stf-export.c	(original)
+++ trunk/src/stf-export.c	Wed May 28 00:31:04 2008
@@ -159,6 +159,8 @@
 	v = value_get_as_float (value);
 	if (v >= 2958466)
 		return NULL;  /* Year 10000 or beyond.  */
+
+#warning "We need to deal with this when fixing #509720"
 	if (v < 0)
 		return NULL;
 	vr = gnm_fake_round (v);
@@ -166,7 +168,7 @@
 
 	needs_date = is_date || v >= 1;
 	needs_time = is_time || gnm_abs (v - vr) > 1e-9;
-	needs_frac_sec = needs_time && gnm_abs (vs - gnm_fake_trunc (vs)) > 1e-6;
+	needs_frac_sec = needs_time && gnm_abs (vs - gnm_fake_trunc (vs)) >= 0.5e-3;
 
 	xlfmt = g_string_new (NULL);
 	if (needs_date) g_string_append (xlfmt, "yyyy/mm/dd");
@@ -175,7 +177,7 @@
 			g_string_append_c (xlfmt, ' ');
 		g_string_append (xlfmt, "hh:mm:ss");
 		if (needs_frac_sec)
-			g_string_append (xlfmt, ".000000");
+			g_string_append (xlfmt, ".000");
 	}
 	actual = go_format_new_from_XL (xlfmt->str);
 	g_string_free (xlfmt, TRUE);



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