Skip to content

Commit

Permalink
fix #5176
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 21, 2012
1 parent d651892 commit 5635391
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1078,27 +1078,38 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode )
{
bool initialized = false;

QDomNode myNode = srsNode.namedItem( "authid" );
if ( !myNode.isNull() )
{
operator=( QgsCRSCache::instance()->crsByAuthId( myNode.toElement().text() ) );
if ( isValid() )
{
initialized = true;
}
}
long srsid = srsNode.namedItem( "srsid" ).toElement().text().toLong();

if ( !initialized )
QDomNode myNode;

if ( srsid < USER_CRS_START_ID )
{
myNode = srsNode.namedItem( "epsg" );
myNode = srsNode.namedItem( "authid" );
if ( !myNode.isNull() )
{
operator=( QgsCRSCache::instance()->crsByEpsgId( myNode.toElement().text().toLong() ) );
operator=( QgsCRSCache::instance()->crsByAuthId( myNode.toElement().text() ) );
if ( isValid() )
{
initialized = true;
}
}

if ( !initialized )
{
myNode = srsNode.namedItem( "epsg" );
if ( !myNode.isNull() )
{
operator=( QgsCRSCache::instance()->crsByEpsgId( myNode.toElement().text().toLong() ) );
if ( isValid() )
{
initialized = true;
}
}
}
}
else
{
QgsDebugMsg( "Ignoring authid/epsg for user crs." );
}

if ( initialized )
Expand Down

0 comments on commit 5635391

Please sign in to comment.