Skip to content

Commit c9aaddd

Browse files
authored
Fix issues noted when testing LT-3356 (#440)
1 parent 9ee5d72 commit c9aaddd

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

  • Src/Common/Controls/DetailControls

Src/Common/Controls/DetailControls/Slice.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,19 +2241,30 @@ public Slice ExpandSubItem(int hvo)
22412241
for (int islice = IndexInContainer + 1; islice < cslice; ++islice)
22422242
{
22432243
var slice = ContainingDataTree.Slices[islice];
2244+
// Stop if we get past the children of the current object.
2245+
if (!EmbeddedSlice(slice))
2246+
break;
22442247
if (slice.Object.Hvo == hvo)
22452248
{
22462249
if (slice.Expansion == DataTree.TreeItemState.ktisCollapsed)
22472250
slice.TreeNode.ToggleExpansion(islice);
22482251
return slice;
22492252
}
2250-
// Stop if we get past the children of the current object.
2251-
if (slice.Indent <= Indent)
2252-
break;
22532253
}
22542254
return null;
22552255
}
22562256

2257+
private bool EmbeddedSlice(Slice slice)
2258+
{
2259+
foreach (object obj in Key)
2260+
{
2261+
var node = obj as XmlNode;
2262+
if (IsRefPartNode(node) && !slice.Key.Contains(node))
2263+
return false;
2264+
}
2265+
return true;
2266+
}
2267+
22572268

22582269
/// <summary>
22592270
/// Return true if the target array starts with the objects in the match array.

0 commit comments

Comments
 (0)