diff options
author | Liang Qi <liang.qi@qt.io> | 2018-08-22 10:31:09 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-08-22 10:31:09 +0000 |
commit | 9be1256e0c337e904e0b7306126e160805ada06f (patch) | |
tree | e6a1aa2cd3a0d96a074f9670608a0b25a92aeca8 /src/gui | |
parent | dc82a0f4f3a380edfe910a78f3bdd32210975b85 (diff) | |
parent | 7533156b689c63fa26d66b3e6bacc598cb58456c (diff) |
Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 29 |
2 files changed, 21 insertions, 10 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index f5527354a2..6f8ea6dc70 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4163,7 +4163,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) const QNativeGestureEvent *ne = static_cast<const QNativeGestureEvent *>(e); dbg << "QNativeGestureEvent("; QtDebugUtils::formatQEnum(dbg, ne->gestureType()); - dbg << "localPos="; + dbg << ", localPos="; QtDebugUtils::formatQPoint(dbg, ne->localPos()); dbg << ", value=" << ne->value() << ')'; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 6826f62b61..4e9b00f9c9 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1043,19 +1043,31 @@ struct QBidiAlgorithm { } } - bool process() + bool checkForBidi() const { - memset(analysis, 0, length * sizeof(QScriptAnalysis)); - - bool hasBidi = (baseLevel != 0); - if (!hasBidi) { - for (int i = 0; i < length; ++i) { - if (text[i].unicode() >= 0x590) { - hasBidi = true; + if (baseLevel != 0) + return true; + for (int i = 0; i < length; ++i) { + if (text[i].unicode() >= 0x590) { + switch (text[i].direction()) { + case QChar::DirR: case QChar::DirAN: + case QChar::DirLRE: case QChar::DirLRO: case QChar::DirAL: + case QChar::DirRLE: case QChar::DirRLO: case QChar::DirPDF: + case QChar::DirLRI: case QChar::DirRLI: case QChar::DirFSI: case QChar::DirPDI: + return true; + default: break; } } } + return false; + } + + bool process() + { + memset(analysis, 0, length * sizeof(QScriptAnalysis)); + + bool hasBidi = checkForBidi(); if (!hasBidi) return false; @@ -2071,7 +2083,6 @@ void QTextEngine::itemize() const case QChar::Nbsp: if (option.flags() & QTextOption::ShowTabsAndSpaces) { analysis->flags = (*uc == QChar::Space) ? QScriptAnalysis::Space : QScriptAnalysis::Nbsp; - analysis->bidiLevel = bidi.baseLevel; break; } Q_FALLTHROUGH(); |