From 56309efc4cefb5eceeb7184cabaf0d1709a7b274 Mon Sep 17 00:00:00 2001 From: Martin Dobias Date: Mon, 15 May 2017 12:13:15 +0800 Subject: [PATCH] Fix loading of labeling from 2.x projects --- src/core/qgsmaplayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/qgsmaplayer.cpp b/src/core/qgsmaplayer.cpp index 226d3ba6fc9..dab1170b2e4 100644 --- a/src/core/qgsmaplayer.cpp +++ b/src/core/qgsmaplayer.cpp @@ -377,6 +377,10 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWr savedValidation = QgsCoordinateReferenceSystem::customCrsValidation(); QgsCoordinateReferenceSystem::setCustomCrsValidation( nullptr ); + // read custom properties before passing reading further to a subclass, so that + // the subclass can also read custom properties + readCustomProperties( layerElement ); + // now let the children grab what they need from the Dom node. layerError = !readXml( layerElement, context ); @@ -504,8 +508,6 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWr } #endif - readCustomProperties( layerElement ); - mMetadata.readFromLayer( this ); return true;