From ef338c9e74d79b90f6243f57ab23feafc5b0e168 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 12 Aug 2016 16:23:16 +0000 Subject: [PATCH] remove VCB1 tabbing code because of change of tabs; step tab on Example should skip paragraph level if off paragraph --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 467ef12f..a5b88165 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3628,15 +3628,11 @@ namespace VEPROMS.CSLA.Library bool doMeta = false; if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) { - // the DSS_SameXOFfSubsections was added for VC Summer Unit 2 & 3 (vcb format) so that all subsections are indented - // the same amount and this is also used for determining level for sequential tabbing, i.e. what seqfmt item to use for - // sequential level. - bool scttablev = ((MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections); if (sd.StepSectionLayoutData.ShowSectionTitles && !MyDocStyle.CancelSectTitle && !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel)) - localPrintLevel = PrintLevel + (((ActiveFormat.PlantFormat.FormatData.Express && IsSequential) || scttablev) ? 0 : CurrentSectionLevel()); - if (!ActiveFormat.PlantFormat.FormatData.Express && !scttablev) doMeta = true; + localPrintLevel = PrintLevel + (((ActiveFormat.PlantFormat.FormatData.Express && IsSequential)) ? 0 : CurrentSectionLevel()); + if (!ActiveFormat.PlantFormat.FormatData.Express) doMeta = true; } if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.CountSubSectionsForLevel) if (SectionLevel() > 1) @@ -3968,7 +3964,9 @@ namespace VEPROMS.CSLA.Library { // fix for Westinghouse single column // - increament the level on a section only if the first character is a number B2016-075 03-09-2016 - if (ii.IsSection && (ii.MyTab.Text != null && ii.MyTab.Text.Length > 0 && char.IsNumber(ii.MyTab.Text.Trim()[0]))) level++; + // Note that 'DisplayNumber' is used rather than MyTab. MyTab was not always set. + //if (ii.IsSection && (ii.MyTab.Text != null && ii.MyTab.Text.Length > 0 && char.IsNumber(ii.MyTab.Text.Trim()[0]))) level++; + if (ii.IsSection && (ii.DisplayNumber != null && ii.DisplayNumber.Length > 0 && char.IsNumber(ii.DisplayNumber.Trim()[0]))) level++; ii = ii.ActiveParent as ItemInfo; } return level; @@ -4169,7 +4167,7 @@ namespace VEPROMS.CSLA.Library } } - // If we're in a subsection, be sure there is a '.' at the end. + // If we're in a subsection, be sure there is a '.' at the end. The following uses config flags for indenting to determine CurrentSectionLevel: int subsection = CurrentSectionLevel(); if (subsection >= 1) { @@ -4177,6 +4175,20 @@ namespace VEPROMS.CSLA.Library if (tmptab.LastIndexOf(".") != tmptab.Length - 1) tmptab = tmptab + "."; return tmptab; } + // If the tbformat is "{Section Prefix}{numeric}" and section prefix ends in an integer, add a '.' + if (tbformat.Contains("{Section Prefix}{numeric}") && MyParent.IsSection) + { + string tmptab = ActiveSection.MyTab.CleanText.TrimEnd(); + if (tmptab.Length > 0) + { + string l = tmptab.Substring(tmptab.Length - 1); + if (char.IsLetterOrDigit(l[0])) + { + if (tmptab.LastIndexOf(".") != tmptab.Length - 1) tmptab = tmptab + "."; + return tmptab; + } + } + } return ActiveSection.MyTab.CleanText.TrimEnd(); } @@ -4267,11 +4279,20 @@ namespace VEPROMS.CSLA.Library } } - // For VS Summer Unit 2 & 3 (vcb formats) include step number in Note & Caution header + // For VC Summer Unit 2 & 3 (vcb formats) include step number in Note & Caution header if (FormatStepData.TabData.IncludeStepNum && MyHeader != null && MyParent != null && MyParent.CombinedTab != null) { - MyHeader.Text = MyHeader.Text + ((MyParent == null) ? "" : " Step " + MyParent.CombinedTab.TrimEnd(".".ToCharArray())); - MyHeader.CleanText = MyHeader.CleanText + ((MyParent == null) ? "" : " Step " + MyParent.CombinedTab.TrimEnd(".".ToCharArray())); + // if my parent is a paragraph, then don't use the paragraph tab in the header, use the parent of the paragraph: + if (MyParent.IsParagraph) + { + MyHeader.Text = MyHeader.Text + ((MyParent == null) ? "" : " Step " + MyParent.MyParent.MyTab.CleanText.TrimEnd(".".ToCharArray())); + MyHeader.CleanText = MyHeader.CleanText + ((MyParent == null) ? "" : " Step " + MyParent.MyParent.MyTab.CleanText.TrimEnd(".".ToCharArray())); + } + else + { + MyHeader.Text = MyHeader.Text + ((MyParent == null) ? "" : " Step " + MyParent.MyTab.CleanText.TrimEnd(".".ToCharArray())); + MyHeader.CleanText = MyHeader.CleanText + ((MyParent == null) ? "" : " Step " + MyParent.MyTab.CleanText.TrimEnd(".".ToCharArray())); + } } return tbformat; }