summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-04-15 15:14:47 +0200
committerTimm Bäder <mail@baedert.org>2020-06-08 19:15:44 +0200
commit62fd1b58c79e11077ac8b03c2eeaae3cec84e976 (patch)
treeec5488f1b0beef85714912195a989483b19b6f6d /pango/pango-layout.c
parent99431a5ce902ec6410ca4e73d49df8127405a97a (diff)
downloadpango-62fd1b58c79e11077ac8b03c2eeaae3cec84e976.tar.gz
layotu: Avoid invalidating when setting attrs from NULL to NULL
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 24b492fe..7a25494b 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -679,11 +679,15 @@ pango_layout_get_line_spacing (PangoLayout *layout)
**/
void
pango_layout_set_attributes (PangoLayout *layout,
- PangoAttrList *attrs)
+ PangoAttrList *attrs)
{
PangoAttrList *old_attrs;
+
g_return_if_fail (layout != NULL);
+ if (!attrs && !layout->attrs)
+ return;
+
old_attrs = layout->attrs;
/* We always clear lines such that this function can be called