From: Tom Hacohen Date: Wed, 18 Nov 2015 10:56:48 +0000 (+0000) Subject: Evas text: Fix last up to pos error return value. X-Git-Tag: upstream/1.20.0~8176 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e1e50ca062abe2381c983a5976f77c4cfc35a81;p=platform%2Fupstream%2Fefl.git Evas text: Fix last up to pos error return value. This commit also simplifies the code a (tiny) bit. This fixes the bug introduced in: 392df9479f816a641fabbf333326bdab4b9cfc28 --- diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 311e28b..f650048 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -271,7 +271,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Object_Text_Item *it; - int pos = 0; + int pos = -1; #ifdef BIDI_SUPPORT /* Reorder if it's a bidi text */ @@ -301,7 +301,6 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, x += it->adv; } eina_list_free(logical_it); - return pos; } else #endif @@ -318,7 +317,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, } } } - return -1; + return pos; } static int