Add error support if incorrect phone.lst format (writes to error log)
This commit is contained in:
		@@ -224,8 +224,11 @@ namespace Volian.Print.Library
 | 
			
		||||
			plist = plist.Replace("\r", "");
 | 
			
		||||
			string[] lines = plist.Split("\n".ToCharArray());
 | 
			
		||||
			DocStyle docstyle = MySection.MyDocStyle;
 | 
			
		||||
			foreach (string cline in lines)
 | 
			
		||||
			try
 | 
			
		||||
			{
 | 
			
		||||
				foreach (string clinex in lines)
 | 
			
		||||
				{
 | 
			
		||||
					string cline = clinex.TrimEnd();
 | 
			
		||||
					if (cline != "")
 | 
			
		||||
					{
 | 
			
		||||
						// xoff handles the columns.  The separator between phone items is a double space.  A phone
 | 
			
		||||
@@ -235,6 +238,8 @@ namespace Volian.Print.Library
 | 
			
		||||
						int endLineindx = cline.IndexOf("  ");
 | 
			
		||||
						bool endOfLine = false;
 | 
			
		||||
						while (!endOfLine)
 | 
			
		||||
						{
 | 
			
		||||
							if (endLineindx - stLineindx > 0)
 | 
			
		||||
							{
 | 
			
		||||
								string phone = cline.Substring(stLineindx, endLineindx - stLineindx);
 | 
			
		||||
								float tmp = 0;
 | 
			
		||||
@@ -251,9 +256,17 @@ namespace Volian.Print.Library
 | 
			
		||||
									if (endLineindx == -1) endLineindx = cline.Length;
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
							else
 | 
			
		||||
								endOfLine = true;
 | 
			
		||||
						}
 | 
			
		||||
						lyoff = lyoff - vlnPrintObject.SixLinesPerInch;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			catch (Exception ex)
 | 
			
		||||
			{
 | 
			
		||||
				_MyLog.Error("Error processing phone list.", ex);
 | 
			
		||||
			}
 | 
			
		||||
			if (PageListLayer != null) pdfContentByte.EndLayer();
 | 
			
		||||
			pdfContentByte.RestoreState();
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user