mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
QgsCoordinateReferenceSystem::readXML() returns false on failure
simplified a check for valid crs
This commit is contained in:
parent
2d0be1cf69
commit
ac1ee1cd50
@ -400,16 +400,9 @@ bool QgsComposerMapGrid::readXML( const QDomElement& itemElem, const QDomDocumen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QDomElement crsElem = itemElem.firstChildElement( "spatialrefsys" );
|
||||
if ( !crsElem.isNull() )
|
||||
{
|
||||
mCRS.readXML( itemElem );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !mCRS.readXML( itemElem ) )
|
||||
mCRS = QgsCoordinateReferenceSystem();
|
||||
}
|
||||
|
||||
mBlendMode = ( QPainter::CompositionMode )( itemElem.attribute( "blendMode", "0" ).toUInt() );
|
||||
|
||||
//annotation
|
||||
|
@ -1148,6 +1148,7 @@ QString QgsCoordinateReferenceSystem::toWkt() const
|
||||
bool QgsCoordinateReferenceSystem::readXML( const QDomNode & theNode )
|
||||
{
|
||||
QgsDebugMsg( "Reading Spatial Ref Sys from xml ------------------------!" );
|
||||
bool result = true;
|
||||
QDomNode srsNode = theNode.namedItem( "spatialrefsys" );
|
||||
|
||||
if ( ! srsNode.isNull() )
|
||||
@ -1260,8 +1261,9 @@ bool QgsCoordinateReferenceSystem::readXML( const QDomNode & theNode )
|
||||
{
|
||||
// Return default CRS if none was found in the XML.
|
||||
createFromId( GEOCRS_ID, InternalCrsId );
|
||||
result = false;
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QgsCoordinateReferenceSystem::writeXML( QDomNode & theNode, QDomDocument & theDoc ) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user