[evolution/wip/webkit-composer: 361/372] Replace some usage of element_has_tag with macros



commit ec83dae452cb020263bb3d14f261a7f648172710
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Jan 30 13:00:20 2014 +0100

    Replace some usage of element_has_tag with macros

 e-util/e-editor-selection.c |    5 ++---
 e-util/e-editor-widget.c    |    7 ++-----
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index c5709b2..242a9dc 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -1880,7 +1880,7 @@ e_editor_selection_is_indented (EEditorSelection *selection)
 
        element = webkit_dom_node_get_parent_element (node);
 
-       if (element_has_tag (element, "blockquote"))
+       if (WEBKIT_DOM_IS_HTML_QUOTE_ELEMENT (element))
                return element_has_class (element, "-x-evo-indented");
 
        return FALSE;
@@ -2022,9 +2022,8 @@ e_editor_selection_unindent (EEditorSelection *selection)
 
                element = webkit_dom_node_get_parent_element (node);
 
-               if (!element || !element_has_tag (element, "blockquote")) {
+               if (!WEBKIT_DOM_IS_HTML_QUOTE_ELEMENT (element))
                        return;
-               }
 
                element_add_class (WEBKIT_DOM_ELEMENT (node), "-x-evo-to-unindent");
 
diff --git a/e-util/e-editor-widget.c b/e-util/e-editor-widget.c
index e328dae..9036c12 100644
--- a/e-util/e-editor-widget.c
+++ b/e-util/e-editor-widget.c
@@ -1719,10 +1719,7 @@ is_citation_node (WebKitDOMNode *node)
 {
        char *value;
 
-       if (node && !WEBKIT_DOM_IS_HTML_ELEMENT (node))
-               return FALSE;
-
-       if (!element_has_tag (WEBKIT_DOM_ELEMENT (node), "blockquote"))
+       if (!WEBKIT_DOM_IS_HTML_QUOTE_ELEMENT (node))
                return FALSE;
 
        value = webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (node), "type");
@@ -2407,7 +2404,7 @@ process_elements (WebKitDOMNode *node,
                        }
 
                        /* Leave blockquotes as they are */
-                       if (element_has_tag (WEBKIT_DOM_ELEMENT (child), "blockquote")) {
+                       if (WEBKIT_DOM_IS_HTML_QUOTE_ELEMENT (child)) {
                                if (!process_nodes) {
                                        content = webkit_dom_html_element_get_outer_html 
(WEBKIT_DOM_HTML_ELEMENT (child));
                                        g_string_append (buffer, content);


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