diff --git a/src/engine/Account.c b/src/engine/Account.c index 395e43b7cc..7dd2347ccc 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -2148,7 +2148,7 @@ xaccAccountSetName (Account *acc, const char *str) /* optimizations */ priv = GET_PRIVATE(acc); - if (str == priv->accountName) + if (safe_strcmp(str, priv->accountName) == 0) return; xaccAccountBeginEdit(acc); @@ -2167,7 +2167,7 @@ xaccAccountSetCode (Account *acc, const char *str) /* optimizations */ priv = GET_PRIVATE(acc); - if (str == priv->accountCode) + if (safe_strcmp(str, priv->accountCode) == 0) return; xaccAccountBeginEdit(acc); @@ -2186,7 +2186,7 @@ xaccAccountSetDescription (Account *acc, const char *str) /* optimizations */ priv = GET_PRIVATE(acc); - if (str == priv->description) + if (safe_strcmp(str, priv->description) == 0) return; xaccAccountBeginEdit(acc); diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index d73d3bf95d..7fafa65a7f 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -409,20 +409,23 @@ gnc_ui_to_account(AccountWindow *aw) gtk_text_buffer_get_end_iter (aw->notes_text_buffer, &end); string = gtk_text_buffer_get_text (aw->notes_text_buffer, &start, &end, FALSE); old_string = xaccAccountGetNotes (account); - if (safe_strcmp (string, old_string) != 0) + if (null_strcmp (string, old_string) != 0) xaccAccountSetNotes (account, string); flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (aw->tax_related_button)); - xaccAccountSetTaxRelated (account, flag); + if (xaccAccountGetTaxRelated (account) != flag) + xaccAccountSetTaxRelated (account, flag); flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (aw->placeholder_button)); - xaccAccountSetPlaceholder (account, flag); + if (xaccAccountGetPlaceholder (account) != flag) + xaccAccountSetPlaceholder (account, flag); flag = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (aw->hidden_button)); - xaccAccountSetHidden (account, flag); + if (xaccAccountGetHidden (account) != flag) + xaccAccountSetHidden (account, flag); parent_account = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT (aw->parent_tree)); diff --git a/src/gnome-utils/gnc-tree-view-account.c b/src/gnome-utils/gnc-tree-view-account.c index 0100e53777..7c27a20293 100644 --- a/src/gnome-utils/gnc-tree-view-account.c +++ b/src/gnome-utils/gnc-tree-view-account.c @@ -2292,18 +2292,24 @@ gnc_tree_view_account_name_edited_cb(Account *account, GtkTreeViewColumn *col, c void gnc_tree_view_account_code_edited_cb(Account *account, GtkTreeViewColumn *col, const gchar *new_code) { + if (safe_strcmp(xaccAccountGetCode(account), new_code) == 0) + return; xaccAccountSetCode(account, new_code); } void gnc_tree_view_account_description_edited_cb(Account *account, GtkTreeViewColumn *col, const gchar *new_desc) { + if (safe_strcmp(xaccAccountGetDescription(account), new_desc) == 0) + return; xaccAccountSetDescription(account, new_desc); } void gnc_tree_view_account_notes_edited_cb(Account *account, GtkTreeViewColumn *col, const gchar *new_notes) { + if (safe_strcmp(xaccAccountGetNotes(account), new_notes) == 0) + return; xaccAccountSetNotes(account, new_notes); }