Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Select a valid variant when there's no variant with the same number o…
…f colors in new scheme. Fixes #2254

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12511 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 19, 2009
1 parent ca70498 commit e3ea4be
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -59,7 +59,13 @@ void QgsVectorColorBrewerColorRampV2Dialog::populateVariants()
}

// try to set the original variant again (if exists)
cboColors->setCurrentIndex( cboColors->findText( oldVariant ) );
int idx = cboColors->findText( oldVariant );
if ( idx == -1 ) // not found?
{
// use the last item
idx = cboColors->count() - 1;
}
cboColors->setCurrentIndex( idx );
}

void QgsVectorColorBrewerColorRampV2Dialog::updatePreview()
Expand Down

0 comments on commit e3ea4be

Please sign in to comment.