diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-20 11:17:26 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-20 12:18:28 -0400 |
commit | 2573ad950a7a6cfb5c5e6da466adbdaeb356857a (patch) | |
tree | d47e628432e3f128c1627d4ad79a1dd2bf80fb9a /pango/pango-attributes.c | |
parent | d1d3be80056ae846589389d46544a072e337020a (diff) | |
download | pango-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.c | 22 |
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: |