From 875e3e49bce779570460414d60aa2d55e38800e6 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Wed, 2 Apr 2003 03:38:23 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8163 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ src/business/business-core/business-core.scm | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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)))