Skip to content
Permalink
Browse files

ending store and restore layer extents in projects

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

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

// set name
mnl = layerElement.namedItem( "layername" );
mne = mnl.toElement();
@@ -1257,6 +1263,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 62cb55a

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