[text] Do not apply unset preedit attributes

The pre-edit attributes are optional and thus should only be applied
if they have been set to avoid assertion failures.
This commit is contained in:
Emmanuele Bassi 2009-09-19 09:18:06 +01:00 committed by Emmanuele Bassi
parent 2883728387
commit 6f43f4b805

View File

@ -312,11 +312,14 @@ clutter_text_create_layout_no_cache (ClutterText *text,
pango_layout_set_text (layout, tmp->str, tmp->len);
pango_attr_list_splice (tmp_attrs, priv->preedit_attrs,
cursor_index,
strlen (priv->preedit_str));
if (priv->preedit_attrs != NULL)
{
pango_attr_list_splice (tmp_attrs, priv->preedit_attrs,
cursor_index,
strlen (priv->preedit_str));
pango_layout_set_attributes (layout, tmp_attrs);
pango_layout_set_attributes (layout, tmp_attrs);
}
g_string_free (tmp, TRUE);
pango_attr_list_unref (tmp_attrs);