From a17b9305e70fce8fcbd09164b48ee7ee7bc75d9f Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sat, 14 Dec 2002 13:17:54 +0000 Subject: [PATCH] 2002-12-14 Christian Stimming * src/import-export/import-backend.c (matchmap_store_destination): Fix error messages when memo or description is empty. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7683 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 3 +++ src/import-export/import-backend.c | 27 ++++++++++++++++----------- src/import-export/import-match-map.c | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7b63468f2..b3aaf7b37f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2002-12-14 Christian Stimming + * src/import-export/import-backend.c (matchmap_store_destination): + Fix error messages when memo or description is empty. + * src/import-export/hbci/gnc-hbci-gettrans.c: Switch to always using the import-main-matcher. diff --git a/src/import-export/import-backend.c b/src/import-export/import-backend.c index a583373c27..2b42f7a0b8 100644 --- a/src/import-export/import-backend.c +++ b/src/import-export/import-backend.c @@ -364,6 +364,7 @@ matchmap_store_destination (GncImportMatchMap *matchmap, { GncImportMatchMap *tmp_matchmap = NULL; Account *dest; + char *descr, *memo; g_assert (trans_info); /* This will store the destination account of the selected match if @@ -384,16 +385,20 @@ matchmap_store_destination (GncImportMatchMap *matchmap, (xaccSplitGetAccount (gnc_import_TransInfo_get_fsplit (trans_info)))); - gnc_imap_add_account (tmp_matchmap, - GNCIMPORT_DESC, - xaccTransGetDescription - (gnc_import_TransInfo_get_trans (trans_info)), - dest); - gnc_imap_add_account (tmp_matchmap, - GNCIMPORT_MEMO, - xaccSplitGetMemo - (gnc_import_TransInfo_get_fsplit (trans_info)), - dest); + descr = xaccTransGetDescription + (gnc_import_TransInfo_get_trans (trans_info)); + if (descr && (strlen (descr) > 0)) + gnc_imap_add_account (tmp_matchmap, + GNCIMPORT_DESC, + descr, + dest); + memo = xaccSplitGetMemo + (gnc_import_TransInfo_get_fsplit (trans_info)); + if (memo && (strlen (memo) > 0)) + gnc_imap_add_account (tmp_matchmap, + GNCIMPORT_MEMO, + memo, + dest); if (matchmap == NULL) gnc_imap_destroy (tmp_matchmap); @@ -701,7 +706,7 @@ gnc_import_process_trans_clist (GtkCList *clist, /* Erase the downloaded transaction */ xaccTransDestroy(trans_info->trans); - DEBUG("CommitEdit trans") + /*DEBUG("CommitEdit trans")*/ xaccTransCommitEdit(trans_info->trans); } break; diff --git a/src/import-export/import-match-map.c b/src/import-export/import-match-map.c index 9214ba01ad..dcea4e764b 100644 --- a/src/import-export/import-match-map.c +++ b/src/import-export/import-match-map.c @@ -127,7 +127,7 @@ void gnc_imap_add_account (GncImportMatchMap *imap, const char *category, { kvp_value *value; - if (!imap || !key || !acc) return; + if (!imap || !key || !acc || (strlen (key) == 0)) return; if (!category) { category = key; key = NULL;