Added properties for IsSubsection, IsSubsectionNumber and IsSeparateSubsection

Improved debug
Calvert: Improved tab on Section Continue Message and print missing Section Continue Message
This commit is contained in:
Kathy Ruffing 2014-11-13 15:50:46 +00:00
parent edf38ca662
commit 7d3b8872c8
3 changed files with 50 additions and 10 deletions

View File

@ -1625,6 +1625,40 @@ namespace VEPROMS.CSLA.Library
return false;
}
}
public bool IsSubsection
{
get
{
if (!IsSection) return false;
ItemInfo par = ActiveParent as ItemInfo;
if (par == null || !par.IsSection) return false;
return true;
}
}
public bool IsSubsectionNumber
{
// returns whether the subsection number is derived from section number,
// for example 6.9 is subsectionnumber of 6.0. B is not a subsectionnumber of 6.9
get
{
if (!IsSection) return false;
ItemInfo par = ActiveParent as ItemInfo;
if (par == null || !par.IsSection) return false;
string parNumber = par.DisplayNumber;
string myNumber = DisplayNumber;
if (parNumber == null || myNumber == null) return false;
if (!parNumber.EndsWith(".0")) return false;
return (myNumber.StartsWith(parNumber.Substring(0, parNumber.Length - 1)));
}
}
public bool IsSeparateSubsection
{
get
{
return (IsSubsection && !IsSubsectionNumber);
}
}
public bool IsFolder
{
get

View File

@ -116,8 +116,14 @@ namespace Volian.Print.Library
yDescent = -iParagraph.Font.BaseFont.GetDescentPoint("Almg", iParagraph.Font.Size);
if (PdfDebug)
{
// be very careful around the following line, if the cursor 'touches'
// NextTextAtCounter, it is incremented and the 'next' value may not be what
// was seen as the UniqueNumber in the pdf.
int next = NextTextAtCounter;
//if (InList(next,1884,1985,1986,1987,1988,1989)) Console.WriteLine("here");
// buffer (unnecessary comments) so
// that cursor does NOT touch 'NextTextAtCounter'
// as easily
//if (InList(next,2958, 2961)) Console.WriteLine("Stop at UniqueNumber");
string dbt = string.Format("[{0}]{1}", next, debugText ?? "");
DrawPdfDebug(cb, left, top, left + width, myColumnText.YLine, dbt, yDescent);
}

View File

@ -1010,7 +1010,7 @@ namespace Volian.Print.Library
if (!itemInfo.IsHigh && !itemInfo.IsSequential && !itemInfo.IsSection) itemInfo = itemInfo.ActiveParent as ItemInfo;
string prTab = "";
string thisTab = itemInfo.MyTab.CleanText.Trim();
if (!itemInfo.IsSection)
if (!itemInfo.IsSection || itemInfo.IsSeparateSubsection)
{
ItemInfo mypar = itemInfo.MyParent;
while (mypar != null && !mypar.IsProcedure)
@ -1029,7 +1029,7 @@ namespace Volian.Print.Library
prTab = "";
thisTab = "";
}
mypar = (mypar.IsSection)? null: mypar.MyParent;
mypar = (mypar.IsSection && !mypar.IsSeparateSubsection) ? null : mypar.MyParent;
}
}
return (prTab + thisTab.Trim()).TrimEnd(".".ToCharArray());
@ -1149,7 +1149,7 @@ namespace Volian.Print.Library
if (doSectionContinue) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null);
// If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it
if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader)
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection))
{
SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig;
doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle;
@ -2291,7 +2291,7 @@ namespace Volian.Print.Library
{
SectionConfig sc = itemInfo.MyParent.MyConfig as SectionConfig;
offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset
: (MyParent.MyTab != null)?MyParent.MyTab.XOffset:XOffset;
: (MyParent != null && MyParent.MyTab != null)?MyParent.MyTab.XOffset:XOffset;
}
}
else