[evolution] Don't wrap on Unicode's non-breaking space character
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Don't wrap on Unicode's non-breaking space character
- Date: Tue, 8 Sep 2015 14:32:37 +0000 (UTC)
commit 676e3e14f9f047ec773dfeba18481b0024026abb
Author: Tomas Popela <tpopela redhat com>
Date: Tue Sep 8 15:56:51 2015 +0200
Don't wrap on Unicode's non-breaking space character
Revert commit db11d8fbe583d939dae84efb11e109ba65a8d870 and instead teach the
code to not to wrap on non-breaking space. Also after previously mentioned
commit it was not possible to insert spaces on the beginning of a line when writing
into multi line content (they were auto collapsed).
e-util/e-html-editor-selection.c | 12 +++++++-----
e-util/e-html-editor-view.c | 11 -----------
2 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 09d1a28..21da6b0 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -6127,7 +6127,8 @@ find_where_to_break_line (WebKitDOMCharacterData *node,
goto out;
}
- if (g_unichar_isspace (uc) || *str == '-') {
+ if ((g_unichar_isspace (uc) && !(g_unichar_break_type (uc) ==
G_UNICODE_BREAK_NON_BREAKING_GLUE)) ||
+ *str == '-') {
if ((last_break_position_is_dash = *str == '-')) {
/* There was no space before the dash */
if (pos - 1 != last_break_position) {
@@ -6159,7 +6160,8 @@ find_where_to_break_line (WebKitDOMCharacterData *node,
str = g_utf8_next_char (str);
uc = g_utf8_get_char (str);
- if (g_unichar_isspace (uc))
+ if ((g_unichar_isspace (uc) &&
+ !(g_unichar_break_type (uc) == G_UNICODE_BREAK_NON_BREAKING_GLUE)))
last_break_position = ++pos;
}
break;
@@ -6591,12 +6593,12 @@ wrap_lines (EHTMLEditorSelection *selection,
/* Find the last character where we can break. */
while (text_length - length > 0) {
- if (strchr (" "UNICODE_NBSP, data[text_length
- length - 1])) {
+ if (strchr (" ", data[text_length - length -
1])) {
length++;
break;
} else if (data[text_length - length - 1] ==
'-' &&
text_length - length > 1 &&
- !strchr (" "UNICODE_NBSP,
data[text_length - length - 2]))
+ !strchr (" ", data[text_length -
length - 2]))
break;
length++;
}
@@ -6655,7 +6657,7 @@ wrap_lines (EHTMLEditorSelection *selection,
mark_and_remove_leading_space (document, nd);
g_free (nd_content);
nd_content = webkit_dom_node_get_text_content (nd);
- if (g_strcmp0 (nd_content, UNICODE_NBSP) == 0 || !*nd_content)
+ if (!*nd_content)
remove_node (nd);
g_free (nd_content);
}
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index db30d06..b0cf7c1 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -8554,16 +8554,6 @@ process_elements (EHTMLEditorView *view,
gchar *class;
const gchar *css_align;
- if (strstr (content, UNICODE_NBSP)) {
- GString *nbsp_free;
-
- nbsp_free = e_str_replace_string (
- content, UNICODE_NBSP, " ");
-
- g_free (content);
- content = g_string_free (nbsp_free, FALSE);
- }
-
class = webkit_dom_element_get_class_name (WEBKIT_DOM_ELEMENT (node));
if ((css_align = strstr (class, "-x-evo-align-"))) {
gchar *align;
@@ -11182,7 +11172,6 @@ e_html_editor_view_update_fonts (EHTMLEditorView *view)
" font-size: %dpt;\n"
" font-weight: %d;\n"
" font-style: %s;\n"
- " -webkit-nbsp-mode: space;"
" -webkit-line-break: after-white-space;\n",
pango_font_description_get_family (vw),
pango_font_description_get_size (vw) / PANGO_SCALE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]