X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2cf3a6d7bef6f20bea35062dd3d4dbf0aec9efb5..be13a2677509304e1ccebbc678da8633028ecd14:/src/common/fileconf.cpp?ds=sidebyside diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index a3bcdb5983..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(); } @@ -1684,9 +1693,9 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) wxLogTrace( FILECONF_TRACE_MASK, _T(" (m_pLine) = prev: %p, this %p, next %p"), - m_pLine ? m_pLine->Prev() : NULL, - m_pLine, - m_pLine ? m_pLine->Next() : NULL ); + m_pLine ? wx_static_cast(void*, m_pLine->Prev()) : 0, + wx_static_cast(void*, m_pLine), + m_pLine ? wx_static_cast(void*, m_pLine->Next()) : 0 ); wxLogTrace( FILECONF_TRACE_MASK, _T(" text: '%s'"), m_pLine ? m_pLine->Text().c_str() : wxEmptyString );