]> 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>
Sun, 4 Nov 2018 08:23:49 +0000 (08:23 +0000)
commit1bed76e2a1057ab2f3f33f01ec23956653265d4a
tree77255d7fa330b687bfc055a72f3f4b8e342f6916
parent76e99e9a20cf635d20effa597551f3a9af484465
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