- wxGrid::GetBestSize() returns same size the grid would have after AutoSize()
- Added wxTreeCtrl::CollapseAll[Children]() and IsEmpty() (Francesco Montorsi)
- Several RTL-related positioning fixes (Diaa Sami)
+- Fix wxConfig::DeleteGroup() for arguments with trailing slash (David Hart)
wxMSW:
// delete the group (with all subgroups)
virtual bool DeleteGroup(const wxString& key) = 0;
// delete the whole underlying object (disk file, registry key, ...)
- // primarly for use by desinstallation routine.
+ // primarily for use by uninstallation routine.
virtual bool DeleteAll() = 0;
// options
static bool IsImmutable(const wxString& key)
{ return !key.IsEmpty() && key[0] == wxCONFIG_IMMUTABLE_PREFIX; }
+ // return the path without trailing separator, if any: this should be called
+ // to sanitize paths referring to the group names before passing them to
+ // wxConfigPathChanger as "/foo/bar/" should be the same as "/foo/bar" and it
+ // isn't interpreted in the same way by it (and this can't be changed there
+ // as it's not the same for the entries names)
+ static wxString RemoveTrailingSeparator(const wxString& key);
+
// do read/write the values of different types
virtual bool DoReadString(const wxString& key, wxString *pStr) const = 0;
virtual bool DoReadLong(const wxString& key, long *pl) const = 0;
bool wxFileConfig::DeleteGroup(const wxString& key)
{
- wxConfigPathChanger path(this, key);
+ wxConfigPathChanger path(this, RemoveTrailingSeparator(key));
if ( !m_pCurrentGroup->DeleteSubgroupByName(path.Name()) )
return false;
bool wxRegConfig::DeleteGroup(const wxString& key)
{
- wxConfigPathChanger path(this, key);
+ wxConfigPathChanger path(this, RemoveTrailingSeparator(key));
if ( !m_keyLocal.Exists() )
{
_T("[root/group2]\n"),
fc );
- CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group2")) );
+ // notice trailing slash: it should be ignored
+ CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group2/")) );
wxVERIFY_FILECONFIG( _T("[root]\n")
_T("entry=value\n"),
fc );