]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
set listview extended styles after switching to report view and not only when creatin...
[wxWidgets.git] / src / xrc / xmlres.cpp
index 00af7a26f9ae6a644c875c7255844e93a3a37835..466faa9870f12e8290595f976ec1111bad030441 100644 (file)
@@ -235,6 +235,7 @@ bool wxXmlResource::Unload(const wxString& filename)
         {
             if ( (*i)->File == fnd )
             {
+                delete *i;
                 Data().erase(i);
                 unloaded = true;
 
@@ -966,7 +967,7 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
 #else
             // The string is internally stored as UTF-8, we have to convert
             // it into system's default encoding so that it can be displayed:
-            return wxString(str2.mb_str(wxConvUTF8), wxConvLocal);
+            return wxString(str2.wc_str(wxConvUTF8), wxConvLocal);
 #endif
         }
     }
@@ -1575,7 +1576,10 @@ void wxXmlResourceHandler::CreateChildrenPrivately(wxObject *parent, wxXmlNode *
 
 struct XRCID_record
 {
-    int id;
+    /* Hold the id so that once an id is allocated for a name, it
+       does not get created again by NewControlId at least
+       until we are done with it */
+    wxWindowIDRef id;
     char *key;
     XRCID_record *next;
 };
@@ -1648,11 +1652,6 @@ static void CleanXRCID_Record(XRCID_record *rec)
     {
         CleanXRCID_Record(rec->next);
 
-        // if we had generated the value of this id automatically, release it
-        // now that we don't need it any longer
-        if ( wxWindow::IsAutoGeneratedId(rec->id) )
-            wxWindow::ReleaseControlId(rec->id);
-
         free(rec->key);
         delete rec;
     }