Skip to content

Commit ab2a7a8

Browse files
author
jef
committed
add support for non-numeric fields in generic minimumValue/maximumValue fallback method
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14034 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 801f93c commit ab2a7a8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/core/qgsvectordataprovider.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ void QgsVectorDataProvider::fillMinMaxCache()
373373
mCacheMinValues[it.key()] = QVariant( DBL_MAX );
374374
mCacheMaxValues[it.key()] = QVariant( -DBL_MAX );
375375
}
376+
else
377+
{
378+
mCacheMinValues[it.key()] = QVariant();
379+
mCacheMaxValues[it.key()] = QVariant();
380+
}
376381
}
377382

378383
QgsFeature f;
@@ -402,6 +407,18 @@ void QgsVectorDataProvider::fillMinMaxCache()
402407
if ( value > mCacheMaxValues[*it].toDouble() )
403408
mCacheMaxValues[*it] = value;
404409
}
410+
else
411+
{
412+
QString value = varValue.toString();
413+
if ( mCacheMinValues[*it].isNull() || value < mCacheMinValues[*it].toString() )
414+
{
415+
mCacheMinValues[*it] = value;
416+
}
417+
if ( mCacheMaxValues[*it].isNull() || value > mCacheMinValues[*it].toString() )
418+
{
419+
mCacheMaxValues[*it] = value;
420+
}
421+
}
405422
}
406423
}
407424

0 commit comments

Comments
 (0)