Skip to content

Commit 4f3564c

Browse files
committed
Avoid potential QgsFields detachments
1 parent ed4d34f commit 4f3564c

25 files changed

+68
-68
lines changed

src/analysis/vector/qgsoverlayanalyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void QgsOverlayAnalyzer::combineFieldLists( QgsFields& fieldListA, const QgsFiel
192192

193193
for ( int idx = 0; idx < fieldListB.count(); ++idx )
194194
{
195-
QgsField field = fieldListB[idx];
195+
QgsField field = fieldListB.at( idx );
196196
int count = 0;
197197
while ( names.contains( field.name() ) )
198198
{

src/app/qgsdelattrdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ QgsDelAttrDialog::QgsDelAttrDialog( const QgsVectorLayer* vl )
3434
const QgsFields& layerAttributes = vl->fields();
3535
for ( int idx = 0; idx < layerAttributes.count(); ++idx )
3636
{
37-
QListWidgetItem* item = new QListWidgetItem( layerAttributes[idx].name(), listBox2 );
37+
QListWidgetItem* item = new QListWidgetItem( layerAttributes.at( idx ).name(), listBox2 );
3838
switch ( vl->fields().fieldOrigin( idx ) )
3939
{
4040
case QgsFields::OriginExpression:

src/app/qgsdiagramproperties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer,
184184
for ( int idx = 0; idx < layerFields.count(); ++idx )
185185
{
186186
QTreeWidgetItem *newItem = new QTreeWidgetItem( mAttributesTreeWidget );
187-
QString name = QString( "\"%1\"" ).arg( layerFields[idx].name() );
187+
QString name = QString( "\"%1\"" ).arg( layerFields.at( idx ).name() );
188188
newItem->setText( 0, name );
189189
newItem->setData( 0, Qt::UserRole, name );
190190
newItem->setFlags( newItem->flags() & ~Qt::ItemIsDropEnabled );
191191

192-
mDataDefinedXComboBox->addItem( layerFields[idx].name(), idx );
193-
mDataDefinedYComboBox->addItem( layerFields[idx].name(), idx );
194-
mDataDefinedVisibilityComboBox->addItem( layerFields[idx].name(), idx );
192+
mDataDefinedXComboBox->addItem( layerFields.at( idx ).name(), idx );
193+
mDataDefinedYComboBox->addItem( layerFields.at( idx ).name(), idx );
194+
mDataDefinedVisibilityComboBox->addItem( layerFields.at( idx ).name(), idx );
195195
}
196196

197197
const QgsDiagramRendererV2* dr = layer->diagramRenderer();

src/app/qgsfieldcalculator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void QgsFieldCalculator::accept()
234234

235235
for ( int idx = 0; idx < fields.count(); ++idx )
236236
{
237-
if ( fields[idx].name() == mOutputFieldNameLineEdit->text() )
237+
if ( fields.at( idx ).name() == mOutputFieldNameLineEdit->text() )
238238
{
239239
mAttributeId = idx;
240240
break;

src/app/qgsfieldsproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ void QgsFieldsProperties::attributeAdded( int idx )
576576
const QgsFields &fields = mLayer->fields();
577577
int row = mFieldsList->rowCount();
578578
mFieldsList->insertRow( row );
579-
setRow( row, idx, fields[idx] );
579+
setRow( row, idx, fields.at( idx ) );
580580
mFieldsList->setCurrentCell( row, idx );
581581

582582
for ( int i = idx + 1; i < mIndexedWidgets.count(); i++ )

src/app/qgsidentifyresultsdialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
493493
featItem->addChild( attrItem );
494494

495495
attrItem->setData( 0, Qt::DisplayRole, vlayer->attributeDisplayName( i ) );
496-
attrItem->setData( 0, Qt::UserRole, fields[i].name() );
496+
attrItem->setData( 0, Qt::UserRole, fields.at( i ).name() );
497497
attrItem->setData( 0, Qt::UserRole + 1, i );
498498

499499
attrItem->setData( 1, Qt::UserRole, value );
@@ -515,7 +515,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
515515
attrItem->treeWidget()->setItemWidget( attrItem, 1, nullptr );
516516
}
517517

518-
if ( fields[i].name() == vlayer->displayField() )
518+
if ( fields.at( i ).name() == vlayer->displayField() )
519519
{
520520
featItem->setText( 0, attrItem->text( 0 ) );
521521
featItem->setText( 1, attrItem->text( 1 ) );
@@ -560,11 +560,11 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
560560
tblResults->setItem( j, 1, item );
561561

562562
item = new QTableWidgetItem( QString::number( i ) );
563-
if ( fields[i].name() == vlayer->displayField() )
563+
if ( fields.at( i ).name() == vlayer->displayField() )
564564
item->setData( Qt::DisplayRole, vlayer->attributeDisplayName( i ) + " *" );
565565
else
566566
item->setData( Qt::DisplayRole, vlayer->attributeDisplayName( i ) );
567-
item->setData( Qt::UserRole, fields[i].name() );
567+
item->setData( Qt::UserRole, fields.at( i ).name() );
568568
item->setData( Qt::UserRole + 1, i );
569569
tblResults->setItem( j, 2, item );
570570

@@ -765,7 +765,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
765765

766766
QTreeWidgetItem *attrItem = new QTreeWidgetItem( QStringList() << QString::number( i ) << attrs.at( i ).toString() );
767767

768-
attrItem->setData( 0, Qt::DisplayRole, fields[i].name() );
768+
attrItem->setData( 0, Qt::DisplayRole, fields.at( i ).name() );
769769

770770
QVariant value = attrs.at( i );
771771
attrItem->setData( 1, Qt::DisplayRole, value );
@@ -1188,7 +1188,7 @@ void QgsIdentifyResultsDialog::doAction( QTreeWidgetItem *item, int action )
11881188
const QgsFields& fields = layer->fields();
11891189
for ( int fldIdx = 0; fldIdx < fields.count(); ++fldIdx )
11901190
{
1191-
if ( fields[fldIdx].name() == fieldName )
1191+
if ( fields.at( fldIdx ).name() == fieldName )
11921192
{
11931193
idx = fldIdx;
11941194
break;
@@ -1741,7 +1741,7 @@ void QgsIdentifyResultsDialog::copyFeatureAttributes()
17411741
if ( attrIdx < 0 || attrIdx >= fields.count() )
17421742
continue;
17431743

1744-
text += QString( "%1: %2\n" ).arg( fields[attrIdx].name(), it.value().toString() );
1744+
text += QString( "%1: %2\n" ).arg( fields.at( attrIdx ).name(), it.value().toString() );
17451745
}
17461746
}
17471747
else if ( rlayer )

src/app/qgslabelpropertydialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, const QString& provid
103103
{
104104
mLabelTextLineEdit->setText( attributeValues.at( mCurLabelField ).toString() );
105105
const QgsFields& layerFields = vlayer->fields();
106-
switch ( layerFields[mCurLabelField].type() )
106+
switch ( layerFields.at( mCurLabelField ).type() )
107107
{
108108
case QVariant::Double:
109109
mLabelTextLineEdit->setValidator( new QDoubleValidator( this ) );

src/app/qgsmergeattributesdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ QVariant QgsMergeAttributesDialog::calcStatistic( int col, QgsStatisticalSummary
358358

359359
if ( values.isEmpty() )
360360
{
361-
return QVariant( mVectorLayer->fields()[col].type() );
361+
return QVariant( mVectorLayer->fields().at( col ).type() );
362362
}
363363

364364
summary.calculate( values );

src/core/composer/qgscomposerattributetable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void QgsComposerAttributeTable::setDisplayAttributes( const QSet<int>& attr, boo
241241
}
242242
QString currentAlias = mVectorLayer->attributeDisplayName( attrIdx );
243243
QgsComposerTableColumn* col = new QgsComposerTableColumn;
244-
col->setAttribute( fields[attrIdx].name() );
244+
col->setAttribute( fields.at( attrIdx ).name() );
245245
col->setHeading( currentAlias );
246246
mColumns.append( col );
247247
}
@@ -652,7 +652,7 @@ bool QgsComposerAttributeTable::readXml( const QDomElement& itemElem, const QDom
652652
//find corresponding column
653653
Q_FOREACH ( QgsComposerTableColumn* column, mColumns )
654654
{
655-
if ( column->attribute() == fields[attribute].name() )
655+
if ( column->attribute() == fields.at( attribute ).name() )
656656
{
657657
column->setSortByRank( i + 1 );
658658
column->setSortOrder( order );

src/core/composer/qgscomposerattributetablev2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void QgsComposerAttributeTableV2::setDisplayAttributes( const QSet<int>& attr, b
338338
}
339339
QString currentAlias = source->attributeDisplayName( attrIdx );
340340
QgsComposerTableColumn* col = new QgsComposerTableColumn;
341-
col->setAttribute( fields[attrIdx].name() );
341+
col->setAttribute( fields.at( attrIdx ).name() );
342342
col->setHeading( currentAlias );
343343
mColumns.append( col );
344344
}

src/core/qgsactionmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ QString QgsActionManager::expandAction( QString action, const QgsAttributeMap &a
210210
switch ( i )
211211
{
212212
case 0:
213-
to_replace = "[%" + fields[attrIdx].name() + ']';
213+
to_replace = "[%" + fields.at( attrIdx ).name() + ']';
214214
break;
215215
case 1:
216216
to_replace = "[%" + mLayer->attributeDisplayName( attrIdx ) + ']';
217217
break;
218218
case 2:
219-
to_replace = '%' + fields[attrIdx].name();
219+
to_replace = '%' + fields.at( attrIdx ).name();
220220
break;
221221
case 3:
222222
to_replace = '%' + mLayer->attributeDisplayName( attrIdx );

src/core/qgsgml.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ QgsGmlStreamingParser::QgsGmlStreamingParser( const QString& typeName,
294294
mThematicAttributes.clear();
295295
for ( int i = 0; i < fields.size(); i++ )
296296
{
297-
mThematicAttributes.insert( fields[i].name(), qMakePair( i, fields[i] ) );
297+
mThematicAttributes.insert( fields.at( i ).name(), qMakePair( i, fields.at( i ) ) );
298298
}
299299

300300
mEndian = QgsApplication::endian();
@@ -355,13 +355,13 @@ QgsGmlStreamingParser::QgsGmlStreamingParser( const QList<LayerProperties>& laye
355355
mThematicAttributes.clear();
356356
for ( int i = 0; i < fields.size(); i++ )
357357
{
358-
QMap< QString, QPair<QString, QString> >::const_iterator att_it = mapFieldNameToSrcLayerNameFieldName.constFind( fields[i].name() );
358+
QMap< QString, QPair<QString, QString> >::const_iterator att_it = mapFieldNameToSrcLayerNameFieldName.constFind( fields.at( i ).name() );
359359
if ( att_it != mapFieldNameToSrcLayerNameFieldName.constEnd() )
360360
{
361361
if ( mLayerProperties.size() == 1 )
362-
mThematicAttributes.insert( att_it.value().second, qMakePair( i, fields[i] ) );
362+
mThematicAttributes.insert( att_it.value().second, qMakePair( i, fields.at( i ) ) );
363363
else
364-
mThematicAttributes.insert( stripNS( att_it.value().first ) + "|" + att_it.value().second, qMakePair( i, fields[i] ) );
364+
mThematicAttributes.insert( stripNS( att_it.value().first ) + "|" + att_it.value().second, qMakePair( i, fields.at( i ) ) );
365365
}
366366
}
367367
bool alreadyFoundGeometry = false;

src/core/qgsvectorfilewriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,13 @@ void QgsVectorFileWriter::init( QString vectorFileName,
398398

399399
for ( int fldIdx = 0; fldIdx < fields.count(); ++fldIdx )
400400
{
401-
QgsField attrField = fields[fldIdx];
401+
QgsField attrField = fields.at( fldIdx );
402402

403403
OGRFieldType ogrType = OFTString; //default to string
404404

405405
if ( fieldValueConverter )
406406
{
407-
attrField = fieldValueConverter->fieldDefinition( fields[fldIdx] );
407+
attrField = fieldValueConverter->fieldDefinition( fields.at( fldIdx ) );
408408
}
409409

410410
int ogrWidth = attrField.length();
@@ -489,7 +489,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
489489
name = QString( "ogc_fid%1" ).arg( i );
490490

491491
int j;
492-
for ( j = 0; j < fields.size() && name.compare( fields[j].name(), Qt::CaseInsensitive ) != 0; j++ )
492+
for ( j = 0; j < fields.size() && name.compare( fields.at( j ).name(), Qt::CaseInsensitive ) != 0; j++ )
493493
;
494494

495495
if ( j == fields.size() )

src/gui/qgsquerybuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void QgsQueryBuilder::populateFields()
7777
// only consider native fields
7878
continue;
7979
}
80-
QStandardItem *myItem = new QStandardItem( fields[idx].name() );
80+
QStandardItem *myItem = new QStandardItem( fields.at( idx ).name() );
8181
myItem->setData( idx );
8282
myItem->setEditable( false );
8383
mModelFields->insertRow( mModelFields->rowCount(), myItem );

src/gui/qgssearchquerybuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void QgsSearchQueryBuilder::populateFields()
7777
const QgsFields& fields = mLayer->fields();
7878
for ( int idx = 0; idx < fields.count(); ++idx )
7979
{
80-
QString fieldName = fields[idx].name();
80+
QString fieldName = fields.at( idx ).name();
8181
mFieldMap[fieldName] = idx;
8282
QStandardItem *myItem = new QStandardItem( fieldName );
8383
myItem->setEditable( false );

src/providers/db2/qgsdb2provider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ QgsVectorLayerImport::ImportError QgsDb2Provider::createEmptyLayer( const QStrin
13321332
QString pk = primaryKey = "QGS_FID";
13331333
for ( int i = 0; i < fieldCount; ++i )
13341334
{
1335-
if ( fields[i].name() == primaryKey )
1335+
if ( fields.at( i ).name() == primaryKey )
13361336
{
13371337
// it already exists, try again with a new name
13381338
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
@@ -1345,10 +1345,10 @@ QgsVectorLayerImport::ImportError QgsDb2Provider::createEmptyLayer( const QStrin
13451345
// search for the passed field
13461346
for ( int i = 0; i < fieldCount; ++i )
13471347
{
1348-
if ( fields[i].name() == primaryKey )
1348+
if ( fields.at( i ).name() == primaryKey )
13491349
{
13501350
// found, get the field type
1351-
QgsField fld = fields[i];
1351+
QgsField fld = fields.at( i );
13521352
if ( convertField( fld ) )
13531353
{
13541354
primaryKeyType = fld.typeName();

src/providers/memory/qgsmemoryprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ QString QgsMemoryProvider::dataSourceUri( bool expandAuthConfig ) const
262262
QgsAttributeList attrs = const_cast<QgsMemoryProvider *>( this )->attributeIndexes();
263263
for ( int i = 0; i < attrs.size(); i++ )
264264
{
265-
QgsField field = mFields[attrs[i]];
265+
QgsField field = mFields.at( attrs[i] );
266266
QString fieldDef = field.name();
267267
fieldDef.append( QString( ":%2(%3,%4)" ).arg( field.typeName() ).arg( field.length() ).arg( field.precision() ) );
268268
uri.addQueryItem( "field", fieldDef );

src/providers/mssql/qgsmssqlprovider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( const QStr
16691669
QString pk = primaryKey = "qgs_fid";
16701670
for ( int i = 0, n = fields.size(); i < n; ++i )
16711671
{
1672-
if ( fields[i].name() == primaryKey )
1672+
if ( fields.at( i ).name() == primaryKey )
16731673
{
16741674
// it already exists, try again with a new name
16751675
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
@@ -1682,10 +1682,10 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( const QStr
16821682
// search for the passed field
16831683
for ( int i = 0, n = fields.size(); i < n; ++i )
16841684
{
1685-
if ( fields[i].name() == primaryKey )
1685+
if ( fields.at( i ).name() == primaryKey )
16861686
{
16871687
// found, get the field type
1688-
QgsField fld = fields[i];
1688+
QgsField fld = fields.at( i );
16891689
if ( convertField( fld ) )
16901690
{
16911691
primaryKeyType = fld.typeName();
@@ -1830,7 +1830,7 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer( const QStr
18301830
QList<QgsField> flist;
18311831
for ( int i = 0, n = fields.size(); i < n; ++i )
18321832
{
1833-
QgsField fld = fields[i];
1833+
QgsField fld = fields.at( i );
18341834
if ( oldToNewAttrIdxMap && fld.name() == primaryKey )
18351835
{
18361836
oldToNewAttrIdxMap->insert( fields.fieldNameIndex( fld.name() ), 0 );

src/providers/oracle/qgsoraclefeatureiterator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,14 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause, bool showLog )
452452
break;
453453

454454
case pktInt:
455-
query += delim + QgsOracleProvider::quotedIdentifier( mSource->mFields[ mSource->mPrimaryKeyAttrs[0] ].name() );
455+
query += delim + QgsOracleProvider::quotedIdentifier( mSource->mFields.at( mSource->mPrimaryKeyAttrs[0] ).name() );
456456
delim = ",";
457457
break;
458458

459459
case pktFidMap:
460460
Q_FOREACH ( int idx, mSource->mPrimaryKeyAttrs )
461461
{
462-
query += delim + mConnection->fieldExpression( mSource->mFields[idx] );
462+
query += delim + mConnection->fieldExpression( mSource->mFields.at( idx ) );
463463
delim = ",";
464464
}
465465
break;
@@ -475,7 +475,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause, bool showLog )
475475
if ( mSource->mPrimaryKeyAttrs.contains( idx ) )
476476
continue;
477477

478-
query += delim + mConnection->fieldExpression( mSource->mFields[idx] );
478+
query += delim + mConnection->fieldExpression( mSource->mFields.at( idx ) );
479479
}
480480

481481
query += QString( " FROM %1 \"FEATUREREQUEST\"" ).arg( mSource->mQuery );

src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ QgsOracleProvider::QgsOracleProvider( QString const & uri )
181181
Q_FOREACH ( int idx, mPrimaryKeyAttrs )
182182
{
183183
Q_ASSERT( idx >= 0 && idx < mAttributeFields.size() );
184-
key += delim + mAttributeFields[ idx ].name();
184+
key += delim + mAttributeFields.at( idx ).name();
185185
delim = ",";
186186
}
187187
}
@@ -416,7 +416,7 @@ QString QgsOracleUtils::whereClause( QgsFeatureId featureId, const QgsFields& fi
416416
{
417417
case pktInt:
418418
Q_ASSERT( primaryKeyAttrs.size() == 1 );
419-
whereClause = QString( "%1=%2" ).arg( QgsOracleConn::quotedIdentifier( fields[ primaryKeyAttrs[0] ].name() ) ).arg( featureId );
419+
whereClause = QString( "%1=%2" ).arg( QgsOracleConn::quotedIdentifier( fields.at( primaryKeyAttrs[0] ).name() ) ).arg( featureId );
420420
break;
421421

422422
case pktRowId:
@@ -966,9 +966,9 @@ bool QgsOracleProvider::determinePrimaryKey()
966966
int idx = fieldNameIndex( mUri.keyColumn() );
967967

968968
if ( idx >= 0 && (
969-
mAttributeFields[idx].type() == QVariant::Int ||
970-
mAttributeFields[idx].type() == QVariant::LongLong ||
971-
mAttributeFields[idx].type() == QVariant::Double
969+
mAttributeFields.at( idx ).type() == QVariant::Int ||
970+
mAttributeFields.at( idx ).type() == QVariant::LongLong ||
971+
mAttributeFields.at( idx ).type() == QVariant::Double
972972
) )
973973
{
974974
if ( mUseEstimatedMetadata || uniqueData( mQuery, primaryKey ) )
@@ -1299,7 +1299,7 @@ bool QgsOracleProvider::addFeatures( QgsFeatureList &flist )
12991299
}
13001300
else
13011301
{
1302-
values += delim + quotedValue( v, mAttributeFields[idx].type() );
1302+
values += delim + quotedValue( v, mAttributeFields.at( idx ).type() );
13031303
}
13041304
}
13051305
else
@@ -2091,7 +2091,7 @@ bool QgsOracleProvider::setSubsetString( const QString& theSQL, bool updateFeatu
20912091
}
20922092
qry.finish();
20932093

2094-
if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields[ mPrimaryKeyAttrs[0] ].name() ) )
2094+
if ( mPrimaryKeyType == pktInt && !uniqueData( mQuery, mAttributeFields.at( mPrimaryKeyAttrs[0] ).name() ) )
20952095
{
20962096
mSqlWhereClause = prevWhere;
20972097
return false;
@@ -2649,7 +2649,7 @@ QgsVectorLayerImport::ImportError QgsOracleProvider::createEmptyLayer(
26492649
int idx = fields.indexFromName( primaryKey );
26502650
if ( idx >= 0 )
26512651
{
2652-
QgsField fld = fields[idx];
2652+
QgsField fld = fields.at( idx );
26532653
if ( convertField( fld ) )
26542654
{
26552655
primaryKeyType = fld.typeName();
@@ -2856,7 +2856,7 @@ QgsVectorLayerImport::ImportError QgsOracleProvider::createEmptyLayer(
28562856
QList<QgsField> launderedFields;
28572857
for ( int i = 0; i < fields.size(); i++ )
28582858
{
2859-
QgsField fld = fields[i];
2859+
QgsField fld = fields.at( i );
28602860

28612861
QString name = fld.name().left( 30 ).toUpper();
28622862

0 commit comments

Comments
 (0)