From 7427c75caa97dd18482bd0843e5f1a93cb20257a Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 29 May 2013 14:56:40 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/DisplayText.cs | 28 +++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index 6c3e75b1..150961ec 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -138,15 +138,25 @@ namespace Volian.Controls.Library bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep) { - // Add 2 spaces before and 1 after if there is prefix so that wrapping in RTB accounts for vertical - // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other - // combinations that did not work. - if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par ": - @"\par " + text + @"\par "; - if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) : - @"\par\par\par "); + if (_MyItemInfo.FormatStepData.UseSmartTemplate) + { + // Add 2 spaces before and 1 after if there is prefix so that wrapping in RTB accounts for vertical + // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other + // combinations that did not work. + if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") + text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par " : + @"\par " + text + @"\par "; + if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") + text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) : + @"\par\par\par "); + } + else + { + if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") + text = _MyItemInfo.FormatStepData.Prefix + text; + if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") + text = text + _MyItemInfo.FormatStepData.Suffix; + } } text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted); StartText = text;