From: Richard Heck Date: Fri, 19 Mar 2010 15:07:52 +0000 (+0000) Subject: Defer calculations we may not have to do. X-Git-Tag: 2.0.0~3757 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=25df3fa83d227ae2a1c525af3d2ca9e6e5ab47a8;p=features.git 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 --- 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; }