X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/444d3e017e42e3469056f0b4318ed66458d9bf17..fe164c3e2ea5453896cd63a5440a26365daec1bc:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 36537f99cf..6babd6ea78 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -24,7 +24,7 @@ #pragma hdrstop #endif //__BORLANDC__ -#if wxUSE_CONFIG +#if wxUSE_CONFIG && wxUSE_FILECONFIG #ifndef WX_PRECOMP #include "wx/string.h" @@ -672,6 +672,16 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal) // new entry pEntry = m_pCurrentGroup->AddEntry(strKey, n); + // + // Take the opportunity to set some pointers now + // that we know there are items in this group. + // Otherwise, items added to a newly read file + // can be put in the wrong place. + m_pCurrentGroup->SetLastEntry(pEntry); + if (m_pCurrentGroup->Parent()) + m_pCurrentGroup->Parent()->SetLastGroup(m_pCurrentGroup); + // + if ( bLocal ) pEntry->SetLine(m_linesTail); }