B2022-088: Find Doc Ro button not working in Word Sections

B2022-089: Updating RO Crashes
This commit is contained in:
Jake
2022-08-08 10:04:21 +00:00
parent b6d69fbd4c
commit f8269a7ac6
13 changed files with 271 additions and 125 deletions

View File

@@ -783,7 +783,8 @@ namespace VEPROMS.CSLA.Library
// 5) If a specific RoChild return value does not exist (maybe it was removed in the ROEditor / latest RO.FST file), then just return
// the first RoChild return value in the "children" collection (0041) instead
private static Dictionary<string, ROFSTLookup.rochild> _roPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
// B2022-088: Find Doc Ro button not working in Word Sections
public static Dictionary<string, ROFSTLookup.rochild> RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
#endregion
@@ -1154,9 +1155,6 @@ namespace VEPROMS.CSLA.Library
int lastStart = sel == null ? 0 : sel.Start;
// Cache RO Values while printing for performance increase
_roPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
while (sel != null)
{
if (!string.IsNullOrEmpty(sel.Text))
@@ -1335,10 +1333,6 @@ namespace VEPROMS.CSLA.Library
}
}
// Disable/Clear RO Cache When done looking up RO Values during printing
_roPrintCache.Clear();
_roPrintCache = null;
if (statusChange != null) statusChange(VolianStatusType.Update, 0, "Creating PDF");
sel = MyApp.Selection;
sel.WholeStory();
@@ -1398,7 +1392,7 @@ namespace VEPROMS.CSLA.Library
string accPageKey = ROFSTLookup.FormatAccPageKey(selText, spPrefix, igPrefix, ref accPageBase, ref accPageExt, true);
// Check if the Rochild is in the PrintCache (use base accPageID without specific extension)
if (!_roPrintCache.ContainsKey(accPageBase))
if (!RoPrintCache.ContainsKey(accPageBase))
{
// Lookup RoChild Info from database
roc = lookup.GetROChildByAccPageID(accPageBase, spPrefix, igPrefix);
@@ -1408,11 +1402,11 @@ namespace VEPROMS.CSLA.Library
return ROFSTLookup.GetEmptyRoChild();
// If Valid Rochild, then add Rochild to Print Cache
_roPrintCache.Add(accPageBase, roc);
RoPrintCache.Add(accPageBase, roc);
}
else // Get Base Rochild from Print Cache
{
roc = (ROFSTLookup.rochild)_roPrintCache[accPageBase];
roc = (ROFSTLookup.rochild)RoPrintCache[accPageBase];
}
// Check if RO is a "Unit Information" value (Ex: <U-ID>, etc..)