woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b84206c4b69b39a4650b695c8396a658a43e51e8

commit b84206c4b69b39a4650b695c8396a658a43e51e8
Author: Wonki Kim <wonki_....@samsung.com>
Date:   Wed Feb 14 10:42:17 2018 +0900

    elementary: modify return value of scroller_movement_block_get
    
    Summary:
    A return value of scroller_movement_block_get has been changed by applying 
the commit(ffa041fe)
    The API returned a value which is being exclusively before, but now it 
returns a composition of states.
    
    This patch modify the api to return "A state" of block mode.
    
    Test Plan:
            1. set movement block mode as ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL 
for a scroller
            2. get movement block mode for the scroller
            3. compare the value and ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL by 
using == operation, not & operation
    
    Reviewers: jpeg, cedric, woohyun, raster
    
    Subscribers: raster
    
    Differential Revision: https://phab.enlightenment.org/D5793
---
 src/lib/elementary/elm_scroller.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/lib/elementary/elm_scroller.c 
b/src/lib/elementary/elm_scroller.c
index 6e5f9c5a13..2298ce9948 100644
--- a/src/lib/elementary/elm_scroller.c
+++ b/src/lib/elementary/elm_scroller.c
@@ -1198,10 +1198,10 @@ elm_scroller_movement_block_set(Evas_Object *obj,
    Efl_Ui_Scroll_Block mode = EFL_UI_SCROLL_BLOCK_NONE;
 
    // legacy -> eo
-   if (block & ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL)
-     mode |= EFL_UI_SCROLL_BLOCK_HORIZONTAL;
-   if (block & ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL)
-     mode |= EFL_UI_SCROLL_BLOCK_VERTICAL;
+   if (block == ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL)
+     mode = EFL_UI_SCROLL_BLOCK_HORIZONTAL;
+   else if (block == ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL)
+     mode = EFL_UI_SCROLL_BLOCK_VERTICAL;
 
    elm_interface_scrollable_movement_block_set(obj, mode);
 }
@@ -1209,7 +1209,6 @@ elm_scroller_movement_block_set(Evas_Object *obj,
 EAPI Elm_Scroller_Movement_Block
 elm_scroller_movement_block_get(const Evas_Object *obj)
 {
-   Elm_Scroller_Movement_Block block = ELM_SCROLLER_MOVEMENT_NO_BLOCK;
    Efl_Ui_Scroll_Block mode;
 
    ELM_SCROLLABLE_CHECK(obj, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
@@ -1217,12 +1216,12 @@ elm_scroller_movement_block_get(const Evas_Object *obj)
    mode = elm_interface_scrollable_movement_block_get(obj);
 
    // eo -> legacy
-   if (mode & EFL_UI_SCROLL_BLOCK_HORIZONTAL)
-     block |= ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL;
-   if (mode & EFL_UI_SCROLL_BLOCK_VERTICAL)
-     block |= ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL;
+   if (mode == EFL_UI_SCROLL_BLOCK_HORIZONTAL)
+     return ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL;
+   else if (mode == EFL_UI_SCROLL_BLOCK_VERTICAL)
+     return ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL;
 
-   return block;
+   return ELM_SCROLLER_MOVEMENT_NO_BLOCK;
 }
 
 EAPI void

-- 


Reply via email to