B2020-033: Auto table of contents line spacing
This commit is contained in:
parent
ae1396bf5a
commit
8c4f36566c
@ -1329,12 +1329,14 @@ namespace Volian.Print.Library
|
|||||||
float secPagePos = (float)tOfC.TofCPageNumPos + xAdjNumber;
|
float secPagePos = (float)tOfC.TofCPageNumPos + xAdjNumber;
|
||||||
float height = tOfC.Font.WindowsFont.Size * 1.5F;
|
float height = tOfC.Font.WindowsFont.Size * 1.5F;
|
||||||
string lastTOCGroupHeading = "";
|
string lastTOCGroupHeading = "";
|
||||||
|
bool firstGroupHeading = true;
|
||||||
if (ii.Sections != null)
|
if (ii.Sections != null)
|
||||||
{
|
{
|
||||||
int sectCnt = 0; // keep count of which section/sub-section we are processing
|
int sectCnt = 0; // keep count of which section/sub-section we are processing
|
||||||
bool doSubY = false;
|
bool doSubY = false;
|
||||||
// C2018-004 create meta file for baseline compares
|
// C2018-004 create meta file for baseline compares
|
||||||
Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos);
|
Volian.Base.Library.BaselineMetaFile.WriteLine("TOC Ystart {0} LeftMar {1} ScNmPos {2} ScTtlPos {3} ScPgPos {4}", yPageStart, leftMargin, secNumPos, secTitlePos, secPagePos);
|
||||||
|
bool inGroup = false;
|
||||||
foreach (SectionInfo mySection in ii.Sections)
|
foreach (SectionInfo mySection in ii.Sections)
|
||||||
{
|
{
|
||||||
sectCnt++;
|
sectCnt++;
|
||||||
@ -1375,8 +1377,14 @@ namespace Volian.Print.Library
|
|||||||
if (tocGrpHeading != lastTOCGroupHeading && tocGrpHeading.Length > 0)
|
if (tocGrpHeading != lastTOCGroupHeading && tocGrpHeading.Length > 0)
|
||||||
{
|
{
|
||||||
doGroupHeading = true;
|
doGroupHeading = true;
|
||||||
if (lastTOCGroupHeading != "")
|
inGroup = true;
|
||||||
|
// B2020-033: for single spacing, add an extra line before a grouping title:
|
||||||
|
float tmpspc = (float)(tOfC.TofCLineSpacing ?? 1);
|
||||||
|
if (lastTOCGroupHeading != "" || (firstGroupHeading && tmpspc==1))
|
||||||
|
{
|
||||||
yLocation += vlnPrintObject.SixLinesPerInch;
|
yLocation += vlnPrintObject.SixLinesPerInch;
|
||||||
|
firstGroupHeading = false;
|
||||||
|
}
|
||||||
lastTOCGroupHeading = tocGrpHeading;
|
lastTOCGroupHeading = tocGrpHeading;
|
||||||
}
|
}
|
||||||
// need to do the section number, section title & page number. Page number
|
// need to do the section number, section title & page number. Page number
|
||||||
@ -1562,7 +1570,7 @@ namespace Volian.Print.Library
|
|||||||
float spcs = (float)(tOfC.TofCLineSpacingSub ?? 1);
|
float spcs = (float)(tOfC.TofCLineSpacingSub ?? 1);
|
||||||
if (spcs == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
|
if (spcs == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
|
||||||
{
|
{
|
||||||
if (sc.Section_TOC_Group_Title != null && sc.Section_TOC_Group_Title != "")
|
if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
|
||||||
spcs = 1;
|
spcs = 1;
|
||||||
else
|
else
|
||||||
spcs = 2;
|
spcs = 2;
|
||||||
@ -1574,7 +1582,7 @@ namespace Volian.Print.Library
|
|||||||
float spc = (float)(tOfC.TofCLineSpacing ?? 1);
|
float spc = (float)(tOfC.TofCLineSpacing ?? 1);
|
||||||
if (spc == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
|
if (spc == -1) // F2018-033: Allow for single & double spacing for Farley (if in group or not)
|
||||||
{
|
{
|
||||||
if (sc.Section_TOC_Group_Title != null && sc.Section_TOC_Group_Title != "")
|
if (inGroup) // Do not require a title to be placed on each section in group for Farley. If in group from above, single space
|
||||||
spc = 1;
|
spc = 1;
|
||||||
else
|
else
|
||||||
spc = 2;
|
spc = 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user