This commit is contained in:
Kathy Ruffing 2011-01-19 16:26:22 +00:00
parent e45eb154ea
commit d58cbfb089

View File

@ -13,6 +13,7 @@ namespace Volian.Print.Library
{ {
public class VlnSvgPageHelper:SvgPageHelper public class VlnSvgPageHelper:SvgPageHelper
{ {
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// This handles Page Breaks within a Step // This handles Page Breaks within a Step
private List<vlnParagraph> _ParaBreaks = new List<vlnParagraph>(); private List<vlnParagraph> _ParaBreaks = new List<vlnParagraph>();
public List<vlnParagraph> ParaBreaks public List<vlnParagraph> ParaBreaks
@ -350,6 +351,7 @@ namespace Volian.Print.Library
private static Regex regexFindToken = new Regex("{[^{}]*}"); private static Regex regexFindToken = new Regex("{[^{}]*}");
private string mySvg_ProcessText(object sender, SvgProcessTextArgs args) private string mySvg_ProcessText(object sender, SvgProcessTextArgs args)
{ {
if (args.MyText == null) return string.Empty; // KBR needed for WCN crash
if (!args.MyText.Contains("{")) if (!args.MyText.Contains("{"))
return args.MyText; return args.MyText;
/* /*
@ -408,6 +410,17 @@ namespace Volian.Print.Library
private string BuildMyText(VEPROMS.CSLA.Library.FormatInfo activeFormat) private string BuildMyText(VEPROMS.CSLA.Library.FormatInfo activeFormat)
{ {
string sGenMac = activeFormat.GenMac; string sGenMac = activeFormat.GenMac;
if (sGenMac == null || sGenMac == "")
{
// If subformat and does not have its own genmac, find an inherited genmac.
FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID);
while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac==""))
{
sGenMac = tmpf.GenMac;
tmpf = FormatInfo.Get(tmpf.ParentID);
}
if (sGenMac == null || sGenMac == "") return "";
}
if (!sGenMac.Contains("xmlns")) if (!sGenMac.Contains("xmlns"))
sGenMac = sGenMac.Replace("<svg ", "<svg xmlns='http://www.w3.org/2000/svg' "); sGenMac = sGenMac.Replace("<svg ", "<svg xmlns='http://www.w3.org/2000/svg' ");
XmlDocument xDocGenMac = new XmlDocument(); XmlDocument xDocGenMac = new XmlDocument();
@ -479,7 +492,8 @@ namespace Volian.Print.Library
svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayNumber)); svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayNumber));
break; break;
default: default:
Console.WriteLine("Token not processed {0}", token); svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token));
//_MyLog.InfoFormat("Token not processed {0}", token);
break; break;
} }
} }
@ -598,7 +612,7 @@ namespace Volian.Print.Library
if (!_MissingTokens.Contains(match.Value)) if (!_MissingTokens.Contains(match.Value))
{ {
_MissingTokens.Add(match.Value); _MissingTokens.Add(match.Value);
Console.WriteLine("\t\t\t\tcase \"{0}\": // Unhandled Token\r\n\t\t\t\t\treturn \"\";", match.Value); _MyLog.InfoFormat("Unhandled token {0}", match.Value);
} }
return ""; return "";
} }