Skip to content
Permalink
Browse files

Fix loading of composer scalebar (ticket #6195)

  • Loading branch information
mhugent committed Aug 14, 2012
1 parent 7f6e873 commit 778e7d735ba8156d6fae55cd1faed77f01f09642
Showing with 5 additions and 6 deletions.
  1. +5 −0 src/app/composer/qgscomposerscalebarwidget.cpp
  2. +0 −6 src/core/composer/qgscomposition.cpp
@@ -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
@@ -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();

0 comments on commit 778e7d7

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