Skip to content

Commit

Permalink
Use better expression to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Apr 19, 2013
1 parent bc62fb0 commit 99c922d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgssymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ QgsExpression* QgsSymbolLayerV2::expression( const QString& property )
QString QgsSymbolLayerV2::dataDefinedPropertyString( const QString& property ) const
{
const QgsExpression* ex = dataDefinedProperty( property );
return ex ? ex->dump() : QString();
return ex ? ex->expression() : QString();
}

void QgsSymbolLayerV2::setDataDefinedProperty( const QString& property, const QString& expressionString )
Expand Down Expand Up @@ -123,7 +123,7 @@ void QgsSymbolLayerV2::saveDataDefinedProperties( QgsStringMap& stringMap ) cons
{
if ( ddIt.value() )
{
stringMap.insert( ddIt.key() + "_expression", ddIt.value()->dump() );
stringMap.insert( ddIt.key() + "_expression", ddIt.value()->expression() );
}
}
}
Expand All @@ -141,7 +141,7 @@ void QgsSymbolLayerV2::copyDataDefinedProperties( QgsSymbolLayerV2* destLayer )
{
if ( ddIt.value() )
{
destLayer->setDataDefinedProperty( ddIt.key(), ddIt.value()->dump() );
destLayer->setDataDefinedProperty( ddIt.key(), ddIt.value()->expression() );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
}
else
{
function = expr->dump();
function = expr->expression();
}

delete expr;
Expand Down
5 changes: 4 additions & 1 deletion src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ void QgsDataDefinedSymbolDialog::expressionButtonClicked()
}
else
{
attributeCombo->setItemText( 0, QString() );
if ( comboIndex != 0 )
{
attributeCombo->setItemText( 0, QString() );
}
attributeCombo->setCurrentIndex( comboIndex );
}
}
Expand Down

0 comments on commit 99c922d

Please sign in to comment.