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



commit ecfa73014e12dafdec4a7abf018a665000862abf
Author: Tomas Popela <tpopela redhat com>
Date:   Tue May 12 16:55:47 2015 +0200

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

 web-extensions/e-html-editor-view-dom-functions.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/web-extensions/e-html-editor-view-dom-functions.c 
b/web-extensions/e-html-editor-view-dom-functions.c
index 47ab168..0baed85 100644
--- a/web-extensions/e-html-editor-view-dom-functions.c
+++ b/web-extensions/e-html-editor-view-dom-functions.c
@@ -6638,7 +6638,6 @@ dom_process_content_after_load (WebKitDOMDocument *document,
 {
        WebKitDOMHTMLElement *body;
        WebKitDOMDOMWindow *dom_window;
-       gchar *data_evo_draft;
 
        /* Don't use CSS when possible to preserve compatibility with older
         * versions of Evolution or other MUAs */
@@ -6668,16 +6667,13 @@ dom_process_content_after_load (WebKitDOMDocument *document,
        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 */
                dom_move_caret_into_element (document, WEBKIT_DOM_ELEMENT (body), FALSE);
                dom_selection_restore (document);
                dom_remove_embed_style_sheet (document);
        }
 
-       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]