Bug report #229

Assignments used as truth value in qgsproject.cpp

Added by Mateusz Loskot - over 17 years ago. Updated over 17 years ago.

Status:Closed
Priority:Low
Assignee:Gary Sherman
Category:Project Loading/Saving
Affected QGIS version: Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10288

Description

I'm not sure what's the idea behind conditional statements in qgsproject.cpp file, in lines: 126, 204 and 274 where following comparisons are used:

}
else if ( nextProperty = currentProperty->find( keySequence.first() ) )
{

but for me this seems to be a bug.

Probably, this statement should look like:

}
else if (( nextProperty == currentProperty->find( keySequence.first() ) ))
{

or

}
else if ( 0 == (nextProperty = currentProperty->find( keySequence.first() ) ) )
{

Additional note, I see the code around those lines is mostly a copy-paste, may be it's reasonable to put it to a separate class or function.

History

#1 Updated by Gavin Macaulay - over 17 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Appled to head

Also available in: Atom PDF