From 4aa79c8e70c79a9c62e423095b1a4d151eef1333 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Tue, 14 Oct 2025 16:52:42 -0700 Subject: [PATCH] Fix LT-22265: If there are new 'common' columns show them by default --- .../Controls/XMLViews/XmlBrowseViewBaseVc.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs b/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs index 5cfe3b7ff6..d8ea71ba1c 100644 --- a/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs +++ b/Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs @@ -224,11 +224,26 @@ public XmlBrowseViewBaseVc(XmlNode xnSpec, int fakeFlid, XmlBrowseViewBase xbv) } else { + var newPossibleColumns = new List(m_possibleColumns); foreach (XmlNode node in doc.DocumentElement.SelectNodes("//column")) { + + // if there is a corresponding possible column, remove it from the newPossibleColumns list. + var possible = newPossibleColumns.Find(n => + XmlUtils.GetOptionalAttributeValue(n, "label", "") == + XmlUtils.GetOptionalAttributeValue(node, "label", "NONE")); + if (possible != null) + newPossibleColumns.Remove(possible); if (IsValidColumnSpec(node)) m_columns.Add(node); } + + foreach (var node in newPossibleColumns) + { + // add any possible columns that were not in the saved list and are common + if (XmlUtils.GetOptionalAttributeValue(node, "common", "false") == "true") + m_columns.Add(node); + } } m_fakeFlid = fakeFlid; SetupSelectColumn();