]> git.saurik.com Git - wxWidgets.git/commitdiff
A fix to prevent mungeing of the config file after reading in
authorJulian Smart <julian@anthemion.co.uk>
Tue, 20 May 2003 21:45:04 +0000 (21:45 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 20 May 2003 21:45:04 +0000 (21:45 +0000)
entries (say, just one entry in one group), then adding entries
to a different group.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/toback24.txt
src/common/fileconf.cpp

index c653128fba4bf037ce7d1447f27cfd967925d8e2..c4bc8320c04b6ffacbf542f3274bae5a84cf0691 100644 (file)
@@ -173,3 +173,8 @@ This gets the tab size and adds a bit for borders.
 We should do the same for other platforms, only rationalise
 it so that wxNotebook returns the tab rect info.
 
 We should do the same for other platforms, only rationalise
 it so that wxNotebook returns the tab rect info.
 
+19. Add wxFileConfig bug fix, marked by <JACS>...</JACS> in Parse().
+This prevents mungeing of the config file after reading in
+entries (say, just one entry in one group), then adding entries
+to a different group.
+
index 36537f99cffb477f4756670b1c5b02a98705b518..3e39151adec4ecc637ae0dbc100ced1e7e55fe89 100644 (file)
@@ -672,6 +672,16 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
           // new entry
           pEntry = m_pCurrentGroup->AddEntry(strKey, n);
 
           // new entry
           pEntry = m_pCurrentGroup->AddEntry(strKey, n);
 
+          // <JACS>
+          // 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);
+          // </JACS>
+
           if ( bLocal )
             pEntry->SetLine(m_linesTail);
         }
           if ( bLocal )
             pEntry->SetLine(m_linesTail);
         }