]> git.lyx.org Git - features.git/commitdiff
Set boundary correctly in getPosNearX
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 6 Apr 2017 13:05:19 +0000 (15:05 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 May 2017 08:59:24 +0000 (10:59 +0200)
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)

src/TextMetrics.cpp

index 0629c1e0cf16c2d100c22b381ed025eff78bae1f..68fcb3c13df079ccbc5857700ed061b7c8155793 100644 (file)
@@ -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;
        }