mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix crash with maximumValue/minimumValue for virtual fields
This commit is contained in:
parent
e5a8749402
commit
38d458ce5c
@ -2882,7 +2882,11 @@ QVariant QgsVectorLayer::minimumValue( int index )
|
||||
else if ( origin == QgsFields::OriginEdit || origin == QgsFields::OriginExpression )
|
||||
{
|
||||
// the layer is editable, but in certain cases it can still be avoided going through all features
|
||||
if ( mEditBuffer->mDeletedFeatureIds.isEmpty() && mEditBuffer->mAddedFeatures.isEmpty() && !mEditBuffer->mDeletedAttributeIds.contains( index ) && mEditBuffer->mChangedAttributeValues.isEmpty() )
|
||||
if ( origin == QgsFields::OriginEdit &&
|
||||
mEditBuffer->mDeletedFeatureIds.isEmpty() &&
|
||||
mEditBuffer->mAddedFeatures.isEmpty() && !
|
||||
mEditBuffer->mDeletedAttributeIds.contains( index ) &&
|
||||
mEditBuffer->mChangedAttributeValues.isEmpty() )
|
||||
{
|
||||
return mDataProvider->minimumValue( index );
|
||||
}
|
||||
@ -2937,10 +2941,11 @@ QVariant QgsVectorLayer::maximumValue( int index )
|
||||
|
||||
return vl->maximumValue( sourceLayerIndex );
|
||||
}
|
||||
else if ( origin == QgsFields::OriginEdit )
|
||||
else if ( origin == QgsFields::OriginEdit || origin == QgsFields::OriginExpression )
|
||||
{
|
||||
// the layer is editable, but in certain cases it can still be avoided going through all features
|
||||
if ( mEditBuffer->mDeletedFeatureIds.isEmpty() &&
|
||||
if ( origin == QgsFields::OriginEdit &&
|
||||
mEditBuffer->mDeletedFeatureIds.isEmpty() &&
|
||||
mEditBuffer->mAddedFeatures.isEmpty() &&
|
||||
!mEditBuffer->mDeletedAttributeIds.contains( index ) &&
|
||||
mEditBuffer->mChangedAttributeValues.isEmpty() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user