Skip to content
Permalink
Browse files

Fix diagrams incorrectly enabled when opening project from >= 2.10

  • Loading branch information
nyalldawson committed Jul 11, 2015
1 parent 388d339 commit c449b95dcb4c37fbc687b4286c68d59758c28be3
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/core/qgsvectorlayer.cpp
@@ -1611,14 +1611,22 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
QDomElement singleCatDiagramElem = node.firstChildElement( "SingleCategoryDiagramRenderer" );
if ( !singleCatDiagramElem.isNull() )
{
mDiagramRenderer = new QgsSingleCategoryDiagramRenderer();
mDiagramRenderer->readXML( singleCatDiagramElem, this );
QDomElement catElem = singleCatDiagramElem.firstChildElement( "DiagramCategory" );
if ( !catElem.isNull() && catElem.attribute( "enabled", "1" ) != "0" )
{
mDiagramRenderer = new QgsSingleCategoryDiagramRenderer();
mDiagramRenderer->readXML( singleCatDiagramElem, this );
}
}
QDomElement linearDiagramElem = node.firstChildElement( "LinearlyInterpolatedDiagramRenderer" );
if ( !linearDiagramElem.isNull() )
{
mDiagramRenderer = new QgsLinearlyInterpolatedDiagramRenderer();
mDiagramRenderer->readXML( linearDiagramElem, this );
QDomElement catElem = linearDiagramElem.firstChildElement( "DiagramCategory" );
if ( !catElem.isNull() && catElem.attribute( "enabled", "1" ) != "0" )
{
mDiagramRenderer = new QgsLinearlyInterpolatedDiagramRenderer();
mDiagramRenderer->readXML( linearDiagramElem, this );
}
}

if ( mDiagramRenderer )

0 comments on commit c449b95

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