Skip to content
Permalink
Browse files

Fix 'redundantCondition' cppcheck warnings

  • Loading branch information
rouault authored and nyalldawson committed Jun 13, 2020
1 parent 21bc22f commit 64808101da21bf01001304924a3e2fcde0b93028
@@ -808,7 +808,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsPalIndexe
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || ( prop.propertyType() == QgsProperty::ExpressionBasedProperty && overwriteExpression ) )
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression )
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
changed = true;
@@ -860,7 +860,7 @@ bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsDiagramIn
{
index = vlayer->fields().lookupField( prop.field() );
}
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || ( prop.propertyType() == QgsProperty::ExpressionBasedProperty && overwriteExpression ) )
else if ( prop.propertyType() != QgsProperty::ExpressionBasedProperty || overwriteExpression )
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
changed = true;
@@ -79,7 +79,7 @@ void QgsAttributeTableDialog::updateMultiEditButtonState()

mActionToggleMultiEdit->setEnabled( mLayer->isEditable() );

if ( !mLayer->isEditable() || ( mLayer->isEditable() && mMainView->view() != QgsDualView::AttributeEditor ) )
if ( !mLayer->isEditable() || mMainView->view() != QgsDualView::AttributeEditor )
{
mActionToggleMultiEdit->setChecked( false );
}
@@ -787,7 +787,7 @@ QgsVectorLayerFeatureCounter *QgsVectorLayer::countSymbolFeatures( bool storeSym
return mFeatureCounter;
}

if ( !mFeatureCounter || ( mFeatureCounter && ( storeSymbolFids && mSymbolFeatureIdMap.isEmpty() ) ) )
if ( !mFeatureCounter || ( storeSymbolFids && mSymbolFeatureIdMap.isEmpty() ) )
{
mFeatureCounter = new QgsVectorLayerFeatureCounter( this, QgsExpressionContext(), storeSymbolFids );
connect( mFeatureCounter, &QgsTask::taskCompleted, this, &QgsVectorLayer::onFeatureCounterCompleted, Qt::UniqueConnection );
@@ -1825,7 +1825,7 @@ void TerminalDisplay::mousePressEvent( QMouseEvent *ev )
}
else if ( ev->button() == Qt::MidButton )
{
if ( _mouseMarks || ( !_mouseMarks && ( ev->modifiers() & Qt::ShiftModifier ) ) )
if ( _mouseMarks || ( ev->modifiers() & Qt::ShiftModifier ) )
emitSelection( true, ev->modifiers() & Qt::ControlModifier );
else
emit mouseSignal( 1, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum(), 0 );
@@ -1015,7 +1015,7 @@ void QgsSpatiaLiteProvider::insertDefaultValue( int fieldIndex, QString defaultV
{
QVariant defaultVariant = defaultVal;

if ( mAttributeFields.at( fieldIndex ).name() != mPrimaryKey || ( mAttributeFields.at( fieldIndex ).name() == mPrimaryKey && !mPrimaryKeyAutoIncrement ) )
if ( mAttributeFields.at( fieldIndex ).name() != mPrimaryKey || !mPrimaryKeyAutoIncrement )
{
bool ok;
switch ( mAttributeFields.at( fieldIndex ).type() )

0 comments on commit 6480810

Please sign in to comment.
You can’t perform that action at this time.