[gnumeric] Fix filled sheet objects properties box on cancelling. [#723745]



commit e28aa205e2c70ae58459a3850393ddf4dfe6eb80
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Feb 6 10:50:05 2014 +0100

    Fix filled sheet objects properties box on cancelling. [#723745]

 ChangeLog                      |    5 +++++
 NEWS                           |    1 +
 src/dialogs/ChangeLog          |    6 ++++++
 src/dialogs/dialog-so-styled.c |    7 ++++---
 src/sheet-object-component.c   |    2 +-
 5 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bad638c..cbec715 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-06  Jean Brefort  <jean brefort normalesup org>
+
+       * src/sheet-object-component.c (destroy_cb), (gnm_soc_user_config):
+       a better fix to previous issue.
+
 2014-01-30  Morten Welinder  <terra gnome org>
 
        * src/wbc-gtk.c (cb_add_menus_toolbars): Tentatively request small
diff --git a/NEWS b/NEWS
index 02089aa..75a37a1 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Andreas:
 Jean:
        * Accept 3D values for vector data. [#722294]
        * Improve performance of ant-int cursor.  [#381011]
+       * Fix filled sheet objects properties box on cancelling. [#723745]
 
 Mario Rugiero:
        * Fix leaks.  [#720306]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 5d8252c..512ff3c 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-06  Jean Brefort  <jean brefort normalesup org>
+
+       * dialog-so-styled.c (dialog_so_styled_free),
+       (cb_dialog_so_styled_response), (dialog_so_styled): really cancel changes
+       on cancelling. [#723745]
+
 2013-11-28  Morten Welinder <terra gnome org>
 
        * Release 1.12.9
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index d5b96a6..37a513a 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -41,6 +41,7 @@ typedef struct {
        GOStyle *orig_style;
        char *orig_text;
        PangoAttrList *orig_attributes;
+       so_styled_t extent;
 } DialogSOStyled;
 
 #define GNM_SO_STYLED_KEY "gnm-so-styled-key"
@@ -52,11 +53,9 @@ dialog_so_styled_free (DialogSOStyled *pref)
                g_object_set (G_OBJECT (pref->so), "style", pref->orig_style, NULL);
                g_object_unref (pref->orig_style);
        }
-       if (pref->orig_text) {
+       if ((pref->extent & SO_STYLED_TEXT) != 0) {
                g_object_set (G_OBJECT (pref->so), "text", pref->orig_text, NULL);
                g_free (pref->orig_text);
-       }
-       if (pref->orig_attributes != NULL) {
                g_object_set (G_OBJECT (pref->so), "markup", pref->orig_attributes, NULL);
                pango_attr_list_unref (pref->orig_attributes);
        }
@@ -79,6 +78,7 @@ cb_dialog_so_styled_response (GtkWidget *dialog,
                pref->orig_text = NULL;
                pango_attr_list_unref (pref->orig_attributes);
                pref->orig_attributes = NULL;
+               pref->extent = 0;
        }
        gtk_widget_destroy (dialog);
 }
@@ -146,6 +146,7 @@ dialog_so_styled (WBCGtk *wbcg,
                 wbcg_toplevel (state->wbcg),
                 GTK_DIALOG_DESTROY_WITH_PARENT,
                 NULL, NULL);
+       state->extent = extent;
 
        gnm_dialog_setup_destroy_handlers (GTK_DIALOG (dialog),
                                           state->wbcg,
diff --git a/src/sheet-object-component.c b/src/sheet-object-component.c
index dada9c5..fe44ff5 100644
--- a/src/sheet-object-component.c
+++ b/src/sheet-object-component.c
@@ -358,6 +358,7 @@ static void
 destroy_cb ( gnm_soc_user_config_t *data)
 {
        wbcg_edit_finish (WBC_GTK (data->wbc), WBC_EDIT_REJECT, NULL);
+       go_component_set_command_context (data->component, NULL);
        g_object_unref (data->component);
        g_free (data);
 }
@@ -376,7 +377,6 @@ gnm_soc_user_config (SheetObject *so, SheetControl *sc)
        go_component_set_command_context (new_comp, GO_CMD_CONTEXT (scg_wbcg (SHEET_CONTROL_GUI (sc))));
        w = (GtkWidget *) go_component_edit (new_comp);
        go_component_set_command_context (soc->component, NULL);
-       go_component_set_command_context (new_comp, NULL);
        if (w) {
                gnm_soc_user_config_t *data = g_new0 (gnm_soc_user_config_t, 1);
                data->so = so;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]