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:
Rich
2017-06-13 17:41:05 +00:00
parent 0d0bd7661b
commit 7ff0dbd98f
2 changed files with 29 additions and 18 deletions

View File

@@ -1867,13 +1867,16 @@ namespace VEPROMS.CSLA.Library
ctmp.Save();
}
//ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst;
ROFSTLookup mylookup = myRoFst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
foreach(RoUsageInfo rou in tmp.ContentRoUsages)
if (tmp.ContentRoUsages.Count != 0) // B2017-118 If no ROUsages ignore ROFST
{
string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID);
int mytype = rocc.type;
ctmp.FixContentText(rou, myvalue, mytype, myRoFst);
ROFSTLookup mylookup = myRoFst.GetROFSTLookup(tmp.ContentItems[0].MyProcedure.MyDocVersion);
foreach (RoUsageInfo rou in tmp.ContentRoUsages)
{
string myvalue = mylookup.GetTranslatedRoValue(rou.ROID, tmp.ContentItems[0].ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
ROFSTLookup.rochild rocc = mylookup.GetRoChild(rou.ROID);
int mytype = rocc.type;
ctmp.FixContentText(rou, myvalue, mytype, myRoFst);
}
}
Content cctmp = ctmp;
if (ctmp.IsDirty)