aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-07 17:32:08 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-07 17:32:08 +0800
commit45fa23472760037a94f00873538da91b1ae65b7f (patch)
tree9ab05f334bd756f904241473be6e4fe5c378b4b5
parent56f8ae3a3f68dfebe4d6f226fc63f6de438c64e0 (diff)
downloadgsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar.gz
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar.bz2
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar.lz
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar.xz
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.tar.zst
gsoc2013-evolution-45fa23472760037a94f00873538da91b1ae65b7f.zip
EHTMLEditorSelection - Limit the paragraph minimal width to 5 characters
-rw-r--r--e-util/e-html-editor-selection.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 47aeecf0e3..86f96ce971 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -44,6 +44,7 @@
#define SPACES_PER_INDENTATION 4
#define SPACES_PER_LIST_LEVEL 8
+#define MINIMAL_PARAGRAPH_WIDTH 5
/**
* EHTMLEditorSelection
@@ -2841,7 +2842,8 @@ e_html_editor_selection_indent (EHTMLEditorSelection *selection)
level = get_indentation_level (WEBKIT_DOM_ELEMENT (block));
final_width = word_wrap_length - SPACES_PER_INDENTATION * (level + 1);
- if (final_width < 10 && !is_in_html_mode (selection)) {
+ if (final_width < MINIMAL_PARAGRAPH_WIDTH &&
+ !is_in_html_mode (selection)) {
if (!after_selection_end) {
block = next_block;
continue;
@@ -2875,7 +2877,8 @@ e_html_editor_selection_indent (EHTMLEditorSelection *selection)
WEBKIT_DOM_ELEMENT (block_to_process));
final_width = word_wrap_length - SPACES_PER_INDENTATION * (level + 1);
- if (final_width < 10 && !is_in_html_mode (selection))
+ if (final_width < MINIMAL_PARAGRAPH_WIDTH &&
+ !is_in_html_mode (selection))
continue;
indent_block (selection, document, block_to_process, final_width);
@@ -5668,7 +5671,7 @@ e_html_editor_selection_wrap_paragraph_length (EHTMLEditorSelection *selection,
g_return_val_if_fail (E_IS_HTML_EDITOR_SELECTION (selection), NULL);
g_return_val_if_fail (WEBKIT_DOM_IS_ELEMENT (paragraph), NULL);
- g_return_val_if_fail (length > 10, NULL);
+ g_return_val_if_fail (length >= MINIMAL_PARAGRAPH_WIDTH, NULL);
document = webkit_dom_node_get_owner_document (WEBKIT_DOM_NODE (paragraph));