From c1c713119990f222b6d48ab52ca78c1e383ac332 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 7 Jan 2009 13:48:45 +0000 Subject: [PATCH] [text] Do not use markup on an editable Text An editable ClutterText should not use pango_layout_set_markup(), as the contents of the text actor will not match the text. Only read-only text actors should parse the contents for Pango markup. --- clutter/clutter-text.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 56db985ef..9f3800354 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -262,7 +262,9 @@ clutter_text_create_layout_no_cache (ClutterText *text, if (priv->text) { - if (!priv->use_markup) + if (priv->use_markup && !priv->editable) + pango_layout_set_markup (layout, priv->text, -1); + else { if (G_LIKELY (priv->password_char == 0)) pango_layout_set_text (layout, priv->text, priv->n_bytes); @@ -290,8 +292,6 @@ clutter_text_create_layout_no_cache (ClutterText *text, g_string_free (str, TRUE); } } - else - pango_layout_set_markup (layout, priv->text, -1); } if (allocation_width > 0 && @@ -3145,6 +3145,9 @@ clutter_text_get_alignment (ClutterText *self) * Sets whether the contents of the #ClutterText actor contains markup * in Pango's text markup language. * + * Calling this function on an editable #ClutterText will not cause + * the actor to parse any markup. + * * Since: 1.0 */ void