[gtk+/gtk-3-22] TextView—Avoid pointless Pango in iter_line_is_rtl
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] TextView—Avoid pointless Pango in iter_line_is_rtl
- Date: Wed, 22 Feb 2017 21:34:28 +0000 (UTC)
commit 03429df872a80e6be9cbc00615118ebe6bed8c60
Author: Daniel Boles <dboles src gnome org>
Date: Wed Feb 22 21:24:48 2017 +0000
TextView—Avoid pointless Pango in iter_line_is_rtl
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 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 2a9f20a..47f1c68 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -6421,12 +6421,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]