From 9d2e558451b7d045ec52bad42fea0a4aac4d2b80 Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 23 Oct 2014 12:58:13 +0000 Subject: [PATCH] =?UTF-8?q?Calvert:=20CheckOffXtraLines=E2=80=99=20support?= =?UTF-8?q?=20for=20new=20check=20off=20[6];=20fix=20blank=20line=20adjust?= =?UTF-8?q?ment=20for=20caution=206=20in=20EOP/AOPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/vlnParagraph.cs | 42 +++++++++++++++------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index b4e4c526..29b2f37a 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2685,10 +2685,28 @@ namespace Volian.Print.Library xloc_co = XOffset + (relX > 0 ? Width : 0) + relX; } } - float xtraCheckOffLines = (co.CheckOffXtraLines ?? 0) * SixLinesPerInch; - xtraCheckOffLines -= ((xtraCheckOffLines>0)? SixLinesPerInch:0); - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff + xtraCheckOffLines, co.Macro)); - yoff += (xtraCheckOffLines > 0) ? xtraCheckOffLines + SixLinesPerInch : 0; + + // if xtraCheckOffLines is a negative number, start the checkoff on the same line + // as text and adjust the y-offset after the checkoff by the amount of the absolute + // value of xtraCheckOffLines. + // if xtraCheckOffLines is a positive number, start the checkoff xtraCheckOffLines - 1 + // down from the text and adjust the y-offset after the checkoff by the amount + // of xtraCheckOffLines. + float xtraCheckOffLines = (co.CheckOffXtraLines ?? 0); + if (xtraCheckOffLines < 0) + { + xtraCheckOffLines = -xtraCheckOffLines; + xtraCheckOffLines *= SixLinesPerInch; + PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff/* + xtraCheckOffLines */, co.Macro)); + yoff += xtraCheckOffLines; + } + else + { + xtraCheckOffLines *= SixLinesPerInch; + xtraCheckOffLines -= ((xtraCheckOffLines > 0) ? SixLinesPerInch : 0); + PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff + xtraCheckOffLines, co.Macro)); + yoff += (xtraCheckOffLines != 0) ? xtraCheckOffLines + SixLinesPerInch : 0; + } } } float yOffRight = yoff; @@ -3186,16 +3204,16 @@ namespace Volian.Print.Library int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; if (everyNLines == -99) return 0; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || - MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) + (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.MyTab!= null && MyItemInfo.MyTab.CleanText != string.Empty))) { - if ((MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.MyParent.IsCaution || MyItemInfo.MyParent.IsNote) && !MyItemInfo.FormatStepData.SpaceIn - && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) - && (MyItemInfo.GetNextItem() == null || MyItemInfo.MyContent.Type != MyItemInfo.GetNextItem().MyContent.Type)) return 0; + if ((MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.MyParent.IsCaution || MyItemInfo.MyParent.IsNote) && !MyItemInfo.FormatStepData.SpaceIn + && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) + && (MyItemInfo.GetNextItem() == null || MyItemInfo.MyContent.Type != MyItemInfo.GetNextItem().MyContent.Type)) return 0; if (everyNLines == 99 && MyItemInfo.GetNextItem() == null) - { - if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0; - if (MyItemInfo.MyParent.GetNextItem() != null && MyItemInfo.MyParent.GetNextItem().MyContent.Type == MyItemInfo.MyContent.Type) return 0; - } + { + if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0; + if (MyItemInfo.MyParent.GetNextItem() != null && MyItemInfo.MyParent.GetNextItem().MyContent.Type == MyItemInfo.MyContent.Type) return 0; + } } if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.GetNextItem() == null) return SixLinesPerInch; // Pagination issue to be used with yEndsWithBlankLine in Pagination code, but not checked in yet.