summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kudryavtsev <[email protected]>2023-10-16 16:56:34 +0300
committerAnton Kudryavtsev <[email protected]>2023-10-25 19:53:14 +0300
commit1427aa6711c260b532919b239d8a0fdba4262735 (patch)
tree8de9ea76aa50025e7b56b9caff7361143bf15fc2
parent887e18990d40c8ffbaf4764b648a96325a2a910f (diff)
Tidy up qtextlayout
- remove unused variable - port index-based loop to range-based for - use const method more to avoid implicit detach Change-Id: I223f6c221d0c6277e94efd2e7b7be0f8d8456c60 Reviewed-by: MÃ¥rten Nordheim <[email protected]>
-rw-r--r--src/gui/text/qtextlayout.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 611369951c7..8aea333e5ca 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1043,12 +1043,9 @@ QList<QGlyphRun> QTextLayout::glyphRuns(int from,
for (int i=0; i<d->lines.size(); ++i) {
if (d->lines.at(i).from > from + length)
break;
- else if (d->lines.at(i).from + d->lines[i].length >= from) {
- QList<QGlyphRun> glyphRuns = QTextLine(i, d).glyphRuns(from, length, retrievalFlags);
-
- for (int j = 0; j < glyphRuns.size(); j++) {
- const QGlyphRun &glyphRun = glyphRuns.at(j);
-
+ else if (d->lines.at(i).from + d->lines.at(i).length >= from) {
+ const QList<QGlyphRun> glyphRuns = QTextLine(i, d).glyphRuns(from, length, retrievalFlags);
+ for (const QGlyphRun &glyphRun : glyphRuns) {
QRawFont rawFont = glyphRun.rawFont();
QFontEngine *fontEngine = rawFont.d->fontEngine;
@@ -1107,7 +1104,6 @@ void QTextLayout::draw(QPainter *p, const QPointF &pos, const QList<FormatRange>
int firstLine = 0;
int lastLine = d->lines.size();
for (int i = 0; i < d->lines.size(); ++i) {
- QTextLine l(i, d);
const QScriptLine &sl = d->lines.at(i);
if (sl.y > clipe) {