Don't refresh ROs if there is no RO Asssociation for this Working Draft.

This commit is contained in:
Rich 2015-02-03 17:41:16 +00:00
parent 1e7ee2d784
commit 26ba8bf51b

View File

@ -718,25 +718,33 @@ namespace VEPROMS.CSLA.Library
ItemInfo ip = itemParent as ItemInfo; ItemInfo ip = itemParent as ItemInfo;
itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab); itemInfo.CombinedTab = (ip == null) ? itemInfo.MyTab.CleanText.Trim() : GetCombinedTab(itemInfo, ip.CombinedTab);
} }
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst; if (docVersionInfo.DocVersionAssociationCount == 1)
//rofstinfo.docVer = docVersionInfo;
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
lookup.MyDocVersionInfo = docVersionInfo;
//DateTime dts = DateTime.Now;
if (itemInfo.MyContent.ContentGridCount > 0)
itemInfo.MyContent.LoadNonCachedGrid();
if (itemInfo.MyContent.ContentRoUsageCount > 0)
{ {
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages) ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
//rofstinfo.docVer = docVersionInfo;
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
lookup.MyDocVersionInfo = docVersionInfo;
//DateTime dts = DateTime.Now;
if (itemInfo.MyContent.ContentGridCount > 0)
itemInfo.MyContent.LoadNonCachedGrid();
if (itemInfo.MyContent.ContentRoUsageCount > 0)
{ {
if (sectionInfo != null) foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
{ {
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); if (sectionInfo != null)
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID); {
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo); string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo);
}
} }
} }
} }
else
{
// Force Error Message
docVersionInfo.GetROFst(0);
}
//TimeSpan ts = DateTime.Now.Subtract(dts); //TimeSpan ts = DateTime.Now.Subtract(dts);
//ticksROUsage += ts.Ticks; //ticksROUsage += ts.Ticks;
//dts = DateTime.Now; //dts = DateTime.Now;
@ -1856,12 +1864,6 @@ namespace VEPROMS.CSLA.Library
string parNumber = par.DisplayNumber; string parNumber = par.DisplayNumber;
string myNumber = DisplayNumber; string myNumber = DisplayNumber;
if (parNumber == null || myNumber == null) return false; if (parNumber == null || myNumber == null) return false;
ItemInfo par2 = par.ActiveParent as ItemInfo;
if (par2 != null && par2.IsSection)
{
// check for 6.1 (parent) and 6.1.1.
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return true;
}
if (!parNumber.Trim().EndsWith(".0")) return false; if (!parNumber.Trim().EndsWith(".0")) return false;
return (myNumber.Trim().StartsWith(parNumber.Trim().Substring(0, parNumber.Length - 1))); return (myNumber.Trim().StartsWith(parNumber.Trim().Substring(0, parNumber.Length - 1)));
} }
@ -5906,14 +5908,6 @@ namespace VEPROMS.CSLA.Library
if (ch[0] == ' ') ch = DisplayNumber != null && DisplayNumber.TrimStart() != "" ? DisplayNumber.TrimStart().Substring(0, 1) : null; if (ch[0] == ' ') ch = DisplayNumber != null && DisplayNumber.TrimStart() != "" ? DisplayNumber.TrimStart().Substring(0, 1) : null;
retStr = ch + "."; retStr = ch + ".";
} }
else if (Snum == -2) // -2 flags to just use display number as is, don't prepend the parent's number.
{
string tmp = DisplayNumber.Trim();
if (underline)
retStr = @"\ul " + DisplayNumber.Trim() + @"\ul0 ";
else
retStr = DisplayNumber.Trim();
}
else else
{ {
string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber; string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber;
@ -5938,12 +5932,6 @@ namespace VEPROMS.CSLA.Library
if (tmpstr == null) return 0; if (tmpstr == null) return 0;
Int32 x; Int32 x;
if (Int32.TryParse(tmpstr, out x)) return x; if (Int32.TryParse(tmpstr, out x)) return x;
// flag the case where the current section's tab already has prefixed in the parent's tab:
// (without this, BGE's section headers were coming up as 6.1.6.1.1...)
if (IsSection && ActiveParent.IsSection)
{
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return -2;
}
return -1; return -1;
} }
return (-1); return (-1);