B2015-043: BGE - fixed section continuation headers and x-offset for subsection titles in OI-34 Appendix sections

This commit is contained in:
Kathy Ruffing 2015-03-27 12:53:12 +00:00
parent 381376843f
commit 37d570626e

View File

@ -1141,19 +1141,33 @@ namespace Volian.Print.Library
ItemInfo mypar = itemInfo.MyParent; ItemInfo mypar = itemInfo.MyParent;
while (mypar != null && !mypar.IsProcedure) while (mypar != null && !mypar.IsProcedure)
{ {
string pTab = mypar.MyTab.CleanText.Trim(); // The following check was added for BGE/OI34. Their APPENDIX sections had the subsections
if (pTab.Length > 0 && char.IsLetterOrDigit(pTab[0])) // printing with incorrect tab in the SectionTitleContinued message. Before this
// fix the tabs were A.B Procedure (Continued) rather than B. Procedure (Continued).
// Unfortunately there was not enough time to make the 'if' statement based on config
// or format settings.
bool addTab = true;
if (mypar.IsSection && mypar.DisplayNumber.ToUpper().Contains("APPENDIX "))
{ {
pTab = pTab.TrimEnd(" .".ToCharArray()) + "."; SectionConfig sch = mypar.MyConfig as SectionConfig;
prTab = pTab + prTab; addTab = (sch == null || sch.Section_PrintHdr == "Y");// && !mypar.MyDocStyle.CancelSectTitle;
} }
else if (addTab)
{ {
// There' a bullet or some other graphics character. string pTab = mypar.MyTab.CleanText.Trim();
// clear out the tab we are building so the we can build if (pTab.Length > 0 && char.IsLetterOrDigit(pTab[0]))
// a continue tab up to this bullet or graphic character. {
prTab = ""; pTab = pTab.TrimEnd(" .".ToCharArray()) + ".";
thisTab = ""; prTab = pTab + prTab;
}
else
{
// There' a bullet or some other graphics character.
// clear out the tab we are building so the we can build
// a continue tab up to this bullet or graphic character.
prTab = "";
thisTab = "";
}
} }
mypar = (mypar.IsSection && !mypar.IsSeparateSubsection) ? null : mypar.MyParent; mypar = (mypar.IsSection && !mypar.IsSeparateSubsection) ? null : mypar.MyParent;
} }
@ -1446,14 +1460,24 @@ namespace Volian.Print.Library
// in the document style that includes 'Continued' // in the document style that includes 'Continued'
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert)
{ {
string myMsg = MyItemInfo.MyDocStyle.Continue.Top.Message; string myMsg = MyItemInfo.MyDocStyle.Continue.Top.Message;
if (myMsg == null || myMsg == "") if (myMsg == null || myMsg == "")
doSectionTitleContinued = false; {
else // There is no message, but still need to check if there is a Section Title Continued message:
{ // This was added for BGE OI34 (if break was within step, no section title continue message was printed)
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; {
} SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
}
else
doSectionTitleContinued = false;
}
else
{
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
}
} }
else else
{ {
@ -2582,8 +2606,28 @@ namespace Volian.Print.Library
{ {
SectionConfig sc = itemInfo.MyParent.MyConfig as SectionConfig; SectionConfig sc = itemInfo.MyParent.MyConfig as SectionConfig;
if (MyParent != null) if (MyParent != null)
offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset {
: (MyParent.MyTab != null)?MyParent.MyTab.XOffset:XOffset; // if the parent is not printed, then adjust the xoffset based on
// the level of the metasection. Note that the 'if (MetaLevel==20) MetaLevel = 1'
// line of code was added so that the xoffsets between 16 & 32 bit are closer.
// This code was added to fix problems in BGE OI34, Appendix sections/subsection xoffsets.
if (sc != null && sc.Section_PrintHdr == "N")
{
if (MetaLevel == 2) MetaLevel = 1;
xMetaAdj = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[0].ColSByLevel;
for (int i = 0; i < MetaLevel; i++)
{
xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos;
xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[i].SecNumPositionAdj;
}
offset += xMetaAdj;
}
else
{
offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset
: (MyParent.MyTab != null) ? MyParent.MyTab.XOffset : XOffset;
}
}
} }
} }
else else