[mapguide-commits] r7512 - in trunk/MgDev/Desktop: . MapViewer
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue May 21 08:14:20 PDT 2013
Author: jng
Date: 2013-05-21 08:14:20 -0700 (Tue, 21 May 2013)
New Revision: 7512
Modified:
trunk/MgDev/Desktop/
trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs
Log:
mg-desktop: The fix for #2248 was not the proper fix. This is the right one.
Property changes on: trunk/MgDev/Desktop
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/2.4/MgDev/Desktop:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006,7152
/sandbox/rfc94/Desktop:5099-5163
+ /branches/2.4/MgDev/Desktop:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006,7152
/branches/2.5/MgDev/Desktop:7511
/sandbox/rfc94/Desktop:5099-5163
Modified: trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs 2013-05-21 15:05:39 UTC (rev 7511)
+++ trunk/MgDev/Desktop/MapViewer/MgLegendControlPresenter.cs 2013-05-21 15:14:20 UTC (rev 7512)
@@ -384,35 +384,36 @@
nodesById.Add(group.GetObjectId(), node);
groupsById.Add(group.GetObjectId(), node);
}
+ }
- //Process child groups
- while (remainingNodes.Count > 0)
+ //Process child groups
+ while (remainingNodes.Count > 0)
+ {
+ List<MgLayerGroup> toRemove = new List<MgLayerGroup>();
+ //Establish parent-child relationship for any child groups here
+ for (int j = 0; j < remainingNodes.Count; j++)
{
- List<MgLayerGroup> toRemove = new List<MgLayerGroup>();
- //Establish parent-child relationship for any child groups here
- for (int j = 0; j < remainingNodes.Count; j++)
+ var parentId = remainingNodes[j].Group.GetObjectId();
+ if (nodesById.ContainsKey(parentId))
{
- var parentId = remainingNodes[j].Group.GetObjectId();
- if (nodesById.ContainsKey(parentId))
- {
- var node = CreateGroupNode(remainingNodes[j]);
- nodesById[parentId].Nodes.Add(node);
+ MgLayerGroup grp = remainingNodes[j];
+ var node = CreateGroupNode(grp);
+ nodesById[parentId].Nodes.Add(node);
- //Got to add this group node too, otherwise we could infinite
- //loop looking for a parent that's not registered
- nodesById.Add(group.GetObjectId(), node);
- groupsById.Add(group.GetObjectId(), node);
+ //Got to add this group node too, otherwise we could infinite
+ //loop looking for a parent that's not registered
+ nodesById.Add(grp.GetObjectId(), node);
+ groupsById.Add(grp.GetObjectId(), node);
- toRemove.Add(remainingNodes[j]);
- }
+ toRemove.Add(grp);
}
- //Whittle down this list
- if (toRemove.Count > 0)
+ }
+ //Whittle down this list
+ if (toRemove.Count > 0)
+ {
+ foreach (var g in toRemove)
{
- foreach (var g in toRemove)
- {
- remainingNodes.Remove(g);
- }
+ remainingNodes.Remove(g);
}
}
}
More information about the mapguide-commits
mailing list