elm_spinner: Maintainance API internal logic. 19/145819/1
authorWoochan Lee <wc0917.lee@samsung.com>
Thu, 24 Aug 2017 04:27:47 +0000 (13:27 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Thu, 24 Aug 2017 04:29:07 +0000 (13:29 +0900)
Change fmt value in the API can break compatibility.

Change-Id: I94e2c9832f907c714653a43aa63cc9ac6c2584eb

src/lib/elm_spinner.c

index e71b5b992a944a4252c084532c68d24cfdc7c815..701ba56dc9a565388cbcf74dbf67f8f063bbecaf 100644 (file)
@@ -1618,18 +1618,20 @@ _elm_spinner_eo_base_constructor(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED)
 EOLIAN static void
 _elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt)
 {
-   Elm_Spinner_Format_Type type;
+   Elm_Spinner_Format_Type type = SPINNER_FORMAT_INVALID;
 
-   if (!fmt) fmt = "%.0f";
-   type = _is_label_format_integer(fmt);
-   if (type == SPINNER_FORMAT_INVALID)
+   if (fmt)
      {
-        ERR("format:\"%s\" is invalid, cannot be set", fmt);
-        return;
-     }
-   else if (type == SPINNER_FORMAT_FLOAT)
-     {
-        sd->decimal_points = _decimal_points_get(fmt);
+        type = _is_label_format_integer(fmt);
+        if (type == SPINNER_FORMAT_INVALID)
+          {
+             ERR("format:\"%s\" is invalid, cannot be set", fmt);
+             return;
+          }
+        else if (type == SPINNER_FORMAT_FLOAT)
+          {
+             sd->decimal_points = _decimal_points_get(fmt);
+          }
      }
 
    eina_stringshare_replace(&sd->label, fmt);