Skip to content
Permalink
Browse files

vector layer: ignore non-existing fields in min/max/uniqueValues (fixes

#13194)

(cherry picked from commit 71e7aab)
  • Loading branch information
jef-n committed Aug 10, 2015
1 parent abd4d1d commit 35028c02faea8b721ea91ab8610e2b4caebcc34d
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/qgsvectorlayer.cpp
@@ -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
{
@@ -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
{
@@ -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
{

0 comments on commit 35028c0

Please sign in to comment.
You can’t perform that action at this time.