Skip to content

Commit

Permalink
[bugfix] Bookmarks fix export SRID and refresh on import
Browse files Browse the repository at this point in the history
Fixes #17674 - Export and Import problems after recent fixes
  • Loading branch information
elpaso committed Dec 13, 2017
1 parent 353ca63 commit 28a61e1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/app/qgsbookmarks.cpp
Expand Up @@ -340,6 +340,7 @@ void QgsBookmarks::importFromXml()
}
mQgisModel->setSort( 0, Qt::AscendingOrder );
mQgisModel->select();
mProxyModel->_resetModel();
}

void QgsBookmarks::exportToXml()
Expand Down Expand Up @@ -388,8 +389,17 @@ void QgsBookmarks::exportToXml()
if ( idx.isValid() )
{
QString value = idx.data( Qt::DisplayRole ).toString();
QDomText idText = doc.createTextNode( value );
QString header = headerList.at( j );
// If it's the EPSG code, convert it to internal srid
if ( header == QStringLiteral( "sr_id" ) )
{
QgsCoordinateReferenceSystem crs;
if ( crs.createFromOgcWmsCrs( value ) )
value = QString::number( QgsCoordinateReferenceSystem::fromOgcWmsCrs( value ).srsid( ) );
else
value = QString();
}
QDomText idText = doc.createTextNode( value );
QDomElement id = doc.createElement( header );
id.appendChild( idText );
bookmark.appendChild( id );
Expand Down

0 comments on commit 28a61e1

Please sign in to comment.