[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-186-g596ecfe

Pierre Biava nobody at users.sourceforge.net
Sat Nov 3 11:31:47 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  596ecfe4394e04797b3ef7e148f3aba9d041b7f3 (commit)
      from  1b0e3f7777e54ca8d60efac22c368736eb1c9dc5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 596ecfe4394e04797b3ef7e148f3aba9d041b7f3
Author: pbiava <pierre.biava at nerim.net>
Date:   Sat Nov 3 11:23:11 2012 +0100

    Fixed a bug in displaying the graphics.

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 10e6f5c..d6a2528 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -49,6 +49,7 @@
 #include "structures.h"
 #include "traitement_variables.h"
 #include "utils_dates.h"
+#include "utils_real.h"
 #include "utils_str.h"
 #include "erreur.h"
 /*END_INCLUDE*/
@@ -2049,7 +2050,7 @@ gchar *bet_data_get_str_amount_in_account_currency ( gsb_real amount,
         break;
     }
 
-    str_amount = gsb_real_safe_real_to_string ( new_amount, floating_point );
+    str_amount = utils_real_get_string ( new_amount );
 
     return str_amount;
 }
diff --git a/src/bet_hist.c b/src/bet_hist.c
index 4ec1b65..b2a4abb 100644
--- a/src/bet_hist.c
+++ b/src/bet_hist.c
@@ -295,7 +295,7 @@ gboolean bet_historical_div_toggle_clicked ( GtkCellRendererToggle *renderer,
                         account_number, div, sub_div); */
             bet_data_hist_add_div ( account_number, div_number, sub_div_nb );
             bet_data_set_div_amount ( account_number, div_number, sub_div_nb,
-                        gsb_real_safe_real_from_string ( str_amount ) );
+                        utils_real_get_from_string ( str_amount ) );
             gtk_tree_store_set ( GTK_TREE_STORE ( model ), &iter,
                         SPP_HISTORICAL_SELECT_COLUMN, 1,
                         SPP_HISTORICAL_RETAINED_COLUMN, str_average,
@@ -338,8 +338,7 @@ gboolean bet_historical_div_toggle_clicked ( GtkCellRendererToggle *renderer,
                 {
                     amount = bet_historical_get_children_amount ( model, &parent );
                     g_free ( str_amount );
-                    str_amount = gsb_real_safe_real_to_string ( amount,
-                                gsb_data_account_get_currency_floating_point ( account_number ) );
+                    str_amount = utils_real_get_string ( amount );
                     g_free ( str_average );
                     str_average = utils_real_get_string_with_currency ( amount,
                                 gsb_data_account_get_currency ( account_number ), TRUE );
@@ -443,8 +442,7 @@ void bet_historical_div_cell_edited (GtkCellRendererText *cell,
         number = utils_real_get_from_string ( new_text );
         currency_number = gsb_data_account_get_currency ( account_number );
         tmp_str = utils_real_get_string_with_currency ( number, currency_number, TRUE );
-        str_amount = gsb_real_safe_real_to_string ( number,
-                                gsb_data_currency_get_floating_point ( currency_number ) );
+        str_amount = utils_real_get_string ( number );
 
         if ( bet_data_search_div_hist ( account_number, div_number, sub_div_nb ) == FALSE )
             bet_data_hist_add_div ( account_number, div_number, sub_div_nb );
@@ -469,8 +467,7 @@ void bet_historical_div_cell_edited (GtkCellRendererText *cell,
         {
             number = bet_historical_get_children_amount ( model, &parent );
             bet_data_set_div_amount ( account_number, div_number, 0, number );
-            str_amount = gsb_real_safe_real_to_string ( number,
-                                gsb_data_currency_get_floating_point ( currency_number ) );
+            str_amount = utils_real_get_string ( number );
             tmp_str = utils_real_get_string_with_currency ( number, currency_number, TRUE );
             gtk_tree_store_set ( GTK_TREE_STORE ( model ),
                         &parent,
@@ -856,12 +853,10 @@ void bet_historical_populate_div_model ( gpointer key,
 
     model = gtk_tree_view_get_model ( tree_view );
 
-    str_balance_amount = gsb_real_safe_real_to_string ( sbr->current_balance,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+    str_balance_amount = utils_real_get_string ( sbr->current_balance );
     str_balance = utils_real_get_string_with_currency ( sbr -> current_balance, currency_number, TRUE );
     average = gsb_real_div ( sbr -> current_balance, period );
-    str_amount = gsb_real_safe_real_to_string ( average,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+    str_amount = utils_real_get_string ( average );
     str_average = utils_real_get_string_with_currency ( average, currency_number, TRUE );
 
     str_current_fyear = utils_real_get_string_with_currency ( sbr -> current_fyear, currency_number, TRUE );
@@ -890,8 +885,7 @@ void bet_historical_populate_div_model ( gpointer key,
     {
         retained = bet_data_hist_get_div_amount ( account_nb, div_number, 0 );
         g_free ( str_amount );
-        str_amount = gsb_real_safe_real_to_string ( retained,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+        str_amount = utils_real_get_string ( retained );
         str_retained = utils_real_get_string_with_currency ( retained, currency_number, TRUE );
         gtk_tree_store_set ( GTK_TREE_STORE ( model ),
                         &parent,
@@ -936,13 +930,11 @@ void bet_historical_populate_div_model ( gpointer key,
             g_strfreev ( tab_str );
         }
 
-        str_balance_amount = gsb_real_safe_real_to_string ( sub_sbr->current_balance,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+        str_balance_amount = utils_real_get_string ( sub_sbr->current_balance );
         str_balance = utils_real_get_string_with_currency ( sub_sbr -> current_balance,
                         currency_number, TRUE );
         average = gsb_real_div ( sub_sbr -> current_balance, period );
-        str_amount = gsb_real_safe_real_to_string ( average,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+        str_amount = utils_real_get_string ( average );
         str_average = utils_real_get_string_with_currency ( average,
                         currency_number, TRUE );
         str_current_fyear = utils_real_get_string_with_currency ( sub_sbr -> current_fyear,
@@ -973,8 +965,7 @@ void bet_historical_populate_div_model ( gpointer key,
                 /* printf ("account_nb = %d div_number = %d sub_sh -> div = %d\n", account_nb, div_number, sub_sh -> div ); */
                 retained = bet_data_hist_get_div_amount ( account_nb, div_number, sub_sh -> div );
                 g_free ( str_amount );
-                str_amount = gsb_real_safe_real_to_string ( retained,
-                        gsb_data_currency_get_floating_point ( currency_number ) );
+                str_amount = utils_real_get_string ( retained );
                 str_retained = utils_real_get_string_with_currency ( retained, currency_number, TRUE );
 
                 edited = FALSE;
@@ -1013,8 +1004,7 @@ void bet_historical_populate_div_model ( gpointer key,
     if ( sub_div_visible && bet_historical_get_full_div ( model, &parent ) )
     {
         amount = bet_historical_get_children_amount ( model, &parent );
-        str_amount = gsb_real_safe_real_to_string ( amount,
-                    gsb_data_currency_get_floating_point ( currency_number ) );
+        str_amount = utils_real_get_string ( amount );
         str_retained = utils_real_get_string_with_currency ( amount, currency_number, TRUE );
 
         gtk_tree_store_set ( GTK_TREE_STORE ( model ),
@@ -1248,10 +1238,10 @@ gboolean bet_historical_set_full_sub_div ( GtkTreeModel *model, GtkTreeIter *par
                         SPP_HISTORICAL_EDITED_COLUMN, &edited,
                         -1 );
 
-            retained = gsb_real_safe_real_from_string ( str_amount );
+            retained = utils_real_get_from_string ( str_amount );
             bet_data_hist_add_div ( account_nb, div_number, sub_div_nb );
             bet_data_set_div_amount ( account_nb, div_number, sub_div_nb,
-                        gsb_real_safe_real_from_string ( str_amount ) );
+                        utils_real_get_from_string ( str_amount ) );
             str_retained = utils_real_get_string_with_currency ( retained,
                         gsb_data_account_get_currency ( account_nb ), TRUE );
             gtk_tree_store_set ( GTK_TREE_STORE ( model ), &fils_iter,
@@ -1340,7 +1330,7 @@ gsb_real bet_historical_get_children_amount ( GtkTreeModel *model, GtkTreeIter *
                         SPP_HISTORICAL_RETAINED_AMOUNT, &str_amount,
                         -1 );
             amount = gsb_real_add ( amount,
-                                gsb_real_safe_real_from_string ( str_amount ) );
+                                utils_real_get_from_string ( str_amount ) );
         }
         while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL ( model ), &fils_iter ) );
     }
@@ -1409,8 +1399,8 @@ gboolean bet_historical_amount_differ_average ( GtkTreeModel *model,
                         SPP_HISTORICAL_RETAINED_AMOUNT, &str_amount,
                         -1 );
 
-    return gsb_real_cmp ( gsb_real_safe_real_from_string ( str_average ),
-                        gsb_real_safe_real_from_string ( str_amount ) );
+    return gsb_real_cmp ( utils_real_get_from_string ( str_average ),
+                        utils_real_get_from_string ( str_amount ) );
 }
 
 
@@ -1554,8 +1544,7 @@ void bet_historical_add_last_amount ( GtkWidget *menu_item,
                         gsb_data_account_get_bet_hist_data ( account_number ) );
 
     currency_number = gsb_data_account_get_currency ( account_number );
-    str_amount = gsb_real_safe_real_to_string ( amount, 
-                    gsb_data_currency_get_floating_point ( currency_number ) );
+    str_amount = utils_real_get_string ( amount );
 
     tmp_str = utils_real_get_string_with_currency ( amount, currency_number, TRUE );
     /* printf ("div = %d sub_div_nb = %d tmp_str = %s\n", div_number, sub_div_nb, tmp_str); */
diff --git a/src/bet_tab.c b/src/bet_tab.c
index 2568a6a..8eb8952 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -449,8 +449,8 @@ static gint bet_array_date_sort_function ( GtkTreeModel *model,
                 result = -1;
             else
             {
-                amount_a = gsb_real_safe_real_from_string ( str_amount_a );
-                amount_b = gsb_real_safe_real_from_string ( str_amount_b );
+                amount_a = utils_real_get_from_string ( str_amount_a );
+                amount_b = utils_real_get_from_string ( str_amount_b );
                 result = - ( gsb_real_cmp ( amount_a, amount_b ) );
             }
 
@@ -516,10 +516,10 @@ static gboolean bet_array_update_average_column ( GtkTreeModel *model,
 
     gtk_tree_model_get ( model, iter, SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &tmp_str, -1 );
 
-    amount = gsb_real_safe_real_from_string ( tmp_str );
+    amount = utils_real_get_from_string ( tmp_str );
 
     tmp_range -> current_balance = gsb_real_add ( tmp_range -> current_balance, amount );
-    str_balance = utils_real_get_string_with_currency ( tmp_range -> current_balance, 
+    str_balance = utils_real_get_string_with_currency ( tmp_range -> current_balance,
                                 gsb_data_account_get_currency ( selected_account ), TRUE );
 
     if ( tmp_range->current_balance.mantissa < 0 )
@@ -598,8 +598,7 @@ void bet_array_refresh_estimate_tab ( gint account_number )
 
     currency_number = gsb_data_account_get_currency ( account_number );
 
-    str_amount = gsb_real_safe_real_to_string ( current_balance, 
-                    gsb_data_currency_get_floating_point ( currency_number ) );
+    str_amount = utils_real_get_string ( current_balance );
     str_current_balance = utils_real_get_string_with_currency ( current_balance, currency_number, TRUE );
 
     if ( current_balance.mantissa < 0 )
@@ -1022,7 +1021,7 @@ void bet_array_refresh_scheduled_data ( GtkTreeModel *tab_model,
                 amount = gsb_real_opposite ( gsb_data_scheduled_get_adjusted_amount_for_currency ( scheduled_number,
                                     currency_number,
                                     floating_point ) );
-                str_amount = gsb_real_safe_real_to_string ( amount, floating_point );
+                str_amount = utils_real_get_string ( amount );
             }
             else if ( account_number == selected_account )
             {
@@ -1301,7 +1300,7 @@ void bet_array_list_add_new_hist_line ( GtkTreeModel *tab_model,
         str_description = bet_data_get_div_name ( div_number, sub_div_nb, NULL );
     }
 
-    amount = gsb_real_safe_real_from_string ( str_amount );
+    amount = utils_real_get_from_string ( str_amount );
 
     if ( amount.mantissa < 0 )
         str_debit = utils_real_get_string_with_currency ( gsb_real_opposite ( amount ),
@@ -1443,8 +1442,7 @@ gboolean bet_array_refresh_futur_data ( GtkTreeModel *tab_model,
             amount = scheduled -> amount;
 
         currency_number = gsb_data_account_get_currency ( account_number );
-        str_amount = gsb_real_safe_real_to_string ( amount, 
-                    gsb_data_currency_get_floating_point ( currency_number ) );
+        str_amount = utils_real_get_string ( amount );
 
         if ( amount.mantissa < 0 )
             str_debit = utils_real_get_string_with_currency ( gsb_real_opposite ( amount ),
@@ -2030,7 +2028,7 @@ void bet_array_adjust_hist_amount ( gint div_number,
                 date_today = gdate_today ( );
                 if ( g_date_get_month ( date ) - g_date_get_month ( date_today ) == 0 )
                 {
-                    number = gsb_real_safe_real_from_string ( str_amount );
+                    number = utils_real_get_from_string ( str_amount );
                     if ( number.mantissa != 0 )
                     {
                         sign = bet_data_get_div_type ( div_number );
@@ -2127,8 +2125,8 @@ void bet_array_list_update_balance ( GtkTreeModel *model )
         SBR *tmp_range;
 
         gtk_tree_model_get ( model, &iter,
-                        SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &str_current_balance, -1 ); 
-        current_balance = gsb_real_safe_real_from_string ( str_current_balance );
+                        SPP_ESTIMATE_TREE_AMOUNT_COLUMN, &str_current_balance, -1 );
+        current_balance = utils_real_get_from_string ( str_current_balance );
 
         tmp_range = struct_initialise_bet_range ( );
         tmp_range -> first_pass = TRUE;
@@ -3017,9 +3015,7 @@ gboolean bet_array_shows_balance_at_beginning_of_month ( GtkTreeModel *tab_model
     g_date_add_months ( date, 1 );
     g_date_set_day ( date, 1 );
 
-    str_amount = gsb_real_safe_real_to_string ( null_real, 
-                        gsb_data_currency_get_floating_point (
-                        bet_data_get_selected_currency ( ) ) );
+    str_amount = utils_real_get_string ( null_real );
 
     while ( g_date_compare ( date, date_max ) < 0 )
     {
diff --git a/src/gsb_real.c b/src/gsb_real.c
index 89e9bd0..7f66934 100644
--- a/src/gsb_real.c
+++ b/src/gsb_real.c
@@ -268,10 +268,10 @@ gsb_real gsb_real_raw_get_from_string ( const gchar *string,
     if (success == TRUE)
     {
         gsb_real result;
+
         result.mantissa = sign * mantissa;
-        result.exponent = ( dot_position >= 0 )
-                          ? nb_digits - dot_position
-                          : 0;
+        result.exponent = ( dot_position >= 0 ) ? nb_digits - dot_position : 0;
+
         return result;
     }
     else


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list