B2022-046 - Copy/Paste table Rows, Columns, or selected Cells was not updating RO and Transition links with new RO or Transition Usage numbers.
This commit is contained in:
@@ -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("<NewID>", indx);
|
||||
Rtf = Rtf.Remove(newid, 7);
|
||||
Rtf = Rtf.Insert(newid, string.Format("<CROUSGID={0}>", 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("<CROUSGID={0}>", oldid), rousg.ROUsageID.ToString());
|
||||
itm.Save();
|
||||
MyItemInfo.MyContent.RefreshContentRoUsages();
|
||||
@@ -1265,8 +1265,7 @@ namespace Volian.Controls.Library
|
||||
int newidt = Rtf.IndexOf("<NewID>", indx);
|
||||
Rtf = Rtf.Remove(newidt, 7);
|
||||
Rtf = Rtf.Insert(newidt, string.Format("<CTID={0}>", ct.TransitionID));
|
||||
//Rtf = Rtf.Replace("<NewID>", string.Format("<CTID={0}>", 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("<CTID={0}>", 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;
|
||||
|
Reference in New Issue
Block a user