[grisbi-cvs] grisbi/src etats_affiche.c, 1.108, 1.109 etats_calculs.c, 1.133, 1.134 etats_csv.c, 1.29, 1.30 transaction_model.c, 1.5, 1.6

Pierre Biava pbiava at users.sourceforge.net
Sun Feb 7 21:04:19 CET 2010


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

Modified Files:
	etats_affiche.c etats_calculs.c etats_csv.c 
	transaction_model.c 
Log Message:
fixed bug 940. Bug solved partly because I have not managed to remove unnecessary columns.

Index: etats_csv.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_csv.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- etats_csv.c	29 Aug 2008 16:09:30 -0000	1.29
+++ etats_csv.c	7 Feb 2010 20:04:16 -0000	1.30
@@ -1,7 +1,8 @@
 /* ************************************************************************** */
 /*                                                                            */
-/*     Copyright (C)	     2005 Benjamin Drieu (bdrieu at april.org)	      */
-/* 			http://www.grisbi.org				      */
+/*     Copyright (C)         2005 Benjamin Drieu (bdrieu at april.org)           */
+/*          2009 Pierre Biava (grisbi at pierre.biava.name)                      */
+/*          http://www.grisbi.org                                             */
 /*                                                                            */
 /*  This program is free software; you can redistribute it and/or modify      */
 /*  it under the terms of the GNU General Public License as published by      */
@@ -32,13 +33,14 @@
 #include "./include.h"
 #include "./structures.h"
 #include "./etats_affiche.h"
+#include "./erreur.h"
 /*END_INCLUDE*/
 
 /*START_STATIC*/
-static void csv_attach_hsep ( int x, int x2, int y, int y2);
-static void csv_attach_label ( gchar * text, gdouble properties, int x, int x2, int y, int y2, 
-			enum alignement align, gint transaction_number );
-static void csv_attach_vsep ( int x, int x2, int y, int y2);
+static void csv_attach_hsep ( gint x, gint x2, gint y, gint y2);
+static void csv_attach_label ( gchar * text, gdouble properties, gint x, gint x2, gint y, gint y2, 
+                        enum alignement align, gint transaction_number );
+static void csv_attach_vsep ( gint x, gint x2, gint y, gint y2);
 static gint csv_finish ();
 static gint csv_initialise (GSList * opes_selectionnees, gchar * filename );
 static void csv_safe ( const gchar * text ) ;
@@ -63,7 +65,6 @@
 /*END_EXTERN*/
 
 
-
 /**
  * Backend function that is responsible for printing a label at a
  * specific place of the report, using text attibutes.
@@ -83,49 +84,34 @@
  * \param transaction_number the number a transaction to link to (not used as csv
  *            backend is not interactive)
  */
-void csv_attach_label ( gchar * text, gdouble properties, int x, int x2, int y, int y2, 
-			enum alignement align, gint transaction_number )
+void csv_attach_label ( gchar * text, gdouble properties, gint x, gint x2, gint y, gint y2, 
+                        enum alignement align, gint transaction_number )
 {
-    int pad, realsize, realcolumns;
-    gint current_report_number;
-
-    current_report_number = gsb_gui_navigation_get_current_report ();
+    gint pad;
 
     if ( !text )
 	text = "";
 
     if ( y >= csv_lastline )
     {
-	csv_lastcol = 0;
-	csv_lastline = y2;
-	fprintf ( csv_out, "\n" );
+        csv_lastcol = 0;
+        csv_lastline = y2;
+        fprintf ( csv_out, "\n" );
     }
 
     for ( pad = csv_lastcol ; pad < x ; pad ++ )
-	fprintf ( csv_out, ";" );
-
-    realsize = (x2 - x);
-    if ( realsize > 1 )
     {
-	if ( gsb_data_report_get_show_report_transactions (current_report_number))
-	{
-	    realsize /= 2;
-	    if ( x == 0 )
-		realsize ++;
-	}
+	    fprintf ( csv_out, ";" );
     }
-    if ( gsb_data_report_get_show_report_transactions (current_report_number))
-	realcolumns = (float)((nb_colonnes / 2) + 1);
-    else 
-	realcolumns = nb_colonnes;
 
     fprintf ( csv_out, "\"" );
     csv_safe (text);
     fprintf ( csv_out, "\"" );
 
-    for ( x++; x < x2 ; x ++ )
-	fprintf ( csv_out, ";" );
-
+    for ( x++; x <= x2 ; x++ )
+    {
+        fprintf ( csv_out, ";" );
+    }
     csv_lastcol = x2;
 }
 
