X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/975fb32b5cac366ad89be9c1d42cca9a789e1802..cc4d5638c66a409e421420ed7110917755a66788:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 286c03955d..e626c3c0cc 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 07.04.98 (adapted from appconf.cpp) -// RCS-ID: $Id$ // Copyright: (c) 1997 Karsten Ballueder & Vadim Zeitlin // Ballueder@usa.net // Licence: wxWindows licence @@ -46,7 +45,7 @@ #include "wx/stdpaths.h" -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private.h" #endif //windows.h #if defined(__WXPM__) @@ -146,7 +145,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 @@ -661,7 +660,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) // which is exactly what we want. else if ( !bLocal || pEntry->IsLocal() ) { wxLogWarning(_("file '%s', line %d: key '%s' was first found at line %d."), - buffer.GetName(), n + 1, strKey.c_str(), pEntry->Line()); + buffer.GetName(), (int)n + 1, strKey.c_str(), pEntry->Line()); } } @@ -1818,6 +1817,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 +2115,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('\\'); }