[pango/wip/baedert/for-master2: 9/17] attributes: Add _pango_attr_list_has_attributes



commit a79e38a784430af97c6b9423f63fc89f90482da2
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 5ac955c4..84d24838 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1989,6 +1989,12 @@ pango_attr_list_equal (PangoAttrList *list,
   return TRUE;
 }
 
+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]