[evolution/wip/webkit-composer: 307/372] Bug #702442 - [webkit-composer] Changing indent makes paragraph style "Blockquote"



commit a604cbfef8b7930c2f2371aca5b0ccfacebf8e4a
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Sep 24 16:26:53 2013 +0200

    Bug #702442 - [webkit-composer] Changing indent makes paragraph style "Blockquote"
    
    We have to look on what type of blockquote we have as parent and
    afterwards decide if we are in indented paragraph.

 e-util/e-editor-selection.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index 3d976dc..2704707 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -1197,8 +1197,6 @@ e_editor_selection_get_block_format (EEditorSelection *selection)
                } else {
                        result = E_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST;
                }
-       } else if (e_editor_dom_node_find_parent_element (node, "BLOCKQUOTE")) {
-               result = E_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE;
        } else if (e_editor_dom_node_find_parent_element (node, "PRE")) {
                result = E_EDITOR_SELECTION_BLOCK_FORMAT_PRE;
        } else if (e_editor_dom_node_find_parent_element (node, "ADDRESS")) {
@@ -1221,6 +1219,14 @@ e_editor_selection_get_block_format (EEditorSelection *selection)
                result = E_EDITOR_SELECTION_BLOCK_FORMAT_PARAGRAPH;
        }
 
+       element = e_editor_dom_node_find_parent_element (node, "BLOCKQUOTE");
+
+       if (element) {
+               /* Indented paragraphs should have the same format as unindented */
+               if (element && !element_has_class (element, "-x-evo-indented"))
+                       result = E_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE;
+       }
+
        return result;
 }
 


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