F2016-039: fix text column widths when a checkoff is used for vcb formats.
This commit is contained in:
parent
04927739bf
commit
73daac2ce1
@ -5333,30 +5333,31 @@ namespace Volian.Print.Library
|
||||
{
|
||||
float CheckOffAdj = 0;
|
||||
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();
|
||||
ChkOff = si.HasInitials;
|
||||
ChkOff = si.HasInitials; // this determines if any steps within the section have checkoffs.
|
||||
}
|
||||
bool FmtHasAdj = false;
|
||||
if (ChkOff)
|
||||
{
|
||||
bool FmtHasAdj = false;
|
||||
if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null)
|
||||
{
|
||||
FmtHasAdj = true;
|
||||
CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment;
|
||||
}
|
||||
if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0)
|
||||
CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment
|
||||
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);
|
||||
if (!itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")) // Don't do the following if in a vcb format (part of fix F2016-039)
|
||||
{
|
||||
if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0)
|
||||
CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment
|
||||
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;
|
||||
CheckOffWidth = -CheckOffAdj;
|
||||
adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth);
|
||||
adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth, FmtHasAdj);
|
||||
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
|
||||
Width += _WidthAdjust;
|
||||
Width += adjwidth;
|
||||
@ -5416,7 +5417,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO);
|
||||
float adjwidths = 0;
|
||||
adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths);
|
||||
adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths, false);
|
||||
Width += (adjwidths + _WidthAdjust);
|
||||
}
|
||||
else if (MyParent == null)
|
||||
@ -5471,12 +5472,14 @@ namespace Volian.Print.Library
|
||||
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;
|
||||
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user