Skip to content

Commit 4e49ad5

Browse files
committed
data defined symbol dialog: only remove quoting if there is one (fixes #9783)
1 parent e497a5c commit 4e49ad5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gui/symbology-ng/qgsdatadefinedsymboldialog.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#include <QComboBox>
77
#include <QPushButton>
88

9-
QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ), mVectorLayer( vl )
9+
QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f )
10+
: QDialog( parent, f )
11+
, mVectorLayer( vl )
1012
{
1113
setupUi( this );
1214

@@ -140,6 +142,7 @@ void QgsDataDefinedSymbolDialog::expressionButtonClicked()
140142
{
141143
attributeCombo->setItemText( 0, d.expressionText() );
142144
attributeCombo->setCurrentIndex( 0 );
145+
Q_ASSERT( d.expressionText() == attributeCombo->currentText() );
143146
}
144147
else
145148
{
@@ -156,7 +159,7 @@ int QgsDataDefinedSymbolDialog::comboIndexForExpressionString( const QString& ex
156159
{
157160
QString attributeString = expr.trimmed();
158161
int comboIndex = cb->findText( attributeString );
159-
if ( comboIndex == -1 )
162+
if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"') )
160163
{
161164
attributeString.remove( 0, 1 ).chop( 1 );
162165
comboIndex = cb->findText( attributeString );

0 commit comments

Comments
 (0)