QTextHtmlParserNode: Fix warnings flood about setting negative pixel size

Exclude the default value (-1) from the check.

Amends 0bd770fb87.

Pick-to: 5.12 5.15 5.15.1
Change-Id: Ib98ae166fd5fdab546c5d4212ce78345b5c9b583
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Friedemann Kleint 2020-09-01 15:41:46 +02:00
parent 11b8c46d2a
commit d23c118fd4

View File

@ -1381,7 +1381,8 @@ void QTextHtmlParserNode::applyCssDeclarations(const QList<QCss::Declaration> &d
QFont f;
int adjustment = -255;
extractor.extractFont(&f, &adjustment);
f.setPixelSize(qMin(f.pixelSize(), INT32_MAX / 2)); // avoid even more extreme values
if (f.pixelSize() > INT32_MAX / 2)
f.setPixelSize(INT32_MAX / 2); // avoid even more extreme values
charFormat.setFont(f, QTextCharFormat::FontPropertiesSpecifiedOnly);
if (adjustment >= -1)