From f39a3dfbaf3e644648eeaec2a40eed86594cece1 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 18 Sep 2012 13:28:50 +0000 Subject: [PATCH] --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9fa5b6b7..8e677de4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -367,6 +367,23 @@ namespace VEPROMS.CSLA.Library (MyDocStyle.StructureStyle.Style & E_DocStructStyle.TableOfContents) == E_DocStructStyle.TableOfContents); } } + public bool MoreThanOneStepSection() + { + if (IsProcedure || IsSection) return false; + // If 'toitem' is a step, get to section. + ItemInfo par = MyParent; + while (par != null && !par.IsSection) par = par.MyParent; + if (par == null) return false; + par = par.FirstSibling; + int cntStepSect = 0; + while (par != null) + { + if (par.IsStepSection) cntStepSect++; + par = par.NextItem; + } + if (cntStepSect > 1) return true; + return false; + } #region StepLevel private int _StepLevel = -2;// Not yet calculated public int StepLevel @@ -2184,7 +2201,10 @@ namespace VEPROMS.CSLA.Library // If token includes 'Wpar', the parent tab prefix's the tab. if (localPrintLevel > 0 && (tbformat.IndexOf("{numericWpar}") > -1 || tbformat.IndexOf("{alphaWpar}") > -1 || tbformat.IndexOf("{ALPHAWpar}") > -1)) { - string parentTab = ((ItemInfo)(ActiveParent)).MyTab.CleanText.Trim(); + string parentTab = null; + ItemInfo myparent = ActiveParent as ItemInfo; + if (myparent != null && myparent.IsParagraph) myparent = myparent.ActiveParent as ItemInfo; + parentTab = myparent.MyTab.CleanText.Trim(); tbformat = parentTab + (parentTab.EndsWith(".") ? "" : ".") + tbformat.TrimStart(); } if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1)