summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-27 09:52:26 +0200
committerLars Knoll <lars.knoll@qt.io>2020-09-07 09:09:55 +0200
commit0ae5b8af9c2af514f316211b71a03defc0f1b65a (patch)
treeaad4383be07eb65617fbe9fb99098164b7e2560f /src/gui/text
parentfae4f80ecc0974257c96c64221f245bdae6178f5 (diff)
Clean up QTextBoundaryFinder and qunicodetools
Make QTBF ready for Qt6 by using qsizetype in the API and use QStringView where it makes sense. Change the exported API of qunicodetools to use QStringView as well and use char16_t internally. Change-Id: I853537bcabf40546a8e60fdf2ee7d751bc371761 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 9e104e118e..074771beaa 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1808,8 +1808,7 @@ const QCharAttributes *QTextEngine::attributes() const
}
QUnicodeTools::initCharAttributes(
- reinterpret_cast<const ushort *>(layoutData->string.constData()),
- layoutData->string.length(),
+ layoutData->string,
scriptItems.data(), scriptItems.size(),
reinterpret_cast<QCharAttributes *>(layoutData->memory),
QUnicodeTools::CharAttributeOptions(QUnicodeTools::GraphemeBreaks
@@ -1921,7 +1920,7 @@ void QTextEngine::itemize() const
{
QUnicodeTools::ScriptItemArray scriptItems;
- QUnicodeTools::initScripts(string, length, &scriptItems);
+ QUnicodeTools::initScripts(layoutData->string, &scriptItems);
for (int i = 0; i < scriptItems.length(); ++i) {
const auto &item = scriptItems.at(i);
int end = i < scriptItems.length() - 1 ? scriptItems.at(i + 1).position : length;