Skip to content

Commit 253ee7a

Browse files
Fix LT-22265: If there are new 'common' columns show them by default
1 parent a9b0ab5 commit 253ee7a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Src/Common/Controls/XMLViews/XmlBrowseViewBaseVc.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,23 @@ 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+
// if there is a corresponding possible column remove it from the newPossibleColumns list.
231+
var possible = newPossibleColumns.Find(n => n.Attributes?["label"].Value == node.Attributes?["label"].Value);
232+
if (possible != null)
233+
newPossibleColumns.Remove(possible);
229234
if (IsValidColumnSpec(node))
230235
m_columns.Add(node);
231236
}
237+
238+
foreach (var node in newPossibleColumns)
239+
{
240+
// add any possible columns that were not in the saved list and are common
241+
if (XmlUtils.GetOptionalAttributeValue(node, "common", "false") == "true")
242+
m_columns.Add(node);
243+
}
232244
}
233245
m_fakeFlid = fakeFlid;
234246
SetupSelectColumn();

0 commit comments

Comments
 (0)