[pango/wip/baedert/for-master] attributes: Add _pango_attr_list_has_attributes



commit 9a0623fdf014dd978a5765cc6d637f5881c42a84
Author: Timm Bäder <mail baedert org>
Date:   Fri Apr 17 08:21:36 2020 +0200

    attributes: Add _pango_attr_list_has_attributes
    
    A private function to find empty attribute lists

 pango/pango-attributes-private.h | 2 ++
 pango/pango-attributes.c         | 6 ++++++
 2 files changed, 8 insertions(+)
---
diff --git a/pango/pango-attributes-private.h b/pango/pango-attributes-private.h
index efeb88cd..b913cc2f 100644
--- a/pango/pango-attributes-private.h
+++ b/pango/pango-attributes-private.h
@@ -37,6 +37,8 @@ struct _PangoAttrList
 
 void     _pango_attr_list_init         (PangoAttrList     *list);
 void     _pango_attr_list_destroy      (PangoAttrList     *list);
+gboolean _pango_attr_list_has_attributes (const PangoAttrList *list);
+
 void     _pango_attr_list_get_iterator (PangoAttrList     *list,
                                         PangoAttrIterator *iterator);
 
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 174dfaa1..79c58466 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1913,6 +1913,12 @@ pango_attr_list_get_attributes (PangoAttrList *list)
   return g_slist_copy_deep (list->attributes, (GCopyFunc)pango_attribute_copy, NULL);
 }
 
+gboolean
+_pango_attr_list_has_attributes (const PangoAttrList *list)
+{
+  return (list->attributes != NULL);
+}
+
 G_DEFINE_BOXED_TYPE (PangoAttrIterator,
                      pango_attr_iterator,
                      pango_attr_iterator_copy,


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