BGE: Fix pagination when a phone list exists

BGE: Auto Table Of Contents, multi-line title leader dots
BGE: Auto ToC, save section title length for printing of leader dots on last line of title
BGE: Fix location of bottom continue message when phone list exists
BGE: Auto ToC, save section title length for printing of leader dots on multi-line of title
This commit is contained in:
2014-05-19 13:16:45 +00:00
parent 5f9331b1b8
commit 86cac2ae13
5 changed files with 54 additions and 22 deletions

View File

@@ -504,24 +504,29 @@ namespace Volian.Print.Library
_MyHelper.PhoneListHeight = 0;
if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList)
{
DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null)
// get config for section
SectionConfig sc = mySection.MyConfig as SectionConfig;
if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y")
{
string phlist = dvc.Print_PhoneList;
if (phlist != null && phlist != "")
DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig;
if (dvc != null)
{
// count lines:
int cl = 1;
int indx = phlist.IndexOf("\n");
while (indx > 0)
string phlist = dvc.Print_PhoneList;
if (phlist != null && phlist != "")
{
cl++;
if (indx + 1 > phlist.Length)
indx = -1;
else
indx = phlist.IndexOf("\n", indx + 1);
// count lines:
int cl = 1;
int indx = phlist.IndexOf("\n");
while (indx > 0)
{
cl++;
if (indx + 1 > phlist.Length)
indx = -1;
else
indx = phlist.IndexOf("\n", indx + 1);
}
_MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
}
_MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch;
}
}
}
@@ -826,6 +831,7 @@ namespace Volian.Print.Library
rtfText = GetRtfToC(mySection.MyContent.Text, tOfC);
Paragraph myparagrapht = vlnPrintObject.RtfToParagraph(rtfText);
width = secPagePos - adjSecTitlePos - 6;
float savTitleWid = width;
float retval = Rtf2Pdf.TextAt(cb, myparagrapht, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin);
if (retval == 0) // couldn't fit, flags need for a page break.
{
@@ -835,10 +841,11 @@ namespace Volian.Print.Library
retval = Rtf2Pdf.TextAt(cb, myparagrapht, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin);
}
float ttlRetval = retval;
float savTitleFillWidth = Rtf2Pdf.FillWidth;
// Now do the section number. Retval is the ylocation on page after the text
// is put out.
retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, width * 1.3F, height, "", yBottomMargin);
retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin);
float lSpace = (tOfC.TofCLineSpacing == 2) ? 2 * vlnPrintObject.SixLinesPerInch : vlnPrintObject.SixLinesPerInch;
@@ -862,12 +869,25 @@ namespace Volian.Print.Library
width = 0;
foreach (Chunk chkt in myparagrapht.Chunks)
width += chkt.GetWidthPoint();
// the '6' in the next 2 lines & in the 'while' loop below allows the placement of the dots (or other space character)
// get height - if two lines high, need width of 2nd line for adding
// space characters
float heightTtl = vlnPrintObject.GetHeight(cb, myparagrapht, savTitleWid, false);
string spaceStr = "";
float startSpace = 0;
// the '6's in the next few code lines & in the 'while' loop below allows the placement of the dots (or other space character)
// to be not too close to section title & page number.
float startSpace = leftMargin + adjSecTitlePos + width + 6;
if (heightTtl > vlnPrintObject.SixLinesPerInch)
{
// this title is 2 or more lines, find start of leader dots by determining length of text
// on 2nd line (the savTitleFillWidth is the widest line of the split title)
float secondLineWidth = width - savTitleFillWidth;
startSpace = leftMargin + adjSecTitlePos + secondLineWidth + 6;
}
else
startSpace = leftMargin + adjSecTitlePos + width + 6;
float endSpace = leftMargin + secPagePos - 6;
float numSpace = endSpace - startSpace;
string spaceStr = "";
rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC);
Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText);
float spacchrwid = 0;
@@ -878,9 +898,11 @@ namespace Volian.Print.Library
spaceStr = spaceStr + tOfC.TofCSpaceChar;
numSpace -= spacchrwid;
}
rtfText = GetRtfToC(spaceStr, tOfC);
Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText);
retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin);
}
// if in the pre-table of content list, just put the page number out as text.
// otherwise, add a template _MyHelper.MyTOCPageCounts