Skip to content

Commit

Permalink
vector layer: ignore non-existing fields in min/max/uniqueValues (fixes
Browse files Browse the repository at this point in the history
#13194)

(cherry picked from commit 71e7aab)
  • Loading branch information
jef-n committed Aug 10, 2015
1 parent abd4d1d commit 35028c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,10 @@ void QgsVectorLayer::uniqueValues( int index, QList<QVariant> &uniqueValues, int
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );
if ( origin == QgsFields::OriginUnknown )
{
return;
}

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down Expand Up @@ -3045,6 +3049,10 @@ QVariant QgsVectorLayer::minimumValue( int index )
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );
if ( origin == QgsFields::OriginUnknown )
{
return QVariant();
}

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down Expand Up @@ -3107,6 +3115,10 @@ QVariant QgsVectorLayer::maximumValue( int index )
}

QgsFields::FieldOrigin origin = mUpdatedFields.fieldOrigin( index );
if ( origin == QgsFields::OriginUnknown )
{
return QVariant();
}

if ( origin == QgsFields::OriginProvider ) //a provider field
{
Expand Down

0 comments on commit 35028c0

Please sign in to comment.