Skip to content
Permalink
Browse files

add quotes to field name is the rendering order settings dialog (#3270)

(fixes #15203)
  • Loading branch information
nirvn authored and m-kuhn committed Jul 4, 2016
1 parent 3d0e6e8 commit 5d4836e9b1fb92532c8d723f9c293c0ce27f7250
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/gui/qgsorderbydialog.cpp
@@ -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() )
{
@@ -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;

0 comments on commit 5d4836e

Please sign in to comment.
You can’t perform that action at this time.