From 6f7e6eca6702356e9cb3113b812b6612805a6e88 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Tue, 6 Jun 2000 05:05:32 +0000 Subject: [PATCH] Bug fixes. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2423 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 6 ++++++ src/register/splitreg.c | 22 ++++++++++++---------- src/scm/report.scm | 23 +++++++++++------------ 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 926c9b461d..f1163c8796 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2000-06-05 Dave Peticolas + * src/guile/guile-util.c (gnc_get_debit_string): make sure to + return a malloc'd string. + + * src/register/splitreg.c (configLabels): check for NULL strings + from the label getters. + * src/gnome/window-register.c (gnc_register_date_window): if 'show all transactions' is not set in the preferences, limit it to 30. Temporary fix for 1.4, this should be configurable. diff --git a/src/register/splitreg.c b/src/register/splitreg.c index 3e4913884e..6b56a57f21 100644 --- a/src/register/splitreg.c +++ b/src/register/splitreg.c @@ -191,19 +191,21 @@ configLabels (SplitRegister *reg) if (debit_getter != NULL) { string = debit_getter(type); - - LABEL (DEBT, string); - - free(string); + if (string != NULL) + { + LABEL (DEBT, string); + free(string); + } } if (credit_getter != NULL) { string = credit_getter(type); - - LABEL (CRED, string); - - free(string); + if (string != NULL) + { + LABEL (CRED, string); + free(string); + } } /* copy debit, dredit strings to ndebit, ncredit cells */ @@ -1068,8 +1070,8 @@ xaccInitSplitRegister (SplitRegister *reg, int type) /* the desc cell */ xaccSetBasicCellBlankHelp (®->descCell->cell, DESC_CELL_HELP); - /* balance cell does not accept input; its display only. */ - /* however, we *do* want it to shadow the true cell contents when + /* The balance cell does not accept input; it's for display only. + * however, we *do* want it to shadow the true cell contents when * the cursor is repositioned. Othewise, it will just display * whatever previous bogus value it contained. */ diff --git a/src/scm/report.scm b/src/scm/report.scm index d35c38d570..498079b67f 100644 --- a/src/scm/report.scm +++ b/src/scm/report.scm @@ -20,10 +20,10 @@ (require 'record) (gnc:support "report.scm") -;; We use a hash to store the report info so that whenever a report is -;; requested, we'll look up the action to take dynamically. That -;; makes it easier for us to allow changing the report definitions on -;; the fly later, and it should have no appreciable performance +;; We use a hash to store the report info so that whenever a report +;; is requested, we'll look up the action to take dynamically. That +;; makes it easier for us to allow changing the report definitions +;; on the fly later, and it should have no appreciable performance ;; effect. (define *gnc:_report-info_* (make-hash-table 23)) @@ -52,15 +52,14 @@ (lambda (item) (display-report-list-item item port)) lines)))) - (define (call-report renderer options) - (let ((lines (renderer options))) - (report-output->string lines))) - (let ((report (hash-ref *gnc:_report-info_* report-name))) - (if (not report) - #f - (let ((renderer (gnc:report-renderer report))) - (call-report renderer options))))) + (if report + (let* ((renderer (gnc:report-renderer report)) + (lines (renderer options)) + (output (report-output->string lines))) + (display output) (newline) + output) + #f))) (define (gnc:report-menu-setup win)