diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index c3754665..9ebe8fdc 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -167,6 +167,7 @@ namespace Volian.Controls.Library if (this.TableCellEditor.Text.Contains("")) return false; XmlDocument XdOld = new XmlDocument(); + oldXml = _ReplaceTextFont.Replace(oldXml, "$1" + FontChangeFmt + "$4"); // B2021-032: use original font XdOld.LoadXml(AdjustHeightAndWidthForDPI(oldXml)); XmlDocument XdNew = new XmlDocument(); XdNew.LoadXml(AdjustHeightAndWidthForDPI(newXml)); @@ -900,23 +901,29 @@ namespace Volian.Controls.Library if (sfW.Width == sfE.Width) return true; return false; } - public void LoadGrid(ItemInfo itemInfo) + // B2021-032: Changes (summary of changes after approval) occur when table does not change. This occurs if the font + // of the table changed in the format so that when the font was used the first time, the save code saw it + // as a difference. Save the new font, so that it can be used when doing the comparison before saving data. + private string _fontChangeFmt = null; + public string FontChangeFmt { get => _fontChangeFmt; set => _fontChangeFmt = value; } + public void LoadGrid(ItemInfo itemInfo) { int profileDepth = ProfileTimer.Push(">>>> VlnFlexGrid.LoadGrid"); _MyItemInfo = itemInfo; string str = itemInfo.MyContent.MyGrid.Data; VE_Font vefont = _MyItemInfo.GetItemFont(); - // the following code is used to be sure that the font used for symbols is the correct font - // based on whether the font for non-symbol text is fixed or proportional. Each steprtb has - // a font for the non-symbol AND the symbol text, and these must be the correct association, i.e. - // for fixed fonts, the symbol font is 'VESymbFix', for proportional fonts, the symbol font is - // 'Arial Unicode MS'. The underlying flexgrid stores the fonts, and if the table font was - // reset for some reason (for example from the drop-down font selection in the user interface), - // this code 'cleans' up if there is a mismatch. + // the following code is used to be sure that the font used for symbols is the correct font + // based on whether the font for non-symbol text is fixed or proportional. Each steprtb has + // a font for the non-symbol AND the symbol text, and these must be the correct association, i.e. + // for fixed fonts, the symbol font is 'VESymbFix', for proportional fonts, the symbol font is + // 'Arial Unicode MS'. The underlying flexgrid stores the fonts, and if the table font was + // reset for some reason (for example from the drop-down font selection in the user interface), + // this code 'cleans' up if there is a mismatch. + FontFamily ff = null; if (StepRTB.MyFontFamily != null) { - FontFamily ff = StepRTB.MyFontFamily; + ff = StepRTB.MyFontFamily; if (StepRTB.MySymbolFontName != "FreeMono") // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing str = _ReplaceVESymbFix.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3"); if (StepRTB.MySymbolFontName != Volian.Base.Library.vlnFont.ProportionalSymbolFont) // C2017-036 get best available proportional font for symbols @@ -925,13 +932,15 @@ namespace Volian.Controls.Library } else { - FontFamily ff = vefont.WindowsFont.FontFamily; + ff = vefont.WindowsFont.FontFamily; if (FontIsFixed(vefont.WindowsFont)) str = _ReplaceArialUnicodeMS.Replace(str, "$1" + "FreeMono" + "$3"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing else str = _ReplaceVESymbFix.Replace(str, "$1" + Volian.Base.Library.vlnFont.ProportionalSymbolFont + "$3"); // C2017-036 get best available proportional font for symbols str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4"); } + FontChangeFmt = ff.Name; // B2021-032 + // To prevent scroll bars from being flashed on/off // - save an image of the current grid // - set Visible to false