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 c092eff commit a924915
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core/qgsattributetableconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,8 @@ void QgsAttributeTableConfig::readXml( const QDomNode &node )
}

mSortExpression = configNode.toElement().attribute( QStringLiteral( "sortExpression" ) );
mSortOrder = static_cast<Qt::SortOrder>( configNode.toElement().attribute( QStringLiteral( "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( QStringLiteral( "sortOrder" ) ).toInt() );
setSortOrder( sortOrder );
}

QString QgsAttributeTableConfig::sortExpression() const
Expand Down

0 comments on commit a924915

Please sign in to comment.