From 25df3fa83d227ae2a1c525af3d2ca9e6e5ab47a8 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 19 Mar 2010 15:07:52 +0000 Subject: [PATCH] Defer calculations we may not have to do. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33802 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 8a18dd2956..19a71ffbb9 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -344,13 +344,6 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos, return false; Paragraph const & par = text_->getPar(pit); - bool left = font.isVisibleRightToLeft(); - bool right; - if (pos == par.size()) - right = par.isRTL(bv_->buffer().params()); - else - right = displayFont(pit, pos).isVisibleRightToLeft(); - // no RTL boundary at line break: // abc|\n -> move right -> abc\n (and not: abc\n| // FED FED| FED ) @@ -360,6 +353,13 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos, || par.isSeparator(pos - 1))) return false; + bool left = font.isVisibleRightToLeft(); + bool right; + if (pos == par.size()) + right = par.isRTL(bv_->buffer().params()); + else + right = displayFont(pit, pos).isVisibleRightToLeft(); + return left != right; }