Bug fixes.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2423 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-06-06 05:05:32 +00:00
parent 65fe217095
commit 6f7e6eca67
3 changed files with 29 additions and 22 deletions

View File

@ -1,5 +1,11 @@
2000-06-05 Dave Peticolas <dave@krondo.com> 2000-06-05 Dave Peticolas <dave@krondo.com>
* 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 * src/gnome/window-register.c (gnc_register_date_window): if 'show
all transactions' is not set in the preferences, limit it to all transactions' is not set in the preferences, limit it to
30. Temporary fix for 1.4, this should be configurable. 30. Temporary fix for 1.4, this should be configurable.

View File

@ -191,19 +191,21 @@ configLabels (SplitRegister *reg)
if (debit_getter != NULL) if (debit_getter != NULL)
{ {
string = debit_getter(type); string = debit_getter(type);
if (string != NULL)
LABEL (DEBT, string); {
LABEL (DEBT, string);
free(string); free(string);
}
} }
if (credit_getter != NULL) if (credit_getter != NULL)
{ {
string = credit_getter(type); string = credit_getter(type);
if (string != NULL)
LABEL (CRED, string); {
LABEL (CRED, string);
free(string); free(string);
}
} }
/* copy debit, dredit strings to ndebit, ncredit cells */ /* copy debit, dredit strings to ndebit, ncredit cells */
@ -1068,8 +1070,8 @@ xaccInitSplitRegister (SplitRegister *reg, int type)
/* the desc cell */ /* the desc cell */
xaccSetBasicCellBlankHelp (&reg->descCell->cell, DESC_CELL_HELP); xaccSetBasicCellBlankHelp (&reg->descCell->cell, DESC_CELL_HELP);
/* balance cell does not accept input; its display only. */ /* The balance cell does not accept input; it's for display only.
/* however, we *do* want it to shadow the true cell contents when * however, we *do* want it to shadow the true cell contents when
* the cursor is repositioned. Othewise, it will just display * the cursor is repositioned. Othewise, it will just display
* whatever previous bogus value it contained. * whatever previous bogus value it contained.
*/ */

View File

@ -20,10 +20,10 @@
(require 'record) (require 'record)
(gnc:support "report.scm") (gnc:support "report.scm")
;; We use a hash to store the report info so that whenever a report is ;; We use a hash to store the report info so that whenever a report
;; requested, we'll look up the action to take dynamically. That ;; is requested, we'll look up the action to take dynamically. That
;; makes it easier for us to allow changing the report definitions on ;; makes it easier for us to allow changing the report definitions
;; the fly later, and it should have no appreciable performance ;; on the fly later, and it should have no appreciable performance
;; effect. ;; effect.
(define *gnc:_report-info_* (make-hash-table 23)) (define *gnc:_report-info_* (make-hash-table 23))
@ -52,15 +52,14 @@
(lambda (item) (display-report-list-item item port)) (lambda (item) (display-report-list-item item port))
lines)))) lines))))
(define (call-report renderer options)
(let ((lines (renderer options)))
(report-output->string lines)))
(let ((report (hash-ref *gnc:_report-info_* report-name))) (let ((report (hash-ref *gnc:_report-info_* report-name)))
(if (not report) (if report
#f (let* ((renderer (gnc:report-renderer report))
(let ((renderer (gnc:report-renderer report))) (lines (renderer options))
(call-report renderer options))))) (output (report-output->string lines)))
(display output) (newline)
output)
#f)))
(define (gnc:report-menu-setup win) (define (gnc:report-menu-setup win)