summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-20 11:17:26 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-20 12:18:28 -0400
commit2573ad950a7a6cfb5c5e6da466adbdaeb356857a (patch)
treed47e628432e3f128c1627d4ad79a1dd2bf80fb9a /pango/pango-attributes.c
parentd1d3be80056ae846589389d46544a072e337020a (diff)
downloadpango-2573ad950a7a6cfb5c5e6da466adbdaeb356857a.tar.gz
Some code reorg
Split the itemization code into its own file, and move things around a bit.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index fdb37f56..4a141792 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -2549,6 +2549,28 @@ pango_attr_iterator_get_attrs (PangoAttrIterator *iterator)
return attrs;
}
+gboolean
+pango_attr_iterator_advance (PangoAttrIterator *iterator,
+ int index)
+{
+ int start_range, end_range;
+
+ pango_attr_iterator_range (iterator, &start_range, &end_range);
+
+ while (index >= end_range)
+ {
+ if (!pango_attr_iterator_next (iterator))
+ return FALSE;
+ pango_attr_iterator_range (iterator, &start_range, &end_range);
+ }
+
+ if (start_range > index)
+ g_warning ("pango_attr_iterator_advance(): iterator had already "
+ "moved beyond the index");
+
+ return TRUE;
+}
+
/**
* pango_attribute_as_int: