Skip to content

Commit

Permalink
Fix loading of composer scalebar (ticket #6195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Aug 14, 2012
1 parent 7f6e873 commit 778e7d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/app/composer/qgscomposerscalebarwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ void QgsComposerScaleBarWidget::refreshMapComboBox()
}
}

if ( saveCurrentComboText.isEmpty() && mComposerScaleBar->composerMap() )
{
//combo box was not initialised before
mMapComboBox->setCurrentIndex( mMapComboBox->findText( tr( "Map %1" ).arg( mComposerScaleBar->composerMap()->id() ) ) );
}
if ( mMapComboBox->findText( saveCurrentComboText ) == -1 )
{
//the former entry is no longer present. Inform the scalebar about the changed composer map
Expand Down
6 changes: 0 additions & 6 deletions src/core/composer/qgscomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,6 @@ void QgsComposition::addComposerMap( QgsComposerMap* map, bool setDefaultPreview

void QgsComposition::addComposerScaleBar( QgsComposerScaleBar* scaleBar )
{
//take first available map
QList<const QgsComposerMap*> mapItemList = composerMapItems();
if ( mapItemList.size() > 0 )
{
scaleBar->setComposerMap( mapItemList.at( 0 ) );
}
addItem( scaleBar );
emit composerScaleBarAdded( scaleBar );
clearSelection();
Expand Down

0 comments on commit 778e7d7

Please sign in to comment.