Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Backport of pull request #1932
  • Loading branch information
ccrook committed Mar 30, 2015
1 parent 002739b commit c7b28db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/qgsfieldcalculator.cpp
Expand Up @@ -158,7 +158,11 @@ void QgsFieldCalculator::accept()
return;
}

if ( mNewFieldGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
// Test for creating expression field based on ! mUpdateExistingGroupBox checked rather
// than on mNewFieldGroupBox checked, as if the provider does not support adding attributes
// then mUpdateExistingGroupBox is set to not checkable, and hence is not checked. This
// is a minimum fix to resolve this - better would be some GUI redesign...
if ( ! mUpdateExistingGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
{
mVectorLayer->addExpressionField( calcString, fieldDefinition() );
}
Expand Down

0 comments on commit c7b28db

Please sign in to comment.