From 4b5b7b82001603a98a909a28d2aea9cf308a81ff Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 9 Oct 2012 00:00:20 +0000 Subject: [PATCH] Added code to remove handled tokens DraftPage, ReferencePage, MasterPage, SamplePage, ProcTitle, ProcTitle2 --- PROMS/Volian.Print.Library/VlnSvgPageHelper.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 14cc9a46..e0438569 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -700,15 +700,19 @@ namespace Volian.Print.Library break; case "{DRAFTPAGE}": if (!AllowedWatermarks.Contains("Draft")) AllowedWatermarks.Add("Draft"); + plstr = plstr.Replace(token, "");// Remove token since it is handled now break; case "{REFERENCEPAGE}": if (!AllowedWatermarks.Contains("Reference")) AllowedWatermarks.Add("Reference"); + plstr = plstr.Replace(token, "");// Remove token since it is handled now break; case "{MASTERPAGE}": if (!AllowedWatermarks.Contains("Master")) AllowedWatermarks.Add("Master"); + plstr = plstr.Replace(token, "");// Remove token since it is handled now break; case "{SAMPLEPAGE}": if (!AllowedWatermarks.Contains("Sample")) AllowedWatermarks.Add("Sample"); + plstr = plstr.Replace(token, "");// Remove token since it is handled now break; case "{INFORMATIONPAGE}": if (!AllowedWatermarks.Contains("Information Only")) AllowedWatermarks.Add("Information Only"); @@ -854,10 +858,10 @@ namespace Volian.Print.Library private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr) //private void SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match) { - if (match == "{PROCTITLE2}") return plstr; + if (match == "{PROCTITLE2}") return plstr.Replace(match,""); if (len == null || len == 0 || ItemInfo.StripRtfFormatting(title).Length < len) { - if (match == "{PROCTITLE2}") return plstr; // this would have been done in proctitle1 + if (match == "{PROCTITLE2}") return plstr.Replace(match, ""); // this would have been done in proctitle1 plstr = plstr.Replace(match, title); //svgGroup.Add(PageItemToSvgText(pageItem, title)); return plstr; @@ -869,13 +873,17 @@ namespace Volian.Print.Library // there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.) float yOffset = (pageItem.Token.Contains("1") && titleLines.Count <= 2) ? 0 : (-6 * (titleLines.Count - 1)); int cnt = 0; + foreach (string line in titleLines) { cnt++; if (cnt == 1 && yOffset == 0) // adj == 0 means we use PROCTITLE1/PROCTITLE2 pagelist tokens with 2 or less lines plstr = plstr.Replace(match, line); else + { svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset)); + plstr = plstr.Replace(match, ""); + } yOffset += 12; } return plstr;