From 3e92a78332daf205a53e4ea28c18bccea3dcfcf9 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Wed, 22 Feb 2017 21:24:48 +0000 Subject: [PATCH] =?UTF-8?q?TextView=E2=80=94Avoid=20pointless=20Pango=20in?= =?UTF-8?q?=20iter=5Fline=5Fis=5Frtl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get the direction that was already worked out and stored in the TextLineDisplay, rather than making Pango figure it out again. https://bugzilla.gnome.org/show_bug.cgi?id=136059 --- gtk/gtktextview.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 01ccd9063f..87f0cb9917 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -5072,12 +5072,11 @@ iter_line_is_rtl (GtkTextIter *iter, GtkTextLayout *layout) { GtkTextLine *line = _gtk_text_iter_get_text_line (iter); GtkTextLineDisplay *display = gtk_text_layout_get_line_display (layout, line, FALSE); - const gchar *text = pango_layout_get_text (display->layout); - PangoDirection pango_dir = pango_find_base_dir (text, -1); + GtkTextDirection direction = display->direction; gtk_text_layout_free_line_display (layout, display); - return pango_dir == PANGO_DIRECTION_RTL; + return direction == GTK_TEXT_DIR_RTL; } static void