B2018-071 Don't crash when trying to convert an invalid word document to PDF

This commit is contained in:
Rich
2018-05-07 16:05:07 +00:00
parent 86c85bee58
commit a2e0b9aee3
2 changed files with 10 additions and 2 deletions

View File

@@ -1145,7 +1145,7 @@ namespace VEPROMS.CSLA.Library
if (MyContent.MyEntry != null && MyContent.MyEntry.MyDocument != null)
{
PdfInfo pi = PdfInfo.Get(this, false);
_MSWordPageCount = (float)pi.PageCount;
if(pi != null) _MSWordPageCount = (float)pi.PageCount;// B2018-071 Don't crash on invalid MS Word section
}
return _MSWordPageCount;
}
@@ -2091,6 +2091,7 @@ namespace VEPROMS.CSLA.Library
//if (si.SectionConfig.Section_ColumnMode != SectionConfig.SectionColumnMode.Default)
return (int)si.SectionConfig.Section_ColumnMode - 1;
}
//Console.WriteLine("PMode={0}, si.ColumnMode={1}, ColumnMode={2}", ActiveFormat.MyStepSectionLayoutData.PMode ,si.ColumnMode,(ActiveFormat.MyStepSectionLayoutData.PMode ?? 2) - 1);
}
return (ActiveFormat.MyStepSectionLayoutData.PMode ?? 2) - 1;
}
@@ -4273,7 +4274,7 @@ namespace VEPROMS.CSLA.Library
//wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}");
//wkstr = wkstr.Replace("{}", "");
//if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}");
//wkstr = wkstr.Replace("<EFBFBD>", @"{Box Step}");
//wkstr = wkstr.Replace("j", @"{Box Step}");
#endregion
// if this has an alternate tab, use it. These have been used in background documents.