summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentfragment.cpp
diff options
context:
space:
mode:
authorSafa AlFulaij <safa1996alfulaij@gmail.com>2018-01-25 09:33:09 +0300
committerSafa Alfulaij <safa1996alfulaij@gmail.com>2018-07-31 05:05:04 +0000
commitd1493b972b29e92937516b08e72a2e66ac9f349e (patch)
treec3d4abe480ccfc0da780a67e2618f48970ddfe29 /src/gui/text/qtextdocumentfragment.cpp
parent27005d3352616dbf726e047e555549872c17b12f (diff)
QTextDocumentFragment: Use logical cursor movement instead of visual
Using QTextCursor::Left and QTextCursor::Right moves the cursor visually to right or left, which does not work with Right to left text, where moving left means advancing to the next character, and vice versa. By using QTextCursor::PreviousCharacter and QTextCursor::NextCharacter we leave it up to the engine for deciding where to move depending on the context. Task-number: QTBUG-50619 Change-Id: Ibf0a886f3ff6bf9ca2c953aeff8c235612bbc01d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocumentfragment.cpp')
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index 3ad49b3f88..f0eff2d4f3 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -724,9 +724,9 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processSpecialNodes()
cursor.insertImage(fmt, QTextFrameFormat::Position(currentNode->cssFloat));
- cursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor);
+ cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
cursor.mergeCharFormat(currentNode->charFormat);
- cursor.movePosition(QTextCursor::Right);
+ cursor.movePosition(QTextCursor::NextCharacter);
compressNextWhitespace = CollapseWhiteSpace;
hasBlock = false;