X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/67868c1e6c5a600fa6752e0abff13b732c8e689f..6d7b547184bfdcdf67790755deb0122050b1d728:/src/xrc/xmlres.cpp?ds=inline diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 040951fc11..96a7cd6b5a 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -215,13 +215,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxXmlResourceHandler, wxObject) void wxXmlResource::AddHandler(wxXmlResourceHandler *handler) { - m_handlers.Add(handler); + m_handlers.Append(handler); handler->SetParentResource(this); } void wxXmlResource::InsertHandler(wxXmlResourceHandler *handler) { - m_handlers.Insert(handler, 0); + m_handlers.Insert(handler); handler->SetParentResource(this); } @@ -229,7 +229,7 @@ void wxXmlResource::InsertHandler(wxXmlResourceHandler *handler) void wxXmlResource::ClearHandlers() { - WX_CLEAR_ARRAY(m_handlers); + WX_CLEAR_LIST(wxList, m_handlers); } @@ -672,19 +672,26 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent, return CreateResFromNode(©, parent, instance); } + wxXmlResourceHandler *handler; + if (handlerToUse) { if (handlerToUse->CanHandle(node)) + { return handlerToUse->CreateResource(node, parent, instance); + } } else if (node->GetName() == wxT("object")) { - for ( wxXmlResourceHandlers::iterator i = m_handlers.begin(); - i != m_handlers.end(); ++i ) + wxList::compatibility_iterator ND = m_handlers.GetFirst(); + while (ND) { - wxXmlResourceHandler *handler = *i; + handler = (wxXmlResourceHandler*)ND->GetData(); if (handler->CanHandle(node)) + { return handler->CreateResource(node, parent, instance); + } + ND = ND->GetNext(); } }