[evolution] EHTMLEditorView - Background image from page is removed when saving draft
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EHTMLEditorView - Background image from page is removed when saving draft
- Date: Fri, 13 May 2016 14:09:06 +0000 (UTC)
commit 07f2a53534013d981781528633f5adf53fb2d34c
Author: Tomas Popela <tpopela redhat com>
Date: Fri May 13 16:07:17 2016 +0200
EHTMLEditorView - Background image from page is removed when saving draft
e-util/e-html-editor-view.c | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 4f241c1..95dd63a 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -10244,24 +10244,25 @@ remove_image_attributes_from_element (WebKitDOMElement *element)
}
static void
-remove_background_images_in_document (WebKitDOMDocument *document)
+remove_background_images_in_element (WebKitDOMElement *element)
{
gint length, ii;
- WebKitDOMNodeList *elements;
+ WebKitDOMNodeList *images;
- elements = webkit_dom_document_query_selector_all (
- document, "[background][data-inline]", NULL);
+ images = webkit_dom_element_query_selector_all (
+ element, "[background][data-inline]", NULL);
- length = webkit_dom_node_list_get_length (elements);
+ length = webkit_dom_node_list_get_length (images);
for (ii = 0; ii < length; ii++) {
- WebKitDOMElement *element = WEBKIT_DOM_ELEMENT (
- webkit_dom_node_list_item (elements, ii));
+ WebKitDOMElement *image = WEBKIT_DOM_ELEMENT (
+ webkit_dom_node_list_item (images, ii));
- remove_image_attributes_from_element (element);
- g_object_unref (element);
+ remove_image_attributes_from_element (image);
+ g_object_unref (image);
}
- g_object_unref (elements);
+ remove_image_attributes_from_element (element);
+ g_object_unref (element);
}
static void
@@ -10555,8 +10556,8 @@ process_content_for_plain_text (EHTMLEditorView *view)
view, WEBKIT_DOM_ELEMENT (source), FALSE);
remove_images_in_element (
view, WEBKIT_DOM_ELEMENT (source));
- remove_background_images_in_document (
- document);
+ remove_background_images_in_element (
+ WEBKIT_DOM_ELEMENT (source));
} else {
gchar *inner_html;
WebKitDOMElement *div;
@@ -10816,7 +10817,7 @@ convert_when_changing_composer_mode (EHTMLEditorView *view)
toggle_paragraphs_style (view);
toggle_smileys (view);
remove_images (view);
- remove_background_images_in_document (document);
+ remove_background_images_in_element (WEBKIT_DOM_ELEMENT (body));
clear_attributes (document);
@@ -11408,7 +11409,8 @@ e_html_editor_view_set_html_mode (EHTMLEditorView *view,
toggle_tables (view);
toggle_unordered_lists (view);
remove_images (view);
- remove_background_images_in_document (document);
+ body = webkit_dom_document_get_body (document);
+ remove_background_images_in_element (WEBKIT_DOM_ELEMENT (body));
plain = process_content_for_mode_change (view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]