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 f1bfeb4 commit c7b1080
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2928,6 +2928,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 @@ -3018,6 +3022,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 @@ -3080,6 +3088,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 c7b1080

Please sign in to comment.