Skip to content
Permalink
Browse files

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
wonder committed Dec 19, 2009
1 parent ca70498 commit e3ea4be44036fe4168611a0c7d39bbb6334d6261
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/gui/symbology-ng/qgsvectorcolorbrewercolorrampv2dialog.cpp
@@ -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()

0 comments on commit e3ea4be

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