Skip to content

Commit e5fcbc3

Browse files
committed
Small optimisation to data defined symbology
1 parent b148968 commit e5fcbc3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/symbology-ng/qgssymbollayerv2.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const QgsExpression* QgsSymbolLayerV2::dataDefinedProperty( const QString& prope
3838

3939
QgsDataDefined *QgsSymbolLayerV2::getDataDefinedProperty( const QString &property ) const
4040
{
41+
if ( mDataDefinedProperties.isEmpty() )
42+
return 0;
43+
4144
QMap< QString, QgsDataDefined* >::const_iterator it = mDataDefinedProperties.find( property );
4245
if ( it != mDataDefinedProperties.constEnd() )
4346
{
@@ -106,6 +109,9 @@ bool QgsSymbolLayerV2::hasDataDefinedProperties() const
106109

107110
bool QgsSymbolLayerV2::hasDataDefinedProperty( const QString& property ) const
108111
{
112+
if ( mDataDefinedProperties.isEmpty() )
113+
return false;
114+
109115
QgsDataDefined* dd = getDataDefinedProperty( property );
110116
return dd && dd->isActive();
111117
}

0 commit comments

Comments
 (0)