@@ -140,7 +126,7 @@
  * \param x2 right position of the separator
  * \param y2 bottom position of the separator
  */
-void csv_attach_vsep ( int x, int x2, int y, int y2)
+void csv_attach_vsep ( gint x, gint x2, gint y, gint y2)
 {
 }
 
@@ -155,7 +141,7 @@
  * \param x2 right position of the separator
  * \param y2 bottom position of the separator
  */
-void csv_attach_hsep ( int x, int x2, int y, int y2)
+void csv_attach_hsep ( gint x, gint x2, gint y, gint y2)
 {
 }
 
@@ -169,8 +155,7 @@
 gint csv_initialise (GSList * opes_selectionnees, gchar * filename )
 {
     g_return_val_if_fail ( filename, FALSE );
-
-    /* initialise values */
+   /* initialise values */
     csv_lastcol = 0;
     csv_lastline = 1;
 

Index: etats_affiche.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_affiche.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- etats_affiche.c	30 Aug 2009 20:36:10 -0000	1.108
+++ etats_affiche.c	7 Feb 2010 20:04:16 -0000	1.109
@@ -1748,7 +1748,7 @@
     else
 	text = g_strdup(COLON(_("General total")));
 
-    etat_affiche_attach_label ( text, TEXT_NORMAL, 0, nb_colonnes - 2, ligne, ligne + 1, LEFT, 0 );
+    etat_affiche_attach_label ( text, TEXT_NORMAL, 0, nb_colonnes - 1, ligne, ligne + 1, LEFT, 0 );
     g_free ( text );
 
     text = gsb_real_get_string_with_currency (total_general, devise_generale_etat, TRUE );

Index: etats_calculs.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_calculs.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- etats_calculs.c	29 Aug 2009 08:36:40 -0000	1.133
+++ etats_calculs.c	7 Feb 2010 20:04:16 -0000	1.134
@@ -2198,7 +2198,6 @@
 	nb_colonnes = nb_colonnes + gsb_data_report_get_show_report_financial_year (current_report_number);
 
 	/* on ajoute les séparations */
-
 	nb_colonnes = 2 * nb_colonnes - 1;
     }
 
@@ -2571,7 +2570,7 @@
 	}
 
 	/* on affiche le total de la partie en cours */
-	/* si les revenus et dépenses ne sont pas mélangés */
+	/* si les revenus et dépenses ne sont pas mélangés */
 
 	if ( gsb_data_report_get_split_credit_debit (current_report_number))
 	    ligne = etat_affiche_affiche_total_partiel ( total_partie,
@@ -2580,7 +2579,7 @@
 
     }
 
-    /* on affiche maintenant le total général */
+    /* on affiche maintenant le total général */
 
     ligne = etat_affiche_affiche_total_general ( total_general,
 						 ligne );

Index: transaction_model.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_model.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- transaction_model.c	21 Jan 2010 22:16:52 -0000	1.5
+++ transaction_model.c	7 Feb 2010 20:04:16 -0000	1.6
@@ -149,7 +149,7 @@
     GtkTreeIter iter;
 
     g_return_val_if_fail ( custom_list != NULL, NULL );
-printf ("transaction_number = %d line_in_transaction = %d\n", transaction_number, line_in_transaction);
+//~ printf ("transaction_number = %d line_in_transaction = %d\n", transaction_number, line_in_transaction);
     if (!transaction_model_get_transaction_iter ( &iter,
 						  transaction_number, line_in_transaction ))
     {
@@ -172,7 +172,7 @@
 	/* it's a child, need to get the path of the mother */
 	gtk_tree_path_append_index (path, record -> mother_row -> filtered_pos);
     }
-    printf ("record -> filtered_pos = %d\n", record -> filtered_pos);
+    //~ printf ("record -> filtered_pos = %d\n", record -> filtered_pos);
     gtk_tree_path_append_index (path, record -> filtered_pos);
 
     return path;



More information about the cvs mailing list