From: Jean-Marc Lasgouttes Date: Thu, 6 Apr 2017 13:05:19 +0000 (+0200) Subject: Set boundary correctly in getPosNearX X-Git-Tag: 2.2.4~133 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ff9732462114b939f330f88689ba36d61fde3b8f;p=features.git Set boundary correctly in getPosNearX The code that looks whether neighbor block has a different direction should look to the left or to the right depending on the direction of the current block. Fixes part of bug #10569 (cherry picked from commit e3d252cd6256b32745b93c0cb0fd5170f448f91c) --- diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 0629c1e0cf..68fcb3c13d 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1181,8 +1181,10 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x, * how boundary helps here. */ else if (pos == cit->endpos - && cit + 1 != row.end() - && cit->isRTL() != (cit + 1)->isRTL()) + && ((!cit->isRTL() && cit + 1 != row.end() + && (cit + 1)->isRTL()) + || (cit->isRTL() && cit != row.begin() + && !(cit - 1)->isRTL()))) boundary = true; }