B2017-255: When pasting a source step that has links to an enhanced step into a section that has linked enhanced steps, do not remove the links to the new enhanced step.

This commit is contained in:
Kathy Ruffing 2017-09-27 14:34:15 +00:00
parent 73a52849bc
commit fc82fced84

View File

@ -880,7 +880,21 @@ namespace VEPROMS.CSLA.Library
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return;
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
if (!pasteItem.ActiveSection.IsEnhancedSection && !pasteItem.ActiveSection.IsEnhancedSectionTitleOnly)
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
bool isSourceSection = false;
EnhancedDocuments eds = pasteItem.ActiveSection.GetMyEnhancedDocuments();
if (eds != null)
{
foreach (EnhancedDocument ed in eds)
{
if (ed.Type != 0)
{
isSourceSection = true;
break;
}
}
}
if (!pasteItem.ActiveSection.IsEnhancedSection && !pasteItem.ActiveSection.IsEnhancedSectionTitleOnly && !isSourceSection)
{
// the RemoveEnhancedFromConfig method clears from the pasted step and any cautions/notes that may be off
// of the pasted step.