Skip to content

Commit

Permalink
data defined symbol dialog: only remove quoting if there is one (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 19, 2014
1 parent e497a5c commit 4e49ad5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp
Expand Up @@ -6,7 +6,9 @@
#include <QComboBox>
#include <QPushButton>

QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ), mVectorLayer( vl )
QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f )
: QDialog( parent, f )
, mVectorLayer( vl )
{
setupUi( this );

Expand Down Expand Up @@ -140,6 +142,7 @@ void QgsDataDefinedSymbolDialog::expressionButtonClicked()
{
attributeCombo->setItemText( 0, d.expressionText() );
attributeCombo->setCurrentIndex( 0 );
Q_ASSERT( d.expressionText() == attributeCombo->currentText() );
}
else
{
Expand All @@ -156,7 +159,7 @@ int QgsDataDefinedSymbolDialog::comboIndexForExpressionString( const QString& ex
{
QString attributeString = expr.trimmed();
int comboIndex = cb->findText( attributeString );
if ( comboIndex == -1 )
if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"') )
{
attributeString.remove( 0, 1 ).chop( 1 );
comboIndex = cb->findText( attributeString );
Expand Down

0 comments on commit 4e49ad5

Please sign in to comment.