Skip to content
Permalink
Browse files

Fix save/restore of a layers geometry properties

  • Loading branch information
m-kuhn committed Aug 21, 2018
1 parent c01220c commit d77906ab623175dd1966f4cc93c322c312670853
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/core/qgsvectorlayer.cpp
@@ -2055,6 +2055,10 @@ bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMes
mFieldWidgetSetups[fieldName] = setup;
}

QDomElement geometryOptionsElement = layerNode.namedItem( QStringLiteral( "geometryOptions" ) ).toElement();
mGeometryOptions.geometryPrecision = geometryOptionsElement.attribute( QStringLiteral( "geometryPrecision" ), QStringLiteral( "0.0" ) ).toDouble();
mGeometryOptions.removeDuplicateNodes = geometryOptionsElement.attribute( QStringLiteral( "removeDuplicateNodes" ), QStringLiteral( "0" ) ).toInt() == 1;

mEditFormConfig.readXml( layerNode, context );

mAttributeTableConfig.readXml( layerNode );
@@ -2249,6 +2253,12 @@ bool QgsVectorLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString
QDomElement fieldConfigurationElement = doc.createElement( QStringLiteral( "fieldConfiguration" ) );
node.appendChild( fieldConfigurationElement );

QDomElement geometryOptionsElement = doc.createElement( QStringLiteral( "geometryOptions" ) );
node.appendChild( geometryOptionsElement );

geometryOptionsElement.setAttribute( QStringLiteral( "removeDuplicateNodes" ), mGeometryOptions.removeDuplicateNodes ? 1 : 0 );
geometryOptionsElement.setAttribute( QStringLiteral( "geometryPrecision" ), mGeometryOptions.geometryPrecision );

int index = 0;
Q_FOREACH ( const QgsField &field, mFields )
{

0 comments on commit d77906a

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