From 86277422a5338350bb3249f0854bc9b62028311d Mon Sep 17 00:00:00 2001 From: John Date: Tue, 12 Jun 2012 15:22:25 +0000 Subject: [PATCH] Added WrapSameAsEdit check to the RemoveLastCharacter() logic for debug/16-bit compare printing. Also added a check in RemoveLastCharacter() so that if there was only one character in the line of text, to NOT remove it (was removing hard-return characters) --- PROMS/Volian.Print.Library/vlnPrintObject.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs b/PROMS/Volian.Print.Library/vlnPrintObject.cs index 7b73f385..612b03cd 100644 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs +++ b/PROMS/Volian.Print.Library/vlnPrintObject.cs @@ -121,7 +121,8 @@ namespace Volian.Print.Library vlnParagraph myParagraph = this as vlnParagraph; if (myParagraph != null) { - if (myParagraph.MyItemInfo.FormatStepData != null && myParagraph.MyItemInfo.FormatStepData.Font.Family == "Prestige Elite Tall") + //if (myParagraph.MyItemInfo.FormatStepData != null && myParagraph.MyItemInfo.FormatStepData.Font.Family == "Prestige Elite Tall") + if (!myParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WrapSameAsEdit) { Chunk chk = RemoveLastCharacter(iParagraph); float heightAllButOne = GetHeight(cb, iParagraph, width, throwException); @@ -146,11 +147,14 @@ namespace Volian.Print.Library object obj = iParagraph[iParagraph.Count-1]; Chunk chk = obj as Chunk; if (chk == null) - Console.WriteLine("Here"); - iParagraph.RemoveAt(iParagraph.Count - 1); + return null; string s = chk.Content; - s = s.Substring(0,s.Length - 1); - iParagraph.Add(new Chunk(s,chk.Font)); + if (s.Length > 1) // don't remove last character if it's the only one + { + iParagraph.RemoveAt(iParagraph.Count - 1); + s = s.Substring(0, s.Length - 1); + iParagraph.Add(new Chunk(s, chk.Font)); + } return chk; } private static float GetHeight(PdfContentByte cb, Paragraph iParagraph, float width, bool throwException)