From ffefbe466100f72eed7ce760512253f0b90786fe Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 2 Apr 2009 10:28:37 +0100 Subject: [PATCH] [text] Avoid a Pango warning with empty markup When the markup string is empty Pango complains about invalid characters. --- clutter/clutter-text.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index 74d943f11..9ece4b8d7 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -3213,7 +3213,8 @@ clutter_text_set_markup_internal (ClutterText *self, /** * clutter_text_set_text: * @self: a #ClutterText - * @text: the text to set. Passing %NULL is the same as passing "" (the empty string) + * @text: the text to set. Passing %NULL is the same as passing "" (the + * empty string) * * Sets the contents of a #ClutterText actor. * @@ -3236,7 +3237,8 @@ clutter_text_set_text (ClutterText *self, /** * clutter_text_set_markup: * @self: a #ClutterText - * @markup: a string containing Pango markup. Passing %NULL is the same as passing "" (the empty string) + * @markup: a string containing Pango markup. Passing %NULL is the same + * as passing "" (the empty string) * * Sets @markup as the contents of a #ClutterText. * @@ -3257,7 +3259,11 @@ clutter_text_set_markup (ClutterText *self, g_return_if_fail (CLUTTER_IS_TEXT (self)); clutter_text_set_use_markup_internal (self, TRUE); - clutter_text_set_markup_internal (self, markup ? markup : ""); + + if (markup != NULL && *markup != '\0') + clutter_text_set_markup_internal (self, markup); + else + clutter_text_set_text_internal (self, ""); clutter_text_dirty_cache (self);