From 5cfc66af5272c4875cf58d6ed9726b0cdb526705 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 26 Oct 2012 10:26:12 +0000 Subject: [PATCH] --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index d42eee8b..3acf07b3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2219,7 +2219,15 @@ namespace VEPROMS.CSLA.Library { string parentTab = null; ItemInfo myparent = ActiveParent as ItemInfo; - if (myparent != null && myparent.IsParagraph) myparent = myparent.ActiveParent as ItemInfo; + if (myparent != null && myparent.IsParagraph) + { + myparent = myparent.ActiveParent as ItemInfo; + if (myparent.MyTab.CleanText.Trim() == "") + { + if ((myparent.ActiveParent as ItemInfo).MyTab.CleanText.Trim() != "") + myparent = myparent.ActiveParent as ItemInfo; + } + } parentTab = myparent.MyTab.CleanText.Trim(); tbformat = parentTab + (parentTab.EndsWith(".") ? "" : ".") + tbformat.TrimStart(); } @@ -2254,7 +2262,7 @@ namespace VEPROMS.CSLA.Library tbformat = tbformat.Replace("{ROMAN}", roman); tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : ordinal.ToString().PadLeft(2)); tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString()); - + tbformat = tbformat.Replace("{asterisk}", "*"); if (tbformat.IndexOf("{!C0}") > -1) // wolf creek uses this to get lines above/below step number { cltext = cltext == null ? tbformat.Replace("{!C0}", "") : cltext.Replace("{!C0}", ""); @@ -2466,7 +2474,7 @@ namespace VEPROMS.CSLA.Library if (FormatStepData.TabData.Justify == "Center") { _MyHeader.Justify = ContentAlignment.MiddleCenter; - _MyHeader.Text = tbformat.Trim(); ; + _MyHeader.Text = tbformat.Replace("\\xA0"," ").Trim(); _MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text); // if there is only step in the group - no bullet is used, if more that one replace the tab // with a bullet. Also, if only one in group and tab text ends with 'S', remove it: @@ -2646,6 +2654,39 @@ namespace VEPROMS.CSLA.Library if (tmp.Count > 0) _MyMacros = tmp; } #endregion + #region UseSmartTemplate + public int GetSmartTemplateIndex() + { + FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData; + int indx = 0; + // find the starting template in the list for the high level step type: + int highType = (int)MyHLS.MyContent.Type - 20001; + while (indx < formatData.Templates.Count) + { + // level of 0 starts a new group. + if (formatData.Templates[indx].level == 0) + { + indx++; + // now see if we're on the high level step type, if so, look under this one + // for the step type that we're on. If found return the index of it. + if (formatData.Templates[indx].type == highType) + { + if (MyHLS.ItemID == ItemID) return indx; // I'm on the HLS, return it. + indx++; + while (indx < formatData.Templates.Count && formatData.Templates[indx].level != 0) + { + if (formatData.Templates[indx].type == MyContent.Type - 20001) + return indx; + indx++; + } + } + } + else + indx++; + } + return -1; // didn't find this step type in the template width override list. + } + #endregion #region CheckOffs private string _SectionCheckOffHeader; public string SectionCheckOffHeader