[evolution/wip/webkit2] EHTMLEditorSelection - When wrapping the block take the Tab characters into account



commit 793da478ca4b67e713a4e0b04e5061354459a6a6
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Feb 24 12:54:46 2016 +0100

    EHTMLEditorSelection - When wrapping the block take the Tab characters into account

 .../e-html-editor-selection-dom-functions.c        |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-selection-dom-functions.c 
b/web-extensions/composer/e-html-editor-selection-dom-functions.c
index 3dd54e3..90e79d3 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.c
@@ -2304,6 +2304,16 @@ wrap_lines (WebKitDOMDocument *document,
                                continue;
                        }
 
+                       if (element_has_class (WEBKIT_DOM_ELEMENT (node), "Apple-tab-span")) {
+                               WebKitDOMNode *prev_sibling;
+
+                               prev_sibling = webkit_dom_node_get_previous_sibling (node);
+                               if (prev_sibling && WEBKIT_DOM_IS_ELEMENT (prev_sibling) &&
+                                   element_has_class (WEBKIT_DOM_ELEMENT (prev_sibling), "Applet-tab-span"))
+                                       line_length += TAB_LENGTH;
+                               else
+                                       line_length += TAB_LENGTH - line_length % TAB_LENGTH;
+                       }
                        /* When we are not removing user-entered BR elements (lines wrapped by user),
                         * we need to skip those elements */
                        if (!remove_all_br && WEBKIT_DOM_IS_HTML_BR_ELEMENT (node)) {


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