Skip to content
Permalink
Browse files
add support for non-numeric fields in generic minimumValue/maximumVal…
…ue fallback method

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 9, 2010
1 parent 801f93c commit ab2a7a8f1d490f740a13f9cc78356e3c5e61c653
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/core/qgsvectordataprovider.cpp
@@ -373,6 +373,11 @@ void QgsVectorDataProvider::fillMinMaxCache()
mCacheMinValues[it.key()] = QVariant( DBL_MAX );
mCacheMaxValues[it.key()] = QVariant( -DBL_MAX );
}
else
{
mCacheMinValues[it.key()] = QVariant();
mCacheMaxValues[it.key()] = QVariant();
}
}

QgsFeature f;
@@ -402,6 +407,18 @@ void QgsVectorDataProvider::fillMinMaxCache()
if ( value > mCacheMaxValues[*it].toDouble() )
mCacheMaxValues[*it] = value;
}
else
{
QString value = varValue.toString();
if ( mCacheMinValues[*it].isNull() || value < mCacheMinValues[*it].toString() )
{
mCacheMinValues[*it] = value;
}
if ( mCacheMaxValues[*it].isNull() || value > mCacheMinValues[*it].toString() )
{
mCacheMaxValues[*it] = value;
}
}
}
}

0 comments on commit ab2a7a8

Please sign in to comment.