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
This commit is contained in:
Richard Heck 2010-03-19 15:07:52 +00:00
parent 72d110bb6e
commit 25df3fa83d

View File

@ -344,13 +344,6 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos,
return false; return false;
Paragraph const & par = text_->getPar(pit); 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: // no RTL boundary at line break:
// abc|\n -> move right -> abc\n (and not: abc\n| // abc|\n -> move right -> abc\n (and not: abc\n|
// FED FED| FED ) // FED FED| FED )
@ -360,6 +353,13 @@ bool TextMetrics::isRTLBoundary(pit_type pit, pos_type pos,
|| par.isSeparator(pos - 1))) || par.isSeparator(pos - 1)))
return false; 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; return left != right;
} }