Skip to content

Commit

Permalink
more legend bugfixes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5041 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 17, 2006
1 parent 25470f2 commit a87d4e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/legend/qgslegend.cpp
Expand Up @@ -969,8 +969,7 @@ bool QgsLegend::readXML(QDomNode& legendnode)
{
QgsLegendPropertyGroup* thePropertyGroup = new QgsLegendPropertyGroup(lastLayer, "Properties");
childelem.attribute("open") == "true" ? expandItem(thePropertyGroup) : collapseItem(thePropertyGroup);
}

}
child = nextDomNode(child);
}
while(!(child.isNull()));
Expand Down Expand Up @@ -1142,6 +1141,7 @@ QTreeWidgetItem* QgsLegend::previousSibling(QTreeWidgetItem* item)

QDomNode QgsLegend::nextDomNode(const QDomNode& theNode)
{
//todo: generalise this for arbitrary deep trees
if(!theNode.firstChild().isNull())
{
return (theNode.firstChild());
Expand All @@ -1158,6 +1158,10 @@ QDomNode QgsLegend::nextDomNode(const QDomNode& theNode)
{
return (theNode.parentNode().parentNode().nextSibling());
}
else if(!theNode.parentNode().isNull() && !theNode.parentNode().parentNode().isNull() && !theNode.parentNode().parentNode().parentNode().isNull() && !theNode.parentNode().parentNode().parentNode().nextSibling().isNull())
{
return (theNode.parentNode().parentNode().parentNode().nextSibling());
}
else
{
QDomNode nullNode;
Expand Down Expand Up @@ -1335,6 +1339,7 @@ void QgsLegend::handleItemChange(QTreeWidgetItem* item, int row)
}
}
mStateOfCheckBoxes[item] = item->checkState(0);
mMapCanvas->setRenderFlag(true);
return;
}

Expand Down

0 comments on commit a87d4e4

Please sign in to comment.