From a1380dbb8aba076f11aa8e5b83ec3973d84d08c4 Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Thu, 18 Jul 2024 14:06:01 -0400 Subject: [PATCH 1/2] B2024-042 - When replacing a procedure, this change will now replace the procedure correctly and add it to the tree node, previously it would replace th eprocedure, then add a whole new procedure to the node, incorrectly using the copy procedure which appended "copy of". --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 26487957..fb7190c4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -2565,13 +2565,10 @@ namespace VEPROMS.CSLA.Library else { //Create tree node for copied procedure when no other procedures exist in the folder - VETreeNode vtn = treeNodeReplace as VETreeNode; - DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - - ItemInfo newProc = dvi.PasteChild(copyStartID); - VETreeNode tn1 = new VETreeNode(newProc); - treeNodeReplace.Nodes.Add(tn1); // add tree node to end of list. - treeNodeReplace = tn1; + VETreeNode tn = null; + tn = new VETreeNode(newItemInfo); + treeNodeReplace.Nodes.Add(tn); + treeNodeReplace = tn; } return newItemInfo; } -- 2.47.2 From bf72a6bf7826b9affad34f935d55bd2f97327b0e Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Mon, 22 Jul 2024 09:39:13 -0400 Subject: [PATCH 2/2] B2024-042 - Update TreeNodeReplace section when adding a node to working draft (remove unneeded code) --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index fb7190c4..4316976c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -2547,6 +2547,7 @@ namespace VEPROMS.CSLA.Library newItemInfo.UpdateTransitionText(); newItemInfo.UpdateROText(); newItemInfo.UpdatePastedStepTransitionText(); + // Add to tree if (newItemInfo.NextItem != null) { @@ -2564,11 +2565,10 @@ namespace VEPROMS.CSLA.Library } else { - //Create tree node for copied procedure when no other procedures exist in the folder + //Create tree node for copied procedure when no other procedures exist in the working draft (treeNodeReplace) VETreeNode tn = null; tn = new VETreeNode(newItemInfo); treeNodeReplace.Nodes.Add(tn); - treeNodeReplace = tn; } return newItemInfo; } -- 2.47.2