diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-26 01:01:32 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-26 01:01:32 +0200 |
commit | 7b3bdcbfe8a920c4c156e91324eb0b374533d42c (patch) | |
tree | 726ee71fc1be50cdda04cdc88a1447599f9d74ae /src/gui/text | |
parent | dff3843d98d52e2c32fea07371f91117de0667e9 (diff) | |
parent | 9d504e1150e4bd49d34aba5cee938d1fd9f7e80c (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 8 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 24 |
2 files changed, 13 insertions, 19 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 7be114adf9..ed23a4d8d9 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2088,8 +2088,12 @@ void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *pain tl->draw(painter, offset, selections, context.clip.isValid() ? (context.clip & clipRect) : clipRect); - if ((context.cursorPosition >= blpos && context.cursorPosition < blpos + bllen) - || (context.cursorPosition < -1 && !tl->preeditAreaText().isEmpty())) { + // if the block is empty and it precedes a table, do not draw the cursor. + // the cursor is drawn later after the table has been drawn so no need + // to draw it here. + if (!isEmptyBlockBeforeTable(frameIteratorForTextPosition(blpos)) + && ((context.cursorPosition >= blpos && context.cursorPosition < blpos + bllen) + || (context.cursorPosition < -1 && !tl->preeditAreaText().isEmpty()))) { int cpos = context.cursorPosition; if (cpos < -1) cpos = tl->preeditAreaPosition() - (cpos + 2); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b37353bf2c..209433dac5 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2125,22 +2125,7 @@ void QTextEngine::itemize() const } #if QT_CONFIG(harfbuzz) analysis = scriptAnalysis.data(); - if (qt_useHarfbuzzNG()) { - // ### pretend HB-old behavior for now - for (int i = 0; i < length; ++i) { - switch (analysis[i].script) { - case QChar::Script_Latin: - case QChar::Script_Hiragana: - case QChar::Script_Katakana: - case QChar::Script_Bopomofo: - case QChar::Script_Han: - analysis[i].script = QChar::Script_Common; - break; - default: - break; - } - } - } else { + if (!qt_useHarfbuzzNG()) { for (int i = 0; i < length; ++i) analysis[i].script = hbscript_to_script(script_to_hbscript(analysis[i].script)); } @@ -3619,7 +3604,12 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, int clusterLength = 0; if (si->analysis.script != QChar::Script_Common && - si->analysis.script != QChar::Script_Greek) { + si->analysis.script != QChar::Script_Greek && + si->analysis.script != QChar::Script_Latin && + si->analysis.script != QChar::Script_Hiragana && + si->analysis.script != QChar::Script_Katakana && + si->analysis.script != QChar::Script_Bopomofo && + si->analysis.script != QChar::Script_Han) { if (glyph_pos == -1) return si->position + end; else { |