From 05e048c8834ce972f7efe82015c68d848447e04b Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 6 Feb 2026 10:44:37 -0800 Subject: [PATCH] Fix LT-22401: Crash when Is Translation Column is added --- Src/Common/Controls/XMLViews/XmlViewsUtils.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Src/Common/Controls/XMLViews/XmlViewsUtils.cs b/Src/Common/Controls/XMLViews/XmlViewsUtils.cs index 7dd15cdcaa..1ffcd8a631 100644 --- a/Src/Common/Controls/XMLViews/XmlViewsUtils.cs +++ b/Src/Common/Controls/XMLViews/XmlViewsUtils.cs @@ -460,7 +460,7 @@ static void CollectBrowseItems(int hvo, XmlNode node, ArrayList collector, case "layout": // These are grouping nodes. In general this terminates things. However, if there is only // one thing embedded apart from comments and properties, we can proceed. - XmlNode mainChild = FindMainChild(node, hvo, cache); + XmlNode mainChild = FindMainChild(node, hvo, cache, sda); if (mainChild == null) { // no single non-trivial child, keep our current object @@ -483,7 +483,7 @@ static void CollectBrowseItems(int hvo, XmlNode node, ArrayList collector, /// Returns null if there is more than one child. /// /// ------------------------------------------------------------------------------------ - static private XmlNode FindMainChild(XmlNode node, int hvo, LcmCache cache) + static private XmlNode FindMainChild(XmlNode node, int hvo, LcmCache cache, ISilDataAccess sda) { XmlNode mainChild = null; int count = 0; @@ -493,21 +493,21 @@ static private XmlNode FindMainChild(XmlNode node, int hvo, LcmCache cache) continue; if (cache != null && child.Name == "if") { - if (!XmlVc.ConditionPasses(child, hvo, cache)) + if (!XmlVc.ConditionPasses(child, hvo, cache, sda, null)) { // Act as if the node is not present. continue; } - mainChild = FindMainChild(child, hvo, cache); + mainChild = FindMainChild(child, hvo, cache, sda); } else if (cache != null && child.Name == "ifnot") { - if (XmlVc.ConditionPasses(child, hvo, cache)) + if (XmlVc.ConditionPasses(child, hvo, cache, sda, null)) { // Act as if the node is not present. continue; } - mainChild = FindMainChild(child, hvo, cache); + mainChild = FindMainChild(child, hvo, cache, sda); } else { @@ -1127,7 +1127,7 @@ static NodeDisplayCommand GetDisplayCommandForColumn1(IManyOnePathSortItem bvi, case "concpara": case "innerpile": { - XmlNode mainChild = FindMainChild(node,hvo, cache); + XmlNode mainChild = FindMainChild(node,hvo, cache, sda); if (mainChild == null) return new NodeDisplayCommand(node); // can't usefully go further. if (collectOuterStructParts != null) @@ -1155,7 +1155,7 @@ static NodeDisplayCommand GetDisplayCommandForColumn1(IManyOnePathSortItem bvi, // Also, expecially in the case of 'layout', they may result from unification, and be meaningless // except for their children; in any case, the children are all we want to process. // This is the main reason we return a command, not just a node: this case has to return the subclass. - XmlNode mainChild = FindMainChild(node, hvo, cache); + XmlNode mainChild = FindMainChild(node, hvo, cache, sda); if (mainChild == null) return new NodeChildrenDisplayCommand(node); // can't usefully go further. return GetDisplayCommandForColumn1(bvi, mainChild, cache, mdc, sda, layouts, depth, out hvo, collectOuterStructParts); @@ -1168,7 +1168,7 @@ static NodeDisplayCommand GetDisplayCommandForColumn1(IManyOnePathSortItem bvi, // Also, expecially in the case of 'layout', they may result from unification, and be meaningless // except for their children; in any case, the children are all we want to process. // This is the main reason we return a command, not just a node: this case has to return the subclass. - XmlNode mainChild = FindMainChild(node, hvo, cache); + XmlNode mainChild = FindMainChild(node, hvo, cache, sda); if (mainChild == null) return new NodeChildrenDisplayCommand(node); // can't usefully go further. return GetDisplayCommandForColumn1(bvi, mainChild, cache, mdc, sda, layouts, depth, out hvo, collectOuterStructParts);