]> git.lyx.org Git - features.git/commit
Fix selection of unmarked RtL text
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 3 Nov 2018 15:55:33 +0000 (15:55 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
commitc87fe42be7bc5a8712893d3e2a3731483fbb70aa
tree77255d7fa330b687bfc055a72f3f4b8e342f6916
parent3d7b588cac7e257a3317aadd4f0e644abbc8885e
Fix selection of unmarked RtL text

With Qt 5.11 at least, RtL text will be drawn RtL even when the
(undocumented) flag Qt::TextForceLeftToRight is applied to the
QTextLayout object. This creates selection issues for Hebrew text
marked as English.

The solution is to do the same as in breakAt_helper, that is prepend
the string with a direction override unicode character.

Doing this requires to introduce a TEXTLAYOUT_OFFSET constant that has
to be used wisely to account for this extra character.

Fixes bug #11284.
src/frontends/qt4/GuiFontMetrics.cpp