summaryrefslogtreecommitdiff
path: root/pango/pango-lines.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-25 08:16:55 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-25 15:31:25 -0500
commitec2958682949220f15a32066eff412d857c735c5 (patch)
tree339adf374dfa447b80a8e8470c904aed7064bd52 /pango/pango-lines.c
parent342a0265b3992925105d04b1ef22cda6a7fa8786 (diff)
downloadpango-ec2958682949220f15a32066eff412d857c735c5.tar.gz
line: Don't return GSList
Change pango_line_get_runs to return an array. So far, this changes just the API. All internals are still done on the list.
Diffstat (limited to 'pango/pango-lines.c')
-rw-r--r--pango/pango-lines.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pango/pango-lines.c b/pango/pango-lines.c
index 2d5fea44..95a12ce9 100644
--- a/pango/pango-lines.c
+++ b/pango/pango-lines.c
@@ -3,6 +3,7 @@
#include "pango-lines-private.h"
#include "pango-line-private.h"
#include "pango-item-private.h"
+#include "pango-run-private.h"
#include "pango-line-iter-private.h"
/**
@@ -621,9 +622,9 @@ pango_lines_get_x_ranges (PangoLines *lines,
}
accumulated_width = 0;
- for (GSList *l = pango_line_get_runs (line); l; l = l->next)
+ for (int i = 0; i < pango_line_get_run_count (line); i++)
{
- PangoGlyphItem *run = l->data;
+ PangoGlyphItem *run = pango_run_get_glyph_item (pango_line_get_runs (line)[i]);
if ((start_index < run->item->offset + run->item->length &&
end_index > run->item->offset))
@@ -668,7 +669,7 @@ pango_lines_get_x_ranges (PangoLines *lines,
range_count++;
- if (l->next)
+ if (i + 1 < pango_line_get_run_count (line))
accumulated_width += pango_glyph_string_get_width (run->glyphs);
}