From 220510a885747bb084e23dc51ea31e35e4fd115e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 6 Dec 2021 12:49:10 +0100 Subject: [PATCH] Fix qtdeclarative baseline test failure for text tables Amend 97cfd4940157817dd761fd02f2e6da4afc5b4a30, which resulted in incorrectly laid out tables in Text elements. Reported by the baseline test for the scenegraph. Not reproducible using a QtWidget text widget, so no unit-test added here. Pick-to: 6.2 5.15 Task-number: QTBUG-86671 Task-number: QTBUG-97463 Change-Id: I607b1fea3fb5923f81f05a3646bafebec3dcf3b5 Reviewed-by: Eirik Aavitsland --- src/gui/text/qtextdocumentlayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index ff0c035a90..1cc891ed5a 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2366,10 +2366,10 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT floatMinWidth = qMax(floatMinWidth, cd->minimumWidth); } - // constraint the maximumWidth by the minimum width of the fixed size floats, to - // keep them visible + // constraint the maximum/minimumWidth by the minimum width of the fixed size floats, + // to keep them visible layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth); - layoutStruct.minimumWidth = floatMinWidth; + layoutStruct.minimumWidth = qMax(layoutStruct.minimumWidth, floatMinWidth); // as floats in cells get added to the table's float list but must not affect // floats in other cells we must clear the list here.