B2021-077 – was sometimes clear tree node text when a group node was selected before saving RO changes

This commit is contained in:
John Jenko 2021-08-13 18:46:56 +00:00
parent ea56515d15
commit fea1b4ca9f

View File

@ -2381,6 +2381,8 @@ namespace ROEditor
mnutmp = myro.GetMenuValueTemplate("GroupMenuItem");
string mnutitle = myro.GetMenuString(mnutmp, false);
if (mnutitle != "") // B2021-077 found that sometimes clicking on a group node would clear the node's title in the tree
{
success = myro.IsDuplicateMenuTitle(mnutitle);
if (success == true) // just reuse boolean, true means it's duplicate
{
@ -2389,7 +2391,7 @@ namespace ROEditor
}
myro.SetAttribute("MenuTitle", mnutitle);
}
// If this doesn't have a recid, insert it.
if (newone != null)
{
@ -2406,7 +2408,7 @@ namespace ROEditor
{
newt=null;
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
if (success==true) roTreeView.SelectedNode.Text = mnutitle;
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
}
newone = null;
return true;