multi-line display nonsense

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1017 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-08-22 07:47:23 +00:00
parent 2cd6f3fcf0
commit 93a39bd967
2 changed files with 66 additions and 29 deletions

View File

@ -178,6 +178,8 @@ xaccLedgerDisplaySimple (Account *acc)
break; break;
} }
reg_type |= REG_SHOW_SDETAIL;
retval = xaccLedgerDisplayGeneral (acc, NULL, reg_type); retval = xaccLedgerDisplayGeneral (acc, NULL, reg_type);
return retval; return retval;
} }
@ -247,10 +249,12 @@ xaccLedgerDisplayAccGroup (Account *acc)
_free (list); _free (list);
return NULL; return NULL;
} }
ledger_type |= REG_SHOW_SDETAIL;
retval = xaccLedgerDisplayGeneral (acc, list, ledger_type); retval = xaccLedgerDisplayGeneral (acc, list, ledger_type);
if (list) _free (list); if (list) _free (list);
return retval; return retval;
} }

View File

@ -428,8 +428,11 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
int num_virt_rows; int num_virt_rows;
int phys_row; int phys_row;
int vrow; int vrow;
int double_line, multi_line;
table = reg->table; table = reg->table;
double_line = (reg->type) & REG_DOUBLE_LINE;
multi_line = (reg->type) & REG_MULTI_LINE;
/* disable move callback -- we con't want the cascade of /* disable move callback -- we con't want the cascade of
* callbacks while we are fiddling with loading the register */ * callbacks while we are fiddling with loading the register */
@ -477,20 +480,28 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
num_virt_rows ++; num_virt_rows ++;
num_phys_rows += reg->trans_cursor->numRows; num_phys_rows += reg->trans_cursor->numRows;
if (double_line) {
/* add one row */
num_virt_rows ++;
num_phys_rows += reg->split_cursor->numRows;
}
if (multi_line) {
/* add a row for each split, minus one, plus one */ /* add a row for each split, minus one, plus one */
j = xaccTransCountSplits (trans); j = xaccTransCountSplits (trans);
num_virt_rows += j; num_virt_rows += j;
num_phys_rows += j * reg->split_cursor->numRows; num_phys_rows += j * reg->split_cursor->numRows;
}
i++; i++;
split = slist[i]; split = slist[i];
} }
/* If user_hook is null, then we haven'tet up the blank split yet, /* If user_hook is null, then we haven't set up the blank split yet,
* so add two lines for it: one blank transaction, one blank split. * so add two lines for it: one blank transaction, one blank split.
* But if we have set it up yet, then we've counted one split too * But if we have set it up yet, then we've counted one split too
* many: the blank-blank at the very end. Subtract it back out. * many: the blank-blank at the very end. Subtract it back out.
*/ */
if (multi_line) {
if (!(reg->user_hook)) { if (!(reg->user_hook)) {
i++; i++;
num_virt_rows += 2; num_virt_rows += 2;
@ -500,6 +511,16 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
num_virt_rows -= 1; num_virt_rows -= 1;
num_phys_rows -= reg->split_cursor->numRows; num_phys_rows -= reg->split_cursor->numRows;
} }
}
/* 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;
}
/* num_virt_cols is always one. */ /* num_virt_cols is always one. */
xaccSetTableSize (table, num_phys_rows, num_phys_cols, num_virt_rows, 1); xaccSetTableSize (table, num_phys_rows, num_phys_cols, num_virt_rows, 1);
@ -528,6 +549,15 @@ printf ("load trans %d at phys row %d \n", i, phys_row);
vrow ++; vrow ++;
phys_row += reg->trans_cursor->numRows; phys_row += reg->trans_cursor->numRows;
if (double_line) {
xaccSetCursor (table, reg->split_cursor, phys_row, 0, vrow, 0);
xaccMoveCursor (table, phys_row, 0);
xaccSRLoadSplitEntry (reg, split, 1);
vrow ++;
phys_row += reg->split_cursor->numRows;
}
if (multi_line) {
/* loop over all of the splits in the transaction */ /* loop over all of the splits in the transaction */
/* the do..while will automaticaly put a blank (null) split at the end */ /* the do..while will automaticaly put a blank (null) split at the end */
trans = xaccSplitGetParent (split); trans = xaccSplitGetParent (split);
@ -545,11 +575,13 @@ printf ("load split %d at phys row %d \n", j, phys_row);
j++; j++;
} while (secondary); } while (secondary);
} }
}
i++; i++;
split = slist[i]; split = slist[i];
} }
#ifdef LATER
/* add the "blank split" at the end. We use either the blank /* add the "blank split" at the end. We use either the blank
* split we've cached away previously in "user_hook", or we create * split we've cached away previously in "user_hook", or we create
* a new one, as needed. */ * a new one, as needed. */
@ -585,6 +617,7 @@ printf ("load split %d at phys row %d \n", j, phys_row);
vrow ++; vrow ++;
phys_row += reg->split_cursor->numRows; phys_row += reg->split_cursor->numRows;
} }
#endif
/* restore the cursor to its original location */ /* restore the cursor to its original location */
if (phys_row <= save_cursor_phys_row) { if (phys_row <= save_cursor_phys_row) {