[evolution/gnome-3-16] EHTMLEditorView - Just check if the element has attribute instead of checking its value



commit d228ae1689d5970406c9d5cc0862a4519dd04d2f
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Mar 25 12:12:12 2015 +0100

    EHTMLEditorView - Just check if the element has attribute instead of checking its value

 e-util/e-html-editor-view.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index f695798..692c1dc 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -8976,7 +8976,6 @@ html_editor_view_load_status_changed (EHTMLEditorView *view)
        WebKitDOMDOMWindow *dom_window;
        WebKitDOMHTMLElement *body;
        WebKitLoadStatus status;
-       gchar *data_evo_draft;
 
        status = webkit_web_view_get_load_status (WEBKIT_WEB_VIEW (view));
        if (status != WEBKIT_LOAD_FINISHED)
@@ -9030,8 +9029,7 @@ html_editor_view_load_status_changed (EHTMLEditorView *view)
        move_elements_to_body (document);
        repair_gmail_blockquotes (document);
 
-       data_evo_draft = webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (body), "data-evo-draft");
-       if (data_evo_draft) {
+       if (webkit_dom_element_has_attribute (WEBKIT_DOM_ELEMENT (body), "data-evo-draft")) {
                /* Restore the selection how it was when the draft was saved */
                e_html_editor_selection_move_caret_into_element (
                        document, WEBKIT_DOM_ELEMENT (body), FALSE);
@@ -9040,8 +9038,6 @@ html_editor_view_load_status_changed (EHTMLEditorView *view)
                e_html_editor_view_remove_embed_styles (view);
        }
 
-       g_free (data_evo_draft);
-
        /* The composer body could be empty in some case (loading an empty string
         * or empty HTML. In that case create the initial paragraph. */
        if (!webkit_dom_node_get_first_child (WEBKIT_DOM_NODE (body))) {


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