From: Bruno Dilly Date: Mon, 8 Oct 2012 22:39:05 +0000 (+0000) Subject: elementary: replace previously special value set X-Git-Tag: submit/efl/20131021.015827~1672 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32fe0383a9cfbfdab07f978ab537e8d51420c4c8;p=platform%2Fupstream%2Felementary.git elementary: replace previously special value set When adding a special value, check if there is already a label for the value. If it's the case, just replace the label. SVN revision: 77589 --- diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index e841c88..d9b7a4d 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -855,10 +855,21 @@ elm_spinner_special_value_add(Evas_Object *obj, const char *label) { Elm_Spinner_Special_Value *sv; + Eina_List *l; ELM_SPINNER_CHECK(obj); ELM_SPINNER_DATA_GET(obj, sd); + EINA_LIST_FOREACH(sd->special_values, l, sv) + { + if (sv->value != value) + continue; + + eina_stringshare_replace(&sv->label, label); + _label_write(obj); + return; + } + sv = calloc(1, sizeof(*sv)); if (!sv) return; sv->value = value;