From f9d0c363f77c1e0ac51d6be216315868f440b406 Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 3 Oct 2014 13:44:46 +0000 Subject: [PATCH] =?UTF-8?q?Support=20for=20=E2=80=98PaginateOnLowerStepLev?= =?UTF-8?q?el=E2=80=99=20pagination=20flag=20(for=20IP2BCK)=20IP2BCK:=20St?= =?UTF-8?q?ep=20Description=20table=E2=80=99s=20title=20(Cont)=20support?= =?UTF-8?q?=20and=20various=20xoffset=20&=20margin=20fixes=20IP2BCK:=20Sup?= =?UTF-8?q?port=20Step=20Descriptions=20table=E2=80=99s=20title=20(Cont)?= =?UTF-8?q?=20message=20IP2BCK:=20Implement=20=E2=80=98NoTabAlign=E2=80=99?= =?UTF-8?q?=20flag=20so=20that=20tab=20aligning=20won=E2=80=99t=20occur=20?= =?UTF-8?q?for=20EquipmentOpt=20step=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Print.Library/Pagination.cs | 2 +- .../Volian.Print.Library/VlnSvgPageHelper.cs | 12 +++++ PROMS/Volian.Print.Library/vlnParagraph.cs | 47 ++++++++++++++++++- PROMS/Volian.Print.Library/vlnTab.cs | 2 +- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index fffe42c0..c01256f3 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -219,7 +219,7 @@ namespace Volian.Print.Library if (mySize < Height) mySize = Height * MyPageHelper.YMultiplier; } float yExtra2 = (SixLinesPerInch - MyItemInfo.MyDocStyle.Layout.FooterLength) ?? 0; - if (KeepStepsOnPage && ySizeIncludingFirst > yWithinMargins) + if (KeepStepsOnPage && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PaginateOnLowerStepLevel && ySizeIncludingFirst > yWithinMargins) KeepStepsOnPage = false; bool KeepWithHeader = isFirstChild && nearTheTop; if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + yExtra) // Don't Paginate if there is enough room, will fit on page diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 3f3fa562..bb5a0b83 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1222,6 +1222,12 @@ namespace Volian.Print.Library get { return _HLRNO; } set { _HLRNO = value; } } + private bool _OldTemplateContMsg = false; + public bool OldTemplateContMsg + { + get { return _OldTemplateContMsg; } + set { _OldTemplateContMsg = value; } + } /// /// /// @@ -1373,6 +1379,12 @@ namespace Volian.Print.Library } plstr = SplitEOPNumber(svgGroup, pageItem, eopnum1, token, plstr); break; + case "{CM:(Cont)}": + if (OldTemplateContMsg) + plstr = plstr.Replace("{CM:(Cont)}", "(Cont)"); + else + plstr = plstr.Replace("{CM:(Cont)}", ""); + break; case "{EOPNUM}": case "[EOPNUM]": case "{PREDELIMEOPNUM}": diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 59678e46..7feaa1c4 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -965,6 +965,11 @@ namespace Volian.Print.Library float yLocalypagestart = yPageStart; // yPageStart is offset into roll; YTopMost is offset of topmost of this paragraph. float yLocation = yPageStart - YTopMost; + + // If this document style has a pagelist item with a continue (some IP2BCK docstyles), clear + // out the variable that flags a continue message + MyPageHelper.OldTemplateContMsg = false; + if(DebugText.IsOpen) DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortPath, XOffset, yLocation, yPageStart, YTopMost); int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null); @@ -1061,9 +1066,23 @@ namespace Volian.Print.Library } } } - + DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, doThreeContinues); cb.PdfDocument.NewPage(); + if (MyItemInfo.IsStep && ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + { + // check if parent (can be HLS, Caution or Note) has the UseOldTemplate. If so, + // flag that a continue message should be printed as part of a pagelist header (if pagelist + // has CM: page list item) + ItemInfo itm = MyItemInfo; + while (itm.IsStep && !itm.FormatStepData.UseOldTemplate) itm = itm.MyParent; + // don't put out continue if the page break item is the same as background step item (caution/note or hls) + if (itm.IsStep && itm.ItemID != MyItemInfo.ItemID) + { + MyPageHelper.OldTemplateContMsg = true; + MyPageHelper.ResetSvg(); + } + } //_MyLog.InfoFormat("NewPage 11 {0}", cb.PdfWriter.CurrentPageNumber); ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); DebugText.WriteLine("Paginate2"); @@ -3548,6 +3567,13 @@ namespace Volian.Print.Library XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * 2); // indent 2 characters for background steps return; } + else if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate() && + ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + { + if (myTab != null) myTab.XOffset = XOffset; + XOffset += myTab.Width; + return; + } else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextBelow") { if ((colOvrd ?? 0) != 0) @@ -3853,6 +3879,23 @@ namespace Volian.Print.Library { if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.TemplateIndex > 1) widOvrd = GetWidthOrStartFromTemplate(itemInfo.MyPrevious, itemInfo.MyPrevious.ActiveFormat, true); } + + // for IP2 backgrounds, set widths appropriately for template items: + if (itemInfo.IsStep && ((itemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) + { + if (itemInfo.IsStep && itemInfo.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW") + { + Width = MyParent.Width; + return; + } + if (widOvrd == 0 && itemInfo.MyParent.IsStep && itemInfo.MyParent.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW") + { + Width = MyParent.MyParent.Width + (MyParent.MyParent.MyTab != null ? MyParent.MyParent.MyTab.Width : 0); + Width -= (MyTab != null ? MyTab.Width : 0); + return; + } + } + //widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; // Don't adjust the RNO width if in single column mode: if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null) @@ -3941,7 +3984,7 @@ namespace Volian.Print.Library else Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit } - else if (itemInfo.IsCaution || itemInfo.IsNote) + else if ((itemInfo.IsCaution || itemInfo.IsNote) && !itemInfo.FormatStepData.UseOldTemplate) { float mycolT = (float)formatInfo.MyStepSectionLayoutData.ColT; if (formatInfo.MyStepSectionLayoutData.Dev_Format) diff --git a/PROMS/Volian.Print.Library/vlnTab.cs b/PROMS/Volian.Print.Library/vlnTab.cs index 07ad2baa..6ed91556 100644 --- a/PROMS/Volian.Print.Library/vlnTab.cs +++ b/PROMS/Volian.Print.Library/vlnTab.cs @@ -21,7 +21,7 @@ namespace Volian.Print.Library if (_TabAlign == null) { _TabAlign = 0; - if (Text != null) + if (Text != null && (!MyParent.MyItemInfo.IsStep || !MyParent.MyItemInfo.FormatStepData.TabData.NoTabAlign)) { while (_TabAlign < Text.Length && Text[(int)_TabAlign] == ' ') _TabAlign++;