diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2021-10-08 16:45:02 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-01 21:23:38 +0000 |
commit | 2a8b75835ca48710443afa00750ae4eaa2af29e8 (patch) | |
tree | 2423e46463cc9de8c573c55fb98a4dd31a3572f9 | |
parent | d0b6ac7cb91f91c76d29c381263ba65ddc0e4b97 (diff) |
Add const to read only local variables
Change-Id: Ideb34a5009277b919a8a3834e53af4ff550dfc6e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 859f2ca1a6eeddafd0d346a5716f84a9df1acbdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index b5459022c9..469810f521 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1579,12 +1579,12 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty } if (!f) return smoothScalable; - QtFontStyle::Key styleKey(style); + const QtFontStyle::Key styleKey(style); for (int j = 0; j < f->count; j++) { QtFontFoundry *foundry = f->foundries[j]; if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) { for (int k = 0; k < foundry->count; k++) { - QtFontStyle *fontStyle = foundry->styles[k]; + const QtFontStyle *fontStyle = foundry->styles[k]; smoothScalable = fontStyle->smoothScalable && ((style.isEmpty() diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index e40f0c5fa0..03eaa9c726 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1957,7 +1957,7 @@ void QTextLine::layout_helper(int maxGlyphs) // spaces to behave as in previous Qt versions in the line breaking algorithm. // The line breaks do not currently follow the Unicode specs, but fixing this would // require refactoring the code and would cause behavioral regressions. - bool isBreakableSpace = lbh.currentPosition < eng->layoutData->string.length() + const bool isBreakableSpace = lbh.currentPosition < eng->layoutData->string.length() && attributes[lbh.currentPosition].whiteSpace && eng->layoutData->string.at(lbh.currentPosition).decompositionTag() != QChar::NoBreak; |