[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-52-g882a80f
Pierre Biava
nobody at users.sourceforge.net
Sun Jan 8 17:03:54 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 882a80f98d45f03e20ed41ea7c1bac4114b7db75 (commit)
via a6c89892030749d812cbd96ac89f79c621cae5bf (commit)
via 85eab4d72a40952f67e976b7c7943abd1fc67ad6 (commit)
via cb4b7354b54771d3b9b0a30da55a8270f3c832a8 (commit)
via efeae2dbefd4289656ca989f3d4665c49f026e66 (commit)
from 661c80fd58dd30c4e8da6a612b3b20a764e44504 (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 882a80f98d45f03e20ed41ea7c1bac4114b7db75
Author: pbiava <pierre.biava at nerim.net>
Date: Sun Jan 8 10:15:02 2012 +0100
csv_parse.c: Fixed a bug when importing a CSV file with 'CR' characters
commit a6c89892030749d812cbd96ac89f79c621cae5bf
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 22:24:29 2012 +0100
parametre.c: update string for preferences
commit 85eab4d72a40952f67e976b7c7943abd1fc67ad6
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 21:49:00 2012 +0100
bet_config.c: Fixed a bug in selecting of the beginning of period
commit cb4b7354b54771d3b9b0a30da55a8270f3c832a8
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 09:58:44 2012 +0100
csv_parse.c: formatting code
commit efeae2dbefd4289656ca989f3d4665c49f026e66
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 08:34:48 2012 +0100
bet_graph.c: cleaning code
-----------------------------------------------------------------------
Changes:
diff --git a/src/bet_config.c b/src/bet_config.c
index a7b5e09..5ed0ff8 100644
--- a/src/bet_config.c
+++ b/src/bet_config.c
@@ -769,6 +769,7 @@ void bet_config_period_clicked ( GtkWidget *togglebutton, GdkEventButton *event,
G_CALLBACK ( bet_config_period_clicked ),
button );
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( togglebutton ), TRUE );
name = gtk_widget_get_name ( GTK_WIDGET ( togglebutton ) );
if ( g_strcmp0 ( name, "bet_period_button_1" ) == 0 )
diff --git a/src/bet_graph.c b/src/bet_graph.c
index e5b00c0..5560896 100644
--- a/src/bet_graph.c
+++ b/src/bet_graph.c
@@ -582,7 +582,6 @@ gboolean bet_graph_affiche_camemberts ( struct_bet_graph_data *self )
gog_series_set_dim ( series, 0, data, &error );
if ( error != NULL )
{
- printf ("tab_vue_libelle_division : erreur = %s\n", error -> message);
g_error_free ( error );
error = NULL;
return FALSE;
@@ -592,7 +591,6 @@ gboolean bet_graph_affiche_camemberts ( struct_bet_graph_data *self )
gog_series_set_dim (series, 1, data, &error);
if ( error != NULL )
{
- printf ("tab_montant_division : erreur = %s\n", error -> message);
g_error_free ( error );
error = NULL;
return FALSE;
@@ -929,12 +927,26 @@ gboolean bet_graph_affiche_XY_line ( struct_bet_graph_data *self )
}
/* on met à jour les données à afficher */
+ gog_plot_clear_series ( GOG_PLOT ( cur_plot ) );
series = GOG_SERIES ( gog_plot_new_series ( GOG_PLOT ( cur_plot ) ) );
data = go_data_vector_str_new ( (const char * const*) self -> tab_vue_libelle, self -> nbre_elemnts, NULL );
gog_series_set_dim (series, 0, data, &error);
+ if ( error != NULL )
+ {
+ g_error_free ( error );
+ error = NULL;
+ return FALSE;
+ }
+
data = go_data_vector_val_new ( self->tab_Y, self->nbre_elemnts, NULL);
gog_series_set_dim (series, 1, data, &error);
+ if ( error != NULL )
+ {
+ g_error_free ( error );
+ error = NULL;
+ return FALSE;
+ }
return TRUE;
}
diff --git a/src/csv_parse.c b/src/csv_parse.c
index 00b57da..8ba15e8 100644
--- a/src/csv_parse.c
+++ b/src/csv_parse.c
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* Copyright (C) 2005-2006 Benjamin Drieu (bdrieu at april.org) */
-/* 2008-2009 Pierre Biava (grisbi at pierre.biava.name) */
+/* 2008-2011 Pierre Biava (grisbi at pierre.biava.name) */
/* http://www.grisbi.org */
/* */
/* This program is free software; you can redistribute it and/or modify */
@@ -43,7 +43,7 @@
/*END_EXTERN*/
/*START_STATIC*/
-static gchar * sanitize_field ( gchar * begin, gchar * end );
+static gchar *sanitize_field ( gchar *begin, gchar *end );
/*END_STATIC*/
@@ -52,115 +52,121 @@ static gchar * sanitize_field ( gchar * begin, gchar * end );
*
*
*/
-GSList * csv_parse_line ( gchar ** contents, gchar * separator )
+GSList * csv_parse_line ( gchar **contents, gchar *separator )
{
- gchar * tmp = (* contents), * begin = tmp;
- gint is_unquoted = FALSE, len = strlen ( separator );
- GSList * list = NULL;
+ gchar *tmp;
+ gchar *begin;
+ gint is_unquoted = FALSE;
+ gint len;
+ GSList *list = NULL;
+
+ len = strlen ( separator );
+ tmp = (*contents);
+ begin = tmp;
if ( *tmp == '\n' )
{
- *contents = tmp+1;
- return GINT_TO_POINTER(-1);
+ *contents = tmp + 1;
+ return GINT_TO_POINTER ( -1 );
}
if ( *tmp == '!' || *tmp == '#' || *tmp == ';' )
{
- *contents = strchr ( tmp, '\n' ) + 1;
- return GINT_TO_POINTER(-1);
+ *contents = strchr ( tmp, '\n' ) + 1;
+ return GINT_TO_POINTER(-1);
}
while ( *tmp )
{
- switch ( *tmp )
- {
- case '\n':
- list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
- *contents = tmp+1;
- return list;
-
- case '"':
- if ( ! is_unquoted )
- {
- tmp++;
- while ( *tmp )
- {
- /* This is lame escaping but we need to
- * support it. */
- if ( *tmp == '\\' && *(tmp+1) == '"' )
- {
- tmp += 2;
- }
-
- /* End of quoted string. */
- if ( *tmp == '"' && *(tmp+1) != '"' )
- {
- break;
- }
-
- tmp++;
- }
- }
-
- default:
- is_unquoted = TRUE;
- if ( !strncmp ( tmp, separator, len ) )
- {
- list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
- begin = tmp + len;
- is_unquoted = FALSE;
- }
- break;
- }
-
- tmp++;
+ switch ( *tmp )
+ {
+ case '\n':
+ list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
+ *contents = tmp+1;
+ return list;
+
+ case '"':
+ if ( ! is_unquoted )
+ {
+ tmp++;
+ while ( *tmp )
+ {
+ /* This is lame escaping but we need to
+ * support it. */
+ if ( *tmp == '\\' && *(tmp+1) == '"' )
+ {
+ tmp += 2;
+ }
+
+ /* End of quoted string. */
+ if ( *tmp == '"' && *(tmp+1) != '"' )
+ {
+ break;
+ }
+
+ tmp++;
+ }
+ }
+
+ default:
+ is_unquoted = TRUE;
+ if ( !strncmp ( tmp, separator, len ) )
+ {
+ list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
+ begin = tmp + len;
+ is_unquoted = FALSE;
+ }
+ break;
+ }
+
+ tmp++;
}
return NULL;
}
-
/**
* TODO
*
*/
-gchar * sanitize_field ( gchar * begin, gchar * end )
+gchar *sanitize_field ( gchar *begin, gchar *end )
{
- gchar * field, * iter;
+ gchar *field;
+ gchar *iter;
g_return_val_if_fail ( begin <= end, NULL );
if ( end <= begin )
- return "";
+ return "";
iter = field = g_malloc0 ( end - begin + 1 );
/* Strip out intial white spaces. */
while ( *begin == ' ' )
- begin++;
+ begin++;
if ( *begin == '"' )
{
- begin++;
- while ( *end != '"' && end >= begin )
- end--;
+ begin++;
+ while ( *end != '"' && end >= begin )
+ end--;
}
while ( begin < end )
{
- if ( *begin == '"' && *(begin+1) == '"' )
- begin++;
+ if ( *begin == '"' && *(begin+1) == '"' )
+ begin++;
- if ( *begin == '\\' && *(begin+1) == '"' )
- begin++;
-
- *iter++ = *begin++;
+ if ( *begin == '\\' && *(begin+1) == '"' )
+ begin++;
+
+ *iter++ = *begin++;
}
/* Strip out remaining white spaces. */
- while ( *(iter-1) == ' ' || *(iter-1) == '\n' )
- iter--;
+ while ( *(iter-1) == ' ' || *(iter-1) == '\r' || *(iter-1) == '\n' )
+ iter--;
*iter = '\0';
@@ -168,10 +174,6 @@ gchar * sanitize_field ( gchar * begin, gchar * end )
}
-
-
-
-
/**
*
*
@@ -256,7 +258,6 @@ gboolean csv_import_validate_amount ( gchar * string )
}
-
/**
*
*
@@ -424,7 +425,8 @@ gboolean csv_import_parse_sub_budget ( struct struct_ope_importation * ope, gcha
*/
gboolean csv_import_parse_balance ( struct struct_ope_importation * ope, gchar * string )
{
- g_return_val_if_fail ( string, FALSE );
+ if ( !string )
+ return FALSE;
if ( strlen ( string ) > 0 )
{
@@ -441,35 +443,38 @@ gboolean csv_import_parse_balance ( struct struct_ope_importation * ope, gchar *
*/
gboolean csv_import_parse_credit ( struct struct_ope_importation * ope, gchar * string )
{
- g_return_val_if_fail ( string, FALSE );
+ if ( !string )
+ return FALSE;
+
if ( strlen ( string ) > 0 )
{
- ope -> montant = gsb_real_add ( ope -> montant,
- utils_real_get_from_string (string));
+ ope -> montant = gsb_real_add ( ope -> montant,
+ utils_real_get_from_string (string));
}
+
return TRUE;
}
-
/**
*
*
*/
gboolean csv_import_parse_debit ( struct struct_ope_importation * ope, gchar * string )
{
- g_return_val_if_fail ( string, FALSE );
+ if ( !string )
+ return FALSE;
if ( strlen ( string ) > 0 )
{
- ope -> montant = gsb_real_sub ( ope -> montant,
- utils_real_get_from_string (string));
+ ope -> montant = gsb_real_sub ( ope -> montant,
+ utils_real_get_from_string ( string ) );
}
+
return TRUE;
}
-
/**
*
*
diff --git a/src/parametres.c b/src/parametres.c
index 7bbfee2..1c98b29 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -1163,13 +1163,13 @@ GtkWidget *onglet_metatree ( void )
GTK_ORIENTATION_VERTICAL );
gsb_automem_radiobutton3_new_with_title ( vbox_pref,
- _("Choice of the action for double click of the mouse: "),
+ _("Action associated with a double click on a subdivision: "),
_("Expand the line"),
_("Edit the line"),
_("Manage the line"),
- &conf.metatree_action_2button_press,
- G_CALLBACK ( gsb_config_onglet_metatree_action_changed ),
- &conf.metatree_action_2button_press,
+ &conf.metatree_action_2button_press,
+ G_CALLBACK ( gsb_config_onglet_metatree_action_changed ),
+ &conf.metatree_action_2button_press,
GTK_ORIENTATION_VERTICAL );
return vbox_pref;
hooks/post-receive
--
grisbi
More information about the cvs
mailing list