mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-26 00:02:43 -04:00
ending store and restore layer extents in projects
This commit is contained in:
parent
b38be6f725
commit
92aed6e38f
@ -424,6 +424,12 @@ bool QgsMapLayer::readLayerXML( const QDomElement& layerElement )
|
|||||||
setMinimumScale( layerElement.attribute( "minimumScale" ).toDouble() );
|
setMinimumScale( layerElement.attribute( "minimumScale" ).toDouble() );
|
||||||
setMaximumScale( layerElement.attribute( "maximumScale" ).toDouble() );
|
setMaximumScale( layerElement.attribute( "maximumScale" ).toDouble() );
|
||||||
|
|
||||||
|
QDomNode extentNode = layerElement.namedItem( "extent" );
|
||||||
|
if ( !extentNode.isNull() )
|
||||||
|
{
|
||||||
|
setExtent( QgsXmlUtils::readRectangle( extentNode.toElement() ) );
|
||||||
|
}
|
||||||
|
|
||||||
// set name
|
// set name
|
||||||
mnl = layerElement.namedItem( "layername" );
|
mnl = layerElement.namedItem( "layername" );
|
||||||
mne = mnl.toElement();
|
mne = mnl.toElement();
|
||||||
@ -1259,6 +1265,11 @@ void QgsMapLayer::exportNamedStyle( QDomDocument &doc, QString &errorMsg )
|
|||||||
myRootNode.setAttribute( "minimumScale", QString::number( minimumScale() ) );
|
myRootNode.setAttribute( "minimumScale", QString::number( minimumScale() ) );
|
||||||
myRootNode.setAttribute( "maximumScale", QString::number( maximumScale() ) );
|
myRootNode.setAttribute( "maximumScale", QString::number( maximumScale() ) );
|
||||||
|
|
||||||
|
if ( !mExtent.isNull() )
|
||||||
|
{
|
||||||
|
myRootNode.appendChild( QgsXmlUtils::writeRectangle( mExtent, myDocument ) );
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// <transparencyLevelInt>
|
// <transparencyLevelInt>
|
||||||
QDomElement transparencyLevelIntElement = myDocument.createElement( "transparencyLevelInt" );
|
QDomElement transparencyLevelIntElement = myDocument.createElement( "transparencyLevelInt" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user