B2024-037 - Fixes made for replacing procs and steps via paste/replace functionality.
This commit is contained in:
parent
616acf0e37
commit
21a83df99d
@ -669,7 +669,7 @@ namespace Volian.Controls.Library
|
|||||||
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||||
string key = "Item - " + proc.ItemID.ToString();
|
string key = "Item - " + proc.ItemID.ToString();
|
||||||
|
|
||||||
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
|
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
||||||
{
|
{
|
||||||
DisplayTabItem pg = _MyDisplayTabItems[key];
|
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||||
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
||||||
@ -708,6 +708,11 @@ namespace Volian.Controls.Library
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
||||||
|
{
|
||||||
|
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||||
|
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1825,8 +1825,17 @@ namespace Volian.Controls.Library
|
|||||||
EditItem newFocus = null;
|
EditItem newFocus = null;
|
||||||
EditItem nextEditItem = MyNextEditItem;
|
EditItem nextEditItem = MyNextEditItem;
|
||||||
EditItem prevEditItem = MyPreviousEditItem;
|
EditItem prevEditItem = MyPreviousEditItem;
|
||||||
if (MyStepPanel?.SelectedEditItem?.ActiveParent == null) return null; //Was causing an error when active parent was null and the replaced proc was opened in the editor.
|
EditItem parentEditItem = null; // ActiveParent;
|
||||||
EditItem parentEditItem = ActiveParent;
|
try
|
||||||
|
{
|
||||||
|
parentEditItem = ActiveParent ?? MyStepPanel?.SelectedEditItem?.ActiveParent;
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
// Handle the case where ActiveParent throws a NullReferenceException
|
||||||
|
parentEditItem = MyStepPanel?.SelectedEditItem?.ActiveParent;
|
||||||
|
}
|
||||||
|
//EditItem parentEditItem = MyStepPanel?.SelectedEditItem?.ActiveParent; // ActiveParent;
|
||||||
|
|
||||||
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
||||||
int TopMostYBefore = TopMostEditItem.Top;
|
int TopMostYBefore = TopMostEditItem.Top;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user