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



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

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



Modified:
   branches/gnumeric-1-8/ChangeLog
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/src/wbc-gtk-edit.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Fri Apr 11 14:45:44 2008
@@ -19,7 +19,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]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.2

Modified: branches/gnumeric-1-8/src/wbc-gtk-edit.c
==============================================================================
--- branches/gnumeric-1-8/src/wbc-gtk-edit.c	(original)
+++ branches/gnumeric-1-8/src/wbc-gtk-edit.c	Fri Apr 11 14:45:44 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]