From 380dd2ceacf28cfa69bf38e965971f76c8a50608 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 26 Mar 2021 19:23:43 +0000 Subject: [PATCH] B2021-034 Sigle cell table with just a jpg in the cell caused PROMS to crash. Wolf Creek data: Maintenance; Mechanical; MPM; MPM KJ-004: 7.1.4 Table --- PROMS/Volian.Print.Library/Grid2Pdf.cs | 70 ++++++++++++++------------ 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/Volian.Print.Library/Grid2Pdf.cs index 13762eab..f154cb2e 100644 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ b/PROMS/Volian.Print.Library/Grid2Pdf.cs @@ -1,4 +1,5 @@ using System; +using System; using System.Collections.Generic; using System.Text; using C1.Win.C1FlexGrid; @@ -556,39 +557,39 @@ public string Path // B2017-105 if a symbol character was set to a bigger font size, then the positioning of the larger symbol character was printing too high on the line // found with Wolf Creek use of the empty box symbol - private float BiggestFontSize(Paragraph myPara) - { - float fontSize = 12; - foreach (Chunk ck in myPara.Chunks) - { - fontSize = Math.Max(fontSize, ck.Font.Size); - if (ck.Font.Size > 12) - { - ck.SetTextRise(-2f); - //_MyLog.WarnFormat("set text rise"); - } - } - return fontSize; - } + //private float BiggestFontSize(Paragraph myPara) + //{ + // float fontSize = 12; + // foreach (Chunk ck in myPara.Chunks) + // { + // fontSize = Math.Max(fontSize, ck.Font.Size); + // if (ck.Font.Size > 12) + // { + // ck.SetTextRise(-2f); + // //_MyLog.WarnFormat("set text rise"); + // } + // } + // return fontSize; + //} // B2017-233, B2017-234 needed to get the smallest font size to help decide if a vertical adjustment of the text is needed in a table cell - private float SmallestFontSize(Paragraph myPara) - { - float fontSize = 30; - foreach (Chunk ck in myPara.Chunks) - { - fontSize = Math.Min(fontSize, ck.Font.Size); - } - return fontSize; - } - private void ShowChunks(System.Collections.ArrayList chunks) // RHM20150429 - Table Scrunch - { - StringBuilder sb = new StringBuilder(); - foreach (Chunk chk in chunks) - { - sb.Append(BuildChunks(chk.Content)); - } - //if (ShowDetails) Console.WriteLine("Chunks = '{0}'", sb.ToString()); - } + //private float SmallestFontSize(Paragraph myPara) + //{ + // float fontSize = 30; + // foreach (Chunk ck in myPara.Chunks) + // { + // fontSize = Math.Min(fontSize, ck.Font.Size); + // } + // return fontSize; + //} + //private void ShowChunks(System.Collections.ArrayList chunks) // RHM20150429 - Table Scrunch + //{ + // StringBuilder sb = new StringBuilder(); + // foreach (Chunk chk in chunks) + // { + // sb.Append(BuildChunks(chk.Content)); + // } + // //if (ShowDetails) Console.WriteLine("Chunks = '{0}'", sb.ToString()); + //} private string BuildChunks(string str) { StringBuilder sb = new StringBuilder(); @@ -1026,8 +1027,11 @@ public string Path // - only need for the first line of table cell text private float GetLargestFontSize(vlnCell vc) { + // B2021-034 WCN Maintenance; Mechanical; MPM; MPM KJ-004: 7.1.4 Table + // has single cell table with just a jpeg image + // need to specify MyPara.Chunks in stead of foreach Chunk in MyPara float largestFontSize = 12; - foreach (Chunk ck in vc.MyPara) + foreach (Chunk ck in vc.MyPara.Chunks) { if (ck.Content.EndsWith("\n")) break; // end of first line