diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-09-02 13:54:58 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-09-02 13:54:58 (GMT) |
commit | 29ceb95f9f1199711ca07ee8d7a1e93b446ab344 (patch) | |
tree | 5380d9c79dca7bffe1a5605ae4c463705ef8a061 /src/gui/styles | |
parent | d2114c84ecdae5746227fc9e6301027213565daf (diff) | |
download | Qt-29ceb95f9f1199711ca07ee8d7a1e93b446ab344.zip Qt-29ceb95f9f1199711ca07ee8d7a1e93b446ab344.tar.gz Qt-29ceb95f9f1199711ca07ee8d7a1e93b446ab344.tar.bz2 |
Fix Coverity findings from QS60Style
Fix issues found out by static analysis tool Coverity from QS60Style.
Task-number: QT-4843
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 10 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 48363de..56420af 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2539,13 +2539,17 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, //Make toolbuttons in toolbar stretch the whole screen area if (widget && qobject_cast<const QToolBar *>(widget->parentWidget())) { const QToolBar *tb = qobject_cast<const QToolBar *>(widget->parentWidget()); - const bool parentCanGrowHorizontally = !(tb->sizePolicy().horizontalPolicy() == QSizePolicy::Fixed || - tb->sizePolicy().horizontalPolicy() == QSizePolicy::Maximum) && tb->orientation() == Qt::Horizontal; + bool parentCanGrowHorizontally = false; + if (tb) { + parentCanGrowHorizontally = !(tb->sizePolicy().horizontalPolicy() == QSizePolicy::Fixed + || tb->sizePolicy().horizontalPolicy() == QSizePolicy::Maximum) + && tb->orientation() == Qt::Horizontal; + } if (parentCanGrowHorizontally) { int buttons = 0; //Make the auto-stretch to happen only for horizontal orientation - if (tb && tb->orientation() == Qt::Horizontal) { + if (tb->orientation() == Qt::Horizontal) { QList<QAction*> actionList = tb->actions(); for (int i = 0; i < actionList.count(); i++) { buttons++; diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index e58b463..cfb10fa 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -985,8 +985,8 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX( break; } case EDrawAnimation: { - CFbsBitmap* animationFrame; - CFbsBitmap* frameMask; + CFbsBitmap* animationFrame = 0; + CFbsBitmap* frameMask = 0; CAknBitmapAnimation* aknAnimation = 0; TBool constructedFromTheme = ETrue; |