Edje_Edit: allow set NULL as a style name for textblock part. 65/82065/2
authorMykyta Biliavskyi <m.biliavskyi@samsung.com>
Tue, 5 Jul 2016 17:18:32 +0000 (20:18 +0300)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 3 Aug 2016 09:26:20 +0000 (02:26 -0700)
NULL as 'style' value remove style name from textblock part state.

Change-Id: I8473a1e6472cc3e20dadba36d2a23be0d99c720c

src/lib/edje/Edje_Edit.h
src/lib/edje/edje_edit.c

index 1e66569..41ca4ee 100644 (file)
@@ -5822,7 +5822,8 @@ EAPI const char * edje_edit_state_text_style_get(Evas_Object *obj, const char *p
  * @param part Part to set the style of.
  * @param state State in which the style is set.
  * @param value Value of the state.
- * @param style The style name to use.
+ * @param style The style name to use. In case when NULL style will removed from textblock part description.
+ *
  *
  * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
  */
index 85851b0..2b39dc8 100644 (file)
@@ -8134,7 +8134,15 @@ edje_edit_state_text_style_set(Evas_Object *obj, const char *part, const char *s
      return EINA_FALSE;
 
    txt = (Edje_Part_Description_Text *)pd;
-   _edje_if_string_replace(ed, &txt->text.style.str, style);
+   if (style == NULL )
+     {
+        _edje_if_string_free(ed, &txt->text.style.str);
+        txt->text.style.str = NULL;
+     }
+   else
+     {
+        _edje_if_string_replace(ed, &txt->text.style.str, style);
+     }
 
    edje_object_calc_force(obj);
    return EINA_TRUE;