Skip to content

Commit

Permalink
remove return and add else clause
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir authored and m-kuhn committed Oct 24, 2017
1 parent d6a39e9 commit c97f06f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,16 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, const
{
QMessageBox::critical( nullptr, tr( "Error" ), tr( "An error occurred while evaluating the calculation string:\n%1" ).arg( error ) );
mLayer->destroyEditCommand();
return;
}
else
{
mLayer->endEditCommand();

mLayer->endEditCommand();

// refresh table with updated values
// fixes https://issues.qgis.org/issues/17312
QgsAttributeTableModel* masterModel = mMainView->masterModel();
masterModel->reload( masterModel->index( 0, 0 ), masterModel->index( masterModel->rowCount() - 1, masterModel->columnCount() - 1 ) );
// refresh table with updated values
// fixes https://issues.qgis.org/issues/17312
QgsAttributeTableModel* masterModel = mMainView->masterModel();
masterModel->reload( masterModel->index( 0, 0 ), masterModel->index( masterModel->rowCount() - 1, masterModel->columnCount() - 1 ) );
}
}

void QgsAttributeTableDialog::replaceSearchWidget( QWidget* oldw, QWidget* neww )
Expand Down

0 comments on commit c97f06f

Please sign in to comment.