Skip to content
Permalink
Browse files

Read the geographic extent only when the trust option is activated

  • Loading branch information
pblottiere committed Mar 10, 2021
1 parent 476ebec commit 2e1fb1b18246b3adca449bf734b8ebbcc2cdb014
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/core/qgsmaplayer.cpp
@@ -392,15 +392,13 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, QgsReadWriteCon
setRefreshOnNofifyMessage( layerElement.attribute( QStringLiteral( "refreshOnNotifyMessage" ), QString() ) );
setRefreshOnNotifyEnabled( layerElement.attribute( QStringLiteral( "refreshOnNotifyEnabled" ), QStringLiteral( "0" ) ).toInt() );

// geographic extent
// if ( mReadExtentFromXml )
// {
QDomNode geoExtentNode = layerElement.namedItem( QStringLiteral( "geographicExtent" ) );
if ( !geoExtentNode.isNull() )
// geographic extent is read only if necessary
if ( mReadFlags & QgsMapLayer::ReadFlag::FlagTrustLayerMetadata )
{
mGeographicExtent = QgsXmlUtils::readRectangle( geoExtentNode.toElement() );
const QDomNode geoExtentNode = layerElement.namedItem( QStringLiteral( "geographicExtent" ) );
if ( !geoExtentNode.isNull() )
mGeographicExtent = QgsXmlUtils::readRectangle( geoExtentNode.toElement() );
}
// }

return ! layerError;
} // bool QgsMapLayer::readLayerXML

0 comments on commit 2e1fb1b

Please sign in to comment.