This commit is contained in:
2013-03-25 12:09:11 +00:00
parent 3c96857d1d
commit bfa0add51c
7 changed files with 90 additions and 12 deletions

View File

@@ -613,6 +613,7 @@ namespace Volian.Print.Library
float numwidth = width;
float yBottomMargin = yPageStart - (float)tocSection.MyDocStyle.Layout.PageLength + (2 * vlnPrintObject.SixLinesPerInch);
Rtf2Pdf.Offset = new PointF(0, 2.5F);
// for indenting of subsections, count up tree. Only start indenting
// at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1:
int level = 0;
@@ -622,8 +623,13 @@ namespace Volian.Print.Library
level++;
iilvl = iilvl.MyParent;
}
// check what level the plant wants the auto ToC indented:
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
float indentOffset = (level * (secTitlePos - secNumPos));
float retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, width * 1.3F, height, "", yBottomMargin);
if (retval == 0) // do a newpage, it couldn't fit on current page.
{