[evolution] EHTMLEditorView - Avoid variables with the same name in one scope



commit 0460b9f53c58f4ac330c10ceb850bd4ab042d202
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Mar 30 10:21:33 2016 +0200

    EHTMLEditorView - Avoid variables with the same name in one scope

 e-util/e-html-editor-view.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 10313da..5594ef8 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -9685,7 +9685,7 @@ process_elements (EHTMLEditorView *view,
 {
        WebKitDOMNodeList *nodes;
        gulong ii, length;
-       gchar *content;
+       gchar *content = NULL;
        gboolean skip_nl = FALSE;
 
        if (to_plain_text && !buffer)
@@ -9745,24 +9745,28 @@ process_elements (EHTMLEditorView *view,
                child = webkit_dom_node_list_item (nodes, ii);
 
                if (WEBKIT_DOM_IS_TEXT (child)) {
-                       gchar *content, *tmp;
                        GRegex *regex;
 
                        content = webkit_dom_node_get_text_content (child);
                        if (strstr (content, UNICODE_ZERO_WIDTH_SPACE)) {
+                               gchar *tmp;
+
                                regex = g_regex_new (UNICODE_ZERO_WIDTH_SPACE, 0, 0, NULL);
                                tmp = g_regex_replace (
                                        regex, content, -1, 0, "", 0, NULL);
-                               webkit_dom_node_set_text_content (child, tmp, NULL);
-                               g_free (tmp);
                                g_free (content);
-                               content = webkit_dom_node_get_text_content (child);
+                               if (changing_mode) {
+                                       webkit_dom_node_set_text_content (child, tmp, NULL);
+                                       g_free (tmp);
+                                       content = webkit_dom_node_get_text_content (child);
+                               } else
+                                       content = tmp;
                                g_regex_unref (regex);
                        }
 
                        if (to_plain_text && !changing_mode) {
                                gchar *class;
-                               const gchar *css_align;
+                               const gchar *css_align = NULL;
 
                                class = webkit_dom_element_get_class_name (WEBKIT_DOM_ELEMENT (node));
                                if ((css_align = strstr (class, "-x-evo-align-"))) {


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