diff --git a/ChangeLog b/ChangeLog index 2ec95ed3a1..ebb42d2881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,11 @@ * src/business/business-gnome/glade/date-close.glade: Fix the glade settings so resizing the window will properly resize the widgets. Fixes #107586. + + * src/business/business-core/business-core.scm: + When building the "name + address" string, check if the + company name and contact name are the same and, if so, + only print one of them. Fixes #109753. 2003-04-01 Christian Stimming diff --git a/src/business/business-core/business-core.scm b/src/business/business-core/business-core.scm index 554297b45b..0c9863750e 100644 --- a/src/business/business-core/business-core.scm +++ b/src/business/business-core/business-core.scm @@ -21,10 +21,13 @@ ((null? (cdr lst)) (car lst)) (else (string-append (build-string (cdr lst)) "\n" (car lst))))) + (define (unique str) + (if (and name str (string=? name str)) #f str)) + (let ((lst '())) (set! lst (add-if-exists lst name)) - (set! lst (add-if-exists lst (gnc:address-get-name addr))) + (set! lst (add-if-exists lst (unique (gnc:address-get-name addr)))) (set! lst (add-if-exists lst (gnc:address-get-addr1 addr))) (set! lst (add-if-exists lst (gnc:address-get-addr2 addr))) (set! lst (add-if-exists lst (gnc:address-get-addr3 addr)))