Skip to content
Permalink
Browse files

ending store and restore layer extents in projects

  • Loading branch information
rldhont committed May 27, 2016
1 parent b38be6f commit 92aed6e38f8549edad6c0677ebefeeacf4dd130c
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/qgsmaplayer.cpp
@@ -424,6 +424,12 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
setMinimumScale( layerElement.attribute( "minimumScale" ).toDouble() );
setMaximumScale( layerElement.attribute( "maximumScale" ).toDouble() );

QDomNode extentNode = layerElement.namedItem( "extent" );
if ( !extentNode.isNull() )
{
setExtent( QgsXmlUtils::readRectangle( extentNode.toElement() ) );
}

// set name
mnl = layerElement.namedItem( "layername" );
mne = mnl.toElement();
@@ -1259,6 +1265,11 @@ void QgsMapLayer::exportNamedStyle( QDomDocument &doc, QString &errorMsg )
myRootNode.setAttribute( "minimumScale", QString::number( minimumScale() ) );
myRootNode.setAttribute( "maximumScale", QString::number( maximumScale() ) );

if ( !mExtent.isNull() )
{
myRootNode.appendChild( QgsXmlUtils::writeRectangle( mExtent, myDocument ) );
}

#if 0
// <transparencyLevelInt>
QDomElement transparencyLevelIntElement = myDocument.createElement( "transparencyLevelInt" );

0 comments on commit 92aed6e

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