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@14034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 9, 2010
1 parent c1bd91f commit e8460ed514e3db2ead7067059eef1d339140ec8f
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 e8460ed

Please sign in to comment.