X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d89b7c194d77ae14dcdb113ac4ffe79f5515b4ca..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 1eabee0e1a..4b63270320 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -46,7 +46,7 @@ #include "wx/stdpaths.h" -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #endif //windows.h #if defined(__WXPM__) @@ -146,7 +146,7 @@ private: wxString m_strName, // entry name m_strValue; // value - bool m_bImmutable:1, // can be overriden locally? + bool m_bImmutable:1, // can be overridden locally? m_bHasValue:1; // set after first call to SetValue() int m_nLine; // used if m_pLine == NULL only @@ -1818,6 +1818,11 @@ bool wxFileConfigGroup::DeleteEntry(const wxString& name) // pNewLast can be NULL here -- it's ok and can happen if we have no // entries left m_pLastEntry = pNewLast; + + // For the root group only, we could be removing the first group line + // here, so update m_pLine to avoid keeping a dangling pointer. + if ( pLine == m_pLine ) + SetLine(NULL); } m_pConfig->LineListRemove(pLine); @@ -2111,7 +2116,7 @@ static wxString FilterOutEntryName(const wxString& str) #if !wxUSE_UNICODE ((unsigned char)c < 127) && #endif // ANSI - !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) ) + !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%()"), c) ) { strResult += wxT('\\'); }