summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2009-04-29 12:41:52 (GMT)
committerJarek Kobus <jkobus@trolltech.com>2009-04-29 12:41:52 (GMT)
commit77a0de016ed8afc60a3d8b961b65b94b37d87036 (patch)
tree3c712f4386cdb9bc81146b6cb3ad7d152bd5365f /src/gui/text/qfont.cpp
parent30087926ae942decd80632fbbb06eb389a343fac (diff)
downloadQt-77a0de016ed8afc60a3d8b961b65b94b37d87036.zip
Qt-77a0de016ed8afc60a3d8b961b65b94b37d87036.tar.gz
Qt-77a0de016ed8afc60a3d8b961b65b94b37d87036.tar.bz2
Fix a crash in case of setting invalid point size
Asserts are replaced with warnings and the call is ignored. Task-number: 252414, 252416, 252502 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r--src/gui/text/qfont.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 43f5b1e..24ff10b 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -890,7 +890,10 @@ int QFont::pointSize() const
*/
void QFont::setPointSize(int pointSize)
{
- Q_ASSERT_X (pointSize > 0, "QFont::setPointSize", "point size must be greater than 0");
+ if (pointSize <= 0) {
+ qWarning("QFont::setPointSize: Point size <= 0 (%d), must be greater than 0", pointSize);
+ return;
+ }
detach();
@@ -909,7 +912,10 @@ void QFont::setPointSize(int pointSize)
*/
void QFont::setPointSizeF(qreal pointSize)
{
- Q_ASSERT_X(pointSize > 0.0, "QFont::setPointSizeF", "point size must be greater than 0");
+ if (pointSize <= 0) {
+ qWarning("QFont::setPointSizeF: Point size <= 0 (%d), must be greater than 0", pointSize);
+ return;
+ }
detach();