From: Shinwoo Kim Date: Thu, 11 Jul 2019 10:33:55 +0000 (+0000) Subject: Efl.Ui.Format: fix regressions X-Git-Tag: accepted/tizen/unified/20190722.074730~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f43d8c9e3ba176849b3f14c8bb6fbb22a98a926c;p=platform%2Fupstream%2Fefl.git Efl.Ui.Format: fix regressions (1) Following commit did not care of efl_ui_format_string_get(set) of elm_slider_part_indicator_eo.c e776f5f Efl.Ui.Format revamp Even though you call elm_slider_indicator_format_set with "%1.0f", elm_slider_indicator_format_get returns NULL. (2) The commit does not initialize format variables - elm_slider_indicator_format_get - elm_slider_unit_format_get - elm_progressbar_unit_format_get Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9276 --- diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 5ad712c..b9eaf6e 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -1109,7 +1109,7 @@ elm_progressbar_unit_format_set(Evas_Object *obj, const char *units) EAPI const char * elm_progressbar_unit_format_get(const Evas_Object *obj) { - const char *fmt; + const char *fmt = NULL; efl_ui_format_string_get(obj, &fmt, NULL); return fmt; } diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index 3880afb..16f2be4 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -1210,7 +1210,7 @@ _indi_default_format_free_cb(void *data) } EOLIAN static void -_elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd EINA_UNUSED, const char *template) +_elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd EINA_UNUSED, const char *template, Efl_Ui_Format_String_Type type EINA_UNUSED) { Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS); @@ -1221,13 +1221,13 @@ _elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd EI efl_ui_format_func_set(efl_part(pd->obj, "indicator"), pd->obj, _indi_default_format_cb, _indi_default_format_free_cb); } -EOLIAN static const char * -_elm_slider_part_indicator_efl_ui_format_format_string_get(const Eo *obj, void *_pd EINA_UNUSED) +EOLIAN static void +_elm_slider_part_indicator_efl_ui_format_format_string_get(const Eo *obj, void *_pd EINA_UNUSED, const char **template, Efl_Ui_Format_String_Type *type EINA_UNUSED) { Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); Elm_Slider_Data *sd = efl_data_scope_get(pd->obj, ELM_SLIDER_CLASS); - return sd->indi_template; + if (template) *template = sd->indi_template; } EOLIAN static void @@ -1303,7 +1303,7 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) EAPI const char * elm_slider_unit_format_get(const Evas_Object *obj) { - const char* fmt; + const char* fmt = NULL; efl_ui_format_string_get(obj, &fmt, NULL); return fmt; } @@ -1482,7 +1482,7 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) EAPI const char * elm_slider_indicator_format_get(const Evas *obj) { - const char *fmt; + const char *fmt = NULL; efl_ui_format_string_get(efl_part(obj, "indicator"), &fmt, NULL); return fmt; } diff --git a/src/lib/elementary/elm_slider_part_indicator_eo.c b/src/lib/elementary/elm_slider_part_indicator_eo.c index 5488294..369285b 100644 --- a/src/lib/elementary/elm_slider_part_indicator_eo.c +++ b/src/lib/elementary/elm_slider_part_indicator_eo.c @@ -9,11 +9,9 @@ EOAPI EFL_FUNC_BODY_CONST(elm_slider_part_indicator_visible_mode_get, Elm_Slider void _elm_slider_part_indicator_efl_ui_format_format_cb_set(Eo *obj, void *pd, void *func_data, Efl_Ui_Format_Func func, Eina_Free_Cb func_free_cb); +void _elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *_pd, const char *template, Efl_Ui_Format_String_Type type); -void _elm_slider_part_indicator_efl_ui_format_format_string_set(Eo *obj, void *pd, const char *units); - - -const char *_elm_slider_part_indicator_efl_ui_format_format_string_get(const Eo *obj, void *pd); +void _elm_slider_part_indicator_efl_ui_format_format_string_get (const Eo *obj, void *_pd, const char **template, Efl_Ui_Format_String_Type *type); void _elm_slider_part_indicator_efl_ui_format_apply_formatted_value(Eo *obj, Elm_Part_Data *pd);