Logic for more control over indenting and underlining on Auto Table of Contents

Added logic to prevent multiple numbers (on top of each other) from printing on the AutoTableOfContents, added logic to support format defined section continue text, logic to support EndMessageOnEachSubSection, logic to repeat high level step text as part of a continue message
Logic to support DidFirstPageDocStyle flag, logic to support {SECTIONLEVELNUMBER} {SECTIONLEVELTITLE} on the same line of a pagelist item when the section title goes to more than one line.
This commit is contained in:
2014-10-07 19:37:11 +00:00
parent 3162883a66
commit ea01b9bf71
3 changed files with 77 additions and 19 deletions

View File

@@ -783,10 +783,19 @@ namespace Volian.Print.Library
//}
float lastyLocation = 0;
private string GetRtfToC(string txt, TableOfContentsData tOfCData)
{
return GetRtfToC(txt, tOfCData, null);
}
private string GetRtfToC(string txt, TableOfContentsData tOfCData, VE_Font overrideFont)
{
StringBuilder _RtfSB = new StringBuilder();
Volian.Controls.Library.DisplayText toctxt = new Volian.Controls.Library.DisplayText(txt, tOfCData.Font, false);
System.Drawing.Font myFont = toctxt.TextFont.WindowsFont;
if (overrideFont != null)
{
toctxt = new Volian.Controls.Library.DisplayText(txt, overrideFont, false);
myFont = overrideFont.WindowsFont;//toctxt.TextFont.WindowsFont;
}
_RtfSB.Append(vlnPrintObject.AddFontTable(myFont));
_RtfSB.Append(toctxt.StartText);
_RtfSB.Append("}");
@@ -843,7 +852,9 @@ namespace Volian.Print.Library
int tofCNumLevels = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCNumLevels ?? 0;
if (tofCNumLevels > 0 && level > tofCNumLevels) return yLocation;
level = level <= 2 ? 0 : level - 2; // no indenting until third level
int startIndentAfterLevel = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCStartIndentAfterLevel ?? 2; //
//level = level <= 2 ? 0 : level - 2; // no indenting until third level
level = level <= startIndentAfterLevel ? 0 : level - startIndentAfterLevel;
float indentOffset = (level * (secTitlePos - secNumPos));
// if the starting column of text would be in 'middle of' the number, just put it
@@ -855,7 +866,14 @@ namespace Volian.Print.Library
// Do the title first since it may wrap to 2nd line and this is an issue for
// doing a pagebreak, i.e. may cause a page break when the number on a single line
// would not.
rtfText = GetRtfToC(mySection.MyContent.Text, tOfC);
//if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData
if (level == 0 && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCUnderlineFirstLevelTitle)
{
VE_Font ovrFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size,(E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI);
rtfText = GetRtfToC(mySection.MyContent.Text, tOfC, ovrFont);
}
else
rtfText = GetRtfToC(mySection.MyContent.Text, tOfC);
Paragraph myparagrapht = vlnPrintObject.RtfToParagraph(rtfText);
width = secPagePos - adjSecTitlePos - 6;
float savTitleWid = width;