From e500ec710f9de28e27516e109fa97518f720e5f0 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 4 Feb 2015 21:58:31 +0000 Subject: [PATCH] =?UTF-8?q?If=20a=20subsections=20number=20included=20the?= =?UTF-8?q?=20parent=20section=E2=80=99s=20number,=20don=E2=80=99t=20prepe?= =?UTF-8?q?nd=20the=20parents=20tab=20to=20the=20subsection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 06d3e523..6e85b48d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -720,26 +720,26 @@ namespace VEPROMS.CSLA.Library } if (docVersionInfo.DocVersionAssociationCount == 1) { - 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) + 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) + { + foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages) { - foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages) + if (sectionInfo != null) { - if (sectionInfo != null) - { - 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); - } + 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 @@ -1864,6 +1864,12 @@ namespace VEPROMS.CSLA.Library string parNumber = par.DisplayNumber; string myNumber = DisplayNumber; 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; return (myNumber.Trim().StartsWith(parNumber.Trim().Substring(0, parNumber.Length - 1))); } @@ -5908,6 +5914,14 @@ namespace VEPROMS.CSLA.Library if (ch[0] == ' ') ch = DisplayNumber != null && DisplayNumber.TrimStart() != "" ? DisplayNumber.TrimStart().Substring(0, 1) : null; 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 { string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber; @@ -5932,6 +5946,12 @@ namespace VEPROMS.CSLA.Library if (tmpstr == null) return 0; Int32 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);