diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-06-30 19:29:42 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-06-30 20:36:23 +0800 |
commit | c060ecad9a29bef6cca6935607125e7c505b2e03 (patch) | |
tree | f11c6ec08796878dc09e7bde60a618c775fc8834 /e-util/e-html-editor-selection.c | |
parent | aaf0bd7d79486b1e65ed63f5a560c7186764bb7b (diff) | |
download | gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar.gz gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar.bz2 gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar.lz gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar.xz gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.tar.zst gsoc2013-evolution-c060ecad9a29bef6cca6935607125e7c505b2e03.zip |
EHTMLEditorSelection - Fix detection of the paragraph format inside the quoted content
Diffstat (limited to 'e-util/e-html-editor-selection.c')
-rw-r--r-- | e-util/e-html-editor-selection.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index bc0d6f4bf6..a351925918 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -1470,22 +1470,7 @@ e_html_editor_selection_get_block_format (EHTMLEditorSelection *selection) if (e_html_editor_dom_node_find_parent_element (node, "UL")) { result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_UNORDERED_LIST; } else if ((element = e_html_editor_dom_node_find_parent_element (node, "OL")) != NULL) { - if (webkit_dom_element_has_attribute (element, "type")) { - gchar *type; - - type = webkit_dom_element_get_attribute (element, "type"); - if (type && ((*type == 'a') || (*type == 'A'))) { - result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST_ALPHA; - } else if (type && ((*type == 'i') || (*type == 'I'))) { - result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST_ROMAN; - } else { - result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST; - } - - g_free (type); - } else { - result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_ORDERED_LIST; - } + result = e_html_editor_selection_get_list_format_from_node (WEBKIT_DOM_NODE (element)); } else if (e_html_editor_dom_node_find_parent_element (node, "PRE")) { result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PRE; } else if (e_html_editor_dom_node_find_parent_element (node, "ADDRESS")) { @@ -1510,8 +1495,16 @@ e_html_editor_selection_get_block_format (EHTMLEditorSelection *selection) if (element_has_class (WEBKIT_DOM_ELEMENT (block), "-x-evo-paragraph")) result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PARAGRAPH; - else - result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE; + else { + /* Paragraphs inside quote */ + if ((element = e_html_editor_dom_node_find_parent_element (node, "DIV")) != NULL) + if (element_has_class (element, "-x-evo-paragraph")) + result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PARAGRAPH; + else + result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE; + else + result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_BLOCKQUOTE; + } } } else if (e_html_editor_dom_node_find_parent_element (node, "P")) { result = E_HTML_EDITOR_SELECTION_BLOCK_FORMAT_PARAGRAPH; |