From 7bb17ee7230d09a44833a4500ca6aa0826ed6d75 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Thu, 9 Feb 2006 05:03:29 +0000 Subject: [PATCH] Fix the code that updates the buy/sell action based on the number of shares entered in a transaction. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13166 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/register/ledger-core/split-register-control.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0b675be63..e31a38eaf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-02-08 David Hampton + * src/register/ledger-core/split-register-control.c: Fix the code + that updates the buy/sell action based on the number of shares + entered in a transaction. + * src/gnome/dialog-price-edit-db.c: * src/engine/gnc-pricedb.c: A couple of performance enhancements. diff --git a/src/register/ledger-core/split-register-control.c b/src/register/ledger-core/split-register-control.c index 6fdb3c9d0b..dddebb58e7 100644 --- a/src/register/ledger-core/split-register-control.c +++ b/src/register/ledger-core/split-register-control.c @@ -968,10 +968,10 @@ gnc_split_register_traverse_check_stock_shares (SplitRegister *reg, const char * return; name = ((ComboCell *)cell)->cell.value; - if (buy && (safe_strcmp (name, ACTION_BUY_STR) != 0)) { + if (buy && (safe_strcmp (name, ACTION_SELL_STR) == 0)) { gnc_combo_cell_set_value((ComboCell *)cell, ACTION_BUY_STR); gnc_basic_cell_set_changed (cell, TRUE); - } else if (safe_strcmp (name, ACTION_SELL_STR) != 0) { + } else if (!buy && safe_strcmp (name, ACTION_BUY_STR) == 0) { gnc_combo_cell_set_value((ComboCell *)cell, ACTION_SELL_STR); gnc_basic_cell_set_changed (cell, TRUE); }