summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-06-25 16:37:48 +0100
committerTom Hacohen <tom@stosb.com>2013-06-25 16:37:48 +0100
commitfdbc477f7990f78f69144a26d5990e35057b3317 (patch)
tree928d76bc9a4c2fa16a6e9415683a20afc08f8b55 /src
parent9c1ed31c7675fa8bfd27f366b93b430287ffe552 (diff)
Evas textblock: Fixed issue with textblocks without fonts segfaulting.
Fixes T184 (which is a regression).
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c5
-rw-r--r--src/tests/evas/evas_test_textblock.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 4ac813dff0..88d1fa4f9e 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -2550,6 +2550,11 @@ _layout_item_ascent_descent_adjust(const Evas_Object *eo_obj,
2550 Evas_Coord *maxascent, Evas_Coord *maxdescent, 2550 Evas_Coord *maxascent, Evas_Coord *maxdescent,
2551 Evas_Object_Textblock_Item *it, Textblock_Position position) 2551 Evas_Object_Textblock_Item *it, Textblock_Position position)
2552{ 2552{
2553 if (!it->format || !it->format->font.font)
2554 {
2555 return;
2556 }
2557
2553 _layout_format_ascent_descent_adjust(eo_obj, maxascent, maxdescent, it->format); 2558 _layout_format_ascent_descent_adjust(eo_obj, maxascent, maxdescent, it->format);
2554 2559
2555 if ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && 2560 if ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) &&
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index ca6644daaf..03332b497d 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -2484,6 +2484,13 @@ START_TEST(evas_textblock_style)
2484 evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); 2484 evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b);
2485 fail_if((l != 1) || (r != 4) || (t != 1) || (b != 4)); 2485 fail_if((l != 1) || (r != 4) || (t != 1) || (b != 4));
2486 2486
2487 /* No font */
2488 evas_textblock_style_set(newst, "DEFAULT=''");
2489 evas_object_textblock_text_markup_set(tb, "Test");
2490 evas_object_textblock_size_formatted_get(tb, &nw, &nh);
2491 ck_assert_int_eq(nw, 0);
2492 ck_assert_int_eq(nw, nh);
2493
2487 END_TB_TEST(); 2494 END_TB_TEST();
2488} 2495}
2489END_TEST 2496END_TEST