Added a check for a Figure substep type without an RO reference
This commit is contained in:
parent
5942d14798
commit
cd523e12a6
@ -3281,28 +3281,31 @@ namespace Volian.Print.Library
|
|||||||
string linkInfoText = itemInfo.MyContent.Text.Replace(@"\v ", "");
|
string linkInfoText = itemInfo.MyContent.Text.Replace(@"\v ", "");
|
||||||
Match m = Regex.Match(linkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)");
|
Match m = Regex.Match(linkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)");
|
||||||
string val = null;
|
string val = null;
|
||||||
if (m.Groups.Count < 4)
|
if (m.Length > 0) // if m.lengh is zero, then no match was found - no RO was entered in the figure substep
|
||||||
{
|
{
|
||||||
//erMsg = "RO was not found during data migration.";
|
if (m.Groups.Count < 4)
|
||||||
// added newlines in the RO number (shown in figure substep type with figure RO)
|
|
||||||
// if we are here, then there is no RO link information, use this number to find the RO image to print
|
|
||||||
val = string.Format("{0}\n{1}\n{2}\n{3}",
|
|
||||||
linkInfoText.Substring(0, linkInfoText.Length - 16),
|
|
||||||
linkInfoText.Substring(linkInfoText.Length - 16, 8),
|
|
||||||
linkInfoText.Substring(linkInfoText.Length - 8, 4),
|
|
||||||
linkInfoText.Substring(linkInfoText.Length - 4, 4));
|
|
||||||
val = val.Replace(@"\u8209?", "-");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string[] subs = m.Groups[3].Value.Split(" ".ToCharArray());
|
|
||||||
val = lookup.GetRoValue(subs[1]);
|
|
||||||
if (val == null || val == "?") val = lookup.GetRoValue(subs[1].Substring(0, 12));
|
|
||||||
if (val == "?")
|
|
||||||
{
|
{
|
||||||
erMsg = string.Format("Referenced Object does not exist.");
|
//erMsg = "RO was not found during data migration.";
|
||||||
_MyLog.WarnFormat("\r\nMissing Referenced Object {0} in {1}", subs[1], itemInfo.ShortPath);
|
// added newlines in the RO number (shown in figure substep type with figure RO)
|
||||||
yoff += 2 * SixLinesPerInch;
|
// if we are here, then there is no RO link information, use this number to find the RO image to print
|
||||||
|
val = string.Format("{0}\n{1}\n{2}\n{3}",
|
||||||
|
linkInfoText.Substring(0, linkInfoText.Length - 16),
|
||||||
|
linkInfoText.Substring(linkInfoText.Length - 16, 8),
|
||||||
|
linkInfoText.Substring(linkInfoText.Length - 8, 4),
|
||||||
|
linkInfoText.Substring(linkInfoText.Length - 4, 4));
|
||||||
|
val = val.Replace(@"\u8209?", "-");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string[] subs = m.Groups[3].Value.Split(" ".ToCharArray());
|
||||||
|
val = lookup.GetRoValue(subs[1]);
|
||||||
|
if (val == null || val == "?") val = lookup.GetRoValue(subs[1].Substring(0, 12));
|
||||||
|
if (val == "?")
|
||||||
|
{
|
||||||
|
erMsg = string.Format("Referenced Object does not exist.");
|
||||||
|
_MyLog.WarnFormat("\r\nMissing Referenced Object {0} in {1}", subs[1], itemInfo.ShortPath);
|
||||||
|
yoff += 2 * SixLinesPerInch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GC.Collect(); // memory garbage collection (Regex memory bug)
|
GC.Collect(); // memory garbage collection (Regex memory bug)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user