mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
fix #3001
git-svn-id: http://svn.osgeo.org/qgis/trunk@14228 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
b420878d7f
commit
a2fd4ea818
@ -305,10 +305,7 @@ QVariant QgsVectorDataProvider::minimumValue( int index )
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if ( mCacheMinMaxDirty )
|
||||
{
|
||||
fillMinMaxCache();
|
||||
}
|
||||
fillMinMaxCache();
|
||||
|
||||
if ( !mCacheMinValues.contains( index ) )
|
||||
return QVariant();
|
||||
@ -324,10 +321,7 @@ QVariant QgsVectorDataProvider::maximumValue( int index )
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if ( mCacheMinMaxDirty )
|
||||
{
|
||||
fillMinMaxCache();
|
||||
}
|
||||
fillMinMaxCache();
|
||||
|
||||
if ( !mCacheMaxValues.contains( index ) )
|
||||
return QVariant();
|
||||
@ -358,8 +352,16 @@ void QgsVectorDataProvider::uniqueValues( int index, QList<QVariant> &values, in
|
||||
}
|
||||
}
|
||||
|
||||
void QgsVectorDataProvider::clearMinMaxCache()
|
||||
{
|
||||
mCacheMinMaxDirty = true;
|
||||
}
|
||||
|
||||
void QgsVectorDataProvider::fillMinMaxCache()
|
||||
{
|
||||
if ( !mCacheMinMaxDirty )
|
||||
return;
|
||||
|
||||
const QgsFieldMap& flds = fields();
|
||||
for ( QgsFieldMap::const_iterator it = flds.begin(); it != flds.end(); ++it )
|
||||
{
|
||||
|
@ -356,6 +356,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
|
||||
protected:
|
||||
QVariant convertValue( QVariant::Type type, QString value );
|
||||
|
||||
void clearMinMaxCache();
|
||||
void fillMinMaxCache();
|
||||
|
||||
bool mCacheMinMaxDirty;
|
||||
|
@ -843,6 +843,9 @@ bool QgsOgrProvider::addFeatures( QgsFeatureList & flist )
|
||||
}
|
||||
recalculateFeatureCount();
|
||||
|
||||
if ( returnvalue )
|
||||
clearMinMaxCache();
|
||||
|
||||
return returnvalue;
|
||||
}
|
||||
|
||||
@ -888,6 +891,11 @@ bool QgsOgrProvider::addAttributes( const QList<QgsField> &attributes )
|
||||
|
||||
bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr_map )
|
||||
{
|
||||
if ( attr_map.isEmpty() )
|
||||
return true;
|
||||
|
||||
clearMinMaxCache();
|
||||
|
||||
for ( QgsChangedAttributesMap::const_iterator it = attr_map.begin(); it != attr_map.end(); ++it )
|
||||
{
|
||||
long fid = ( long ) it.key();
|
||||
@ -1049,6 +1057,8 @@ bool QgsOgrProvider::deleteFeatures( const QgsFeatureIds & id )
|
||||
|
||||
recalculateFeatureCount();
|
||||
|
||||
clearMinMaxCache();
|
||||
|
||||
if ( extent_ )
|
||||
{
|
||||
free( extent_ );
|
||||
|
Loading…
x
Reference in New Issue
Block a user