diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 1ce50415..2363e5ad 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -727,6 +727,8 @@ namespace VEPROMS.CSLA.Library PdfInfo myPdf = PdfInfo.Get(sect,DocReplace!=null); return true; } + // B2018-071 Save list of DocIDs for invalid document so that error log messages are not repeated + private static List _MissingDocs = new List(); public static bool SetDocPdf(DocumentInfo docInfo, ItemInfo sect) { string pdfTmp = null; @@ -737,6 +739,11 @@ namespace VEPROMS.CSLA.Library } catch (Exception ex) { + if (!_MissingDocs.Contains(docInfo.DocID))// B2018-071 Only add the message once to the error log + { + _MyLog.WarnFormat("Error trying to create PDF DocID = {0}", docInfo.DocID);// 2018-071 MS Word section could not be converted to PDF + _MissingDocs.Add(docInfo.DocID); + } return false; } if (pdfTmp == null) return false; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 957f18af..523fa898 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -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("ê", @"{Box Step}"); + //wkstr = wkstr.Replace("j", @"{Box Step}"); #endregion // if this has an alternate tab, use it. These have been used in background documents.