@@ -597,7 +597,15 @@ internal int ListItemsClass
597597 /// <returns>True if we can't prove the column is invalid</returns>
598598 internal bool IsValidColumnSpec ( XmlNode node )
599599 {
600- List < XmlNode > possibleColumns = ComputePossibleColumns ( ) ;
600+ // In the simple case, `node`s label should match a label in PossibleColumnSpecs. There may be more complicated cases.
601+ // The existing code sure seems complicated and is entirely untested.
602+ var label = XmlUtils . GetLocalizedAttributeValue ( node , "label" , null ) ??
603+ XmlUtils . GetMandatoryAttributeValue ( node , "label" ) ;
604+ var oLabel = XmlUtils . GetAttributeValue ( node , "originalLabel" ) ;
605+ //MenuItem mi = new MenuItem(label, ConfigItemClicked);
606+ if ( XmlViewsUtils . FindNodeWithAttrVal ( ColumnSpecs , "label" , label ) != null ||
607+ XmlViewsUtils . FindNodeWithAttrVal ( ColumnSpecs , "originalLabel" , label ) != null )
608+ return PossibleColumnSpecs . Contains ( node ) ;
601609 //// first, check to see if we can find some part or child node information
602610 //// to process. Eg. Custom field column nodes that refer to parts that no longer exist
603611 //// because the custom field has been removed so the parts cannot be generated
@@ -610,7 +618,7 @@ internal bool IsValidColumnSpec(XmlNode node)
610618 //bool badReversalIndex = CheckForBadReversalIndex(possibleColumns, node);
611619 //if (badReversalIndex)
612620 // return false;
613- return true ; // valid as far as we can tell.
621+ return true ; // valid as far as we can tell.
614622 }
615623
616624 /// <summary>
0 commit comments