Skip to content

Commit

Permalink
Fix diagrams incorrectly enabled when opening project from >= 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 11, 2015
1 parent 388d339 commit c449b95
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit c449b95

Please sign in to comment.