Skip to content

Commit

Permalink
#9062 (FIX): Unmerge, already fixed in master
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Nov 14, 2013
1 parent 92c6751 commit c26fecf
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -91,31 +91,6 @@ void QgsOgrFeatureIterator::ensureRelevantFields()
{
mFetchGeometry = ( mRequest.filterType() == QgsFeatureRequest::FilterRect ) || !( mRequest.flags() & QgsFeatureRequest::NoGeometry );
QgsAttributeList attrs = ( mRequest.flags() & QgsFeatureRequest::SubsetOfAttributes ) ? mRequest.subsetOfAttributes() : P->attributeIndexes();

// Assigns to Layer managed the relevant fields of the current FeatureRequest.
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800
if ( OGR_L_TestCapability( ogrLayer, OLCIgnoreFields ) )
{
QVector<const char*> ignoredFields;
OGRFeatureDefnH featDefn = OGR_L_GetLayerDefn( ogrLayer );

for ( int i = 0, fieldCount = OGR_FD_GetFieldCount( featDefn ); i < fieldCount; i++ )
{
if ( !attrs.contains( i ) )
{
// add to ignored fields
ignoredFields.append( OGR_Fld_GetNameRef( OGR_FD_GetFieldDefn( featDefn, i ) ) );
}
}

if ( !mFetchGeometry ) ignoredFields.append( "OGR_GEOMETRY" );
ignoredFields.append( "OGR_STYLE" ); // not used by QGIS
ignoredFields.append( NULL );

OGR_L_SetIgnoredFields( ogrLayer, ignoredFields.data() );
}
#endif

P->setRelevantFields( mFetchGeometry, attrs );
P->mRelevantFieldsForNextFeature = true;
}
Expand Down

0 comments on commit c26fecf

Please sign in to comment.