mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
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:
parent
72d110bb6e
commit
25df3fa83d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user