From dc1e2e858cbc562081caf7a03715254f3060c051 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 14 Oct 2011 10:32:47 +0000 Subject: [PATCH] --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 7ac90cc6..7fee2f86 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2004,7 +2004,7 @@ namespace VEPROMS.CSLA.Library _MyTab.Text = ""; _MyTab.CleanText = ""; return; - } + } int stepType = (int)(MyContent.Type % 10000); string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint; // rno gets parent tab @@ -3129,13 +3129,51 @@ namespace VEPROMS.CSLA.Library public override void SetupTags() { MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font); - _MyTab.Text = DisplayNumber; - _MyTab.CleanText = DisplayNumber.PadRight(20); + string sectTab = GetSectionTab(false); + _MyTab.Text = sectTab; + _MyTab.CleanText = sectTab.PadRight(20); MyHeader = new MetaTag(ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font); _MyHeader.Text = null; MyFooter = null; _TagsSetup = true; } + private string GetSectionTab(bool underline) + { + if (DisplayNumber == null || DisplayNumber == "" || !IsStepSection) return DisplayNumber; + if (MyDocStyle.SpecialStepsFoldout) return DisplayNumber; + if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) + { + if (underline) + return @"\ul " + DisplayNumber + @"\ul0 "; + else + return DisplayNumber; + } + string retStr = null; + string ch = DisplayNumber != null && DisplayNumber != "" ? DisplayNumber.Substring(0,1) : null; + int Snum = GetSectionNum(); + if (Snum == -1) + retStr = ch + "."; + else { + string tmp = DisplayNumber.IndexOf(".")>-1?DisplayNumber.Substring(0,DisplayNumber.IndexOf(".")):DisplayNumber; + if (underline) + retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 "; + else + retStr = tmp + "." + Snum.ToString(); + } + return retStr; + } + + private int GetSectionNum() + { + int indx = -1; + if (DisplayNumber != null && DisplayNumber != "" && (indx = DisplayNumber.IndexOf("."))>-1) + { + // if there is a number after the '.', return it as a number. For example if it is 001, return a 1: + string tmpstr = indx+1