From 120e79b2726e8aef63eb321fe3de984a27921d9e Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 22 Mar 2010 08:39:20 +0200 Subject: QS60Style assert fails to detect an index failure QS60Style asserts that a given index is correct when setting theme colors. Unfortunately it uses less-and-equal-to operator ('<='), which is incorrect. It should use less-than ('<')operator, otherwise the assert fails when index is equal to number of items in the color table. Task-number: QT-3078 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 5202701..14782d8 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1121,7 +1121,7 @@ QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, &KAknsIIDQsnParentColors, &KAknsIIDQsnTextColors }; - Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0])); + Q_ASSERT((int)list < (int)sizeof(idMap)/sizeof(idMap[0])); const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1); return option ? QS60StylePrivate::stateColor(color, option) : color; } -- cgit v0.12