int l, r, t, b;
} style_pad;
double valign;
- char *markup_text;
+ Eina_Stringshare *markup_text;
void *engine_data;
const char *repch;
const char *bidi_delimiters;
Evas_Textblock_Style *old_ts;
if (o->markup_text)
{
- free(o->markup_text);
+ eina_stringshare_del(o->markup_text);
o->markup_text = NULL;
}
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
evas_object_async_block(obj);
- if ((text != o->markup_text) && (o->markup_text))
+
{
- free(o->markup_text);
- o->markup_text = NULL;
+ text = eina_stringshare_add(text);
+ if (text == o->markup_text)
+ {
+ /* Text is the same, do nothing. */
+ return;
+ }
}
_nodes_clear(eo_obj);
EINA_INLIST_GET(o->text_nodes),
EINA_INLIST_GET(o->cursor->node)));
- if (!o->style && !o->style_user)
- {
- if (text != o->markup_text)
- {
- if (text) o->markup_text = strdup(text);
- }
- return;
- }
-
evas_textblock_cursor_paragraph_first(o->cursor);
evas_object_textblock_text_markup_prepend(o->cursor, text);
EINA_LIST_FOREACH(o->cursors, l, data)
evas_textblock_cursor_paragraph_first(data);
}
+
+ o->markup_text = text;
}
EAPI void
free(text_base);
}
- (((Evas_Textblock_Data *)o)->markup_text) = eina_strbuf_string_steal(txt);
+ (((Evas_Textblock_Data *)o)->markup_text) = eina_stringshare_add(eina_strbuf_string_get(txt));
eina_strbuf_free(txt);
markup = (o->markup_text);
o->content_changed = 1;
if (o->markup_text)
{
- free(o->markup_text);
+ eina_stringshare_del(o->markup_text);
o->markup_text = NULL;
}