_evas_textblock_node_format_remove(o, fmt, 0);
}
/* Find the matching format and pop it, if the matching format
- * is out format, i.e the last one, pop and break. */
+ * is our format, i.e the last one, pop and break. */
else
{
- Eina_List *i;
- EINA_LIST_FOREACH(formats, i, fnode)
+ Eina_List *i, *next;
+ EINA_LIST_FOREACH_SAFE(formats, i, next, fnode)
{
if (_FORMAT_IS_CLOSER_OF(
fnode->orig_format, fstr, fstr_len))
formats = eina_list_remove_list(formats, i);
_evas_textblock_node_format_remove(o, fnode, 0);
_evas_textblock_node_format_remove(o, fmt, 0);
+ break;
}
}
}
fnode = evas_textblock_node_format_next_get(fnode);
fail_if (fnode);
+ /* Remove two pairs with the same name and same positions. */
+ evas_object_textblock_text_markup_set(tb, "<a><a>A</a></a>");
+ evas_textblock_cursor_pos_set(cur, 0);
+ evas_textblock_cursor_char_delete(cur);
+
+ fnode = evas_textblock_node_format_first_get(tb);
+ fail_if (fnode);
+
/* Try to remove a format that doesn't have a pair (with a bad mkup) */
evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</>d</i>e");
evas_textblock_cursor_pos_set(cur, 2);