Bug report #9285
qgis-2.0.1/src/gui/qgscomposerview.cpp: 2* bad if test ?
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | - | ||
Affected QGIS version: | 2.0.1 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 17896 |
Description
I just ran the static analyser "cppcheck" over the
source code of qgis-2.0.1
It said many things, including
1.
qgis-2.0.1/src/gui/qgscomposerview.cpp:226]: (style) Same expression on both sides of '||'.
Source code is
if ( !mRubberBandItem || mRubberBandItem->rect().width() < 0.1 || mRubberBandItem->rect().width() < 0.1 )
Maybe
if ( !mRubberBandItem || mRubberBandItem->rect().width() < 0.1 || mRubberBandItem->rect().height() < 0.1 )
might be better code.
2.
qgis-2.0.1/src/gui/qgscomposerview.cpp:318]: (style) Same expression on both sides of '||'.
Duplicate.
Associated revisions
Fix bad tests in composerview (fix #9285)
History
#1 Updated by Nyall Dawson almost 11 years ago
- Status changed from Open to Closed
Fixed in changeset bee12917270c5d286ff0915c727381eb08e9e017.
#2 Updated by Nyall Dawson almost 11 years ago
Good catch -- thanks!