summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@remarkable.com>2021-01-06 11:17:01 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-07 18:05:08 +0000
commit4460711a802b4dfb6a9e71666185b15c59fb2e3a (patch)
tree1d2389224d89d6469409e780874617427328fb5e /src
parent062d42e355693a6d66bbd1ffb897cc85e69f41ac (diff)
Revert "Fix invalid text layout data when a full layout run is interrupted"
This reverts commit 09ee4282e5eedf5b44245e8b28b223339f87ddfa. The commit made the layouting time go from linear to quadratic, which is problematic when rendering big documents impractical. I wrote an alternative fix for QTBUG-20354 which will come as separate change since it approaches the problem in a different way. Fixes: QTBUG-89599 Task-number: QTBUG-20354 Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit a62fa9b7cc520f3548356182bf5d6642c05be204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 7a46ae4ce9..141fe0eba5 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -105,14 +105,13 @@ public:
bool sizeDirty;
bool layoutDirty;
- bool fullLayoutCompleted;
QList<QPointer<QTextFrame>> floats;
};
QTextFrameData::QTextFrameData()
: maximumWidth(QFIXED_MAX),
- currentLayoutStruct(nullptr), sizeDirty(true), layoutDirty(true), fullLayoutCompleted(false)
+ currentLayoutStruct(nullptr), sizeDirty(true), layoutDirty(true)
{
}
@@ -2944,7 +2943,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
QTextFrameData *fd = data(f);
QFixed newContentsWidth;
- bool fullLayout = (f == document->rootFrame() && !fd->fullLayoutCompleted);
+ bool fullLayout = false;
{
QTextFrameFormat fformat = f->frameFormat();
// set sizes of this frame from the format
@@ -3398,7 +3397,6 @@ 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;
// #######
@@ -3810,7 +3808,6 @@ 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);