[Gnucash-changes] r13173 - gnucash/trunk - Better fix for the code
that updates the buy/sell action based on the
David Hampton
hampton at cvs.gnucash.org
Thu Feb 9 02:26:40 EST 2006
Author: hampton
Date: 2006-02-09 02:26:40 -0500 (Thu, 09 Feb 2006)
New Revision: 13173
Trac: http://svn.gnucash.org/trac/changeset/13173
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/register/ledger-core/split-register-control.c
Log:
Better fix for the code that updates the buy/sell action based on the
number of shares entered in a transaction.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-02-09 07:24:18 UTC (rev 13172)
+++ gnucash/trunk/ChangeLog 2006-02-09 07:26:40 UTC (rev 13173)
@@ -1,3 +1,9 @@
+2006-02-09 David Hampton <hampton at employees.org>
+
+ * src/register/ledger-core/split-register-control.c: Better fix
+ for the code that updates the buy/sell action based on the number
+ of shares entered in a transaction.
+
2006-02-08 David Hampton <hampton at employees.org>
* src/register/ledger-core/split-register-control.c: Fix the code
Modified: gnucash/trunk/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-control.c 2006-02-09 07:24:18 UTC (rev 13172)
+++ gnucash/trunk/src/register/ledger-core/split-register-control.c 2006-02-09 07:26:40 UTC (rev 13173)
@@ -968,12 +968,18 @@
return;
name = ((ComboCell *)cell)->cell.value;
- 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 (!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);
+ if (buy) {
+ if ((safe_strcmp (name, "") == 0) ||
+ (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, "") == 0) ||
+ (safe_strcmp (name, ACTION_BUY_STR) == 0)) {
+ gnc_combo_cell_set_value((ComboCell *)cell, ACTION_SELL_STR);
+ gnc_basic_cell_set_changed (cell, TRUE);
+ }
}
}
More information about the gnucash-changes
mailing list