cedric pushed a commit to branch master.

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

commit f8db9a85fb0d878026f4b3e3e0e8f263a272c624
Author: Kateryna Fesyna <[email protected]>
Date:   Mon Oct 20 17:30:26 2014 +0200

    edje: Edje_Edit - fix edje_edit_state_aspect_pref_set() function to setup 
Source and None aspect preferences
    
    Summary:
    This commit fixes check of passed value of aspect preference in 
edje_edit_state_aspect_pref_set() because it ignores None and Sorce values.
    @fix
    
    Reviewers: reutskiy.v.v, Hermet, raster, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1542
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/edje/Edje_Edit.h | 12 ++++++++++--
 src/lib/edje/edje_edit.c |  2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 795a383..01dd366 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -3071,13 +3071,21 @@ EAPI unsigned char 
edje_edit_state_aspect_pref_get(Evas_Object *obj, const char
 
 /** Set the aspect preference of a part state.
  *
+ * The available values of aspect preference are:
+ * <ul style="list-style-type:none">
+ *     <li>0 - None</li>
+ *     <li>1 - Vertical</li>
+ *     <li>2 - Horizontal</li>
+ *     <li>3 - Both</li>
+ *     <li>4 - Source</li>
+ * </ul>
+ *
  * @param obj Object being edited.
  * @param part Part that contain state.
  * @param state The name of the state to set aspect preference (not
  *              including the state value).
  * @param value The state value.
- * @param pref The aspect preference to set (0 = None, 1 = Vertical, 2
- *             = Horizontal, 3 = Both)
+ * @param pref The aspect preference to be set
  *
  * @return @c EINA_TRUE if the parameter was found, @c EINA_FALSE otherwise.
  */
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index b117480..2693506 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -5702,7 +5702,7 @@ EAPI Eina_Bool
 edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char 
*state, double value, unsigned char pref)
 {
    GET_PD_OR_RETURN(EINA_FALSE);
-   if ((!pref) || (pref > 3)) return EINA_FALSE;
+   if (pref > 4) return EINA_FALSE;
    pd->aspect.prefer = pref;
    return EINA_TRUE;
 }

-- 


Reply via email to