Skip to content
Permalink
Browse files

Maintain order in scale list (fixes #8320)

  • Loading branch information
SebDieBln committed Dec 8, 2015
1 parent 7671626 commit 9aff9c56891179f1565cca63ef7a10ec4e833569
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/app/qgsoptions.cpp
@@ -2153,8 +2153,16 @@ void QgsOptions::on_mButtonExportColors_clicked()
QListWidgetItem* QgsOptions::addScaleToScaleList( const QString &newScale )
{
QListWidgetItem* newItem = new QListWidgetItem();
int newDenominator = newScale.split( ":" ).value( 1 ).toInt();
int i;
for ( i = 0; i < mListGlobalScales->count(); i++ )
{
int denominator = mListGlobalScales->item( i )->text().split( ":" ).value( 1 ).toInt();
if ( newDenominator > denominator )
break;
}
newItem->setText( newScale );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
mListGlobalScales->addItem( newItem );
mListGlobalScales->insertItem( i, newItem );
return newItem;
}

0 comments on commit 9aff9c5

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