[grisbi-cvs] grisbi/src gsb_payment_method.c, 1.14, 1.15 transaction_list.c, 1.30, 1.31 utils_str.c, 1.63, 1.64

Pierre Biava pbiava at users.sourceforge.net
Wed Mar 18 22:48:31 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24033/src

Modified Files:
	gsb_payment_method.c transaction_list.c utils_str.c 
Log Message:
fix bug display splited transactions in mode three lines

Index: gsb_payment_method.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_payment_method.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gsb_payment_method.c	15 Mar 2009 17:17:45 -0000	1.14
+++ gsb_payment_method.c	18 Mar 2009 21:48:25 -0000	1.15
@@ -318,7 +318,6 @@
             /* pbiava the 03/15/09 incremente le futur n° de Cheque */
             gchar* tmpstr = utils_str_itoa (gsb_data_payment_get_last_number (
                         payment_number) + 1);
-            printf ("next numero = %s\n", tmpstr );
             gtk_entry_set_text ( GTK_ENTRY (cheque_entry), tmpstr);
             g_free ( tmpstr );
         }

Index: transaction_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/transaction_list.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- transaction_list.c	5 Mar 2009 19:12:31 -0000	1.30
+++ transaction_list.c	18 Mar 2009 21:48:28 -0000	1.31
@@ -1,7 +1,7 @@
 /* ************************************************************************** */
 /*                                                                            */
-/*     Copyright (C)	2000-2008 Cédric Auger (cedric at grisbi.org)	      */
-/* 			http://www.grisbi.org				      */
+/*     Copyright (C)	2000-2008 Cédric Auger (cedric at grisbi.org)	          */
+/* 			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      */
@@ -62,12 +62,16 @@
 static  void transaction_list_append_child ( gint transaction_number );
 static  CustomRecord *transaction_list_create_record ( gint transaction_number,
 						      gint line_in_transaction );
+static gint transaction_list_get_last_line ( gint nb_rows );
 static  gboolean transaction_list_update_white_child ( CustomRecord *white_record );
 /*END_STATIC*/
 
 /*START_EXTERN*/
 extern GdkColor archive_background_color;
 extern GdkColor couleur_fond[2];
+extern gint display_one_line;
+extern gint display_three_lines;
+extern gint display_two_lines;
 extern gsb_real null_real;
 extern GSList *orphan_child_transactions;
 extern GdkColor split_background;
@@ -677,7 +681,8 @@
 		/* the row is shown, if it's the last row chowed of the transaction
 		 * we have to move the children to that row if they exist */
 		if ( record -> number_of_children && 
-		     record -> line_in_transaction == (gsb_data_account_get_nb_rows (account_number) - 1))
+		     record -> line_in_transaction == ( transaction_list_get_last_line (
+                        gsb_data_account_get_nb_rows (account_number) ) ) )
 		{
 		    /* ok, we are on the last visible line, there is some children and if before
 		     * the children were not associated to that row, we have to move them */
@@ -1814,3 +1819,75 @@
 }
 
 
+/**
+ * return the last visible line
+ *
+ * \param nb_rows	the number of visibles lines (1, 2, 3 or 4)
+ *
+ * \return numero of the last line
+ * */
+gint transaction_list_get_last_line ( gint nb_rows )
+{
+
+    switch (nb_rows)
+    {
+	case 1:
+	    /* 1 line visible mode */
+		return display_one_line;
+	    break;
+	case 2:
+	    /* 2 lines visibles mode */
+	    switch (display_two_lines)
+	    {
+		case 0:
+		    /* show lines 1-2 */
+			return 1;
+		    break;
+		case 1:
+		    /* show lines 1-3 */
+			return 2;
+		    break;
+		case 2:
+		    /* show lines 1-4 */
+			return 3;
+		    break;
+		case 3:
+		    /* show lines 2-3 */
+			return 2;
+		    break;
+		case 4:
+		    /* show lines 2-4 */
+			return 3;
+		    break;
+		case 5:
+		    /* show lines 3-4 */
+			return 3;
+		    break;
+	    }
+	    break;
+	case 3:
+	    /* 3 lines visibles mode */
+	    switch (display_three_lines)
+	    {
+		case 0:
+		    /* show lines 1-2-3 */
+			return 2;
+		    break;
+		case 1:
+		    /* show lines 1-2-4 */
+			return 3;
+		    break;
+		case 2:
+		    /* show lines 1-3-4 */
+			return 3;
+		    break;
+		case 3:
+		    /* show lines 2-3-4 */
+			return 3;
+		    break;
+	    }
+	    break;
+    }
+    return 3;
+}
+

Index: utils_str.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_str.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- utils_str.c	13 Mar 2009 20:15:38 -0000	1.63
+++ utils_str.c	18 Mar 2009 21:48:28 -0000	1.64
@@ -785,7 +785,6 @@
     if ( is_prefix && is_suffix )
     {
         tab_str = g_strsplit_set ( needle, "%*", 0 );
-        //~ printf ("prefix = TRUE suffix = TRUE - contenant :%s needle %s\n", payee_name, needle );
         is_prefix = g_str_has_prefix ( payee_name, tab_str[0] );
         is_suffix = g_str_has_suffix ( payee_name, tab_str[1] );
         if ( is_prefix && is_suffix )
@@ -796,7 +795,6 @@
     else if ( is_prefix && ! is_suffix )
     {
         tmpstr = gsb_string_supprime_joker ( needle );
-        //~ printf ("prefix = TRUE - contenant :%s needle %s\n", payee_name, tmpstr );
         is_prefix = g_str_has_prefix (payee_name, tmpstr);
         g_free (tmpstr);
         return is_prefix;
@@ -804,7 +802,6 @@
     else if ( is_suffix && ! is_prefix )
     {
         tmpstr = gsb_string_supprime_joker ( needle );
-        //~ printf ("suffix = TRUE - contenant :%s needle %s\n", payee_name, tmpstr );
         is_suffix = g_str_has_suffix (payee_name, tmpstr);
         g_free (tmpstr);
         return is_suffix;



More information about the cvs mailing list