[evolution/webkit-composer: 190/231] Bug 689799 - [webkit-composer] Wrap Lines doesn't wrap



commit 1d23da6376beb17690249c46dfc1ea2eb79ca208
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Apr 23 13:37:31 2013 +0200

    Bug 689799 - [webkit-composer] Wrap Lines doesn't wrap

 e-util/e-editor-selection.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index 1e9f506..811a1d6 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -2292,15 +2292,16 @@ e_editor_selection_wrap_lines (EEditorSelection *selection)
 
        web_view = WEBKIT_WEB_VIEW (editor_widget);
 
+       /* When there is nothing selected, we select the whole document */
+       if (g_strcmp0 (e_editor_selection_get_string (selection), "") == 0) {
+               EEditorWidgetCommand command;
+               command = E_EDITOR_WIDGET_COMMAND_SELECT_ALL;
+               e_editor_widget_exec_command (editor_widget, command, NULL);
+       }
+
        document = webkit_web_view_get_dom_document (web_view);
        range = editor_selection_get_current_range (selection);
 
-       /* Extend the range to include entire nodes */
-       webkit_dom_range_select_node_contents (
-               range,
-               webkit_dom_range_get_common_ancestor_container (range, NULL),
-               NULL);
-
        /* Copy the selection from DOM, wrap the lines and then paste it back
         * using the DOM command which will overwrite the selection, and
         * record it as an undoable action */


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