Skip to content

Commit 8df2ecb

Browse files
Fix LT-22265: If there are new 'common' columns show them by default (#486)
1 parent a9b0ab5 commit 8df2ecb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,26 @@ public XmlBrowseViewBaseVc(XmlNode xnSpec, int fakeFlid, XmlBrowseViewBase xbv)
224224
}
225225
else
226226
{
227+
var newPossibleColumns = new List<XmlNode>(m_possibleColumns);
227228
foreach (XmlNode node in doc.DocumentElement.SelectNodes("//column"))
228229
{
230+
231+
// if there is a corresponding possible column, remove it from the newPossibleColumns list.
232+
var possible = newPossibleColumns.Find(n =>
233+
XmlUtils.GetOptionalAttributeValue(n, "label", "") ==
234+
XmlUtils.GetOptionalAttributeValue(node, "label", "NONE"));
235+
if (possible != null)
236+
newPossibleColumns.Remove(possible);
229237
if (IsValidColumnSpec(node))
230238
m_columns.Add(node);
231239
}
240+
241+
foreach (var node in newPossibleColumns)
242+
{
243+
// add any possible columns that were not in the saved list and are common
244+
if (XmlUtils.GetOptionalAttributeValue(node, "common", "false") == "true")
245+
m_columns.Add(node);
246+
}
232247
}
233248
m_fakeFlid = fakeFlid;
234249
SetupSelectColumn();

0 commit comments

Comments
 (0)