From 469a8da0baf8c24aea4a172363a934b0fa6fee71 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 16 Feb 2015 19:44:10 +0000 Subject: [PATCH] Added logic to support ColOverride on Caution and Note types in Enhanced Background Formats. --- PROMS/Volian.Print.Library/vlnParagraph.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 86722adc..6b044fc0 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4010,6 +4010,12 @@ namespace Volian.Print.Library get { return _XOffsetCenter; } set { _XOffsetCenter = value; } } + + public bool IsEnhancedBackgroundFormat(ItemInfo itminfo) + { + return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds); + } + public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab, float xMetaAdj) { float tabWidth = (myTab == null) ? 0 : myTab.Width; @@ -4200,15 +4206,22 @@ namespace Volian.Print.Library } } } - else if (((colOvrd ?? 0) != 0) && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.NullBox) + else if (((colOvrd ?? 0) != 0) && (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.NullBox)) { float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset; - XOffset = (float)colOvrd; if (myTab != null) myTab.XOffset = XOffset + tabOffset; return; } - // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) + else if (((colOvrd ?? 0) != 0) && (IsEnhancedBackgroundFormat(itemInfo) && (itemInfo.IsNote || itemInfo.IsCaution))) + { + float tabOffset = (myTab == null ? 0 : myTab.XOffset); + // Adjust the position of the Note/Caution text by the difference of the colOverride and the tab xoffset + XOffset += ((float)colOvrd - tabOffset); + if (myTab != null) myTab.XOffset = (float)colOvrd; // set the note/caution tab offset to the colOverride + return; + } + // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) else if (bxIndx != null && (itemInfo.IsCaution || itemInfo.IsNote || !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps)) { @@ -4262,7 +4275,7 @@ namespace Volian.Print.Library { // if the tab is 3 char or smaller, make the indent amount for the rno text 4 characters. // if bigger, make it the additional tab size. - int len = myTab.Text.Trim().Length; + int len = myTab.Text.Trim().Length; int adj = len <= 3 ? 4 : (len - 3) + 4; float rnoOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)itemInfo.MyDocStyle.CenterLineX + 5; float tPtPerChar = itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6;