]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileconf.cpp
xti expansions, streaming code changes
[wxWidgets.git] / src / common / fileconf.cpp
index 36537f99cffb477f4756670b1c5b02a98705b518..876047dfc65d0a7ab3d325bdde15bf8b55ec594f 100644 (file)
@@ -24,7 +24,7 @@
   #pragma hdrstop
 #endif  //__BORLANDC__
 
-#if wxUSE_CONFIG
+#if wxUSE_CONFIG && wxUSE_FILECONFIG
 
 #ifndef   WX_PRECOMP
   #include  "wx/string.h"
@@ -106,8 +106,15 @@ static wxString GetAppName(const wxString& appname);
 // "template" array types
 // ----------------------------------------------------------------------------
 
-WX_DEFINE_SORTED_EXPORTED_ARRAY(wxFileConfigEntry *, ArrayEntries);
-WX_DEFINE_SORTED_EXPORTED_ARRAY(wxFileConfigGroup *, ArrayGroups);
+#ifdef WXMAKINGDLL_BASE
+    WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigEntry *, ArrayEntries,
+                                         WXDLLIMPEXP_BASE);
+    WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigGroup *, ArrayGroups,
+                                         WXDLLIMPEXP_BASE);
+#else
+    WX_DEFINE_SORTED_ARRAY(wxFileConfigEntry *, ArrayEntries);
+    WX_DEFINE_SORTED_ARRAY(wxFileConfigGroup *, ArrayGroups);
+#endif
 
 // ----------------------------------------------------------------------------
 // wxFileConfigLineList
@@ -672,6 +679,16 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal)
           // 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);
         }