Support 'BoldHighLevel' format flag and fix section tabs with spaces.

This commit is contained in:
Kathy Ruffing 2013-12-16 15:43:08 +00:00
parent a425670a08
commit bca68b2fd0

View File

@ -1736,6 +1736,7 @@ namespace VEPROMS.CSLA.Library
int typindx = type - 20000; // what to do for other types rather than steps int typindx = type - 20000; // what to do for other types rather than steps
font = format.PlantFormat.FormatData.StepDataList[typindx].Font; font = format.PlantFormat.FormatData.StepDataList[typindx].Font;
if (typindx == _ParagraphType) font = AdjustForTextSubFollowsTextStyle(format,typindx,font); if (typindx == _ParagraphType) font = AdjustForTextSubFollowsTextStyle(format,typindx,font);
if (IsRNOPart && MyParent.IsHigh && FormatStepData.BoldHighLevel) font = BoldTextStyle(font);
break; break;
} }
} }
@ -1745,6 +1746,14 @@ namespace VEPROMS.CSLA.Library
} }
return font; return font;
} }
private VE_Font BoldTextStyle(VE_Font font)
{
E_Style myStyle = (E_Style) font.Style;
myStyle |= E_Style.Bold;
if (myStyle != font.Style)
font = new VE_Font(font.Family, (int)font.Size, myStyle, (float)font.CPI);
return font;
}
private const int _ParagraphType=24; private const int _ParagraphType=24;
protected VE_Font AdjustForTextSubFollowsTextStyle(VE_Font font) protected VE_Font AdjustForTextSubFollowsTextStyle(VE_Font font)
{ {
@ -4900,8 +4909,12 @@ namespace VEPROMS.CSLA.Library
string ch = DisplayNumber != null && DisplayNumber != "" ? DisplayNumber.Substring(0,1) : null; string ch = DisplayNumber != null && DisplayNumber != "" ? DisplayNumber.Substring(0,1) : null;
int Snum = GetSectionNum(); int Snum = GetSectionNum();
if (Snum == -1) if (Snum == -1)
{
if (ch[0] == ' ') ch = DisplayNumber != null && DisplayNumber.TrimStart() != "" ? DisplayNumber.TrimStart().Substring(0, 1) : null;
retStr = ch + "."; retStr = ch + ".";
else { }
else
{
string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber; string tmp = DisplayNumber.IndexOf(".") > -1 ? DisplayNumber.Substring(0, DisplayNumber.IndexOf(".")) : DisplayNumber;
if (underline) if (underline)
retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 "; retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 ";
@ -4919,7 +4932,7 @@ namespace VEPROMS.CSLA.Library
// if there is a number after the '.', return it as a number. For example if it is 001, return a 1: // if there is a number after the '.', return it as a number. For example if it is 001, return a 1:
string tmpstr = indx+1<DisplayNumber.Length?DisplayNumber.Substring(indx+1):null; string tmpstr = indx+1<DisplayNumber.Length?DisplayNumber.Substring(indx+1):null;
// if the section's tab is a letter, we don't want a 0 on the section.... for example A.0. // if the section's tab is a letter, we don't want a 0 on the section.... for example A.0.
if (IsSection && tmpstr == null && System.Char.IsLetter(DisplayNumber, 0)) return -1; if (IsSection && tmpstr == null && System.Char.IsLetter(DisplayNumber.TrimStart(), 0)) return -1;
if (tmpstr != null && tmpstr.IndexOf('-') >= 0) return -1; if (tmpstr != null && tmpstr.IndexOf('-') >= 0) return -1;
if (tmpstr == null) return 0; if (tmpstr == null) return 0;
Int32 x; Int32 x;