F2016-039: fix text column widths when a checkoff is used for vcb formats.
This commit is contained in:
		| @@ -5333,30 +5333,31 @@ namespace Volian.Print.Library | |||||||
| 			{ | 			{ | ||||||
| 				float CheckOffAdj = 0; | 				float CheckOffAdj = 0; | ||||||
| 				bool ChkOff = itemInfo.MyDocStyle.UseCheckOffs; | 				bool ChkOff = itemInfo.MyDocStyle.UseCheckOffs; | ||||||
| 				if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) | 				if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert || itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")) | ||||||
| 				{ | 				{ | ||||||
| 					// For Calvert STP/OP: see if this section has checkoffs by looking in the section config: |  | ||||||
| 					//SectionInfo si= SectionInfo.Get(itemInfo.ActiveSection.ItemID); |  | ||||||
| 					SectionInfo si = itemInfo.ActiveSection.GetSectionInfo(); | 					SectionInfo si = itemInfo.ActiveSection.GetSectionInfo(); | ||||||
| 					ChkOff = si.HasInitials; | 					ChkOff = si.HasInitials;		// this determines if any steps within the section have checkoffs. | ||||||
| 				} | 				} | ||||||
|  | 				bool FmtHasAdj = false; | ||||||
| 				if (ChkOff) | 				if (ChkOff) | ||||||
| 				{ | 				{ | ||||||
| 					bool FmtHasAdj = false; |  | ||||||
| 					if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null) | 					if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null) | ||||||
| 					{ | 					{ | ||||||
| 						FmtHasAdj = true; | 						FmtHasAdj = true; | ||||||
| 						CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; | 						CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; | ||||||
| 					} | 					} | ||||||
| 					if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) | 					if (!itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB"))		// Don't do the following if in a vcb format (part of fix F2016-039) | ||||||
| 						CheckOffAdj += (float)(9 * 7.2);   // 9 is the size of the SIGNOFF adjustment | 					{ | ||||||
| 					else if (!FmtHasAdj && HasCheckOffHeading(itemInfo, formatInfo)) | 						if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) | ||||||
| 						// For Robinson, tried using font's CharsToTwips but it made it too narrow, so used hardcoded 6: | 							CheckOffAdj += (float)(9 * 7.2);   // 9 is the size of the SIGNOFF adjustment | ||||||
| 						CheckOffAdj = -((float)9 * 6); | 						else if (!FmtHasAdj && HasCheckOffHeading(itemInfo, formatInfo)) | ||||||
|  | 							// For Robinson, tried using font's CharsToTwips but it made it too narrow, so used hardcoded 6: | ||||||
|  | 							CheckOffAdj = -((float)9 * 6); | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 				float adjwidth = CheckOffAdj; | 				float adjwidth = CheckOffAdj; | ||||||
| 				CheckOffWidth = -CheckOffAdj; | 				CheckOffWidth = -CheckOffAdj; | ||||||
| 				adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth); | 				adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth, FmtHasAdj); | ||||||
| 				Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); | 				Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); | ||||||
| 				Width += _WidthAdjust; | 				Width += _WidthAdjust; | ||||||
| 				Width += adjwidth; | 				Width += adjwidth; | ||||||
| @@ -5416,7 +5417,7 @@ namespace Volian.Print.Library | |||||||
| 			{ | 			{ | ||||||
| 				Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); | 				Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); | ||||||
| 				float adjwidths = 0; | 				float adjwidths = 0; | ||||||
| 				adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths); | 				adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths, false); | ||||||
| 				Width += (adjwidths + _WidthAdjust); | 				Width += (adjwidths + _WidthAdjust); | ||||||
| 			} | 			} | ||||||
| 			else if (MyParent == null) | 			else if (MyParent == null) | ||||||
| @@ -5471,12 +5472,14 @@ namespace Volian.Print.Library | |||||||
| 				Width += 10;   // FIX THIS!!! | 				Width += 10;   // FIX THIS!!! | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		private float AdjustMetaWidth(ItemInfo itemInfo, FormatInfo formatInfo, float adjwidth) | 		private float AdjustMetaWidth(ItemInfo itemInfo, FormatInfo formatInfo, float adjwidth, bool coadj) | ||||||
| 		{ | 		{ | ||||||
| 			SectData sd = formatInfo.PlantFormat.FormatData.SectData; | 			SectData sd = formatInfo.PlantFormat.FormatData.SectData; | ||||||
| 			if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) | 			if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) | ||||||
| 			{ | 			{ | ||||||
| 				adjwidth = MyTab != null ? -MyTab.Width : 0; | 				// don't adjust the width if there already was an adjustment for checkoffs - for VCB only (F2016-039) | ||||||
|  | 				if (!(itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && coadj)) | ||||||
|  | 					adjwidth = MyTab != null ? -MyTab.Width : 0; | ||||||
| 			} | 			} | ||||||
| 			else if (sd.UseMetaSections) | 			else if (sd.UseMetaSections) | ||||||
| 			{ | 			{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user