B2018-046 - Fix code so that duplicate ROs will not cause problems when they are converted to text during import.
This commit is contained in:
parent
f9ef66880b
commit
c10da98204
@ -3270,6 +3270,11 @@ namespace VEPROMS
|
|||||||
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousageid);
|
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousageid);
|
||||||
int lastIndex = 0;
|
int lastIndex = 0;
|
||||||
string newText = content.Text;
|
string newText = content.Text;
|
||||||
|
// B2018-046 This loop repeats code to convert duplicate ROs in text to text
|
||||||
|
int originalCount = 0;
|
||||||
|
while (ms.Count > 0 && (originalCount == 0 || ms.Count < originalCount))
|
||||||
|
{
|
||||||
|
originalCount = ms.Count;
|
||||||
foreach (Match mm in ms)
|
foreach (Match mm in ms)
|
||||||
{
|
{
|
||||||
int offset = mm.Index;
|
int offset = mm.Index;
|
||||||
@ -3303,9 +3308,12 @@ namespace VEPROMS
|
|||||||
content.Text = part1 + part2 + part3;
|
content.Text = part1 + part2 + part3;
|
||||||
ROToTextAnnotation(content, part2); // B2016-225 (follow through) add annotation when RO is converted to text
|
ROToTextAnnotation(content, part2); // B2016-225 (follow through) add annotation when RO is converted to text
|
||||||
_DidProcessROs = true; // B2017-076 flag that ROs where processed
|
_DidProcessROs = true; // B2017-076 flag that ROs where processed
|
||||||
|
break; // B2018-046 If it finds a match try again
|
||||||
}
|
}
|
||||||
lastIndex = mm.Index + mm.Length;
|
lastIndex = mm.Index + mm.Length;
|
||||||
}
|
}
|
||||||
|
ms = Regex.Matches(content.Text, findLink); // B2018-046 Look for match again
|
||||||
|
}
|
||||||
}
|
}
|
||||||
content.Save();
|
content.Save();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user