struct _Evas_Object_Textblock_Node_Format
{
EINA_INLIST;
- Eina_Strbuf *format;
+ const char *format;
Evas_Object_Textblock_Node_Text *text_node;
size_t offset;
unsigned char anchor : 2;
const char *item;
int handled = 0;
- s = eina_strbuf_string_get(n->format);
+ s = n->format;
if (!strncmp(s, "+ item ", 7))
{
// one of:
if (create_item)
{
- fi = _layout_format_item_add(c, n, NULL, fmt);
+ fi = _layout_format_item_add(c, n, s, fmt);
fi->vsize = vsize;
fi->size = size;
fi->formatme = 1;
{
if (fnode->new)
{
- const char *fstr = eina_strbuf_string_get(fnode->format);
+ const char *fstr = fnode->format;
/* balance < 0 means we gave up and everything should be
* invalidated */
if (*fstr == '+')
const char *tag;
const char *replace;
- replace_len = eina_strbuf_length_get(fnode->format);
- replace = eina_strbuf_string_get(fnode->format);
+ replace_len = strlen(fnode->format);
+ replace = fnode->format;
tag = _style_match_replace(o->style, replace, replace_len, &tag_len);
eina_strbuf_append_char(txt, '<');
if (tag)
int pop = 0;
// FIXME: need to escape
- s = eina_strbuf_string_get(fnode->format);
+ s = fnode->format;
if (*s == '+') push = 1;
if (*s == '-') pop = 1;
while ((*s == ' ') || (*s == '+') || (*s == '-')) s++;
do
{
- const char *fstr = eina_strbuf_string_get(fmt->format);
+ const char *fstr = fmt->format;
if (fstr && (*fstr == '+'))
{
if (n->visible)
{
size_t ind = _evas_textblock_node_format_pos_get(n);
- const char *format = eina_strbuf_string_get(n->format);
+ const char *format = n->format;
Evas_Textblock_Cursor cur;
cur.obj = obj;
do
{
Evas_Object_Textblock_Node_Format *nnode;
- const char *fstr = eina_strbuf_string_get(fmt->format);
+ const char *fstr = fmt->format;
nnode = _NODE_FORMAT(EINA_INLIST_GET(fmt)->next);
if (nnode)
if (!itr || (itr && (itr->text_node != n)))
{
/* Remove the PS, and return since it's the end of the node */
- if (_IS_PARAGRAPH_SEPARATOR(o,
- eina_strbuf_string_get(last_node->format)))
+ if (_IS_PARAGRAPH_SEPARATOR(o, last_node->format))
{
_evas_textblock_node_format_remove(o, last_node, 0);
return EINA_TRUE;
Evas_Object_Textblock_Node_Format *n)
{
if (!n) return;
- eina_strbuf_free(n->format);
+ eina_stringshare_del(n->format);
if (n->anchor == ANCHOR_ITEM)
o->anchors_item = eina_list_remove(o->anchors_item, n);
else if (n->anchor == ANCHOR_A)
Evas_Object_Textblock_Node_Format *n;
n = calloc(1, sizeof(Evas_Object_Textblock_Node_Format));
- n->format = eina_strbuf_new();
- eina_strbuf_append(n->format, format);
+ n->format = eina_stringshare_add(format);
_evas_textblock_format_is_visible(n, format);
if (n->anchor == ANCHOR_A)
{
Evas_Object_Textblock_Node_Format *last_fmt;
/* If there's a PS it must be the last become it delimits paragraphs */
last_fmt = _evas_textblock_node_format_last_at_off(fmt);
- format = eina_strbuf_string_get(last_fmt->format);
+ format = last_fmt->format;
if (format && _IS_PARAGRAPH_SEPARATOR(o, format))
{
merge_nodes = 1;
evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fmt)
{
if (!fmt) return NULL;
- return eina_strbuf_string_get(fmt->format);
+ return fmt->format;
}
EAPI void
fmt = _evas_textblock_cursor_node_format_at_pos_get(&cur2);
- if (!fmt ||
- !_IS_LINE_SEPARATOR(eina_strbuf_string_get(fmt->format)))
+ if (!fmt || !_IS_LINE_SEPARATOR(fmt->format))
{
dir_cur = &cur2;
before_char = EINA_FALSE;