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



commit f7fe07d75769bd8a4efca63c4b67c1f63ca8d117
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 8a12be5..5b539dd 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -8962,7 +8962,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)
@@ -9016,8 +9015,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);
@@ -9026,8 +9024,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]