gnumeric r16503 - in trunk: . src



Author: mortenw
Date: Fri Apr 11 14:45:16 2008
New Revision: 16503
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16503&view=rev

Log:
	(guess_time_format): Improve handling of elapsed time format.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/src/wbc-gtk-edit.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Apr 11 14:45:16 2008
@@ -68,7 +68,7 @@
 	* Fix performance repeated VLOOKUP/HLOOKUP/MATCH with constant
 	  data range.  [#525875]
 	* Fix date pasting problems to/from 1904 workbooks.  [#490419]
-	* Fix problems editing times.
+	* Fix problems editing times.  [#527392]
 
 Nick Lamb:
 	* Honour detachable-toolbar preference.  [#321867]

Modified: trunk/src/wbc-gtk-edit.c
==============================================================================
--- trunk/src/wbc-gtk-edit.c	(original)
+++ trunk/src/wbc-gtk-edit.c	Fri Apr 11 14:45:16 2008
@@ -635,7 +635,10 @@
 	GString *str = g_string_new (prefix);
 	GOFormat *fmt;
 
-	g_string_append (str, "hh:mm");
+	if (f >= 0 && f < 1)
+		g_string_append (str, "hh:mm");
+	else
+		g_string_append (str, "[h]:mm");
 	f *= 24 * 60;
 	if (!close_to_int (f, eps / 60)) {
 		g_string_append (str, ":ss");
@@ -874,17 +877,15 @@
 				break;
 			}
 
-			case GO_FORMAT_TIME:
-				if (f >= 0 && f <= 1) {
-					GOFormat *new_fmt =
-						guess_time_format (NULL, f);
-
-					text = format_value (new_fmt, cell->value, NULL, -1,
-							     workbook_date_conv (sv->sheet->workbook));
-					set_text = TRUE;
-					go_format_unref (new_fmt);
-				}
+			case GO_FORMAT_TIME: {
+				GOFormat *new_fmt = guess_time_format (NULL, f);
+
+				text = format_value (new_fmt, cell->value, NULL, -1,
+						     workbook_date_conv (sv->sheet->workbook));
+				set_text = TRUE;
+				go_format_unref (new_fmt);
 				break;
+			}
 
 			default:
 				break;



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