[pango/wip/baedert/for-master: 2/2] layotu: Avoid invalidating when setting attrs from NULL to NULL



commit 1302af45a2ead911fa81f5afae96776999b4a0a5
Author: Timm Bäder <mail baedert org>
Date:   Wed Apr 15 15:14:47 2020 +0200

    layotu: Avoid invalidating when setting attrs from NULL to NULL

 pango/pango-layout.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]