Skip to content

Commit

Permalink
ending store and restore layer extents in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed May 27, 2016
1 parent b38be6f commit 92aed6e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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" );
Expand Down

0 comments on commit 92aed6e

Please sign in to comment.