C2017-031 Extend Copy / Paste Replace Functionality for Enhanced Background Steps
This commit is contained in:
@@ -1750,7 +1750,7 @@ namespace Volian.Controls.Library
|
||||
// note in follow if statements, 'setting' == false when in enhanced document:
|
||||
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
||||
allowDel = true; // allow delete if not linked
|
||||
btnCpyStp.Enabled = setting;
|
||||
btnCpyStp.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi); // C2017-031: Support for paste/replace an enhanced step
|
||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
//B2020-058: crash on null reference
|
||||
@@ -1801,7 +1801,8 @@ namespace Volian.Controls.Library
|
||||
btnPasteAfter.Enabled = btnCMPasteAfter.Enabled = enable;
|
||||
//B20170-158 Don't allow a step to replace a linked step
|
||||
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && !MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep;
|
||||
// C2017-031: Support for paste/replace an enhanced step, enable button
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && ((!MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep) || (MyItemInfo.IsEnhancedStep));
|
||||
}
|
||||
private void SetPasteButtonEnabled()
|
||||
{
|
||||
@@ -4110,9 +4111,19 @@ namespace Volian.Controls.Library
|
||||
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
||||
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
|
||||
EditItem oldEditItem = MyEditItem;
|
||||
// C2017-031: Support for paste/replace an enhanced step, if pasting an enhanced, remove its EditItem from the 'cache'. A new EditItem gets created during paste.
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.IsEnhancedStep) MyEditItem.MyStepPanel._LookupEditItems.Remove(MyEditItem.MyItemInfo.ItemID);
|
||||
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, add Dispose of old EditItem if enhanced
|
||||
if (MyEditItem != null && ((MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) || MyEditItem.MyItemInfo.IsEnhancedStep))
|
||||
oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, refresh ItemInfo's in user interface caches.
|
||||
if (MyEditItem.MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
MyEditItem.MyItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
tmp.MyStepPanel.SelectedItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPdfCreate_Click(object sender, EventArgs e)
|
||||
|
Reference in New Issue
Block a user