C2022-001 fixed index out of range when updating RO values

C2022-001 pass in Otherxxx parent/child information to get correct child RO value
C2022-001 new logic to get parent (default) RO value.
This commit is contained in:
2022-01-21 14:35:17 +00:00
parent 8a2b19521d
commit b10d66fc53
3 changed files with 14 additions and 3 deletions

View File

@@ -331,7 +331,8 @@ namespace Volian.Controls.Library
int EndCVidx = rntval.IndexOf(" /APL>", startCVIdx);
string aplicValues = rntval.Substring(startCVIdx, EndCVidx + 6 - startCVIdx);
int endDefIdx = rntval.IndexOf(",", startCVIdx);
string defValue = rntval.Substring(startCVIdx + 16, endDefIdx - (startCVIdx + 16));
// C2022-001 - handle if there is no child value in the RO FSt
string defValue = rntval.Substring(startCVIdx + 16, ((endDefIdx > 0) ? endDefIdx : EndCVidx) - (startCVIdx + 16));
rntval = rntval.Replace(aplicValues, defValue);
}
return rntval;