From be96be3ecc7cceda651994a7f0a3b84cb9f83fa1 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 9 Oct 2014 13:32:39 +0000 Subject: [PATCH] Was going through left tab adjust logic even though the adjustment for the current level was zero. This caused an extra space to be added in between the tab and the step text which shortened the step text width and cause different word wrapping. This happens only when the UseMetaSection flag is turned --- PROMS/Volian.Print.Library/vlnParagraph.cs | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 035805b0..a28a5cf7 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -3852,16 +3852,29 @@ namespace Volian.Print.Library { int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); float tableftadj = GetLeftJustify(formatInfo, indxLevels); - // the order of this is important. First adjust the tab's xoffset for the width of - // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable - // if it existed for this level. - myTab.XOffset += tabWidth; - if (tableftadj != 0 && myTab.Width < tableftadj) - tabWidth = myTab.Width = tableftadj; - XOffset += tabWidth; - myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); - Width = MyParent.Width - myTab.Width; + if (tableftadj != 0) + { + // the order of this is important. First adjust the tab's xoffset for the width of + // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable + // if it existed for this level. + myTab.XOffset += tabWidth; + if (tableftadj != 0 && myTab.Width < tableftadj) + tabWidth = myTab.Width = tableftadj; + XOffset += tabWidth; + myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); + Width = MyParent.Width - myTab.Width; + } + else // if no left justify, right align the tab + { + XOffset += tabWidth - (myTab == null ? 0 : myTab.TabAlign); + if (myTab != null) + { + myTab.XOffset += tabWidth - myTab.TabAlign; + if (myTab.MyMacro != null && myTab.MyMacro.XOffset != 0) myTab.MyMacro.XOffset += tabWidth - myTab.TabAlign; + } + } } + //else if ((itemInfo.FormatStepData.ColOverride ?? 0) > 0) //{ // XOffset = (float)itemInfo.FormatStepData.ColOverride;