Fix usage of string cache.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3189 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-11-21 22:04:47 +00:00
parent 67c7c0d2a6
commit 878bfc048a

View File

@ -1179,6 +1179,9 @@ xaccSplitRebalance (Split *split)
gnc_numeric value;
const gnc_commodity * base_currency = NULL;
/* let's see how we do without all this stuff */
return;
trans = split->parent;
/* We might have gotten here if someone is manipulating
@ -1273,13 +1276,13 @@ xaccSplitRebalance (Split *split)
xaccAccountInsertSplit (split->acc, s);
g_cache_remove(gnc_string_cache, s->memo);
s->memo = g_cache_insert(gnc_string_cache, split->memo);
g_cache_remove(gnc_string_cache, s->action);
s->action = g_cache_insert(gnc_string_cache, split->action);
xaccSplitSetValue(s, gnc_numeric_neg(split->value));
xaccSplitSetShareAmount(s, gnc_numeric_neg(split->value));
s->memo = g_cache_insert(gnc_string_cache, split->memo);
s->action = g_cache_insert(gnc_string_cache, split->action);
}
}
}
@ -1476,13 +1479,13 @@ xaccTransRollbackEdit (Transaction *trans)
* the guid would have been unlisted. Restore that */
xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS);
#define PUT_BACK(val) { g_free(trans->val); \
trans->val=orig->val; orig->val=NULL; }
#define PUT_BACK_CACHE(val) { g_cache_remove(gnc_string_cache, trans->val); \
trans->val=orig->val; orig->val=NULL; }
g_cache_remove (gnc_string_cache, trans->num);
trans->num = orig->num;
orig->num = g_cache_insert(gnc_string_cache, "");
PUT_BACK (num);
PUT_BACK_CACHE (description);
g_cache_remove (gnc_string_cache, trans->description);
trans->description = orig->description;
orig->description = g_cache_insert(gnc_string_cache, "");
trans->date_entered.tv_sec = orig->date_entered.tv_sec;
trans->date_entered.tv_nsec = orig->date_entered.tv_nsec;
@ -1517,10 +1520,13 @@ xaccTransRollbackEdit (Transaction *trans)
if (so->acc != s->acc) { force_it = 1; mismatch=i; break; }
#define HONKY_CAT(val) { g_free(s->val); s->val=so->val; so->val=NULL; }
g_cache_remove (gnc_string_cache, s->action);
s->action = so->action;
so->action = g_cache_insert(gnc_string_cache, "");
HONKY_CAT (action);
HONKY_CAT (memo);
g_cache_remove (gnc_string_cache, s->memo);
s->memo = so->memo;
so->memo = g_cache_insert(gnc_string_cache, "");
s->reconciled = so->reconciled;
s->damount = so->damount;