Skip to content

Commit b7187ed

Browse files
committed
Followup 9508f8b, fix other potential crashes
1 parent ff28e6a commit b7187ed

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

src/app/qgsattributetabledialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer* layer, QStrin
364364

365365
int rownum = 1;
366366

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

369369
//go through all the features and change the new attributes
370370
QgsFeatureIterator fit = layer->getFeatures( request );

src/app/qgsfieldcalculator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void QgsFieldCalculator::accept()
235235
bool useGeometry = exp.needsGeometry();
236236
int rownum = 1;
237237

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

240240
bool newField = !mUpdateExistingGroupBox->isChecked();
241241
QVariant emptyAttribute;

src/app/qgsidentifyresultsdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ void QgsIdentifyResultsDialog::attributeValueChanged( QgsFeatureId fid, int idx,
14551455
if ( idx >= vlayer->fields().size() )
14561456
return;
14571457

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

14601460
for ( int i = 0; i < layItem->childCount(); i++ )
14611461
{

src/gui/attributetable/qgsattributetablemodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons
526526
if ( role == FieldIndexRole )
527527
return fieldId;
528528

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

531531
QVariant::Type fldType = field.type();
532532
bool fldNumeric = ( fldType == QVariant::Int || fldType == QVariant::Double || fldType == QVariant::LongLong );

src/gui/editorwidgets/core/qgseditorwidgetfactory.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ QString QgsEditorWidgetFactory::representValue( QgsVectorLayer* vl, int fieldIdx
6666
Q_UNUSED( cache )
6767
Q_UNUSED( value )
6868

69-
const QgsField &fld = vl->fields().at( fieldIdx );
70-
return fld.displayString( value );
69+
return vl->fields().at( fieldIdx ).displayString( value );
7170
}
7271

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

0 commit comments

Comments
 (0)