]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/xml/xmlres.cpp
Fixed buffer overrun in call to wxStripMenuCodes()
[wxWidgets.git] / contrib / src / xml / xmlres.cpp
index 7fb10475f0b664878c939b61a8f09df7e37e31ec..e74d13b7ee8fc8ec31ac79a20f2cd0d0cfcc78cd 100644 (file)
 WX_DEFINE_OBJARRAY(wxXmlResourceDataRecords);
 
 
-wxXmlResource::wxXmlResource(bool use_locale = TRUE)
+wxXmlResource::wxXmlResource(bool use_locale)
 {
     m_Handlers.DeleteContents(TRUE);
     m_UseLocale = use_locale;
 }
     
-wxXmlResource::wxXmlResource(const wxString& filemask, bool use_locale = TRUE)
+wxXmlResource::wxXmlResource(const wxString& filemask, bool use_locale)
 {
     m_UseLocale = use_locale;
     m_Handlers.DeleteContents(TRUE);
@@ -175,7 +175,10 @@ bool wxXmlResource::LoadPanel(wxPanel *panel, wxWindow *parent, const wxString&
     return CreateResFromNode(FindResource(name, wxT("wxPanel")), parent, panel) != NULL;
 }
 
-
+bool wxXmlResource::LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name)
+{
+    return CreateResFromNode(FindResource(name, wxT("wxFrame")), parent, frame) != NULL;
+}
 
 wxBitmap wxXmlResource::LoadBitmap(const wxString& name)
 {
@@ -836,7 +839,7 @@ void wxXmlResourceHandler::CreateChildren(wxObject *parent, bool this_hnd_only)
 }
 
 
-void wxXmlResourceHandler::CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL)
+void wxXmlResourceHandler::CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode)
 {
     wxXmlNode *root;
     if (rootnode == NULL) root = m_Node; else root = rootnode;
@@ -873,10 +876,11 @@ struct XMLID_record
 };
 
 static XMLID_record *XMLID_Records[XMLID_TABLE_SIZE] = {NULL};
-static int XMLID_LastID = wxID_HIGHEST;
 
 /*static*/ int wxXmlResource::GetXMLID(const char *str_id)
 {
+    static int XMLID_LastID = wxID_HIGHEST;
+    
     int index = 0;
     
     for (const char *c = str_id; *c != '\0'; c++) index += (int)*c;