mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-26 02:40:43 -06:00
[Transaction.c] don't set TxnType kvp if it is the same as before
will avoid dirtying the transaction.
This commit is contained in:
parent
9f6d495ca1
commit
aa43c198c6
@ -2112,6 +2112,12 @@ xaccTransSetTxnType (Transaction *trans, char type)
|
|||||||
GValue v = G_VALUE_INIT;
|
GValue v = G_VALUE_INIT;
|
||||||
g_return_if_fail(trans);
|
g_return_if_fail(trans);
|
||||||
g_value_init (&v, G_TYPE_STRING);
|
g_value_init (&v, G_TYPE_STRING);
|
||||||
|
qof_instance_get_kvp (QOF_INSTANCE (trans), &v, 1, TRANS_TXN_TYPE_KVP);
|
||||||
|
if (!g_strcmp0 (s, g_value_get_string (&v)))
|
||||||
|
{
|
||||||
|
g_value_unset (&v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
g_value_set_string (&v, s);
|
g_value_set_string (&v, s);
|
||||||
xaccTransBeginEdit(trans);
|
xaccTransBeginEdit(trans);
|
||||||
qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, TRANS_TXN_TYPE_KVP);
|
qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, TRANS_TXN_TYPE_KVP);
|
||||||
|
Loading…
Reference in New Issue
Block a user