Skip to content

Commit 6ffe507

Browse files
committedJan 14, 2017
[composer] Remove support for upgrading pre 2.2 project atlas map
settings Open the project in a recent 2.x release and resave to upgrade the project
1 parent b548063 commit 6ffe507

File tree

6 files changed

+2
-63
lines changed

6 files changed

+2
-63
lines changed
 

‎doc/api_break.dox

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ QgsAdvancedDigitizingDockWidget {#qgis_api_break_3_0_QgsAdvancedDigitizin
399399
QgsAtlasComposition {#qgis_api_break_3_0_QgsAtlasComposition}
400400
-------------------
401401

402-
- readXMLMapSettings() has been renamed to readXmlMapSettings()
402+
- readXMLMapSettings() was removed. QGIS no longer supports upgrading pre 2.2 compositions and if this is a
403+
requirement the projects should first be upgraded by opening and saving in 2.18.
403404
- composerMap() and setComposerMap() were removed. Use QgsComposerMap::atlasDriven() and setAtlasDriven()
404405
instead
405406
- fixedScale() and setFixedScale() were removed. Use QgsComposerMap::atlasScalingMode() and setAtlasScalingMode()

‎python/core/composer/qgsatlascomposition.sip

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,6 @@ public:
189189
*/
190190
void readXml( const QDomElement& elem, const QDomDocument& doc );
191191

192-
/** Reads old (pre 2.2) map related atlas settings from xml
193-
* @param elem a QDomElement holding the atlas map properties.
194-
* @param doc QDomDocument for the source xml.
195-
* @see readXMLMapSettings
196-
* @note This method should be called after restoring composer item properties
197-
* @note added in version 2.5
198-
*/
199-
void readXmlMapSettings( const QDomElement& elem, const QDomDocument& doc );
200-
201192
QgsComposition* composition();
202193

203194
/** Requeries the current atlas coverage layer and applies filtering and sorting. Returns

‎src/app/composer/qgscomposer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,10 +3588,6 @@ void QgsComposer::readXml( const QDomElement& composerElem, const QDomDocument&
35883588
delete oldAtlasWidget;
35893589
mAtlasDock->setWidget( new QgsAtlasCompositionWidget( mAtlasDock, mComposition ) );
35903590

3591-
//read atlas map parameters (for pre 2.2 templates)
3592-
//this part must be done after adding items
3593-
mComposition->atlasComposition().readXmlMapSettings( atlasElem, doc );
3594-
35953591
//set state of atlas controls
35963592
QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
35973593
toggleAtlasControls( atlasMap->enabled() );

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -661,40 +661,6 @@ void QgsAtlasComposition::readXml( const QDomElement& atlasElem, const QDomDocum
661661
emit parameterChanged();
662662
}
663663

664-
void QgsAtlasComposition::readXmlMapSettings( const QDomElement &elem, const QDomDocument &doc )
665-
{
666-
Q_UNUSED( doc );
667-
//look for stored composer map, to upgrade pre 2.1 projects
668-
int composerMapNo = elem.attribute( QStringLiteral( "composerMap" ), QStringLiteral( "-1" ) ).toInt();
669-
QgsComposerMap * composerMap = nullptr;
670-
if ( composerMapNo != -1 )
671-
{
672-
QList<QgsComposerMap*> maps;
673-
mComposition->composerItems( maps );
674-
for ( QList<QgsComposerMap*>::iterator it = maps.begin(); it != maps.end(); ++it )
675-
{
676-
if (( *it )->id() == composerMapNo )
677-
{
678-
composerMap = ( *it );
679-
composerMap->setAtlasDriven( true );
680-
break;
681-
}
682-
}
683-
}
684-
685-
//upgrade pre 2.1 projects
686-
double margin = elem.attribute( QStringLiteral( "margin" ), QStringLiteral( "0.0" ) ).toDouble();
687-
if ( composerMap && !qgsDoubleNear( margin, 0.0 ) )
688-
{
689-
composerMap->setAtlasMargin( margin );
690-
}
691-
bool fixedScale = elem.attribute( QStringLiteral( "fixedScale" ), QStringLiteral( "false" ) ) == QLatin1String( "true" ) ? true : false;
692-
if ( composerMap && fixedScale )
693-
{
694-
composerMap->setAtlasScalingMode( QgsComposerMap::Fixed );
695-
}
696-
}
697-
698664
void QgsAtlasComposition::setHideCoverage( bool hide )
699665
{
700666
mHideCoverage = hide;

‎src/core/composer/qgsatlascomposition.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
220220
*/
221221
void readXml( const QDomElement& elem, const QDomDocument& doc );
222222

223-
/** Reads old (pre 2.2) map related atlas settings from xml
224-
* @param elem a QDomElement holding the atlas map properties.
225-
* @param doc QDomDocument for the source xml.
226-
* @see readXMLMapSettings
227-
* @note This method should be called after restoring composer item properties
228-
* @note added in version 2.5
229-
*/
230-
void readXmlMapSettings( const QDomElement& elem, const QDomDocument& doc );
231-
232223
QgsComposition* composition() { return mComposition; }
233224

234225
/** Requeries the current atlas coverage layer and applies filtering and sorting. Returns

‎src/core/composer/qgscomposition.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,12 +1084,6 @@ bool QgsComposition::loadFromTemplate( const QDomDocument& doc, QMap<QString, QS
10841084
//addItemsFromXML
10851085
addItemsFromXml( importDoc.documentElement(), importDoc, nullptr, addUndoCommands, nullptr );
10861086

1087-
//read atlas map parameters (for pre 2.2 templates)
1088-
//this can only be done after items have been added
1089-
if ( clearComposition )
1090-
{
1091-
atlasComposition().readXmlMapSettings( atlasElem, importDoc );
1092-
}
10931087
return true;
10941088
}
10951089

0 commit comments

Comments
 (0)