Skip to content
Permalink
Browse files

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

  • Loading branch information
jef-n committed Aug 7, 2015
1 parent 6bbc9d5 commit 71e7aabbdec6cc5d542420948d897f7f7fda8303
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/qgsvectorlayer.cpp
@@ -2929,6 +2929,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
{
@@ -3019,6 +3023,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
{
@@ -3081,6 +3089,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 71e7aab

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