From 97cfd4940157817dd761fd02f2e6da4afc5b4a30 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 25 Nov 2021 12:28:07 +0100 Subject: Don't let text table cells shrink below their minimum width We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Pick-to: 6.2 5.15 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen --- src/gui/text/qtextdocumentlayout.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui') diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index 699d8e5fd3..ff0c035a90 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2369,6 +2369,7 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT // constraint the maximumWidth by the minimum width of the fixed size floats, to // keep them visible layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth); + 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. -- cgit v1.2.3