aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-04-15 17:15:22 +0100
committerTom Hacohen <tom@stosb.com>2013-04-15 17:15:22 +0100
commit3f3ad67616d491c40e4c7c34d3927896f80b8caa (patch)
tree40353354f35648fa50c3dccd020c930c7e03702e
parentEvas polygon: Cleaned up the way we clean the points. (diff)
downloadefl-3f3ad67616d491c40e4c7c34d3927896f80b8caa.tar.gz
Evas textblock: Fixed a bug with deletion of ranges.
Fixed a bug with deletion of ranges that end just before a visual format. Thanks to WooHyun Jung for reporting.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c5
-rw-r--r--src/tests/evas/evas_test_textblock.c7
4 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 621e2129e4..41b41816f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-15 Tom Hacohen
+ * Evas textblock: Fixed a bug with deletion of ranges that end just
+ before a visual format.
+
2013-04-14 Jiyoun Park
* Evas: fix gif bug related with scale down decode.
diff --git a/NEWS b/NEWS
index f163c45e99..a283beadc9 100644
--- a/NEWS
+++ b/NEWS
@@ -242,4 +242,5 @@ Fixes:
* Evas: Don't update evas update area by the clipper if the image obj visible is changed.
* Evas: fix gif decoding bug related with background color.
* Evas: fix gif bug related with scale down decode.
+ * Evas textblock: Fixed a bug with deletion of ranges that end just a visual format.
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 15300dfa09..76a9cdbcb7 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7545,6 +7545,11 @@ _evas_textblock_node_text_adjust_offsets_to_start(Evas_Object_Textblock *o,
last_node->offset -= delta;
break;
}
+ else if (use_end && itr && (pos + itr->offset >= (size_t) end) &&
+ itr->visible)
+ {
+ break;
+ }
delta = orig_end - pos;
if (!first)
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 173b85df7a..43f325b1a7 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -1218,6 +1218,13 @@ START_TEST(evas_textblock_format_removal)
fnode = evas_textblock_node_format_first_get(tb);
fail_if (fnode);
+ /* Range delete with empty paragraphs. */
+ evas_object_textblock_text_markup_set(tb, "<ps/><ps/><ps/><ps/><ps/>");
+ evas_textblock_cursor_pos_set(cur, 2);
+ evas_textblock_cursor_pos_set(main_cur, 3);
+ evas_textblock_cursor_range_delete(cur, main_cur);
+ ck_assert_str_eq(evas_object_textblock_text_markup_get(tb), "<ps/><ps/><ps/><ps/>");
+
/* Verify fmt position and REP_CHAR positions are the same */
evas_object_textblock_text_markup_set(tb,
"This is<ps/>an <item absize=93x152 vsize=ascent></>a.");