Skip to content
Permalink
Browse files

QgsCoordinateReferenceSystem::readXML() returns false on failure

simplified a check for valid crs
  • Loading branch information
SebDieBln committed Dec 11, 2015
1 parent 2d0be1c commit ac1ee1cd500492bea87a07cb0dbe93f9bd430cf7
Showing with 5 additions and 10 deletions.
  1. +2 −9 src/core/composer/qgscomposermapgrid.cpp
  2. +3 −1 src/core/qgscoordinatereferencesystem.cpp
@@ -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

0 comments on commit ac1ee1c

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