gengrid: fix Logic in _item_single_select_left and _item_single_select_right.

Summary:
In _item_single_select_left/right functions if logic is corrected from && to ||.
The previous thing is like: if "there is a generation mismatch" and "item is
disable" then only get the next gengrid item. This seems logically incorrect.

The suggested logic is if "there is generation mismatch" OR "item disabled" then
go for the new item. Whether we get a generation mismatch or item disable, we
should look for next item. So there should be || logic instead of && logic.

@fix

Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: Hermet, raster, singh.amitesh, SanghyeonLee, cedric

Subscribers: cedric, sachin.dev

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Umesh Tanwar 2015-12-07 15:55:33 -08:00 committed by Cedric BAIL
parent 51355d307e
commit 58b9f34035
1 changed files with 4 additions and 4 deletions

View File

@ -2366,8 +2366,8 @@ _item_single_select_left(Elm_Gengrid_Data *sd)
if (!sd->selected)
{
prev = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
while ((prev) && (prev->generation < sd->generation)
&& elm_object_item_disabled_get(EO_OBJ(prev)))
while (((prev) && (prev->generation < sd->generation))
|| elm_object_item_disabled_get(EO_OBJ(prev)))
prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
}
else
@ -2400,8 +2400,8 @@ _item_single_select_right(Elm_Gengrid_Data *sd)
if (!sd->selected)
{
next = ELM_GEN_ITEM_FROM_INLIST(sd->items);
while ((next) && (next->generation < sd->generation)
&& elm_object_item_disabled_get(EO_OBJ(next)))
while (((next) && (next->generation < sd->generation))
|| elm_object_item_disabled_get(EO_OBJ(next)))
next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
}
else