Skip to content

Commit

Permalink
hide setting and value control in setSortOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed May 10, 2017
1 parent a82b8cf commit 8f862a5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core/qgsattributetableconfig.cpp
Expand Up @@ -196,13 +196,8 @@ void QgsAttributeTableConfig::readXml( const QDomNode& node )
}

mSortExpression = configNode.toElement().attribute( "sortExpression" );
mSortOrder = static_cast<Qt::SortOrder>( configNode.toElement().attribute( "sortOrder" ).toInt() );
// fix https://hub.qgis.org/issues/15803
// because static_cast give umpredictable value if value is not in the enum range
if ( mSortOrder != Qt::AscendingOrder && mSortOrder != Qt::DescendingOrder )
{
mSortOrder = Qt::AscendingOrder;
}
Qt::SortOrder sortOrder = static_cast<Qt::SortOrder>( configNode.toElement().attribute( "sortOrder" ).toInt() );
setSortOrder( sortOrder );
}

QString QgsAttributeTableConfig::sortExpression() const
Expand Down

0 comments on commit 8f862a5

Please sign in to comment.