[pango/hyphen-crash] Drop some leftover code



commit 8ec0d2b23ab87cc686cffd2708d547c0ec7dcc85
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 2 17:55:38 2019 +0100

    Drop some leftover code
    
    In d6bc8daa6935b53c1, we added code to remove "hyphen runs".
    But we no longer create such runs, so this code is harmful
    and can cause crashes under certain circumstances.
    
    Closes: https://gitlab.gnome.org/GNOME/pango/issues/418

 pango/pango-layout.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 7404dd77..b63d8cbe 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2992,8 +2992,7 @@ free_run (PangoLayoutRun *run, gpointer data)
 static PangoItem *
 uninsert_run (PangoLayoutLine *line)
 {
-  PangoLayout *layout = line->layout;
-  PangoLayoutRun *run, *prev;
+  PangoLayoutRun *run;
   PangoItem *item;
 
   GSList *tmp_node = line->runs;
@@ -3004,18 +3003,6 @@ uninsert_run (PangoLayoutLine *line)
   line->runs = tmp_node->next;
   line->length -= item->length;
 
-  if (item->length == 2 &&
-      strncmp (layout->text + run->item->offset, "\302\255", 2) == 0)
-    {
-      /* this is a hyphen run, add the SHY back
-       * to the previous item
-       */
-      prev = line->runs->data;
-      item = prev->item;
-      item->length += 2;
-      item->num_chars += 1;
-    }
-
   g_slist_free_1 (tmp_node);
   free_run (run, (gpointer)FALSE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]