diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 1aa7aca3..f43a867d 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -827,8 +827,19 @@ namespace Volian.Controls.Library break; } } + private ItemInfo lastItem = null; + private int lastStart = -1; + private int lastLength = -1; + private string lastText = null; void _MyStepRTB_SelectionChanged(object sender, EventArgs e) { + //B2019-154 This will prevent duplicate processing of the ribbon menu and refresh of step items, speeding up the editing experience + if (_MyStepRTB.MyItemInfo == lastItem && _MyStepRTB.SelectionStart == lastStart && _MyStepRTB.SelectionLength == lastLength && _MyStepRTB.SelectedText == lastText) + return; + lastItem = _MyStepRTB.MyItemInfo; + lastStart = _MyStepRTB.SelectionStart; + lastLength = _MyStepRTB.SelectionLength; + lastText = _MyStepRTB.SelectedText; SetButtonAndMenuEnabling(false); } //void _MyStepRTB_MouseUp(object sender, MouseEventArgs e) @@ -1536,6 +1547,36 @@ namespace Volian.Controls.Library try // RHM20150506 Multiline ItemID TextBox { IDataObject iData = Clipboard.GetDataObject(); + // B2019-154 clean up the Windows Clipboard - Word on Windows 10 computers seems to have placed extra information (not needed by PROMS) on the clipboard + if (iData.GetFormats().Length > 1) + { + DataObject myDO = new DataObject(); + foreach (string objname in iData.GetFormats()) + { + switch (objname) + { + //case "Object Descriptor": + //case "HTML Format": + case "EnhancedMetafile": + //case "MetaFilePict": + //case "Embed Source": + //case "Link Source": + //case "Link Source Descriptor": + //case "ObjectLink": + //case "HyperlinkWordBkmk": + //case "Hyperlink": + break; + default: + //case "Text": + //case "Rich Text Format": + myDO.SetData(objname, iData.GetData(objname)); + break; + } + } + Clipboard.Clear(); + Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard + } + iData = Clipboard.GetDataObject(); bool noEquationData = true; // part of bug B2017-117 we were running out of window handles when printing, found this similar use of // creating a new richtextbox just for some processing. Put a Using around this to ensure the window handle