Added code to remove handled tokens

DraftPage, ReferencePage, MasterPage, SamplePage, ProcTitle, ProcTitle2
This commit is contained in:
Rich 2012-10-09 00:00:20 +00:00
parent ca1c51f5df
commit 4b5b7b8200

View File

@ -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;