Skip to content

Commit 99c922d

Browse files
committedApr 19, 2013
Use better expression to string conversion
1 parent bc62fb0 commit 99c922d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
 

‎src/core/symbology-ng/qgssymbollayerv2.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ QgsExpression* QgsSymbolLayerV2::expression( const QString& property )
4747
QString QgsSymbolLayerV2::dataDefinedPropertyString( const QString& property ) const
4848
{
4949
const QgsExpression* ex = dataDefinedProperty( property );
50-
return ex ? ex->dump() : QString();
50+
return ex ? ex->expression() : QString();
5151
}
5252

5353
void QgsSymbolLayerV2::setDataDefinedProperty( const QString& property, const QString& expressionString )
@@ -123,7 +123,7 @@ void QgsSymbolLayerV2::saveDataDefinedProperties( QgsStringMap& stringMap ) cons
123123
{
124124
if ( ddIt.value() )
125125
{
126-
stringMap.insert( ddIt.key() + "_expression", ddIt.value()->dump() );
126+
stringMap.insert( ddIt.key() + "_expression", ddIt.value()->expression() );
127127
}
128128
}
129129
}
@@ -141,7 +141,7 @@ void QgsSymbolLayerV2::copyDataDefinedProperties( QgsSymbolLayerV2* destLayer )
141141
{
142142
if ( ddIt.value() )
143143
{
144-
destLayer->setDataDefinedProperty( ddIt.key(), ddIt.value()->dump() );
144+
destLayer->setDataDefinedProperty( ddIt.key(), ddIt.value()->expression() );
145145
}
146146
}
147147
}

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ bool QgsSymbolLayerV2Utils::functionFromSldElement( QDomElement &element, QStrin
22542254
}
22552255
else
22562256
{
2257-
function = expr->dump();
2257+
function = expr->expression();
22582258
}
22592259

22602260
delete expr;

‎src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ void QgsDataDefinedSymbolDialog::expressionButtonClicked()
138138
}
139139
else
140140
{
141-
attributeCombo->setItemText( 0, QString() );
141+
if ( comboIndex != 0 )
142+
{
143+
attributeCombo->setItemText( 0, QString() );
144+
}
142145
attributeCombo->setCurrentIndex( comboIndex );
143146
}
144147
}

0 commit comments

Comments
 (0)
Please sign in to comment.