Skip to content

Commit

Permalink
Fix selecting last page from atlas combo (fix #13311)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 3, 2015
1 parent 166e5bf commit ffd82a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ void QgsComposer::atlasPageComboEditingFinished()
QString text = mAtlasPageComboBox->lineEdit()->text();

//find matching record in combo box
int page = -1;
int page = -1; //note - first page starts at 1, not 0
for ( int i = 0; i < mAtlasPageComboBox->count(); ++i )
{
if ( text.compare( mAtlasPageComboBox->itemData( i, Qt::UserRole + 1 ).toString(), Qt::CaseInsensitive ) == 0
Expand All @@ -1175,7 +1175,7 @@ void QgsComposer::atlasPageComboEditingFinished()
}
bool ok = ( page > 0 );

if ( !ok || page >= mComposition->atlasComposition().numFeatures() || page < 1 )
if ( !ok || page > mComposition->atlasComposition().numFeatures() || page < 1 )
{
mAtlasPageComboBox->blockSignals( true );
mAtlasPageComboBox->setCurrentIndex( mComposition->atlasComposition().currentFeatureNumber() );
Expand Down

0 comments on commit ffd82a3

Please sign in to comment.