Added logic to handle RO table (in word section) that uses underbars to draw the horizontal lines.

This commit is contained in:
John Jenko 2014-02-25 15:22:18 +00:00
parent 7ceacd813c
commit 238724db6c

View File

@ -1054,8 +1054,20 @@ namespace VEPROMS.CSLA.Library
string[] parts = val.Split("_".ToCharArray()); string[] parts = val.Split("_".ToCharArray());
foreach (string part in parts) foreach (string part in parts)
{ {
// if we have a row of underbar "_" chars then we will parts of empty strings.
// in this case, we want to output the underbar char and turn off underlining.
// Ex Commanche Peak RO table in ECA-1.1A Attachment 5
if (part.Equals(""))
{
if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone)
{
sel.Font.Underline = LBWdUnderline.wdUnderlineNone;
sel.TypeText("_");
}
sel.TypeText("_");
}
// If there is a carrage return, and underline is turned on, then turn off the underline // If there is a carrage return, and underline is turned on, then turn off the underline
if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone && part.Contains("\r")) else if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone && part.Contains("\r"))
{ {
int idx = part.IndexOf("\r"); int idx = part.IndexOf("\r");
string part1 = part.Substring(0, idx); string part1 = part.Substring(0, idx);
@ -1073,7 +1085,7 @@ namespace VEPROMS.CSLA.Library
// The problem was in Farley's FNP-1-ECP-3.1, Table 1 - 'ro': W.4T. // The problem was in Farley's FNP-1-ECP-3.1, Table 1 - 'ro': W.4T.
if (part.EndsWith(" ")) if (part.EndsWith(" "))
{ {
sel.TypeText(part.Substring(0,part.Length-1)); sel.TypeText(part.Substring(0, part.Length - 1));
sel.InsertSymbol(160); sel.InsertSymbol(160);
} }
else else
@ -1084,6 +1096,7 @@ namespace VEPROMS.CSLA.Library
else else
sel.Font.Underline = LBWdUnderline.wdUnderlineNone; sel.Font.Underline = LBWdUnderline.wdUnderlineNone;
} }
//}
} }
// We are done processing the text in val, if underline is on, turn it off // We are done processing the text in val, if underline is on, turn it off
if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone) if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone)