[evolution/gnome-3-24] Remove duplicate function for determining the citation level
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-24] Remove duplicate function for determining the citation level
- Date: Fri, 31 Mar 2017 08:27:36 +0000 (UTC)
commit 02a6ac485ee19952ae1c050a5f2af339364145c9
Author: Tomas Popela <tpopela redhat com>
Date: Thu Mar 30 17:29:35 2017 +0200
Remove duplicate function for determining the citation level
.../web-extension/e-editor-dom-functions.c | 27 +++----------------
1 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index 39923a0..61e6efe 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -14290,23 +14290,6 @@ e_editor_dom_put_node_into_paragraph (EEditorPage *editor_page,
return container;
}
-static gint
-selection_get_citation_level (WebKitDOMNode *node)
-{
- WebKitDOMNode *parent = webkit_dom_node_get_parent_node (node);
- gint level = 0;
-
- while (parent && !WEBKIT_DOM_IS_HTML_BODY_ELEMENT (parent)) {
- if (WEBKIT_DOM_IS_HTML_QUOTE_ELEMENT (parent) &&
- webkit_dom_element_has_attribute (WEBKIT_DOM_ELEMENT (parent), "type"))
- level++;
-
- parent = webkit_dom_node_get_parent_node (parent);
- }
-
- return level;
-}
-
WebKitDOMElement *
e_editor_dom_wrap_paragraph_length (EEditorPage *editor_page,
WebKitDOMElement *paragraph,
@@ -14412,7 +14395,7 @@ e_editor_dom_selection_wrap (EEditorPage *editor_page)
after_selection_end = webkit_dom_node_contains (
block, WEBKIT_DOM_NODE (selection_end_marker));
- citation_level = selection_get_citation_level (block);
+ citation_level = e_editor_dom_get_citation_level (block, FALSE);
quote = citation_level ? citation_level * 2 : 0;
wrapped_paragraph = e_editor_dom_wrap_paragraph_length (
@@ -14458,7 +14441,7 @@ e_editor_dom_wrap_paragraphs_in_document (EEditorPage *editor_page)
gint word_wrap_length, quote, citation_level;
WebKitDOMNode *node = webkit_dom_node_list_item (list, ii);
- citation_level = selection_get_citation_level (node);
+ citation_level = e_editor_dom_get_citation_level (node, FALSE);
quote = citation_level ? citation_level * 2 : 0;
word_wrap_length = e_editor_page_get_word_wrap_length (editor_page);
@@ -14489,7 +14472,7 @@ e_editor_dom_wrap_paragraph (EEditorPage *editor_page,
g_return_val_if_fail (WEBKIT_DOM_IS_ELEMENT (paragraph), NULL);
indentation_level = get_indentation_level (paragraph);
- citation_level = selection_get_citation_level (WEBKIT_DOM_NODE (paragraph));
+ citation_level = e_editor_dom_get_citation_level (WEBKIT_DOM_NODE (paragraph), FALSE);
if (node_is_list_or_item (WEBKIT_DOM_NODE (paragraph))) {
gint list_level = get_list_level (WEBKIT_DOM_NODE (paragraph));
@@ -16446,7 +16429,7 @@ process_block_to_block (EEditorPage *editor_page,
remove_node (block);
if (!next_block && !after_selection_end) {
- citation_level = selection_get_citation_level (WEBKIT_DOM_NODE (element));
+ citation_level = e_editor_dom_get_citation_level (WEBKIT_DOM_NODE (element), FALSE);
if (citation_level > 0) {
next_block = webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (element));
@@ -16457,7 +16440,7 @@ process_block_to_block (EEditorPage *editor_page,
block = next_block;
if (!html_mode && format == E_CONTENT_EDITOR_BLOCK_FORMAT_PARAGRAPH) {
- citation_level = selection_get_citation_level (WEBKIT_DOM_NODE (element));
+ citation_level = e_editor_dom_get_citation_level (WEBKIT_DOM_NODE (element), FALSE);
if (citation_level > 0) {
gint quote, word_wrap_length;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]