diff options
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-html-editor-cell-dialog.c | 2 | ||||
-rw-r--r-- | e-util/e-html-editor-selection.c | 34 | ||||
-rw-r--r-- | e-util/e-html-editor-view.c | 43 | ||||
-rw-r--r-- | e-util/e-mail-signature-preview.c | 2 | ||||
-rw-r--r-- | e-util/e-web-view.c | 3 |
5 files changed, 75 insertions, 9 deletions
diff --git a/e-util/e-html-editor-cell-dialog.c b/e-util/e-html-editor-cell-dialog.c index 2b487288ae..0a936454c7 100644 --- a/e-util/e-html-editor-cell-dialog.c +++ b/e-util/e-html-editor-cell-dialog.c @@ -332,6 +332,8 @@ cell_set_header_style (WebKitDOMHTMLTableCellElement *cell, dialog->priv->cell = new_cell; + g_object_unref (nodes); + g_free (tagname); } diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index a47fcf94ee..2c50d13caf 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -917,6 +917,8 @@ e_html_editor_selection_has_text (EHTMLEditorSelection *selection) } } + g_object_unref (node); + return FALSE; } @@ -1272,6 +1274,7 @@ format_change_list_from_list (EHTMLEditorSelection *selection, } if (webkit_dom_node_contains (item, WEBKIT_DOM_NODE (selection_end_marker))) { + g_object_unref (source_list_clone); source_list_clone = webkit_dom_node_clone_node (current_list, FALSE); after_selection_end = TRUE; } @@ -1659,6 +1662,8 @@ remove_wrapping_from_element (WebKitDOMElement *element) remove_node (webkit_dom_node_list_item (list, ii)); webkit_dom_node_normalize (WEBKIT_DOM_NODE (element)); + + g_object_unref (list); } void @@ -1672,6 +1677,7 @@ remove_quoting_from_element (WebKitDOMElement *element) length = webkit_dom_node_list_get_length (list); for (ii = 0; ii < length; ii++) remove_node (webkit_dom_node_list_item (list, ii)); + g_object_unref (list); list = webkit_dom_element_query_selector_all ( element, "span.-x-evo-temp-text-wrapper", NULL); @@ -1689,12 +1695,14 @@ remove_quoting_from_element (WebKitDOMElement *element) remove_node (node); } + g_object_unref (list); list = webkit_dom_element_query_selector_all ( element, "br.-x-evo-temp-br", NULL); length = webkit_dom_node_list_get_length (list); for (ii = 0; ii < length; ii++) remove_node (webkit_dom_node_list_item (list, ii)); + g_object_unref (list); webkit_dom_node_normalize (WEBKIT_DOM_NODE (element)); } @@ -2592,14 +2600,18 @@ e_html_editor_selection_is_indented (EHTMLEditorSelection *selection) fragment = webkit_dom_range_clone_contents (range, NULL); if (fragment) { + gboolean ret_val = TRUE; + element = webkit_dom_document_fragment_query_selector ( fragment, ".-x-evo-indented", NULL); - if (element) - return TRUE; + if (!element) { + element = get_element_for_inspection (range); + ret_val = element_has_class (element, "-x-evo-indented"); + } - element = get_element_for_inspection (range); - return element_has_class (element, "-x-evo-indented"); + g_object_unref (fragment); + return ret_val; } } @@ -2862,6 +2874,8 @@ e_html_editor_selection_indent (EHTMLEditorSelection *selection) goto out; } + g_object_unref (list); + block = next_block; } out: @@ -3182,6 +3196,7 @@ e_html_editor_selection_unindent (EHTMLEditorSelection *selection) if (after_selection_end) goto out; } + g_object_unref (list); block = next_block; } out: @@ -3563,12 +3578,13 @@ e_html_editor_selection_set_monospaced (EHTMLEditorSelection *selection, if (!e_html_editor_selection_is_collapsed (selection)) { gchar *html, *outer_html; + WebKitDOMNode *range_clone; + + range_clone = WEBKIT_DOM_NODE ( + webkit_dom_range_clone_contents (range, NULL)); webkit_dom_node_append_child ( - WEBKIT_DOM_NODE (monospace), - WEBKIT_DOM_NODE ( - webkit_dom_range_clone_contents (range, NULL)), - NULL); + WEBKIT_DOM_NODE (monospace), range_clone, NULL); outer_html = webkit_dom_html_element_get_outer_html ( WEBKIT_DOM_HTML_ELEMENT (monospace)); @@ -5032,6 +5048,7 @@ wrap_lines (EHTMLEditorSelection *selection, /* And remove them */ for (ii = 0; ii < br_count; ii++) remove_node (webkit_dom_node_list_item (wrap_br, ii)); + g_object_unref (wrap_br); } else { if (!webkit_dom_node_has_child_nodes (paragraph)) return WEBKIT_DOM_ELEMENT (paragraph); @@ -5687,6 +5704,7 @@ e_html_editor_selection_wrap_paragraphs_in_document (EHTMLEditorSelection *selec selection->priv->word_wrap_length - quote); } } + g_object_unref (list); } WebKitDOMElement * diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 580c8a3e69..414ab10976 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -517,6 +517,7 @@ quote_plain_text_element_after_wrapping (WebKitDOMDocument *document, NULL); } + g_object_unref (list); g_free (quotation); } @@ -1019,6 +1020,7 @@ change_cid_images_src_to_base64 (EHTMLEditorView *view) set_base64_to_element_attribute (view, WEBKIT_DOM_ELEMENT (node), "src"); } + g_object_unref (list); /* Namespaces */ attributes = webkit_dom_element_get_attributes (document_element); @@ -1045,11 +1047,13 @@ change_cid_images_src_to_base64 (EHTMLEditorView *view) view, WEBKIT_DOM_ELEMENT (node), attribute_ns); } + g_object_unref (list); g_free (attribute_ns); g_free (selector); } g_free (name); } + g_object_unref (attributes); list = webkit_dom_document_query_selector_all ( document, "[background^=\"cid:\"]", NULL); @@ -1060,6 +1064,7 @@ change_cid_images_src_to_base64 (EHTMLEditorView *view) set_base64_to_element_attribute ( view, WEBKIT_DOM_ELEMENT (node), "background"); } + g_object_unref (list); g_hash_table_remove_all (view->priv->inline_images); } @@ -1110,6 +1115,7 @@ move_elements_to_body (WebKitDOMDocument *document) remove_node (node); } + g_object_unref (list); } static void @@ -1128,6 +1134,7 @@ repair_gmail_blockquotes (WebKitDOMDocument *document) webkit_dom_element_remove_attribute (WEBKIT_DOM_ELEMENT (node), "style"); webkit_dom_element_set_attribute (WEBKIT_DOM_ELEMENT (node), "type", "cite", NULL); } + g_object_unref (list); } static void @@ -2261,6 +2268,7 @@ prevent_from_deleting_last_element_in_body (EHTMLEditorView *view) if (webkit_dom_element_query_selector (WEBKIT_DOM_ELEMENT (body), "img", NULL)) ret_val = FALSE; } + g_object_unref (list); return ret_val; } @@ -2570,6 +2578,7 @@ mark_node_as_paragraph_after_ending_list (EHTMLEditorSelection *selection, e_html_editor_selection_set_paragraph_style ( selection, WEBKIT_DOM_ELEMENT (node), -1, 0, ""); } + g_object_unref (list); } static gboolean @@ -3522,6 +3531,7 @@ e_html_editor_view_quote_plain_text_element (EHTMLEditorView *view, WEBKIT_DOM_NODE (element), NULL); + g_object_unref (list); return WEBKIT_DOM_ELEMENT (element_clone); } @@ -3578,6 +3588,7 @@ e_html_editor_view_quote_plain_text (EHTMLEditorView *view) remove_node (child); } } + g_object_unref (list); webkit_dom_node_normalize (body_clone); quote_plain_text_recursive (document, body_clone, body_clone, 0); @@ -3598,6 +3609,7 @@ e_html_editor_view_quote_plain_text (EHTMLEditorView *view) g_free (name); g_free (value); } + g_object_unref (attributes); /* Replace old BODY with one, that is quoted */ webkit_dom_node_replace_child ( @@ -3639,6 +3651,7 @@ e_html_editor_view_dequote_plain_text (EHTMLEditorView *view) remove_quoting_from_element (element); } } + g_object_unref (paragraphs); } static gboolean @@ -4107,6 +4120,7 @@ html_editor_view_process_document_from_convertor (EHTMLEditorView *view, remove_node (node); } + g_object_unref (list); repair_gmail_blockquotes (document_convertor); @@ -5074,6 +5088,7 @@ process_blockquote (WebKitDOMElement *blockquote) g_free (text_content); } + g_object_unref (list); /* Afterwards replace quote nodes with symbols */ list = webkit_dom_element_query_selector_all ( @@ -5090,6 +5105,7 @@ process_blockquote (WebKitDOMElement *blockquote) g_free (text_content); } + g_object_unref (list); if (element_has_class (blockquote, "-x-evo-indented")) { WebKitDOMNode *child; @@ -5529,6 +5545,7 @@ process_elements (EHTMLEditorView *view, g_free (value); } g_string_append (buffer, ">"); + g_object_unref (attributes); } if (to_html) remove_evolution_attributes (WEBKIT_DOM_ELEMENT (node)); @@ -5960,6 +5977,7 @@ process_elements (EHTMLEditorView *view, g_free (content); } + g_object_unref (nodes); } static void @@ -5976,6 +5994,8 @@ remove_wrapping_from_view (EHTMLEditorView *view) length = webkit_dom_node_list_get_length (list); for (ii = 0; ii < length; ii++) remove_node (webkit_dom_node_list_item (list, ii)); + + g_object_unref (list); } static void @@ -5992,6 +6012,8 @@ remove_images_in_element (EHTMLEditorView *view, length = webkit_dom_node_list_get_length (images); for (ii = 0; ii < length; ii++) remove_node (webkit_dom_node_list_item (images, ii)); + + g_object_unref (images); } static void @@ -6042,6 +6064,8 @@ toggle_smileys (EHTMLEditorView *view) else element_remove_class (parent, "-x-evo-resizable-wrapper"); } + + g_object_unref (smileys); } static void @@ -6110,6 +6134,7 @@ toggle_paragraphs_style_in_element (EHTMLEditorView *view, } } } + g_object_unref (paragraphs); } static void @@ -6372,10 +6397,13 @@ process_content_for_plain_text (EHTMLEditorView *view) webkit_dom_element_set_id ( WEBKIT_DOM_ELEMENT (paragraph), ""); } + g_object_unref (paragraphs); convert_element_from_html_to_plain_text ( view, div, &wrap, "e); + g_object_unref (source); + source = WEBKIT_DOM_NODE (div); clean = TRUE; @@ -6410,6 +6438,7 @@ process_content_for_plain_text (EHTMLEditorView *view) selection, WEBKIT_DOM_ELEMENT (paragraph)); } } + g_object_unref (paragraphs); paragraphs = webkit_dom_element_query_selector_all ( WEBKIT_DOM_ELEMENT (source), @@ -6424,6 +6453,7 @@ process_content_for_plain_text (EHTMLEditorView *view) remove_node (node); webkit_dom_node_normalize (parent); } + g_object_unref (paragraphs); if (view->priv->html_mode || quote) quote_plain_text_recursive (document, source, source, 0); @@ -6432,6 +6462,8 @@ process_content_for_plain_text (EHTMLEditorView *view) if (clean) remove_node (source); + else + g_object_unref (source); /* Return text content between <body> and </body> */ return g_string_free (plain_text, FALSE); @@ -6442,6 +6474,7 @@ process_content_for_html (EHTMLEditorView *view) { WebKitDOMDocument *document; WebKitDOMNode *body, *document_clone; + gchar *html_content; document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view)); document_clone = webkit_dom_node_clone_node ( @@ -6450,8 +6483,12 @@ process_content_for_html (EHTMLEditorView *view) WEBKIT_DOM_ELEMENT (document_clone), "body", NULL)); process_elements (view, body, TRUE, FALSE, FALSE, NULL); - return webkit_dom_html_element_get_outer_html ( + html_content = webkit_dom_html_element_get_outer_html ( WEBKIT_DOM_HTML_ELEMENT (document_clone)); + + g_object_unref (document_clone); + + return html_content; } static gboolean @@ -6512,6 +6549,7 @@ clear_attributes (WebKitDOMDocument *document) webkit_dom_element_remove_attribute_node ( document_element, WEBKIT_DOM_ATTR (node), NULL); } + g_object_unref (attributes); /* Remove everything from HEAD element */ while (webkit_dom_node_has_child_nodes (WEBKIT_DOM_NODE (head))) @@ -6537,6 +6575,7 @@ clear_attributes (WebKitDOMDocument *document) g_free (name); } + g_object_unref (attributes); } static void @@ -7592,6 +7631,7 @@ e_html_editor_view_get_parts_for_inline_images (EHTMLEditorView *view, g_free (src); g_free (cid); } + g_object_unref (list); list = webkit_dom_document_query_selector_all ( document, "[data-inline][background]", NULL); @@ -7624,6 +7664,7 @@ e_html_editor_view_get_parts_for_inline_images (EHTMLEditorView *view, g_free (cid); } + g_object_unref (list); g_hash_table_destroy (added); return parts; diff --git a/e-util/e-mail-signature-preview.c b/e-util/e-mail-signature-preview.c index ecf64191b6..f125c8b33d 100644 --- a/e-util/e-mail-signature-preview.c +++ b/e-util/e-mail-signature-preview.c @@ -80,6 +80,7 @@ replace_local_image_links (WebKitDOMDocument *document) g_free (new_src); g_free (src); } + g_object_unref (list); list = webkit_dom_document_get_elements_by_tag_name ( document, "iframe"); length = webkit_dom_node_list_get_length (list); @@ -96,6 +97,7 @@ replace_local_image_links (WebKitDOMDocument *document) if (content_document && WEBKIT_DOM_IS_DOCUMENT (content_document)) replace_local_image_links (content_document); } + g_object_unref (list); } static void diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c index ed8324c1b1..8a3b9c794b 100644 --- a/e-util/e-web-view.c +++ b/e-util/e-web-view.c @@ -2536,6 +2536,7 @@ web_view_get_frame_selection_html (WebKitDOMElement *iframe) if (text != NULL) return text; } + g_object_unref (frames); return NULL; } @@ -2568,6 +2569,7 @@ e_web_view_get_selection_html (EWebView *web_view) if (text != NULL) return text; } + g_object_unref (frames); return NULL; } @@ -3368,6 +3370,7 @@ add_css_rule_into_style_sheet_recursive (WebKitDOMDocument *document, selector, style); } + g_object_unref (frames); } /** |