Skip to content
Permalink
Browse files

Followup 9508f8b, fix other potential crashes

  • Loading branch information
nyalldawson committed Aug 6, 2015
1 parent ff28e6a commit b7187ed0575ee2ada943cc999eddfbe20f464509
@@ -364,7 +364,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, QStrin

int rownum = 1;

const QgsField &fld = layer->fields()[ fieldindex ];
QgsField fld = layer->fields()[ fieldindex ];

//go through all the features and change the new attributes
QgsFeatureIterator fit = layer->getFeatures( request );
@@ -235,7 +235,7 @@ void QgsFieldCalculator::accept()
bool useGeometry = exp.needsGeometry();
int rownum = 1;

const QgsField& field = mVectorLayer->fields()[mAttributeId];
QgsField field = mVectorLayer->fields()[mAttributeId];

bool newField = !mUpdateExistingGroupBox->isChecked();
QVariant emptyAttribute;
@@ -1455,7 +1455,7 @@ void QgsIdentifyResultsDialog::attributeValueChanged( QgsFeatureId fid, int idx,
if ( idx >= vlayer->fields().size() )
return;

const QgsField &fld = vlayer->fields().at( idx );
QgsField fld = vlayer->fields().at( idx );

for ( int i = 0; i < layItem->childCount(); i++ )
{
@@ -526,7 +526,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
if ( role == FieldIndexRole )
return fieldId;

const QgsField& field = layer()->fields().at( fieldId );
QgsField field = layer()->fields().at( fieldId );

QVariant::Type fldType = field.type();
bool fldNumeric = ( fldType == QVariant::Int || fldType == QVariant::Double || fldType == QVariant::LongLong );
@@ -66,8 +66,7 @@ QString QgsEditorWidgetFactory::representValue( QgsVectorLayer* vl, int fieldIdx
Q_UNUSED( cache )
Q_UNUSED( value )

const QgsField &fld = vl->fields().at( fieldIdx );
return fld.displayString( value );
return vl->fields().at( fieldIdx ).displayString( value );
}

QVariant QgsEditorWidgetFactory::createCache( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config )

0 comments on commit b7187ed

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