summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/evas/canvas/evas_object_text.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 3e3e9ffe97..c066a408d2 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -879,21 +879,27 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t
/* FIXME: We shouldn't do anything. */
}
- int cut = ENFN->font_last_up_to_pos(ENDT,
- o->font,
- &itr->text_props,
- ellip_frame - (advance + l + r),
- 0);
- if (cut >= 0)
+ /* In case when we reach end of itr list, and have NULL */
+ int cut = -1;
+ if (itr && (itr != end_ellip_it))
{
- end_ellip_it->text_pos = itr->text_pos + cut;
- end_ellip_it->visual_pos = itr->visual_pos + cut;
- if (_layout_text_item_trim(obj, o, itr, cut, EINA_TRUE))
+ cut = ENFN->font_last_up_to_pos(ENDT,
+ o->font,
+ &itr->text_props,
+ ellip_frame - (advance + l + r),
+ 0);
+ if (cut >= 0)
{
- itr = (Evas_Object_Text_Item *) EINA_INLIST_GET(itr)->next;
+ end_ellip_it->text_pos = itr->text_pos + cut;
+ end_ellip_it->visual_pos = itr->visual_pos + cut;
+ if (_layout_text_item_trim(obj, o, itr, cut, EINA_TRUE))
+ {
+ itr = (Evas_Object_Text_Item *) EINA_INLIST_GET(itr)->next;
+ }
}
}
+
/* Remove the rest of the items */
while (itr)
{