[evolution/webkit-composer: 229/231] Check if node, that we are trying to edit is WEBKIKT_DOM_CHARACTER_DATA.
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit-composer: 229/231] Check if node, that we are trying to edit is WEBKIKT_DOM_CHARACTER_DATA.
- Date: Fri, 13 Sep 2013 14:25:13 +0000 (UTC)
commit 3bb96a5ec18dd63ce814a6b2c6ff2260ab1e5a0c
Author: Tomas Popela <tpopela redhat com>
Date: Thu Jul 25 14:12:12 2013 +0200
Check if node, that we are trying to edit is WEBKIKT_DOM_CHARACTER_DATA.
e-util/e-editor-selection.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index ae0af9a..180737b 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -3200,21 +3200,24 @@ e_editor_selection_wrap_lines (EEditorSelection *selection,
/* If there is hidden space character in the beginning we remove it */
if (strstr (webkit_dom_node_get_text_content (paragraph), UNICODE_HIDDEN_SPACE)) {
WebKitDOMNode *child = webkit_dom_node_get_first_child (paragraph);
- GRegex *regex;
- gchar *node_text;
- regex = g_regex_new (UNICODE_HIDDEN_SPACE, 0, 0, NULL);
- if (!regex)
- return;
+ if (WEBKIT_DOM_IS_CHARACTER_DATA (child)) {
+ GRegex *regex;
+ gchar *node_text;
- node_text = webkit_dom_character_data_get_data (WEBKIT_DOM_CHARACTER_DATA (child));
- webkit_dom_character_data_set_data (
- WEBKIT_DOM_CHARACTER_DATA (child),
- g_regex_replace_literal (regex, node_text, -1, 0, "", 0, NULL),
- NULL);
+ regex = g_regex_new (UNICODE_HIDDEN_SPACE, 0, 0, NULL);
+ if (!regex)
+ return;
- g_free (node_text);
- g_regex_unref (regex);
+ node_text = webkit_dom_character_data_get_data (WEBKIT_DOM_CHARACTER_DATA
(child));
+ webkit_dom_character_data_set_data (
+ WEBKIT_DOM_CHARACTER_DATA (child),
+ g_regex_replace_literal (regex, node_text, -1, 0, "", 0, NULL),
+ NULL);
+
+ g_free (node_text);
+ g_regex_unref (regex);
+ }
}
if (previously_wrapped) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]