From 576cf413bb126e0350a2d8d79267496d7619e6c2 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 6 Jan 2015 12:55:58 +0100 Subject: Doc: verb "to layout" changed to "to lay out" Task-number: QTBUG-43657 Change-Id: I574186253ee423cc380ec3c6f274f1caa2a6aa2a Reviewed-by: Martin Smith --- src/gui/text/qfontmetrics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 9610482145..e010dd62ae 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -647,7 +647,7 @@ int QFontMetrics::charWidth(const QString &text, int pos) const e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the width() method returns. - If you want to know the advance width of the string (to layout + If you want to know the advance width of the string (to lay out a set of strings next to each other), use width() instead. Newline characters are processed as normal characters, \e not as @@ -817,7 +817,7 @@ QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabA e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the width() method returns. - If you want to know the advance width of the string (to layout + If you want to know the advance width of the string (to lay out a set of strings next to each other), use width() instead. Newline characters are processed as normal characters, \e not as @@ -1432,7 +1432,7 @@ qreal QFontMetricsF::width(QChar ch) const e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the width() method returns. - If you want to know the advance width of the string (to layout + If you want to know the advance width of the string (to lay out a set of strings next to each other), use width() instead. Newline characters are processed as normal characters, \e not as @@ -1606,7 +1606,7 @@ QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *ta e.g. for italicized fonts, and that the width of the returned rectangle might be different than what the width() method returns. - If you want to know the advance width of the string (to layout + If you want to know the advance width of the string (to lay out a set of strings next to each other), use width() instead. Newline characters are processed as normal characters, \e not as -- cgit v1.2.3 From 62a96dbb53d77d6cd7320c6fc8d33ee9c4add0fe Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 18 Jan 2015 21:57:20 +0100 Subject: QTextFormat: fix undefined behavior Left-shifting of negative values is undefined ([expr.shift]/2). Since hashValue is a uint already, rectify by casting it->key to uint prior to shifting. Found by UBSan. Change-Id: I94a5311f5a4492f514f595b8fb79726df1e7d0de Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/text/qtextformat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index cecfd85df1..ecd87188e7 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -319,7 +319,7 @@ uint QTextFormatPrivate::recalcHash() const { hashValue = 0; for (QVector::ConstIterator it = props.constBegin(); it != props.constEnd(); ++it) - hashValue += (it->key << 16) + variantHash(it->value); + hashValue += (static_cast(it->key) << 16) + variantHash(it->value); hashDirty = false; -- cgit v1.2.3