[evolution/wip/webkit-composer] EEditorSelection: Return Node instead of Element in e_editor_selection_get_caret_position_node



commit 2bcd0d24c7991659df59042ca5c3746bbc405308
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Jan 27 15:10:40 2014 +0100

    EEditorSelection: Return Node instead of Element in e_editor_selection_get_caret_position_node

 e-util/e-editor-selection.c |   10 +++++-----
 e-util/e-editor-selection.h |    2 +-
 e-util/e-editor-widget.c    |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index 58b1957..8f62412 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -3275,7 +3275,7 @@ e_editor_selection_clear_caret_position_marker (EEditorSelection *selection)
        g_object_unref (widget);
 }
 
-WebKitDOMElement *
+WebKitDOMNode *
 e_editor_selection_get_caret_position_node (WebKitDOMDocument *document)
 {
        WebKitDOMElement *element;
@@ -3287,7 +3287,7 @@ e_editor_selection_get_caret_position_node (WebKitDOMDocument *document)
        webkit_dom_html_element_set_inner_html (
                WEBKIT_DOM_HTML_ELEMENT (element), "*", NULL);
 
-       return element;
+       return WEBKIT_DOM_NODE (element);
 }
 
 /**
@@ -3301,9 +3301,9 @@ e_editor_selection_save_caret_position (EEditorSelection *selection)
 {
        EEditorWidget *widget;
        WebKitDOMDocument *document;
-       WebKitDOMElement *element;
        WebKitDOMNode *split_node;
        WebKitDOMNode *start_offset_node;
+       WebKitDOMNode *caret_node;
        WebKitDOMRange *range;
        gulong start_offset;
 
@@ -3324,7 +3324,7 @@ e_editor_selection_save_caret_position (EEditorSelection *selection)
        start_offset = webkit_dom_range_get_start_offset (range, NULL);
        start_offset_node = webkit_dom_range_get_end_container (range, NULL);
 
-       element = e_editor_selection_get_caret_position_node (document);
+       caret_node = e_editor_selection_get_caret_position_node (document);
 
        if (WEBKIT_DOM_IS_TEXT (start_offset_node)) {
                WebKitDOMText *split_text;
@@ -3339,7 +3339,7 @@ e_editor_selection_save_caret_position (EEditorSelection *selection)
 
        webkit_dom_node_insert_before (
                webkit_dom_node_get_parent_node (start_offset_node),
-               WEBKIT_DOM_NODE (element),
+               caret_node,
                split_node,
                NULL);
 }
diff --git a/e-util/e-editor-selection.h b/e-util/e-editor-selection.h
index 8e2f0f3..920cab3 100644
--- a/e-util/e-editor-selection.h
+++ b/e-util/e-editor-selection.h
@@ -159,7 +159,7 @@ void                e_editor_selection_insert_text  (EEditorSelection *selection,
                                                 const gchar *plain_text);
 void           e_editor_selection_clear_caret_position_marker
                                                (EEditorSelection *selection);
-WebKitDOMElement *
+WebKitDOMNode *
                e_editor_selection_get_caret_position_node
                                                (WebKitDOMDocument *document);
 void           e_editor_selection_save_caret_position
diff --git a/e-util/e-editor-widget.c b/e-util/e-editor-widget.c
index b5b2326..c55158f 100644
--- a/e-util/e-editor-widget.c
+++ b/e-util/e-editor-widget.c
@@ -1125,7 +1125,7 @@ editor_widget_key_release_event (GtkWidget *widget,
                                selection,
                                document,
                                node,
-                               WEBKIT_DOM_NODE (e_editor_selection_get_caret_position_node (document)));
+                               e_editor_selection_get_caret_position_node (document));
 
                        webkit_dom_node_remove_child (
                                webkit_dom_node_get_parent_node (next_sibling),


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