r23498 - gnucash/trunk/src/gnome - Don't add a \n to the beginning of the split memo, account, or amount lists.

Mike Alexander mta at code.gnucash.org
Sat Dec 7 02:33:40 EST 2013


Author: mta
Date: 2013-12-07 02:33:39 -0500 (Sat, 07 Dec 2013)
New Revision: 23498
Trac: http://svn.gnucash.org/trac/changeset/23498

Modified:
   gnucash/trunk/src/gnome/dialog-print-check.c
   gnucash/trunk/src/gnome/dialog-print-check2.c
Log:
Don't add a \n to the beginning of the split memo, account, or amount lists.
Pango seems to ignore it, but it really shouldn't be there.

Modified: gnucash/trunk/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check.c	2013-12-07 07:33:33 UTC (rev 23497)
+++ gnucash/trunk/src/gnome/dialog-print-check.c	2013-12-07 07:33:39 UTC (rev 23498)
@@ -401,7 +401,10 @@
             gchar* amt_temp;
             split_amount = xaccPrintAmount(xaccSplitGetAmount(split), gnc_split_amount_print_info(split, TRUE));
             amt_temp = amount;
-            amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
+            if (amount && *amount)
+                amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
+            else
+                amount = g_strconcat(amt_temp, split_amount, NULL);
             g_free(amt_temp);
         }
         node = node->next;
@@ -436,7 +439,10 @@
             gchar* memo_temp;
             split_memo = xaccSplitGetMemo(split);
             memo_temp = memo;
-            memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
+            if (memo && *memo)
+                memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
+            else
+                memo = g_strconcat(memo_temp, split_memo, NULL);
             g_free(memo_temp);
         }
         node = node->next;
@@ -473,7 +479,10 @@
             pAccount = xaccSplitGetAccount(split);
             aName = gnc_get_account_name_for_register(pAccount);
             account_temp = account;
-            account = g_strconcat(account_temp, "\n", aName, NULL);
+            if (account && *account)
+                account = g_strconcat(account_temp, "\n", aName, NULL);
+            else
+                account = g_strconcat(account_temp, aName, NULL);
             g_free(account_temp);
         }
         node = node->next;

Modified: gnucash/trunk/src/gnome/dialog-print-check2.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check2.c	2013-12-07 07:33:33 UTC (rev 23497)
+++ gnucash/trunk/src/gnome/dialog-print-check2.c	2013-12-07 07:33:39 UTC (rev 23498)
@@ -401,7 +401,10 @@
             gchar* amt_temp;
             split_amount = xaccPrintAmount(xaccSplitGetAmount(split), gnc_split_amount_print_info(split, TRUE));
             amt_temp = amount;
-            amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
+            if (amount && *amount)
+                amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
+            else
+                amount = g_strconcat(amt_temp, split_amount, NULL);
             g_free(amt_temp);
         }
         node = node->next;
@@ -436,7 +439,10 @@
             gchar* memo_temp;
             split_memo = xaccSplitGetMemo(split);
             memo_temp = memo;
-            memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
+            if (memo && *memo)
+                memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
+            else
+                memo = g_strconcat(memo_temp, split_memo, NULL);
             g_free(memo_temp);
         }
         node = node->next;
@@ -473,7 +479,10 @@
             pAccount = xaccSplitGetAccount(split);
             aName = gnc_get_account_name_for_register(pAccount);
             account_temp = account;
-            account = g_strconcat(account_temp, "\n", aName, NULL);
+            if (account && *account)
+                account = g_strconcat(account_temp, "\n", aName, NULL);
+            else
+                account = g_strconcat(account_temp, aName, NULL);
             g_free(account_temp);
         }
         node = node->next;



More information about the gnucash-changes mailing list