Merge "[copy&paste] add interface for OSP"
[framework/uifw/elementary.git] / src / lib / elm_datetime.c
index 6f65f74..8736e8d 100644 (file)
@@ -325,7 +325,7 @@ _theme_hook(Evas_Object *obj)
              snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR, field->location);
              edje_object_signal_emit(wd->base, buf, "elm");
              snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, field->location);
-             edje_object_part_text_set(wd->base, buf, field->separator);
+             edje_object_part_text_escaped_set(wd->base, buf, field->separator);
              dt_mod->field_value_display(wd->mod_data, field->item_obj);
           }
         else
@@ -642,7 +642,7 @@ _parse_format(Evas_Object *obj, char *fmt_ptr)
 {
    Widget_Data *wd;
    Datetime_Field *field = NULL;
-   unsigned int len = 0, idx, location = 0;
+   unsigned int len = 0, idx = 0, location = 0;
    char separator[MAX_SEPARATOR_LEN];
    char cur;
    Eina_Bool fmt_parsing = EINA_FALSE, sep_parsing = EINA_FALSE,
@@ -681,7 +681,7 @@ _parse_format(Evas_Object *obj, char *fmt_ptr)
              if (field) eina_stringshare_replace(&field->separator, separator);
           }
 
-        // ignore the set of chars (global, field specific).
+        // ignore the set of chars (global, field specific) as field separators.
         if (sep_parsing && (len < MAX_SEPARATOR_LEN - 1) &&
             (field->type != ELM_DATETIME_AMPM) && (!strchr(ignore_separators, cur)) &&
             (!strchr(mapping[idx].ignore_sep, cur)))
@@ -716,6 +716,7 @@ _reload_format(Evas_Object *obj)
 #endif
 
    dt_fmt = (char *)malloc(MAX_FORMAT_LEN);
+   if (!dt_fmt) return;
    strncpy(dt_fmt, wd->format, MAX_FORMAT_LEN);
 
    _expand_format(dt_fmt);
@@ -750,7 +751,7 @@ _reload_format(Evas_Object *obj)
              edje_object_signal_emit(wd->base, buf, "elm");
           }
         snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, (field->location + 1));
-        edje_object_part_text_set(wd->base, buf, field->separator);
+        edje_object_part_text_escaped_set(wd->base, buf, field->separator);
      }
    edje_object_message_signal_process(wd->base);
    _field_list_arrange(obj);