From 4f987dc7fc2f234acda8dd7992c7864d68245700 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 13 May 2022 12:40:41 +0000 Subject: [PATCH] =?UTF-8?q?B2022-053=20Fix=20to=20finding=20and=20resolvin?= =?UTF-8?q?g=20all=20of=20the=20RO=20tokens=20in=20Word=20sections.=20=20W?= =?UTF-8?q?ord=20is=20having=20a=20problem=20finding=20RO=20tokens=20when?= =?UTF-8?q?=20text=20in=20the=20same=20Word=20Table=20row=20contains=20a?= =?UTF-8?q?=20=E2=80=9C<=E2=80=9D=20used=20as=20the=20less=20than=20symbol?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/DocumentExt.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 2231f2b9..6ce347a0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -1761,7 +1761,25 @@ namespace VEPROMS.CSLA.Library find.MatchWildcards = true; find.MatchSoundsLike = false; find.MatchAllWordForms = false; - executeResult = find.Execute(); + // B2022-053 in a Barakah word attachment (ST procedure set procedure DG-5204) the RO tokens are not resolved after a certain + // point in a table. + // Turns out this happens when a table cell had text that begins with a "<" and it does not end with a ">" and there is no + // space or other word following that text in the table cell. For example, there was a table cell who's text + // was "<90" cause the Word Find command to return an entire table row which cause PROMS to stop processing + // the rest of the Word attachment section. + bool tryagain = false; + do + { + tryagain = false; + executeResult = find.Execute(); + // B2022-053 if the found text does not begin with a "<" and end with a ">", then + // move past that text and try the Word Find function again. + if (executeResult && !sel.Text.StartsWith("<") && !sel.Text.EndsWith(">")) + { + sel.MoveStart(LBWdUnits.wdCharacter, sel.Text.Length-1); + tryagain = true; + } + } while (tryagain); if (!executeResult) return null; // B2019-123 Word 2019 returns true when find string was not found