From 0fff0b09a80f9d45380a25d975b7cb28f026420c Mon Sep 17 00:00:00 2001 From: John Date: Thu, 18 Apr 2013 15:54:39 +0000 Subject: [PATCH] =?UTF-8?q?logic=20to=20support=20NSP=E2=80=99s=20Note=20a?= =?UTF-8?q?nd=20Caution=20Tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 658ee16a..94ef55cf 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2783,7 +2783,7 @@ namespace VEPROMS.CSLA.Library } return ActiveSection.MyTab.CleanText.TrimEnd(); } - + private string CheckNoteCautionTab(string tbformat) { string prevTbFormat = null; @@ -2843,8 +2843,31 @@ namespace VEPROMS.CSLA.Library ((prevTbFormat != tbformat && (NextItem.MyContent.Type == (int)(MyContent.Type % 10000)))))) { tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; + //string bstr = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; + //int bstrlen = bstr.Length; + //string tstr = tbformat.Substring(tbformat.Length - bstrlen); + //bool good = true; + //for (int i = 0; i < tstr.Length; i++) + // good = (tstr[i] == ' '); + //if (good) + // tbformat = tbformat.Substring(0, tbformat.Length - bstrlen) + bstr; + //else + // tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; if (TabToIdentBAdjustFont()) - _MyTab.RemovedStyleUnderline = true; + _MyTab.RemovedStyleUnderline = true; + } + // Since we append the bullet (IdentB) to the Caution or Note tab (like in 16-bit code) + // we need to append blank characters when there is only one Note or Caution (thus no bullet) + // in order for the Note or Caution tab to consistantly print at the same horizontal location + else if (tbformat != null && !FormatStepData.AlwaysTab && !FormatStepData.MixCautionsAndNotes + && (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB != null + && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB.Length > 0)) + { + int identBLen = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB.Length; + string bbstr = new string(' ', identBLen); + tbformat = tbformat + bbstr; + if (TabToIdentBAdjustFont()) + _MyTab.RemovedStyleUnderline = true; } return tbformat; }