Skip to content

Commit

Permalink
add quotes to field name is the rendering order settings dialog (#3270)
Browse files Browse the repository at this point in the history
(fixes #15203)
  • Loading branch information
nirvn authored and m-kuhn committed Jul 4, 2016
1 parent 3d0e6e8 commit 5d4836e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/qgsorderbydialog.cpp
Expand Up @@ -58,6 +58,7 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
for ( int i = 0; i < mOrderByTableWidget->rowCount(); ++i )
{
QString expressionText = static_cast<QgsFieldExpressionWidget*>( mOrderByTableWidget->cellWidget( i, 0 ) )->currentText();
bool isExpression = static_cast<QgsFieldExpressionWidget*>( mOrderByTableWidget->cellWidget( i, 0 ) )->isExpression();

if ( ! expressionText.isEmpty() )
{
Expand All @@ -71,6 +72,9 @@ QgsFeatureRequest::OrderBy QgsOrderByDialog::orderBy()
if ( nullsFirstIndex == 1 )
nullsFirst = true;

if ( !isExpression )
expressionText = QgsExpression::quotedColumnRef( expressionText );

QgsFeatureRequest::OrderByClause orderByClause( expressionText, asc, nullsFirst );

orderBy << orderByClause;
Expand Down

0 comments on commit 5d4836e

Please sign in to comment.