B2017-118 - Don't access RO Association unless there is a RO Usage
B2017-118 - Restore Children, Sibling, Text or Table cell text when no RO Association has been established
This commit is contained in:
@@ -626,10 +626,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
if (MessageBox.Show(this, "Do you want to restore this content change?", "Confirm Content Change Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
ROFstInfo myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ROFstInfo myRoFst = null; // B2017-118 If No ROFST don't crash
|
||||
if (MyItemInfo.MyDocVersion.DocVersionAssociations != null)
|
||||
myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ContentInfo ci = ContentInfo.RestoreContent(cai,myRoFst);
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
RefreshRequired = true;
|
||||
UpdateHistory();
|
||||
myRTB.Clear();
|
||||
@@ -648,10 +650,12 @@ namespace Volian.Controls.Library
|
||||
ItemInfo ii = null;
|
||||
if (iai.Level == 2)
|
||||
{
|
||||
ROFstInfo myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ROFstInfo myRoFst = null; // B2017-118 If No ROFST don't crash
|
||||
if(MyItemInfo.MyDocVersion.DocVersionAssociations != null)
|
||||
myRoFst= MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
if(myRoFst != null) myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ii = MyItemInfo.RestoreItem(iai,myRoFst);
|
||||
myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
//_MyEditItem.AddChild((E_FromType)fromtype, contenttype);
|
||||
//ii.ItemParts[0].FromType
|
||||
//ii.MyContent.Type
|
||||
@@ -718,10 +722,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
ROFstInfo myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ROFstInfo myRoFst = null; // B2017-118 If No ROFST don't crash
|
||||
if (MyItemInfo.MyDocVersion.DocVersionAssociations != null)
|
||||
myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ii = MyItemInfo.RestoreSibling(iai,myRoFst);
|
||||
myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (ii.IsStep)
|
||||
ii = StepInfo.Get(ii.ItemID);
|
||||
else if (ii.IsSection)
|
||||
@@ -780,10 +786,12 @@ namespace Volian.Controls.Library
|
||||
if (MessageBox.Show(this, "Do you want to restore this table?", "Confirm Table Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
ContentAuditInfo cai = ContentAuditInfo.Get(gai.ContentAuditID);
|
||||
ROFstInfo myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ROFstInfo myRoFst = null; // B2017-118 If No ROFST don't crash
|
||||
if (MyItemInfo.MyDocVersion.DocVersionAssociations != null)
|
||||
myRoFst = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
ContentInfo ci = ContentInfo.RestoreContent(cai,myRoFst);
|
||||
myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
|
||||
RefreshRequired = true;
|
||||
UpdateHistory();
|
||||
myRTB.Clear();
|
||||
|
Reference in New Issue
Block a user