From 2edb2d8ac795796627f81bad2bb17985f56f1a16 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sun, 5 Nov 2017 20:35:38 +1000 Subject: [PATCH] Remove unused QgsCoordinateTransform::readXml/writeXml methods These methods are not used in master and are of questionable value. Better to serialise the source and dest crs separately and create the transform when required --- doc/api_break.dox | 2 +- src/core/qgscoordinatetransform.cpp | 38 ----------------------------- src/core/qgscoordinatetransform.h | 17 ------------- 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/doc/api_break.dox b/doc/api_break.dox index 38e0fac46c5..adbd66f1a84 100644 --- a/doc/api_break.dox +++ b/doc/api_break.dox @@ -930,7 +930,7 @@ plugins calling these methods will need to be updated. - 'p' argument in transform() has been renamed to 'point', 'theRect' to 'rectangle', 'poly' to 'polygon' - setDestCRSID has been removed, use setDestinationCrs() instead - 'theNode', 'theDoc' parameters in readXML and writeXML have been renamed to 'node' and 'document' respectively -- readXML() and writeXML() have been renamed to readXml() and writeXml() for consistency +- readXML() and writeXML() have been removed. QgsCoordinateTransformCache {#qgis_api_break_3_0_QgsCoordinateTransformCache} diff --git a/src/core/qgscoordinatetransform.cpp b/src/core/qgscoordinatetransform.cpp index fd08c905018..bc6f463665f 100644 --- a/src/core/qgscoordinatetransform.cpp +++ b/src/core/qgscoordinatetransform.cpp @@ -574,44 +574,6 @@ bool QgsCoordinateTransform::isShortCircuited() const return !d->mIsValid || d->mShortCircuit; } -bool QgsCoordinateTransform::readXml( const QDomNode &node ) -{ - d.detach(); - - QgsDebugMsg( "Reading Coordinate Transform from xml ------------------------!" ); - - QDomNode mySrcNode = node.namedItem( QStringLiteral( "sourcesrs" ) ); - d->mSourceCRS.readXml( mySrcNode ); - - QDomNode myDestNode = node.namedItem( QStringLiteral( "destinationsrs" ) ); - d->mDestCRS.readXml( myDestNode ); - - d->mSourceDatumTransform = node.toElement().attribute( QStringLiteral( "sourceDatumTransform" ), QStringLiteral( "-1" ) ).toInt(); - d->mDestinationDatumTransform = node.toElement().attribute( QStringLiteral( "destinationDatumTransform" ), QStringLiteral( "-1" ) ).toInt(); - - return d->initialize(); -} - -bool QgsCoordinateTransform::writeXml( QDomNode &node, QDomDocument &doc ) const -{ - QDomElement myNodeElement = node.toElement(); - QDomElement myTransformElement = doc.createElement( QStringLiteral( "coordinatetransform" ) ); - myTransformElement.setAttribute( QStringLiteral( "sourceDatumTransform" ), QString::number( d->mSourceDatumTransform ) ); - myTransformElement.setAttribute( QStringLiteral( "destinationDatumTransform" ), QString::number( d->mDestinationDatumTransform ) ); - - QDomElement mySourceElement = doc.createElement( QStringLiteral( "sourcesrs" ) ); - d->mSourceCRS.writeXml( mySourceElement, doc ); - myTransformElement.appendChild( mySourceElement ); - - QDomElement myDestElement = doc.createElement( QStringLiteral( "destinationsrs" ) ); - d->mDestCRS.writeXml( myDestElement, doc ); - myTransformElement.appendChild( myDestElement ); - - myNodeElement.appendChild( myTransformElement ); - - return true; -} - const char *finder( const char *name ) { QString proj; diff --git a/src/core/qgscoordinatetransform.h b/src/core/qgscoordinatetransform.h index 82e5e8d12c7..dc4d8af322c 100644 --- a/src/core/qgscoordinatetransform.h +++ b/src/core/qgscoordinatetransform.h @@ -279,23 +279,6 @@ class CORE_EXPORT QgsCoordinateTransform //!initialize is used to actually create the Transformer instance void initialize(); - /** - * Restores state from the given Dom node. - * \param node The node from which state will be restored - * \returns bool True on success, False on failure - * \see writeXml() - */ - bool readXml( const QDomNode &node ); - - /** - * Stores state to the given Dom node in the given document - * \param node The node in which state will be restored - * \param document The document in which state will be stored - * \returns bool True on success, False on failure - * \see readXml() - */ - bool writeXml( QDomNode &node, QDomDocument &document ) const; - private: static void searchDatumTransform( const QString &sql, QList< int > &transforms );