@@ -53,8 +53,8 @@ class TestQgsComposerDD : public QObject
5353 void ddEvaluate (); // test setting/evaluating data defined value
5454
5555 private:
56- QgsComposition* mComposition ;
57- QgsMapSettings mMapSettings ;
56+ QgsComposition * mComposition ;
57+ QgsMapSettings * mMapSettings ;
5858 QgsVectorLayer* mVectorLayer ;
5959 QgsComposerMap* mAtlasMap ;
6060 QgsAtlasComposition* mAtlas ;
@@ -66,6 +66,8 @@ void TestQgsComposerDD::initTestCase()
6666 QgsApplication::init ();
6767 QgsApplication::initQgis ();
6868
69+ mMapSettings = new QgsMapSettings ();
70+
6971 // create maplayers from testdata and add to layer registry
7072 QFileInfo vectorFileInfo ( QString ( TEST_DATA_DIR ) + " /france_parts.shp" );
7173 mVectorLayer = new QgsVectorLayer ( vectorFileInfo.filePath (),
@@ -79,15 +81,15 @@ void TestQgsComposerDD::initTestCase()
7981 QgsMapLayerRegistry::instance ()->addMapLayers ( QList<QgsMapLayer*>() << mVectorLayer );
8082
8183 // create composition with composer map
82- mMapSettings . setLayers ( QStringList () << mVectorLayer ->id () );
83- mMapSettings . setCrsTransformEnabled ( true );
84- mMapSettings . setMapUnits ( QGis::Meters );
84+ mMapSettings -> setLayers ( QStringList () << mVectorLayer ->id () );
85+ mMapSettings -> setCrsTransformEnabled ( true );
86+ mMapSettings -> setMapUnits ( QGis::Meters );
8587
8688 // select epsg:2154
8789 QgsCoordinateReferenceSystem crs;
8890 crs.createFromSrid ( 2154 );
89- mMapSettings . setDestinationCrs ( crs );
90- mComposition = new QgsComposition ( mMapSettings );
91+ mMapSettings -> setDestinationCrs ( crs );
92+ mComposition = new QgsComposition ( * mMapSettings );
9193 mComposition ->setPaperSize ( 297 , 210 ); // A4 landscape
9294
9395 // fix the renderer, fill with green
@@ -114,6 +116,7 @@ void TestQgsComposerDD::initTestCase()
114116void TestQgsComposerDD::cleanupTestCase ()
115117{
116118 delete mComposition ;
119+ delete mMapSettings ;
117120
118121 QString myReportFile = QDir::tempPath () + " /qgistest.html" ;
119122 QFile myFile ( myReportFile );
0 commit comments