r17559 - gnucash/branches/2.2/src/gnome-utils - [r17553] GNCAmountEdit: Put the text through the expression parser once instead of twice.

Andreas Köhler andi5 at cvs.gnucash.org
Thu Sep 18 22:18:21 EDT 2008


Author: andi5
Date: 2008-09-18 22:18:20 -0400 (Thu, 18 Sep 2008)
New Revision: 17559
Trac: http://svn.gnucash.org/trac/changeset/17559

Modified:
   gnucash/branches/2.2/src/gnome-utils/gnc-amount-edit.c
Log:
[r17553] GNCAmountEdit: Put the text through the expression parser once instead of twice.

This caused a problem in locales that print negative numbers in parentheses. For
example, if you entered "-4/3", after the first parse the displayed text would
change to "(1 + 1/3)", meaning negative one and one-third. Parsing that text a
second time changes the text to "1 + 1/3" since, to the expression parser,
parentheses indicate grouping rather than sign.

The reason the GNCAmountEdit was putting the text through the parser twice was
that it was setting gae->need_to_parse FALSE, but then immediately calling
gtk_entry_set_text(), which issues a "changed" signal. The callback for that
signal was setting gae->need_to_parse back to TRUE. So I simply changed the
order of the statements.



More information about the gnucash-patches mailing list