Bug report #9285

qgis-2.0.1/src/gui/qgscomposerview.cpp: 2* bad if test ?

Added by David Binderman about 10 years ago. Updated about 10 years ago.

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

Revision bee12917
Added by Nyall Dawson about 10 years ago

Fix bad tests in composerview (fix #9285)

History

#1 Updated by Nyall Dawson about 10 years ago

  • Status changed from Open to Closed

#2 Updated by Nyall Dawson about 10 years ago

Good catch -- thanks!

Also available in: Atom PDF