X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/008202b7e900e475422dd39e6248249da5192feb..0cdd04ad993f86710bc5c9d9c8c12ec25a34ac71:/src/common/fileconf.cpp?ds=sidebyside diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index cc4823e058..8d67e3a4f7 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -1547,8 +1547,17 @@ void wxFileConfigGroup::Rename(const wxString& newName) { wxCHECK_RET( m_pParent, _T("the root group can't be renamed") ); + if ( newName == m_strName ) + return; + + // we need to remove the group from the parent and it back under the new + // name to keep the parents array of subgroups alphabetically sorted + m_pParent->m_aSubgroups.Remove(this); + m_strName = newName; + m_pParent->m_aSubgroups.Add(this); + // update the group lines recursively UpdateGroupAndSubgroupsLines(); }