This commit is contained in:
Kathy Ruffing 2013-02-01 14:59:30 +00:00
parent 42c3ba8dd5
commit f399ad350a

View File

@ -353,7 +353,6 @@ namespace Volian.Print.Library
int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout); int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout);
foreach (SectionInfo mySection in myProcedure.Sections) foreach (SectionInfo mySection in myProcedure.Sections)
{ {
if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT" if ((mySection.MyContent.Number.ToUpper() == "FOLDOUT"
|| (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT"))) || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT")))
!= doingFoldout) continue; != doingFoldout) continue;
@ -467,7 +466,8 @@ namespace Volian.Print.Library
if (_MyHelper.MyTOCPageCounts.ContainsKey(tocKey)) if (_MyHelper.MyTOCPageCounts.ContainsKey(tocKey))
{ {
PageCount pc = _MyHelper.MyTOCPageCounts[tocKey]; PageCount pc = _MyHelper.MyTOCPageCounts[tocKey];
pc.Total = _MyHelper.CurrentPageNumber; // add 1 because have not hit end page yet.
pc.Total = _MyHelper.CurrentTOCPageNumber + 1;
pc.DrawTemplates(); pc.DrawTemplates();
} }
else else
@ -479,9 +479,9 @@ namespace Volian.Print.Library
{ {
string tockey = "TOC" + mySection.ItemID.ToString(); string tockey = "TOC" + mySection.ItemID.ToString();
if (!_MyHelper.MyTOCPageNums.ContainsKey(tockey)) if (!_MyHelper.MyTOCPageNums.ContainsKey(tockey))
// increment the currentpagenumber by 1 since we haven't hit an // increment the CurrentTOCPageNumber by 1 since we haven't hit an
// endpage yet, and that's what increments it to the current page number. // endpage yet, and that's what increments it to the current page number.
_MyHelper.MyTOCPageNums.Add(tockey, _MyHelper.CurrentPageNumber+1); _MyHelper.MyTOCPageNums.Add(tockey, _MyHelper.CurrentTOCPageNumber + 1);
} }
} }
float origYoff = (float)mySection.MyDocStyle.Layout.TopMargin; float origYoff = (float)mySection.MyDocStyle.Layout.TopMargin;
@ -641,12 +641,37 @@ namespace Volian.Print.Library
yLocation += (lastyLocation - retval - vlnPrintObject.SixLinesPerInch); yLocation += (lastyLocation - retval - vlnPrintObject.SixLinesPerInch);
lastyLocation = retval; lastyLocation = retval;
// if the space character is not null & is not a space, the we've got to put out
// these between the section title & the page number
if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ")
{
width = 0;
foreach (Chunk chkt in myparagrapht.Chunks)
width += chkt.GetWidthPoint();
float startSpace = leftMargin + adjSecTitlePos + width;
float endSpace = leftMargin + secPagePos;
float numSpace = endSpace - startSpace;
string spaceStr = "";
rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC);
Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText);
float spacchrwid = 0;
foreach (Chunk chkt in tmpmyparagraph.Chunks)
spacchrwid += chkt.GetWidthPoint();
while (numSpace > 0)
{
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. // if in the pre-table of content list, just put the page number out as text.
// otherwise, add a template _MyHelper.MyTOCPageCounts // otherwise, add a template _MyHelper.MyTOCPageCounts
string key = "TOC" + mySection.ItemID.ToString(); string key = "TOC" + mySection.ItemID.ToString();
if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key))
{ {
string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentPageNumber+1).ToString(); string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString();
rtfText = GetRtfToC(pnum, tOfC); rtfText = GetRtfToC(pnum, tOfC);
Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText); Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText);
width = pnum.Length * 6; width = pnum.Length * 6;