Skip to content
Permalink
Browse files

disable global composer map counter. Fixes ticket 2042

git-svn-id: http://svn.osgeo.org/qgis/trunk@11867 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Oct 30, 2009
1 parent 7a039d4 commit 27318ae45730dbcf86c1cab5f6fb84068777f77c
Showing with 8 additions and 7 deletions.
  1. +8 −4 src/core/composer/qgscomposermap.cpp
  2. +0 −3 src/core/composer/qgscomposermap.h
@@ -39,17 +39,15 @@
#include <iostream>
#include <cmath>

int QgsComposerMap::mCurrentComposerId = 0;

QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ), mGridEnabled( false ), mGridStyle( Solid ), \
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), \
mGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mGridAnnotationDirection( Horizontal ), \
mRotation( 0 ), mCrossLength( 3 )
{
mComposition = composition;
mId = mComposition->composerMapItems().size();
mMapRenderer = mComposition->mapRenderer();
mId = mCurrentComposerId++;
mPreviewMode = QgsComposerMap::Rectangle;
mCurrentRectangle = rect();

@@ -87,7 +85,7 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )

mComposition = composition;
mMapRenderer = mComposition->mapRenderer();
mId = mCurrentComposerId++;
mId = mComposition->composerMapItems().size();
mPreviewMode = QgsComposerMap::Rectangle;
mCurrentRectangle = rect();

@@ -560,6 +558,7 @@ bool QgsComposerMap::writeXML( QDomElement& elem, QDomDocument & doc ) const
}

QDomElement composerMapElem = doc.createElement( "ComposerMap" );
composerMapElem.setAttribute( "id", mId );

//previewMode
if ( mPreviewMode == Cache )
@@ -643,6 +642,11 @@ bool QgsComposerMap::readXML( const QDomElement& itemElem, const QDomDocument& d
return false;
}

QString idRead = itemElem.attribute( "id", "not found" );
if ( idRead != "not found" )
{
mId = idRead.toInt();
}
mPreviewMode = Rectangle;

//previewMode
@@ -309,9 +309,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
/**Stored layer list (used if layer live-link mKeepLayerSet is disabled)*/
QStringList mLayerSet;

/**For the generation of new unique ids*/
static int mCurrentComposerId;

/**Establishes signal/slot connection for update in case of layer change*/
void connectUpdateSlot();

0 comments on commit 27318ae

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