B2019-158 Added logic to support the format flag to turn off the bolding of the sub-section header. Used in the Barakah Single Column Format.

This commit is contained in:
John Jenko 2021-08-10 16:51:45 +00:00
parent 4bc93dfe33
commit 9e33d021eb

View File

@ -3033,10 +3033,17 @@ namespace VEPROMS.CSLA.Library
font = format.PlantFormat.FormatData.Font;
break;
case 1: // section
if (format.PlantFormat.FormatData.SectData.SectionHeader.OnlyUnderlineTopSect && MyParent.IsSection)
// B2019-158 Added the OnlyBoldTopSect format flag to control whether the sub-section heading are bolded
// The following logic will turn off the Bolding and/or underlining of sub-section headings
// This logic assumes that the top section header is both bolded and underlined
if ((format.PlantFormat.FormatData.SectData.SectionHeader.OnlyUnderlineTopSect || format.PlantFormat.FormatData.SectData.SectionHeader.OnlyBoldTopSect) && MyParent.IsSection)
{
VE_Font hdrFont = format.PlantFormat.FormatData.SectData.SectionHeader.Font;
E_Style es = (E_Style)(hdrFont.Style & E_Style.Bold);
E_Style es = (E_Style)hdrFont.Style;
if (format.PlantFormat.FormatData.SectData.SectionHeader.OnlyUnderlineTopSect)
es = es & E_Style.Bold; // only keep the underline (turn off the bold)
if (format.PlantFormat.FormatData.SectData.SectionHeader.OnlyBoldTopSect)
es = es & E_Style.Underline; // only keep the bold (turn off underline)
font = new VE_Font(hdrFont.Family, (int)hdrFont.Size, es, (float)hdrFont.CPI);
}
else