Skip to content
Permalink
Browse files

Improve efficiency of load old props

(cherry picked from commit 0b312d9)
  • Loading branch information
m-kuhn authored and nyalldawson committed Dec 22, 2020
1 parent 0ba9655 commit e54a2cdef332cbc14530bf6d5043eda2ad2472b1
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/symbology/qgssymbollayer.cpp
@@ -364,7 +364,7 @@ void QgsSymbolLayer::restoreOldDataDefinedProperties( const QgsStringMap &string
QgsStringMap::const_iterator propIt = stringMap.constBegin();
for ( ; propIt != stringMap.constEnd(); ++propIt )
{
QgsProperty prop;
std::unique_ptr<QgsProperty> prop;
QString propertyName;

if ( propIt.key().endsWith( QLatin1String( "_dd_expression" ) ) )
@@ -374,7 +374,7 @@ void QgsSymbolLayer::restoreOldDataDefinedProperties( const QgsStringMap &string
//get data defined property name by stripping "_dd_expression" from property key
propertyName = propIt.key().left( propIt.key().length() - 14 );

prop = propertyFromMap( stringMap, propertyName );
prop = qgis::make_unique<QgsProperty>( propertyFromMap( stringMap, propertyName ) );
}
else if ( propIt.key().endsWith( QLatin1String( "_expression" ) ) )
{
@@ -383,7 +383,7 @@ void QgsSymbolLayer::restoreOldDataDefinedProperties( const QgsStringMap &string
//get data defined property name by stripping "_expression" from property key
propertyName = propIt.key().left( propIt.key().length() - 11 );

prop = QgsProperty::fromExpression( propIt.value() );
prop = qgis::make_unique<QgsProperty>( QgsProperty::fromExpression( propIt.value() ) );
}

if ( !prop || !OLD_PROPS.contains( propertyName ) )
@@ -400,7 +400,7 @@ void QgsSymbolLayer::restoreOldDataDefinedProperties( const QgsStringMap &string
key = QgsSymbolLayer::PropertyStrokeColor;
}

setDataDefinedProperty( key, prop );
setDataDefinedProperty( key, QgsProperty( *prop.get() ) );
}
}

0 comments on commit e54a2cd

Please sign in to comment.
You can’t perform that action at this time.