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



Author: mortenw
Date: Thu Mar  6 21:06:02 2008
New Revision: 16442
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16442&view=rev

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

	* src/wbc-gtk-actions.c (insert_date_time_common): Fix the time
	cases.



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

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Thu Mar  6 21:06:02 2008
@@ -31,6 +31,7 @@
 	* Fix mstyle problem.  [#519451]
 	* Fix auto-fill problem.  [#519680]
 	* Fix corrupted-gnumeric-bug.  [#519761]
+	* Fix insert-time problem.
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.1

Modified: branches/gnumeric-1-8/src/wbc-gtk-actions.c
==============================================================================
--- branches/gnumeric-1-8/src/wbc-gtk-actions.c	(original)
+++ branches/gnumeric-1-8/src/wbc-gtk-actions.c	Thu Mar  6 21:06:02 2008
@@ -581,22 +581,26 @@
 						      sv->edit_pos.row);
 		GODateConventions const *date_conv =
 			workbook_date_conv (sheet->workbook);
-		GnmValue *v = value_new_int (
-			datetime_timet_to_serial (time (NULL), date_conv));
+		time_t now = time (NULL);
+		gnm_float d;
+		GnmValue *v;
 		GOFormat *vfmt;
 		char *txt;
 
 		switch (what) {
 		case 1:
+			d = datetime_timet_to_serial_raw (now, date_conv);
 			vfmt = go_format_default_time ();
 			go_format_ref (vfmt);
 			break;
 		case 2:
+			d = datetime_timet_to_serial (now, date_conv);
 			vfmt = gnm_format_for_date_editing (cell);
 			break;
 		case 3: {
 			GString *fstr;
 
+			d = datetime_timet_to_serial_raw (now, date_conv);
 			vfmt = gnm_format_for_date_editing (cell);
 			fstr = g_string_new (go_format_as_XL (vfmt));
 			go_format_unref (vfmt);
@@ -611,6 +615,7 @@
 			g_assert_not_reached ();
 		}
 
+		v = value_new_float (d);
 		txt = format_value (vfmt, v, NULL, -1, date_conv);
 		wb_control_edit_line_set (wbc, txt);
 



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