Fix access of multi-return RO values if group definition is not in order in RO Editor
This commit is contained in:
parent
fb55534ed8
commit
e3c0de2793
@ -84,6 +84,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Local Data
|
#region Local Data
|
||||||
private string _ROValue = "";
|
private string _ROValue = "";
|
||||||
private List<string> lstRoValues;
|
private List<string> lstRoValues;
|
||||||
|
private List<string> multiRoValues;
|
||||||
private Dictionary<string, string> DictROVar = new Dictionary<string, string>();
|
private Dictionary<string, string> DictROVar = new Dictionary<string, string>();
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@ -691,8 +692,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
myGrp.children = new rochild[lstROVals.Count];
|
myGrp.children = new rochild[lstROVals.Count];
|
||||||
for (int i = 0; i < lstROVals.Count; i++)
|
for (int i = 0; i < lstROVals.Count; i++)
|
||||||
{
|
{
|
||||||
|
string tsts = Convert.ToInt32(multiRoValues[i][0]).ToString("X4");
|
||||||
myGrp.children[i].value = lstROVals[i];
|
myGrp.children[i].value = lstROVals[i];
|
||||||
myGrp.children[i].roid = TableID.ToString("X4") + myGrp.ID.ToString("X8") + (0x41+i).ToString("X4");
|
myGrp.children[i].roid = TableID.ToString("X4") + myGrp.ID.ToString("X8") + tsts;
|
||||||
myGrp.children[i].type = -1; // Multiple return value inherit type from parent
|
myGrp.children[i].type = -1; // Multiple return value inherit type from parent
|
||||||
myGrp.children[i].title = lstROVals[i];
|
myGrp.children[i].title = lstROVals[i];
|
||||||
}
|
}
|
||||||
@ -763,9 +765,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public List<string> GetROReturnValue(string roval)
|
public List<string> GetROReturnValue(string roval)
|
||||||
{
|
{
|
||||||
lstRoValues = new List<string>();
|
lstRoValues = new List<string>();
|
||||||
|
multiRoValues = new List<string>();
|
||||||
DictROVar = new Dictionary<string, string>(); // set up a dictionary of RO defined Variables
|
DictROVar = new Dictionary<string, string>(); // set up a dictionary of RO defined Variables
|
||||||
string tmp = ProcessRO(_DocVersionInfo==null?roval:_DocVersionInfo.ProcessDocVersionSpecificInfo(roval), false);
|
string tmp = ProcessRO(_DocVersionInfo==null?roval:_DocVersionInfo.ProcessDocVersionSpecificInfo(roval), false);
|
||||||
if (lstRoValues.Count == 0) // was not a multiple return value
|
if (tmp != null && lstRoValues.Count == 0) // was not a multiple return value
|
||||||
lstRoValues.Add(tmp);
|
lstRoValues.Add(tmp);
|
||||||
return lstRoValues;
|
return lstRoValues;
|
||||||
}
|
}
|
||||||
@ -799,6 +802,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
cnt = ptr; //(int)(ptr - str);
|
cnt = ptr; //(int)(ptr - str);
|
||||||
bool nfnd = false;
|
bool nfnd = false;
|
||||||
string pbstr = ProcessBrace(str.Substring(1, cnt - 2), cnt - 2, ref nfnd, multiRtnVal);
|
string pbstr = ProcessBrace(str.Substring(1, cnt - 2), cnt - 2, ref nfnd, multiRtnVal);
|
||||||
|
if (pbstr == null) return null;
|
||||||
if (nfnd)
|
if (nfnd)
|
||||||
rtnstr += str.Substring(0, cnt);
|
rtnstr += str.Substring(0, cnt);
|
||||||
// add(new seText(str, cnt));
|
// add(new seText(str, cnt));
|
||||||
@ -916,7 +920,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// 'l' is the lenght up to the matching brace of the variable definition
|
// 'l' is the lenght up to the matching brace of the variable definition
|
||||||
string tmpval = ProcessRO(str.Substring(nxt + 1, l - nxt - 1), multiRtnVal);
|
string tmpval = ProcessRO(str.Substring(nxt + 1, l - nxt - 1), multiRtnVal);
|
||||||
if (tmpval.Equals(string.Empty)) tmpval = " "; // nothing assinged to variable
|
if (tmpval.Equals(string.Empty)) tmpval = " "; // nothing assinged to variable
|
||||||
DictROVar.Add(str.Substring(0, nxt), tmpval);
|
if (!DictROVar.ContainsKey(str.Substring(0, nxt))) // need a try/catch here.
|
||||||
|
{
|
||||||
|
DictROVar.Add(str.Substring(0, nxt), tmpval);
|
||||||
|
multiRoValues.Add(str.Substring(0, nxt));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return null;
|
||||||
if (multiRtnVal)
|
if (multiRtnVal)
|
||||||
rtnstr = tmpval;
|
rtnstr = tmpval;
|
||||||
}
|
}
|
||||||
@ -1036,7 +1046,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
while (tstr.Length > 0)
|
while (tstr.Length > 0)
|
||||||
{
|
{
|
||||||
int idx = MatchingBrace(tstr);
|
int idx = MatchingBrace(tstr);
|
||||||
lstRoValues.Add(ProcessRO(tstr.Substring(0, idx + 1), true));
|
string tmpVal = ProcessRO(tstr.Substring(0, idx + 1), true);
|
||||||
|
if (tmpVal != null) lstRoValues.Add(tmpVal); // duplicates get returned as null
|
||||||
tstr = tstr.Substring(idx + 1);
|
tstr = tstr.Substring(idx + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user