Use pango api better
authorMatthias Clasen <mclasen@redhat.com>
Sun, 23 Jan 2022 14:55:46 +0000 (09:55 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 23 Jan 2022 14:55:46 +0000 (09:55 -0500)
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.#

gtk/gtktextutil.c

index 6570994bb219481dab7ba4c53a5677a767d420ed..75f081732a6642404b839b98911a684f807041da 100644 (file)
@@ -50,7 +50,9 @@ append_n_lines (GString *str, const char *text, GSList *lines, int n_lines)
   for (i = 0; i < n_lines; i++)
     {
       line = lines->data;
-      g_string_append_len (str, &text[line->start_index], line->length);
+      g_string_append_len (str,
+                           &text[pango_layout_line_get_start_index (line)],
+                           pango_layout_line_get_length (line));
       lines = lines->next;
     }
 }