efl/legacy
SangHyeon Lee 3d536db3c2 elm_gengrid: fix the bug that gengrid item index(position) is updated wrong value in item_update
Summary:
elm_gengrid_item_update perform item_unrealize/item_realize/item_place itself.
But when gengrid items are added and not calculated yet,
caller want to get item's index after execute elm_gengrid_item_update,
return value is wrong because item_place update it's position in not-updated item's x and y.

to prevent this,
if item position is already updated,
do not updates position in item place.

additionally,
I fixed gengrid item prepend wrong posiiton update.
gengrid item position start from 1 not 0, so item_position_update also must be started from 1.

@fix

Test Plan:
To test this scenario,
need to fix src/bin/test_gengrid.c first.

1. add below codes in bottom of _after_bt_clicked(line 703).

```
      Elm_Object_Item *it = elm_gengrid_item_next_get(id->item);
      printf("before update efl item[%p], index [%d]\n",id->item,elm_gengrid_item_index_get(it));
      elm_gengrid_item_update(it);
      printf("after update efl item[%p], index [%d]\n",id->item,elm_gengrid_item_index_get(it));
```

2. execute elementary_test and go to gengrid2 test.

3. add 3 items and select 2nd item then add new item by insert after.

4. you can see index is changed wrong value after item_update executed.

after add fallback code in item_update,
index is returned same value even after item_update execusion.

Reviewers: raster, Hermet, seoz, jaehwan

Subscribers: anand.km, eagleeye, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D2616

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-25 17:24:08 +02:00
..
elementary elm_gengrid: fix the bug that gengrid item index(position) is updated wrong value in item_update 2015-06-25 17:24:08 +02:00