B2021-090 fixed issue were PROMS crashed when you clicked and dragged on a RO table. Also added logic to disable the Font Size dropdown on the Table Ribbon when on an RO Table and if there wasn’t any font size information to load from the format files.

This commit is contained in:
John Jenko 2021-08-26 14:20:29 +00:00
parent c40f58f572
commit b1a91b9e63

View File

@ -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()
{