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 f1bfeb4 commit c7b1080f4635dd2017c9bb7a4123d483cd04965a
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/qgsvectorlayer.cpp
@@ -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
{
@@ -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
{
@@ -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
{

0 comments on commit c7b1080

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