r18365 - gnucash/trunk/src/register/ledger-core - Follow-up to r18354: Patch for balance column displayed in template register

Christian Stimming cstim at code.gnucash.org
Sat Oct 3 10:01:28 EDT 2009


Author: cstim
Date: 2009-10-03 10:01:28 -0400 (Sat, 03 Oct 2009)
New Revision: 18365
Trac: http://svn.gnucash.org/trac/changeset/18365

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-layout.c
Log:
Follow-up to r18354: Patch for balance column displayed in template register

Patch by Tim M: The attached patch is an improvement to the original patch
which supplies the correct number of columns to gnucash for the
general_ledger register view if the register is a template.

Signed-off-by: Christian Stimming <stimming at tuhh.de>

Modified: gnucash/trunk/src/register/ledger-core/split-register-layout.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-layout.c	2009-10-03 13:59:15 UTC (rev 18364)
+++ gnucash/trunk/src/register/ledger-core/split-register-layout.c	2009-10-03 14:01:28 UTC (rev 18365)
@@ -242,13 +242,15 @@
         {
           gnc_table_layout_set_cell (layout, curs, FDEBT_CELL,  0, 5);
           gnc_table_layout_set_cell (layout, curs, FCRED_CELL,  0, 6);
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,   0, 7);
         }
         else
         {
           gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 5);
           gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 6);
+          gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
         }
-        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 
         curs_last = curs;
         curs = gnc_table_layout_get_cursor (layout,
@@ -268,11 +270,12 @@
         gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
         gnc_table_layout_set_cell (layout, curs, TDEBT_CELL, 0, 5);
         gnc_table_layout_set_cell (layout, curs, TCRED_CELL, 0, 6);
-        if (!reg->is_template)
-        {
+        if (reg->is_template)
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 7);
+        else {
           gnc_table_layout_set_cell (layout, curs, RBALN_CELL, 0, 7);
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
         }
-        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 
         curs_last = curs;
         curs = gnc_table_layout_get_cursor (layout,
@@ -294,13 +297,14 @@
         {
           gnc_table_layout_set_cell (layout, curs, FDEBT_CELL,  0, 5);
           gnc_table_layout_set_cell (layout, curs, FCRED_CELL,  0, 6);
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,   0, 7);
         }
         else
         {
           gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 5);
           gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 6);
+          gnc_table_layout_set_cell (layout, curs, RATE_CELL,  0, 8);
         }
-        gnc_table_layout_set_cell (layout, curs, RATE_CELL, 0, 8);
 
         break;
       }
@@ -463,7 +467,10 @@
     case INCOME_LEDGER:
     case GENERAL_LEDGER:
     case SEARCH_LEDGER:
-      num_cols = 9;
+      if (reg->is_template)
+        num_cols = 8;
+      else
+        num_cols = 9;
       break;
 
     case STOCK_REGISTER:



More information about the gnucash-changes mailing list