summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2015-02-09 17:30:30 +0000
committerTom Hacohen <tom@stosb.com>2015-02-09 17:31:35 +0000
commit2d403151270d074cb10367232ef7109d65e6be00 (patch)
tree302e564372300a38eb32c7acb1d5b9a03d01e3be
parent1d4e8c2f1d58af2d3b730565d4d476cf87c412c3 (diff)
evas text: fix _ellipsis_get to return -1.0 on failure.
Summary: When getting ellipsis value from evas text object fails, the most reasonable return value is -1.0. Currently, evas_object_text_ellipsis_get API with NULL returns 0.0. It means ellipsis is not off. It must return -1.0 when API fails. @fix Comments by Tom: until now, this was inconsistent. With this change, it now returns -1.0 consistently. Also, fixed commit summary. Reviewers: woohyun, Hermet, seoz, tasn Reviewed By: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1944
-rw-r--r--src/lib/evas/canvas/evas_text.eo4
-rw-r--r--src/tests/evas/evas_test_text.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo
index 56b630255b..c6ddfe29a5 100644
--- a/src/lib/evas/canvas/evas_text.eo
+++ b/src/lib/evas/canvas/evas_text.eo
@@ -58,12 +58,12 @@ class Evas.Text (Evas.Object, Efl.Text, Efl.Text_Properties)
58 /*@ 58 /*@
59 @brief Gets the ellipsis currently set on the text object. 59 @brief Gets the ellipsis currently set on the text object.
60 60
61 @return The ellipsis set on the text object. 61 @return The ellipsis set on the text object. The ellipsis is -1.0.
62 @see evas_object_text_ellipsis_set. 62 @see evas_object_text_ellipsis_set.
63 @since 1.8 */ 63 @since 1.8 */
64 } 64 }
65 values { 65 values {
66 double ellipsis; /*@ the ellipsis. */ 66 double ellipsis(-1); /*@ the ellipsis. */
67 } 67 }
68 } 68 }
69 bidi_delimiters { 69 bidi_delimiters {
diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c
index e969050161..90ce19dcc8 100644
--- a/src/tests/evas/evas_test_text.c
+++ b/src/tests/evas/evas_test_text.c
@@ -224,6 +224,10 @@ START_TEST(evas_text_ellipsis)
224 /* Ligatures */ 224 /* Ligatures */
225 buf = "Fffffffffffffffffffffffffffffffffff"; 225 buf = "Fffffffffffffffffffffffffffffffffff";
226 _test_ellipsis(to, buf, font, size, 0.0); 226 _test_ellipsis(to, buf, font, size, 0.0);
227
228 /* Check ellipsis value with NULL */
229 fail_if(evas_object_text_ellipsis_get(NULL) != -1.0);
230
227 END_TEXT_TEST(); 231 END_TEXT_TEST();
228} 232}
229END_TEST 233END_TEST