Skip to content

Commit

Permalink
[composer] Fix loading atlas settings from pre 2.2 projects (fix #9567)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 15, 2014
1 parent efec316 commit 366daa7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -594,17 +594,18 @@ void QgsAtlasComposition::readXML( const QDomElement& atlasElem, const QDomDocum
}
}
//look for stored composer map, to upgrade pre 2.1 projects
int composerMapNo = atlasElem.attribute( "composerMap", "0" ).toInt();
int composerMapNo = atlasElem.attribute( "composerMap", "-1" ).toInt();
QgsComposerMap * composerMap = 0;
if ( composerMapNo != 0 )
if ( composerMapNo != -1 )
{
QList<QgsComposerMap*> maps;
mComposition->composerItems( maps );
for ( QList<QgsComposerMap*>::iterator it = maps.begin(); it != maps.end(); ++it )
{
if (( *it )->id() == composerMapNo )
{
( *it )->setAtlasDriven( true );
composerMap = ( *it );
composerMap->setAtlasDriven( true );
break;
}
}
Expand Down

0 comments on commit 366daa7

Please sign in to comment.