From f2ffc649bb0ee6a92d450b102f3efab26522d2cf Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Mon, 6 Aug 2001 21:15:48 +0000 Subject: [PATCH] 2001-08-06 Dave Peticolas * src/register/pricecell.c: fix bugs git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5072 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 2 ++ src/register/pricecell.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7bbcb14403..4a6816db8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2001-08-06 Dave Peticolas + * src/register/pricecell.c: fix bugs + * src/engine/sql/upgrade.h: fix warning * src/engine/gnc-pricedb.[ch] (gnc_price_equal): new func diff --git a/src/register/pricecell.c b/src/register/pricecell.c index b6676d1630..51963b1776 100644 --- a/src/register/pricecell.c +++ b/src/register/pricecell.c @@ -56,7 +56,6 @@ static void xaccInitPriceCell (PriceCell *cell); static void PriceSetValue (BasicCell *bcell, const char *value); static const char * xaccPriceCellPrintValue (PriceCell *cell); - /* ================================================ */ static gboolean @@ -126,7 +125,7 @@ PriceMV (BasicCell *_cell, /* ================================================ */ static void -PriceParse (PriceCell *cell) +PriceParse (PriceCell *cell, gboolean update_value) { const char *newval; char *oldval; @@ -149,6 +148,9 @@ PriceParse (PriceCell *cell) else cell->amount = gnc_numeric_zero (); + if (!update_value) + return; + newval = xaccPriceCellPrintValue (cell); /* If they are identical do nothing */ @@ -166,7 +168,7 @@ PriceLeave (BasicCell *_cell) { PriceCell *cell = (PriceCell *) _cell; - PriceParse (cell); + PriceParse (cell, TRUE); } /* ================================================ */ @@ -246,7 +248,7 @@ xaccGetPriceCellValue (PriceCell *cell) if (cell == NULL) return gnc_numeric_zero (); - PriceParse (cell); + PriceParse (cell, FALSE); return cell->amount; }