summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2018-01-30 19:28:19 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-01-30 19:50:08 +0900
commitc53cbc572ed258eef0831b51241808658f37ece6 (patch)
tree75dc96eb8932df12d19a62b427177dc95172eec8
parent10342af9204ce180b5c2d26791c7d662c143ed0f (diff)
efl_ui_panes: Handle NULL object case
-rw-r--r--src/lib/elementary/efl_ui_panes.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c
index 6f77dd7f61..4548c9036b 100644
--- a/src/lib/elementary/efl_ui_panes.c
+++ b/src/lib/elementary/efl_ui_panes.c
@@ -681,7 +681,7 @@ elm_panes_add(Evas_Object *parent)
681EAPI void 681EAPI void
682elm_panes_content_left_min_size_set(Evas_Object *obj, int size) 682elm_panes_content_left_min_size_set(Evas_Object *obj, int size)
683{ 683{
684 EFL_UI_PANES_DATA_GET(obj, sd); 684 EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
685 685
686 sd->left_min_size = size; 686 sd->left_min_size = size;
687 if (sd->left_min_size < 0) sd->left_min_size = 0; 687 if (sd->left_min_size < 0) sd->left_min_size = 0;
@@ -692,14 +692,14 @@ elm_panes_content_left_min_size_set(Evas_Object *obj, int size)
692EAPI int 692EAPI int
693elm_panes_content_left_min_size_get(const Evas_Object *obj) 693elm_panes_content_left_min_size_get(const Evas_Object *obj)
694{ 694{
695 EFL_UI_PANES_DATA_GET(obj, sd); 695 EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
696 return sd->left_min_size; 696 return sd->left_min_size;
697} 697}
698 698
699EAPI void 699EAPI void
700elm_panes_content_right_min_size_set(Evas_Object *obj, int size) 700elm_panes_content_right_min_size_set(Evas_Object *obj, int size)
701{ 701{
702 EFL_UI_PANES_DATA_GET(obj, sd); 702 EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
703 703
704 sd->right_min_size = size; 704 sd->right_min_size = size;
705 if (sd->right_min_size < 0) sd->right_min_size = 0; 705 if (sd->right_min_size < 0) sd->right_min_size = 0;
@@ -710,7 +710,7 @@ elm_panes_content_right_min_size_set(Evas_Object *obj, int size)
710EAPI int 710EAPI int
711elm_panes_content_right_min_size_get(const Evas_Object *obj) 711elm_panes_content_right_min_size_get(const Evas_Object *obj)
712{ 712{
713 EFL_UI_PANES_DATA_GET(obj, sd); 713 EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
714 return sd->right_min_size; 714 return sd->right_min_size;
715} 715}
716 716
@@ -729,6 +729,8 @@ elm_panes_content_left_size_set(Evas_Object *obj, double size)
729EAPI double 729EAPI double
730elm_panes_content_right_size_get(const Evas_Object *obj) 730elm_panes_content_right_size_get(const Evas_Object *obj)
731{ 731{
732 EFL_UI_PANES_CHECK(obj) 0.0;
733
732 return 1.0 - elm_panes_content_left_size_get(obj); 734 return 1.0 - elm_panes_content_left_size_get(obj);
733} 735}
734 736
@@ -741,7 +743,7 @@ elm_panes_content_right_size_set(Evas_Object *obj, double size)
741EAPI void 743EAPI void
742elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size) 744elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size)
743{ 745{
744 EFL_UI_PANES_DATA_GET(obj, sd); 746 EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
745 sd->left_min_relative_size = size; 747 sd->left_min_relative_size = size;
746 if (sd->left_min_relative_size < 0) sd->left_min_relative_size = 0; 748 if (sd->left_min_relative_size < 0) sd->left_min_relative_size = 0;
747 sd->left_min_size_is_relative = EINA_TRUE; 749 sd->left_min_size_is_relative = EINA_TRUE;
@@ -751,14 +753,14 @@ elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size)
751EAPI double 753EAPI double
752elm_panes_content_left_min_relative_size_get(const Evas_Object *obj) 754elm_panes_content_left_min_relative_size_get(const Evas_Object *obj)
753{ 755{
754 EFL_UI_PANES_DATA_GET(obj, sd); 756 EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
755 return sd->left_min_relative_size; 757 return sd->left_min_relative_size;
756} 758}
757 759
758EAPI void 760EAPI void
759elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size) 761elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size)
760{ 762{
761 EFL_UI_PANES_DATA_GET(obj, sd); 763 EFL_UI_PANES_DATA_GET_OR_RETURN(obj, sd);
762 764
763 sd->right_min_relative_size = size; 765 sd->right_min_relative_size = size;
764 if (sd->right_min_relative_size < 0) sd->right_min_relative_size = 0; 766 if (sd->right_min_relative_size < 0) sd->right_min_relative_size = 0;
@@ -769,13 +771,15 @@ elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size)
769EAPI double 771EAPI double
770elm_panes_content_right_min_relative_size_get(const Evas_Object *obj) 772elm_panes_content_right_min_relative_size_get(const Evas_Object *obj)
771{ 773{
772 EFL_UI_PANES_DATA_GET(obj, sd); 774 EFL_UI_PANES_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
773 return sd->right_min_relative_size; 775 return sd->right_min_relative_size;
774} 776}
775 777
776EAPI void 778EAPI void
777elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) 779elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
778{ 780{
781 EFL_UI_PANES_CHECK(obj);
782
779 Efl_Ui_Dir dir; 783 Efl_Ui_Dir dir;
780 784
781 if (horizontal) 785 if (horizontal)
@@ -789,6 +793,8 @@ elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
789EAPI Eina_Bool 793EAPI Eina_Bool
790elm_panes_horizontal_get(const Evas_Object *obj) 794elm_panes_horizontal_get(const Evas_Object *obj)
791{ 795{
796 EFL_UI_PANES_CHECK(obj) EINA_FALSE;
797
792 Efl_Ui_Dir dir = efl_ui_direction_get(obj); 798 Efl_Ui_Dir dir = efl_ui_direction_get(obj);
793 799
794 if (dir == EFL_UI_DIR_HORIZONTAL) 800 if (dir == EFL_UI_DIR_HORIZONTAL)