Fix seg when window is resized too small.

SVN revision: 42968
This commit is contained in:
titan 2009-10-08 20:38:00 +00:00 committed by titan
parent ded2e589e6
commit 9c7fb20968
1 changed files with 11 additions and 0 deletions

View File

@ -187,6 +187,8 @@ void ephoto_table_viewport_set(Evas_Object *obj, int w, int h)
sd->rows = sd->pageh/(sd->padh+sd->itemh);
sd->columns = sd->pagew/(sd->padw+sd->itemw);
sd->items_per_page = sd->rows*sd->columns;
if (sd->items_per_page == 0)
return;
pages = eina_list_count(sd->images)/sd->items_per_page;
remain = eina_list_count(sd->images)%sd->items_per_page;
if (remain > 0)
@ -213,6 +215,9 @@ void ephoto_table_pack(Evas_Object *obj, char *image)
if (!sd)
return;
if (sd->items_per_page == 0)
return;
sd->images = eina_list_append(sd->images, strdup(image));
if (sd->cur_row > sd->rows)
@ -307,6 +312,9 @@ static void _table_smart_change_page(Smart_Data *sd, int direction)
int w, h, j, vis, head, back, pages, remain;
Eina_List *iterator, *iteratorb;
if (sd->items_per_page == 0)
return;
pages = eina_list_count(sd->images)/sd->items_per_page;
remain = eina_list_count(sd->images)%sd->items_per_page;
if (remain > 0)
@ -501,6 +509,9 @@ static void _table_smart_reconfigure(Smart_Data *sd)
int w, h, j;
Eina_List *iterator, *iteratorb;
if (sd->items_per_page == 0)
return;
if (!sd->images)
return;