Fix field calc bar error when setting to field name with spaces

This commit is contained in:
Nyall Dawson 2016-03-29 11:24:54 +11:00
parent 53b493c6e6
commit a4ed8e03e6

View File

@ -349,13 +349,13 @@ void QgsAttributeTableDialog::updateFieldFromExpression()
{ {
bool filtered = mMainView->filterMode() != QgsAttributeTableFilterModel::ShowAll; bool filtered = mMainView->filterMode() != QgsAttributeTableFilterModel::ShowAll;
QgsFeatureIds filteredIds = filtered ? mMainView->filteredFeatures() : QgsFeatureIds(); QgsFeatureIds filteredIds = filtered ? mMainView->filteredFeatures() : QgsFeatureIds();
runFieldCalculation( mLayer, mFieldCombo->currentText(), mUpdateExpressionText->currentField(), filteredIds ); runFieldCalculation( mLayer, mFieldCombo->currentText(), mUpdateExpressionText->asExpression(), filteredIds );
} }
void QgsAttributeTableDialog::updateFieldFromExpressionSelected() void QgsAttributeTableDialog::updateFieldFromExpressionSelected()
{ {
QgsFeatureIds filteredIds = mLayer->selectedFeaturesIds(); QgsFeatureIds filteredIds = mLayer->selectedFeaturesIds();
runFieldCalculation( mLayer, mFieldCombo->currentText(), mUpdateExpressionText->currentField(), filteredIds ); runFieldCalculation( mLayer, mFieldCombo->currentText(), mUpdateExpressionText->asExpression(), filteredIds );
} }
void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, const QString& fieldName, const QString& expression, const QgsFeatureIds& filteredIds ) void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, const QString& fieldName, const QString& expression, const QgsFeatureIds& filteredIds )