diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 0dee3df9..638c5112 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -2588,7 +2588,8 @@ namespace Volian.Controls.Library { // Selected table cell is not in edit mode. Go into edit mode and position according // to the pass in selOpt. - if (MyFlexGrid != null && MyFlexGrid.Editor == null) + // B2021-090 don't try to get the font size on an RO table + if (MyFlexGrid != null && MyFlexGrid.Editor == null && !MyFlexGrid.IsRoTable) { float fntSz = 0; C1.Win.C1FlexGrid.CellRange cr = MyFlexGrid.Selection; // get the selected grid cell range @@ -4291,6 +4292,16 @@ namespace Volian.Controls.Library // C2021-005 - setup the font size dropdowns for the table ribbon and context menu // A list of font sizes is set in the base format file and can be overidden in a plant's format file string tfntszs = MyItemInfo.ActiveFormat.PlantFormat.FormatData.FontSizes.TableFontSizes; + // B2021-090 If the current formats were not updated then there will be no list of table font sizes + // so in this case we want to disable the font size dropdown list in the table ribbon and in the context menu + if (tfntszs == null) + { + btnCMChgFontSize.Enabled = false; + rbTblFont.Enabled = false; + rbTblFntSz.Enabled = false; + cmFontSizeList.Enabled = false; + return; + } rbTblFntSz.Items.Clear(); cmFontSizeList.Items.Clear(); rbTblFntSz.Items.AddRange(tfntszs.Replace(" ", "").Split(",".ToCharArray())); // dropdown on table ribbon @@ -4325,7 +4336,9 @@ namespace Volian.Controls.Library btnTblDgnPaste.Enabled = ((VlnFlexGrid.MyCopyInfo.MyCopiedFlexGrid != null) && enableContent); btnTblDgnSplitCells.Enabled = enableContent; btnCmGridSplitCell.Enabled = enableContent; - + //B2021-090 don't enable the font size selection on RO tables - was crashing trying to read font sizes on an RO table + // enableContent is set to false (above) when on an RO table + rbTblFont.Enabled = enableContent; } public void SetRibbonForGridCellIndent() {