handle junk comments
This commit is contained in:
parent
06319605f2
commit
73830ed0e1
@ -151,61 +151,66 @@ namespace DataLoader
|
|||||||
bool recdirty = false;
|
bool recdirty = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (tok >= 0 && tok != Textm.Length)
|
|
||||||
{
|
|
||||||
int nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
|
||||||
|
|
||||||
char chr = Textm[tok];
|
if (tok >= 0 && tok != Textm.Length)
|
||||||
|
{
|
||||||
|
string tkstring = Textm.Substring(tok);
|
||||||
|
int nxttok = 0;
|
||||||
|
|
||||||
|
char chr = tkstring[nxttok];
|
||||||
int typ = 0;
|
int typ = 0;
|
||||||
if (chr == '\x1')
|
if (chr == '\x5') // Continuous Action Summary
|
||||||
{
|
|
||||||
// add the comment to annotation table. Set type to comment.
|
|
||||||
if (nxttok < 0) nxttok = Textm.Length;
|
|
||||||
Annotation annot = Annotation.MakeAnnotation(item, CommentType, null, Textm.Substring(tok + 1, nxttok - tok - 1), null, dts, userid);
|
|
||||||
}
|
|
||||||
else if (chr == '\x2')
|
|
||||||
typ = STP_MULT_CHGID;
|
|
||||||
else if (chr == '\x3')
|
|
||||||
{
|
|
||||||
typ = STP_LNK_SEQ;
|
|
||||||
// check for a double \3 - override tab.
|
|
||||||
if (tok + 1 < Textm.Length)
|
|
||||||
{
|
|
||||||
char nxttokchr = Textm[tok + 1];
|
|
||||||
if (nxttokchr == '\x3')
|
|
||||||
{
|
|
||||||
typ = STP_OVR_TAB;
|
|
||||||
tok++; // this was a double \3, get past 1st one.
|
|
||||||
nxttok = Textm.IndexOfAny(chrarr, tok + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (chr == '\x5')
|
|
||||||
{
|
{
|
||||||
recdirty = true;
|
recdirty = true;
|
||||||
if (ci == null) ci = new ConfigInfo(null);
|
if (ci == null) ci = new ConfigInfo(null);
|
||||||
ci.AddItem("Step", "ContActSum", "True");
|
ci.AddItem("Step", "ContActSum", "True");
|
||||||
if (nxttok < 0) nxttok = Textm.Length;
|
tkstring = tkstring.Substring(0,nxttok);
|
||||||
|
nxttok = tkstring.IndexOfAny("\x3\x2\x1".ToCharArray());
|
||||||
|
if (nxttok > -1)
|
||||||
|
chr = tkstring[nxttok];
|
||||||
}
|
}
|
||||||
|
if (chr == '\x3') //Linked Sequence or Step Override Tab (two '\x3')
|
||||||
// if not comment or ContActSum (xml) make a steptext element
|
|
||||||
if (typ == STP_MULT_CHGID || typ == STP_LNK_SEQ || typ == STP_OVR_TAB)
|
|
||||||
{
|
{
|
||||||
if (nxttok < 0) nxttok = Textm.Length;
|
|
||||||
// if this is a sequence number - may need to convert hi-end chars
|
|
||||||
string strn = null;
|
string strn = null;
|
||||||
if (typ == STP_LNK_SEQ)
|
typ = STP_LNK_SEQ;
|
||||||
strn = TextConvert.ConvertSeq(Textm.Substring(tok + 1, nxttok - tok - 1));
|
if (((nxttok + 1) <= tkstring.Length) && tkstring[nxttok + 1] == '\x3')
|
||||||
|
{
|
||||||
|
typ = STP_OVR_TAB;
|
||||||
|
strn = tkstring.Substring(nxttok + 2);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
strn = Textm.Substring(tok + 1, nxttok - tok - 1);
|
strn = TextConvert.ConvertSeq(tkstring.Substring(nxttok + 1));
|
||||||
if (strn != null && strn != "")
|
if (strn != null && strn != "")
|
||||||
{
|
{
|
||||||
recdirty = true;
|
recdirty = true;
|
||||||
content.ContentDetails.Add(typ, strn);
|
content.ContentDetails.Add(typ, strn);
|
||||||
}
|
}
|
||||||
|
tkstring = tkstring.Substring(0,nxttok);
|
||||||
|
nxttok = tkstring.IndexOfAny("\x2\x1".ToCharArray());
|
||||||
|
if (nxttok > -1)
|
||||||
|
chr = tkstring[nxttok];
|
||||||
}
|
}
|
||||||
tok = nxttok;
|
if (chr == '\x2') // Multiple Change Ids
|
||||||
|
{
|
||||||
|
typ = STP_MULT_CHGID;
|
||||||
|
string strn = tkstring.Substring(nxttok+1);
|
||||||
|
if (strn != null && strn != "")
|
||||||
|
{
|
||||||
|
recdirty = true;
|
||||||
|
content.ContentDetails.Add(typ, strn);
|
||||||
}
|
}
|
||||||
|
tkstring = tkstring.Substring(0,nxttok);
|
||||||
|
nxttok = 0; // tkstring.IndexOf('\x1');
|
||||||
|
if ((tkstring != null) && (tkstring.Length > 0))
|
||||||
|
chr = tkstring[nxttok];
|
||||||
|
}
|
||||||
|
if (chr == '\x1') // Comment
|
||||||
|
{
|
||||||
|
// add the comment to annotation table. Set type to comment.
|
||||||
|
Annotation annot = Annotation.MakeAnnotation(item, CommentType, null, tkstring.Substring(nxttok + 1), null, dts, userid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// also see if a check-off needs added.
|
// also see if a check-off needs added.
|
||||||
if (Recid[0] != '0')
|
if (Recid[0] != '0')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user