text: Consistently protect against NULL strings
When calling clutter_text_set_text_internal() or clutter_text_set_markup_internal() we need to make sure to pass a non-NULL string.
This commit is contained in:
parent
c3e8d30afa
commit
320bdeac03
@ -1186,10 +1186,11 @@ clutter_text_set_property (GObject *gobject,
|
|||||||
const char *str = g_value_get_string (value);
|
const char *str = g_value_get_string (value);
|
||||||
|
|
||||||
clutter_text_set_contents (self, str);
|
clutter_text_set_contents (self, str);
|
||||||
|
|
||||||
if (self->priv->use_markup)
|
if (self->priv->use_markup)
|
||||||
clutter_text_set_markup_internal (self, str);
|
clutter_text_set_markup_internal (self, str ? str : "");
|
||||||
else
|
else
|
||||||
clutter_text_set_text_internal (self, str);
|
clutter_text_set_text_internal (self, str ? str : "");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4508,6 +4509,7 @@ clutter_text_set_text (ClutterText *self,
|
|||||||
* Pango markup, and it is logically equivalent to:
|
* Pango markup, and it is logically equivalent to:
|
||||||
*
|
*
|
||||||
* |[
|
* |[
|
||||||
|
* /* the order is important */
|
||||||
* clutter_text_set_text (CLUTTER_TEXT (actor), markup);
|
* clutter_text_set_text (CLUTTER_TEXT (actor), markup);
|
||||||
* clutter_text_set_use_markup (CLUTTER_TEXT (actor), TRUE);
|
* clutter_text_set_use_markup (CLUTTER_TEXT (actor), TRUE);
|
||||||
* ]|
|
* ]|
|
||||||
@ -4522,11 +4524,7 @@ clutter_text_set_markup (ClutterText *self,
|
|||||||
|
|
||||||
clutter_text_set_use_markup_internal (self, TRUE);
|
clutter_text_set_use_markup_internal (self, TRUE);
|
||||||
clutter_text_set_contents (self, markup);
|
clutter_text_set_contents (self, markup);
|
||||||
|
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, "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user