From fd97a7853d53d4ef96b06facf1a350d971be73be Mon Sep 17 00:00:00 2001 From: John Jenko Date: Fri, 10 Nov 2023 08:57:17 -0500 Subject: [PATCH 1/2] B2022-046 - Copy/Paste table Rows, Columns, or selected Cells was not updating RO and Transition links with new RO or Transition Usage numbers. --- PROMS/Volian.Controls.Library/GridItem.cs | 10 +++--- PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 36 +++++++++++++------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/PROMS/Volian.Controls.Library/GridItem.cs b/PROMS/Volian.Controls.Library/GridItem.cs index 0010f49f..c26e35c3 100644 --- a/PROMS/Volian.Controls.Library/GridItem.cs +++ b/PROMS/Volian.Controls.Library/GridItem.cs @@ -1192,7 +1192,7 @@ namespace Volian.Controls.Library string linkstr = mro.Groups[2].Value; string[] roparts = linkstr.Split(" ".ToCharArray()); ContentRoUsage rousg = null; - int oldid = -1; + int oldid = -1; using (Item itm = MyItemInfo.Get()) { using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) @@ -1203,7 +1203,7 @@ namespace Volian.Controls.Library int newid = Rtf.IndexOf("", indx); Rtf = Rtf.Remove(newid, 7); Rtf = Rtf.Insert(newid, string.Format("", rousg.ROUsageID)); - itm.Save(); + itm.Save(); // this will generate a new ROUsageID that we grab and put in the RO link in the RTF Rtf = Rtf.Replace(string.Format("", oldid), rousg.ROUsageID.ToString()); itm.Save(); MyItemInfo.MyContent.RefreshContentRoUsages(); @@ -1265,8 +1265,7 @@ namespace Volian.Controls.Library int newidt = Rtf.IndexOf("", indx); Rtf = Rtf.Remove(newidt, 7); Rtf = Rtf.Insert(newidt, string.Format("", ct.TransitionID)); - //Rtf = Rtf.Replace("", string.Format("", ct.TransitionID)); - itm.Save(); + itm.Save(); // this will generate a new TransitionID that we grab and put in the Transition link in the RTF Rtf = Rtf.Replace(string.Format("", oldidt), ct.TransitionID.ToString()); itm.Save(); MyItemInfo.MyContent.RefreshContentTransitions(); @@ -1277,6 +1276,9 @@ namespace Volian.Controls.Library } } MyFlexGrid[r, c] = Rtf; + // B2022-046 need to save context of each cell in the table after fixing RO and Transition links + // otherwise the RTF for that cell will revert back to previous data then the itm.Save() is called above + SaveContents(); } } c = c + 1; diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index 0e654e53..cc01cd61 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -3397,7 +3397,11 @@ namespace Volian.Controls.Library // if the paste is below - put back the range for the source location if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) MergedRanges.Add(cr); - this[r + rowOffset, c] = MyCopyInfo.MyCopiedFlexGrid[r, c]; + // B2022-046 if the cell contains an RO or Transition then replace the usage id with to force a new usage id in the link + if (MyCopyInfo.MyCopiedFlexGrid[r, c] != null) + this[r + rowOffset, c] = ItemInfo.ReplaceLinkWithNewID(MyCopyInfo.MyCopiedFlexGrid[r, c].ToString().Replace("\r\n", "")); + else + this[r + rowOffset, c] = MyCopyInfo.MyCopiedFlexGrid[r, c]; MatchStyle(crm, cr); PasteBorders(r + rowOffset, c, r, c); PasteShading(r + rowOffset, c, r, c); // C2021-004 paste the shading information @@ -3506,7 +3510,11 @@ namespace Volian.Controls.Library if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) MergedRanges.Add(cr); // copy cell text to the destination, copy the style, copy the cell borders - this[r, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; + // B2022-046 if the cell contains an RO or Transition then replace the usage id with to force a new usage id in the link + if (MyCopyInfo.MyCopiedFlexGrid[r, c] != null) + this[r, c + colOffset] = ItemInfo.ReplaceLinkWithNewID(MyCopyInfo.MyCopiedFlexGrid[r, c].ToString().Replace("\r\n", "")); + else + this[r, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; MatchStyle(crm, cr); PasteBorders(r, c + colOffset, r, c); PasteShading(r, c + colOffset, r, c); // C2021-004 paste the shading information @@ -3581,16 +3589,20 @@ namespace Volian.Controls.Library for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2, Cols.Count - 1 - colOffset); c++) { CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1 + colOffset, crm.r2 + rowOffset, crm.c2 + colOffset); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - this[r + rowOffset, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r + rowOffset, c + colOffset, r, c); - PasteShading(r + rowOffset, c + colOffset, r, c); // C2021-004 paste the shading information - } + if (r == crm.r1 && c == crm.c1) + { + CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1 + colOffset, crm.r2 + rowOffset, crm.c2 + colOffset); + if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) + MergedRanges.Add(cr); + // B2022-046 if the cell contains an RO or Transition then replace the usage id with to force a new usage id in the link + if (MyCopyInfo.MyCopiedFlexGrid[r, c] != null) + this[r + rowOffset, c + colOffset] = ItemInfo.ReplaceLinkWithNewID(MyCopyInfo.MyCopiedFlexGrid[r, c].ToString().Replace("\r\n", "")); + else + this[r + rowOffset, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; + MatchStyle(crm, cr); + PasteBorders(r + rowOffset, c + colOffset, r, c); + PasteShading(r + rowOffset, c + colOffset, r, c); // C2021-004 paste the shading information + } } } this.AdjustGridControlSize(); From 4033961323d383979e5d5f2c13aa9ab9b62aa50c Mon Sep 17 00:00:00 2001 From: John Jenko Date: Mon, 13 Nov 2023 10:01:48 -0500 Subject: [PATCH 2/2] =?UTF-8?q?F2023-142=20=20=20Customer=20requested=20to?= =?UTF-8?q?=20change=20the=20indent=20of=20steps=20for=20the=20=E2=80=9CAt?= =?UTF-8?q?tachment=20with=20Section=20Number=20and=20Title=20=E2=80=93=20?= =?UTF-8?q?steps=20adj=20left=20(includes=20END=20msg)=E2=80=9D=20in=20the?= =?UTF-8?q?=20=E2=80=9CBeaver=20Valley=20Single=20Column=20Format=20with?= =?UTF-8?q?=20Issue=20Number=20(BVPS1)=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Formats/fmtall/BVPS1all.xml | Bin 133218 -> 133216 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/BVPS1all.xml b/PROMS/Formats/fmtall/BVPS1all.xml index ac856c574d4d4df515ffc3fb463883dfbf1bf7f6..840a57390f4eadaea606b8d9fd7daf61cce86418 100644 GIT binary patch delta 27 jcmaDff#bmhj)pCaUdN}eddtW&U9XQ(YP6 delta 22 ecmaDbf#cBxj)pCaUdN|@n9iuSJ?}W