Skip to content

Commit a924915

Browse files
committedMay 10, 2017
hide setting and value control in setSortOrder
1 parent c092eff commit a924915

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎src/core/qgsattributetableconfig.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,8 @@ void QgsAttributeTableConfig::readXml( const QDomNode &node )
197197
}
198198

199199
mSortExpression = configNode.toElement().attribute( QStringLiteral( "sortExpression" ) );
200-
mSortOrder = static_cast<Qt::SortOrder>( configNode.toElement().attribute( QStringLiteral( "sortOrder" ) ).toInt() );
201-
// fix https://hub.qgis.org/issues/15803
202-
// because static_cast give umpredictable value if value is not in the enum range
203-
if ( mSortOrder != Qt::AscendingOrder && mSortOrder != Qt::DescendingOrder )
204-
{
205-
mSortOrder = Qt::AscendingOrder;
206-
}
200+
Qt::SortOrder sortOrder = static_cast<Qt::SortOrder>( configNode.toElement().attribute( QStringLiteral( "sortOrder" ) ).toInt() );
201+
setSortOrder( sortOrder );
207202
}
208203

209204
QString QgsAttributeTableConfig::sortExpression() const

0 commit comments

Comments
 (0)
Please sign in to comment.