Skip to content

Commit

Permalink
Read the geographic extent only when the trust option is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 10, 2021
1 parent 476ebec commit 2e1fb1b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 2e1fb1b

Please sign in to comment.