B2016-222 fixed calculation of box height for notes and cautions at a section level

Added a check to prevent an index out of range error
This commit is contained in:
John Jenko 2016-10-04 19:13:11 +00:00
parent aa3be25330
commit 454697efdf
2 changed files with 4 additions and 3 deletions

View File

@ -3490,7 +3490,8 @@ namespace Volian.Print.Library
// In Checklist: I don't have children or if I have children the first child doesn't alignwithparent.
|| (!itemInfo.IsStepSection && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate
&& ((itemInfo.Steps == null || itemInfo.Steps.Count == 0)
|| !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)))
|| !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab))
||((MyItemInfo.IsNote || MyItemInfo.IsCaution) && MyItemInfo.MyParent.IsSection)) // B2016-222 check if is a caution or note and parent is a section
{
bool doprint = !(MyPageHelper.DidHLSText && MyItemInfo.ItemID == MyPageHelper.HasHLSTextId);
if (MyItemInfo.IsSection)

View File

@ -29,7 +29,7 @@ namespace Volian.Print.Library
{
if ("0123456789".Contains(Text[(int)_TabAlign].ToString()))
{
while ("0123456789".Contains(Text[(int)_TabAlign].ToString()))
while (_TabAlign < Text.Length && "0123456789".Contains(Text[(int)_TabAlign].ToString()))
_TabAlign++;
_TabAlign--;
}