Skip to content

Commit 5b98be1

Browse files
author
mhugent
committed
more legend bugfixes
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5041 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 8162ece commit 5b98be1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/legend/qgslegend.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,7 @@ bool QgsLegend::readXML(QDomNode& legendnode)
969969
{
970970
QgsLegendPropertyGroup* thePropertyGroup = new QgsLegendPropertyGroup(lastLayer, "Properties");
971971
childelem.attribute("open") == "true" ? expandItem(thePropertyGroup) : collapseItem(thePropertyGroup);
972-
}
973-
972+
}
974973
child = nextDomNode(child);
975974
}
976975
while(!(child.isNull()));
@@ -1142,6 +1141,7 @@ QTreeWidgetItem* QgsLegend::previousSibling(QTreeWidgetItem* item)
11421141

11431142
QDomNode QgsLegend::nextDomNode(const QDomNode& theNode)
11441143
{
1144+
//todo: generalise this for arbitrary deep trees
11451145
if(!theNode.firstChild().isNull())
11461146
{
11471147
return (theNode.firstChild());
@@ -1158,6 +1158,10 @@ QDomNode QgsLegend::nextDomNode(const QDomNode& theNode)
11581158
{
11591159
return (theNode.parentNode().parentNode().nextSibling());
11601160
}
1161+
else if(!theNode.parentNode().isNull() && !theNode.parentNode().parentNode().isNull() && !theNode.parentNode().parentNode().parentNode().isNull() && !theNode.parentNode().parentNode().parentNode().nextSibling().isNull())
1162+
{
1163+
return (theNode.parentNode().parentNode().parentNode().nextSibling());
1164+
}
11611165
else
11621166
{
11631167
QDomNode nullNode;
@@ -1335,6 +1339,7 @@ void QgsLegend::handleItemChange(QTreeWidgetItem* item, int row)
13351339
}
13361340
}
13371341
mStateOfCheckBoxes[item] = item->checkState(0);
1342+
mMapCanvas->setRenderFlag(true);
13381343
return;
13391344
}
13401345

0 commit comments

Comments
 (0)