Skip to content

Commit

Permalink
Fix crash if undoing / redoing scale bar unit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Aug 13, 2012
1 parent 18f2c43 commit 9a26650
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/composer/qgscomposerscalebarwidget.cpp
Expand Up @@ -182,10 +182,11 @@ void QgsComposerScaleBarWidget::setGuiElements()

//alignment
mAlignmentComboBox->setCurrentIndex(( int )( mComposerScaleBar->alignment() ) );
blockMemberSignals( false );

//units
mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData(( int )mComposerScaleBar->units() ) );

blockMemberSignals( false );
}

//slots
Expand Down Expand Up @@ -420,6 +421,7 @@ void QgsComposerScaleBarWidget::on_mUnitsComboBox_currentIndexChanged( int index
{
return;
}

mComposerScaleBar->beginCommand( tr( "Scalebar unit changed" ) );
mComposerScaleBar->setUnits(( QgsComposerScaleBar::ScaleBarUnits )unitData.toInt() );
mComposerScaleBar->update();
Expand Down

0 comments on commit 9a26650

Please sign in to comment.