From a2533d8c9e26de187c7051ae29912af3fdffdb48 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Sat, 22 Aug 1998 20:28:43 +0000 Subject: [PATCH] enable correct editing git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1018 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/MultiLedger.c | 6 ++++-- src/SplitLedger.c | 40 ++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/MultiLedger.c b/src/MultiLedger.c index 53650abb0e..c26d56b08e 100644 --- a/src/MultiLedger.c +++ b/src/MultiLedger.c @@ -178,7 +178,8 @@ xaccLedgerDisplaySimple (Account *acc) break; } - reg_type |= REG_SHOW_SDETAIL; + /* default to single-line display */ + reg_type |= REG_SHOW_TDETAIL; retval = xaccLedgerDisplayGeneral (acc, NULL, reg_type); return retval; @@ -250,7 +251,8 @@ xaccLedgerDisplayAccGroup (Account *acc) return NULL; } - ledger_type |= REG_SHOW_SDETAIL; + /* default to single-line display */ + ledger_type |= REG_SHOW_TDETAIL; retval = xaccLedgerDisplayGeneral (acc, list, ledger_type); diff --git a/src/SplitLedger.c b/src/SplitLedger.c index ca253f253b..1f6fb8b07a 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -513,13 +513,23 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist, } } -/* hack alert -- this extra stuff is all wrong !?!?! */ if (double_line) { /* add two rows */ - num_virt_rows ++; - num_phys_rows += reg->trans_cursor->numRows; - num_virt_rows ++; - num_phys_rows += reg->split_cursor->numRows; + if (!(reg->user_hook)) { + i++; + num_virt_rows ++; + num_phys_rows += reg->trans_cursor->numRows; + num_virt_rows ++; + num_phys_rows += reg->split_cursor->numRows; + } + } + + if (!multi_line && !double_line) { + if (!(reg->user_hook)) { + i++; + num_virt_rows += 1; + num_phys_rows += reg->trans_cursor->numRows; + } } /* num_virt_cols is always one. */ @@ -581,7 +591,6 @@ printf ("load split %d at phys row %d \n", j, phys_row); split = slist[i]; } -#ifdef LATER /* add the "blank split" at the end. We use either the blank * split we've cached away previously in "user_hook", or we create * a new one, as needed. */ @@ -607,17 +616,16 @@ printf ("load split %d at phys row %d \n", j, phys_row); phys_row += reg->trans_cursor->numRows; /* do the split row of the blank split */ - { - Transaction *trans; - trans = xaccSplitGetParent (split); - split = xaccTransGetSplit (trans, 1); - xaccSetCursor (table, reg->split_cursor, phys_row, 0, vrow, 0); - xaccMoveCursor (table, phys_row, 0); - xaccSRLoadRegEntry (reg, split); - vrow ++; - phys_row += reg->split_cursor->numRows; + if (double_line || multi_line) { + Transaction *trans; + trans = xaccSplitGetParent (split); + split = xaccTransGetSplit (trans, 1); + xaccSetCursor (table, reg->split_cursor, phys_row, 0, vrow, 0); + xaccMoveCursor (table, phys_row, 0); + xaccSRLoadRegEntry (reg, split); + vrow ++; + phys_row += reg->split_cursor->numRows; } -#endif /* restore the cursor to its original location */ if (phys_row <= save_cursor_phys_row) {