B2019-033 Check for and handle if a RO Group name was stored in the database with spaces replaced with two under bars when trying to save changes to a group name

This commit is contained in:
John Jenko 2019-03-13 17:37:01 +00:00
parent 7aa2251bb6
commit f78e7fde23

View File

@ -611,7 +611,14 @@ namespace ROEditor
if (this.tbGroup.Text != origGroup)
{
XmlNode tmpn = (XmlNode) elem;
tmpn.FirstChild.Value = tmpn.FirstChild.Value.Replace(origGroup, this.tbGroup.Text);
// B2019-033 check if the xml node value has two '_'s instead of spaces.
// remove the replace each '__' with a space for the comparison
// save the changed text with the spaces instead of the underbars - spaces are OK in XLM values
string tmpstr = tmpn.FirstChild.Value;
string tmpstr2 = tmpn.FirstChild.Value.Replace(CvtUserFldToFld(origGroup), this.tbGroup.Text);
if (tmpstr == tmpstr2)
tmpstr2 = tmpn.FirstChild.Value.Replace(origGroup, this.tbGroup.Text);
tmpn.FirstChild.Value = tmpstr2; //tmpn.FirstChild.Value.Replace(CvtUserFldToFld(origGroup), this.tbGroup.Text);
modified=true;
}
if ((elem.HasAttribute("AccPageIDPrefix")&&this.tbPrefix.Text != origPrefix) || this.tbPrefix.Modified==true)