Skip to content

Commit 5d4836e

Browse files
nirvnm-kuhn
authored andcommittedJul 4, 2016
add quotes to field name is the rendering order settings dialog (#3270)
(fixes #15203)
1 parent 3d0e6e8 commit 5d4836e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/gui/qgsorderbydialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
5858
for ( int i = 0; i < mOrderByTableWidget->rowCount(); ++i )
5959
{
6060
QString expressionText = static_cast<QgsFieldExpressionWidget*>( mOrderByTableWidget->cellWidget( i, 0 ) )->currentText();
61+
bool isExpression = static_cast<QgsFieldExpressionWidget*>( mOrderByTableWidget->cellWidget( i, 0 ) )->isExpression();
6162

6263
if ( ! expressionText.isEmpty() )
6364
{
@@ -71,6 +72,9 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
7172
if ( nullsFirstIndex == 1 )
7273
nullsFirst = true;
7374

75+
if ( !isExpression )
76+
expressionText = QgsExpression::quotedColumnRef( expressionText );
77+
7478
QgsFeatureRequest::OrderByClause orderByClause( expressionText, asc, nullsFirst );
7579

7680
orderBy << orderByClause;

0 commit comments

Comments
 (0)
Please sign in to comment.