From be740f85439e4f2aa5e74173a1fc31ca32c0c653 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 19 Oct 2008 07:31:10 +0000 Subject: [PATCH] Bidi::computeTables(): avoid a Font instantiation for each char. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26959 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Bidi.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Bidi.cpp b/src/Bidi.cpp index d00b8eb72d..4470e755f1 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -109,17 +109,18 @@ void Bidi::computeTables(Paragraph const & par, !par.isLineSeparator(lpos + 1) && !par.isNewline(lpos + 1)) ? lpos + 1 : lpos; - Font font = par.getFontSettings(bufparams, pos); - if (pos != lpos && 0 < lpos && rtl0 && font.isRightToLeft() && - font.fontInfo().number() == FONT_ON && + + Font const * font = &(par.getFontSettings(bufparams, pos)); + if (pos != lpos && 0 < lpos && rtl0 && font->isRightToLeft() && + font->fontInfo().number() == FONT_ON && par.getFontSettings(bufparams, lpos - 1).fontInfo().number() == FONT_ON) { - font = par.getFontSettings(bufparams, lpos); + font = &(par.getFontSettings(bufparams, lpos)); is_space = false; } + bool new_rtl = font->isVisibleRightToLeft(); + bool new_rtl0 = font->isRightToLeft(); - bool new_rtl = font.isVisibleRightToLeft(); - bool new_rtl0 = font.isRightToLeft(); int new_level; if (lpos == body_pos - 1 -- 2.39.2