[grisbi-cvs] grisbi/src balance_estimate_tab.c, 1.61, 1.62 gsb_real.c, 1.76, 1.77 import.c, 1.329, 1.330 main.c, 1.171, 1.172

Pierre Biava pbiava at users.sourceforge.net
Wed Apr 14 22:54:15 CEST 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25346/src

Modified Files:
	balance_estimate_tab.c gsb_real.c import.c main.c 
Log Message:
Fixed bug of converting a double in gsb_real. Others minor changes

Index: gsb_real.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_real.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- gsb_real.c	13 Apr 2010 20:40:04 -0000	1.76
+++ gsb_real.c	14 Apr 2010 20:54:12 -0000	1.77
@@ -872,7 +872,7 @@
 	gsb_real real_number = {0, exp_add};
 
     maxlong = G_MAXLONG / 10;
-
+    //~ printf ("number initial = %f exp_add = %d\n",number, exp_add);
 	if(exp_add >=9)
 		return null_real;
 
@@ -887,10 +887,19 @@
             number = rint (number);
     }
 	decimal = modf ( number, &tmp_double );
-	if ( ( (real_number.exponent == (9-exp_add)) ) && (decimal >= 0.5) )
-		real_number.mantissa = ((glong) number ) + 1;
-	
-    real_number.mantissa = (glong) (number);
+    //~ printf ("number = %f decimal = %f tmp_double = %f\n", number, decimal, tmp_double);
+	if ( ( ( real_number.exponent == ( 9 - exp_add ) ) ) && ( fabs ( decimal ) >= 0.5 ) )
+    {
+        if ( tmp_double < 0 )
+		    real_number.mantissa = ((glong) tmp_double ) - 1;
+        else
+            real_number.mantissa = ((glong) tmp_double ) + 1;
+
+        gsb_real_minimize_exponent ( &real_number );
+    }
+	else
+        real_number.mantissa = (glong) (number);
+    //~ printf ("real_number.mantissa = %ld real_number.exponent = %d\n", real_number.mantissa,real_number.exponent); 
     return real_number;
 }
 

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.329
retrieving revision 1.330
diff -u -d -r1.329 -r1.330
--- import.c	5 Apr 2010 21:24:53 -0000	1.329
+++ import.c	14 Apr 2010 20:54:12 -0000	1.330
@@ -1956,6 +1956,7 @@
         if ( etat.get_fusion_import_transactions &&
                         imported_transaction -> ope_correspondante > 0 )
         {
+            gsb_transactions_list_update_transaction ( transaction_number );
             list_tmp = list_tmp -> next;
             continue;
         }

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- main.c	5 Apr 2010 21:24:53 -0000	1.171
+++ main.c	14 Apr 2010 20:54:13 -0000	1.172
@@ -111,7 +111,7 @@
     gchar *string;
     gchar *path;
     cmdline_options  opt;
-#ifdef IS_DEVELOPMENT_VERSION
+#if IS_DEVELOPMENT_VERSION == 1
 	struct lconv *conv;
 #endif
 
@@ -126,7 +126,7 @@
     g_mem_set_vtable(glib_mem_profiler_table);
 #endif
 
-#if IS_DEVELOPMENT_VERSION
+#if IS_DEVELOPMENT_VERSION == 1
     gsb_cunit_run_tests();
     initialize_debugging();
 #endif
@@ -192,7 +192,7 @@
     init_variables ();
     register_import_formats ();
 
-#ifdef IS_DEVELOPMENT_VERSION
+#if IS_DEVELOPMENT_VERSION == 1
     /* test local pour les nombres */
 	conv = localeconv();
     

Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- balance_estimate_tab.c	5 Apr 2010 21:24:53 -0000	1.61
+++ balance_estimate_tab.c	14 Apr 2010 20:54:12 -0000	1.62
@@ -515,6 +515,7 @@
                         G_CALLBACK ( bet_config_duration_number_changed ),
                         GINT_TO_POINTER ( 1 ) );
 
+    /* set the start date and the automatic change of month */
     label = gtk_label_new ( COLON ( _("Start date" ) ) );
     gtk_misc_set_padding ( GTK_MISC (label), 5, 0 );
     gtk_box_pack_start ( GTK_BOX (hbox), label, FALSE, FALSE, 0 );
@@ -531,6 +532,11 @@
     g_object_set_data ( G_OBJECT ( notebook ), "initial_date", initial_date );
     gtk_box_pack_start ( GTK_BOX (hbox), initial_date, FALSE, FALSE, 0 );
 
+    widget = gtk_check_button_new ( );
+    gtk_widget_set_tooltip_text ( GTK_WIDGET ( widget ),
+                        SPACIFY(_("Check the box to automatically change start date") ) );
+    gtk_box_pack_start ( GTK_BOX (hbox), widget, FALSE, FALSE, 0 );
+
     /* create the estimate treeview */
     tree_view = gtk_tree_view_new ( );
     gtk_tree_view_set_rules_hint ( GTK_TREE_VIEW ( tree_view ), TRUE );



More information about the cvs mailing list