B2019-154 Resave the windows clipboard so to remove the extra information (not used by PROMS) when copying from a Word document on a Windows 10 computer. Also added logic the prevent redundant refresh of the ribbon and items in the step editor. Both changes help to prevent extreme slowdown of the editor
This commit is contained in:
parent
836f143d87
commit
bf3548fbb1
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user