summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qfusionstyle.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-10-11 00:56:59 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-12 08:16:38 +0000
commit1ab521e7f46ad4e3c925d4eececdf3a2ff8b493b (patch)
tree7679d6044ac27bba64937e575cb36efdcdfd8947 /src/widgets/styles/qfusionstyle.cpp
parent2ecd95bbe907cc9199773bb7930f781058735e1c (diff)
QFusionStyle: add missing break in switch in drawControl()
The old code fell through into from the CE_RubberBand case into the CE_SizeGrip case if the cast of the the QStyleOption to a QStyleOptionRubberBand failed. Quite obviously, the drawing of a rubber band was requested by the caller, drawing a size grip instead must be considered a bug, regardless of any additional guards employed by the size grip case. So, fix by removing the conditional return in the success case and adding an unconditional break. The function ends after the switch, and all other cases also break instead of return, so consider the switch from return to break a contribution to the internal consistency of the function. Discovered independently by GCC 7 and Coverity. Coverity-Id: 11182 Change-Id: I2158f03b9eb018b952716ffa5e615c7b3cc49132 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index e9e1f349c5..dcc99496e3 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1077,8 +1077,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
painter->setPen(innerLine);
painter->drawRoundedRect(option->rect.adjusted(1, 1, -2, -2), 1, 1);
painter->restore();
- return;
}
+ break;
case CE_SizeGrip:
painter->save();
{