[text] Do not use markup on an editable Text
authorEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 7 Jan 2009 13:48:45 +0000 (13:48 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 7 Jan 2009 13:48:45 +0000 (13:48 +0000)
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

index 56db985..9f38003 100644 (file)
@@ -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 <link linkend="PangoMarkupFormat">Pango's text markup language</link>.
  *
+ * Calling this function on an editable #ClutterText will not cause
+ * the actor to parse any markup.
+ *
  * Since: 1.0
  */
 void