diff options
author | Liang Qi <liang.qi@qt.io> | 2020-05-18 08:52:33 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2020-05-18 08:52:33 +0200 |
commit | 2cd6d76d680b1bddef774acc51d80da9e29f1c2e (patch) | |
tree | 69f2aac58f25223910debd0f20b9d5550c69541c /src/gui/text/qtextdocumentlayout.cpp | |
parent | b800f3039a754f67466df5e195e70ea2821f9404 (diff) | |
parent | 786ae0141a524c66e01e652aed0e6ed4c97d08bc (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
src/corelib/text/qbytearray.cpp
Change-Id: I63706409464d31391012bacdadfd1f6300509787
Diffstat (limited to 'src/gui/text/qtextdocumentlayout.cpp')
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index e5731bcfab..fc61ee50bb 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -105,13 +105,14 @@ public: bool sizeDirty; bool layoutDirty; + bool fullLayoutCompleted; QVector<QPointer<QTextFrame> > floats; }; QTextFrameData::QTextFrameData() : maximumWidth(QFIXED_MAX), - currentLayoutStruct(nullptr), sizeDirty(true), layoutDirty(true) + currentLayoutStruct(nullptr), sizeDirty(true), layoutDirty(true), fullLayoutCompleted(false) { } @@ -2943,7 +2944,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in QTextFrameData *fd = data(f); QFixed newContentsWidth; - bool fullLayout = false; + bool fullLayout = (f == document->rootFrame() && !fd->fullLayoutCompleted); { QTextFrameFormat fformat = f->frameFormat(); // set sizes of this frame from the format @@ -3397,6 +3398,7 @@ void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayout cp.contentsWidth = layoutStruct->contentsWidth; checkPoints.append(cp); checkPoints.reserve(checkPoints.size()); + fd->fullLayoutCompleted = true; } else { currentLazyLayoutPosition = checkPoints.constLast().positionInFrame; // ####### @@ -3808,6 +3810,7 @@ void QTextDocumentLayout::documentChanged(int from, int oldLength, int length) d->contentHasAlignment = false; d->currentLazyLayoutPosition = 0; d->checkPoints.clear(); + data(d->docPrivate->rootFrame())->fullLayoutCompleted = false; d->layoutStep(); } else { d->ensureLayoutedByPosition(from); |