Skip to content
Permalink
Browse files

[composer] Fix crash when loading project

  • Loading branch information
nyalldawson committed Aug 18, 2014
1 parent 1a89731 commit 0b213b6f403fce742d3756dcb16f0d7547f7ca8c
Showing with 10 additions and 4 deletions.
  1. +7 −2 src/core/composer/qgscomposermapoverview.cpp
  2. +3 −2 src/core/composer/qgscomposition.cpp
@@ -203,7 +203,7 @@ void QgsComposerMapOverview::setFrameMap( const int mapId )
}

//disconnect old map
if ( mFrameMapId != -1 && mComposerMap->composition() )
if ( mFrameMapId != -1 && mComposerMap && mComposerMap->composition() )
{
const QgsComposerMap* map = mComposerMap->composition()->getComposerMapById( mFrameMapId );
if ( map )
@@ -218,6 +218,11 @@ void QgsComposerMapOverview::setFrameMap( const int mapId )

void QgsComposerMapOverview::connectSignals()
{
if ( !mComposerMap )
{
return;
}

if ( mFrameMapId != -1 && mComposerMap->composition() )
{
const QgsComposerMap* map = mComposerMap->composition()->getComposerMapById( mFrameMapId );
@@ -258,7 +263,7 @@ void QgsComposerMapOverview::overviewExtentChanged()
}

//if using overview centering, update the map's extent
if ( mComposerMap && mComposerMap->composition() && mCentered && mFrameMapId != -1 )
if ( mComposerMap->composition() && mCentered && mFrameMapId != -1 )
{
QgsRectangle extent = *mComposerMap->currentMapExtent();

@@ -1057,8 +1057,9 @@ void QgsComposition::addItemsFromXML( const QDomElement& elem, const QDomDocumen
QgsComposerMap* map = ( *mit );
if ( map )
{
QList<QgsComposerMapOverview* >::iterator overviewIt = map->mapOverviews().begin();
for ( ; overviewIt != map->mapOverviews().end(); ++overviewIt )
QList<QgsComposerMapOverview* > overviews = map->mapOverviews();
QList<QgsComposerMapOverview* >::iterator overviewIt = overviews.begin();
for ( ; overviewIt != overviews.end(); ++overviewIt )
{
( *overviewIt )->connectSignals();
}

0 comments on commit 0b213b6

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