don't use untyped wxList in wxXmlResource

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2006-07-27 14:03:02 +00:00
parent 28f92d74ee
commit 67868c1e6c
2 changed files with 11 additions and 15 deletions

View File

@ -18,7 +18,6 @@
#include "wx/string.h"
#include "wx/dynarray.h"
#include "wx/datetime.h"
#include "wx/list.h"
#include "wx/gdicmn.h"
#include "wx/filesys.h"
#include "wx/bitmap.h"
@ -88,6 +87,10 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxXmlResourceDataRecord,
wxXmlResourceDataRecords,
WXDLLIMPEXP_XRC);
WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxXmlResourceHandler*,
wxXmlResourceHandlers,
class WXDLLIMPEXP_XRC);
enum wxXmlResourceFlags
{
wxXRC_USE_LOCALE = 1,
@ -274,7 +277,7 @@ private:
long m_version;
int m_flags;
wxList m_handlers;
wxXmlResourceHandlers m_handlers;
wxXmlResourceDataRecords m_data;
#if wxUSE_FILESYSTEM
wxFileSystem m_curFileSystem;

View File

@ -215,13 +215,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxXmlResourceHandler, wxObject)
void wxXmlResource::AddHandler(wxXmlResourceHandler *handler)
{
m_handlers.Append(handler);
m_handlers.Add(handler);
handler->SetParentResource(this);
}
void wxXmlResource::InsertHandler(wxXmlResourceHandler *handler)
{
m_handlers.Insert(handler);
m_handlers.Insert(handler, 0);
handler->SetParentResource(this);
}
@ -229,7 +229,7 @@ void wxXmlResource::InsertHandler(wxXmlResourceHandler *handler)
void wxXmlResource::ClearHandlers()
{
WX_CLEAR_LIST(wxList, m_handlers);
WX_CLEAR_ARRAY(m_handlers);
}
@ -672,26 +672,19 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent,
return CreateResFromNode(&copy, parent, instance);
}
wxXmlResourceHandler *handler;
if (handlerToUse)
{
if (handlerToUse->CanHandle(node))
{
return handlerToUse->CreateResource(node, parent, instance);
}
}
else if (node->GetName() == wxT("object"))
{
wxList::compatibility_iterator ND = m_handlers.GetFirst();
while (ND)
for ( wxXmlResourceHandlers::iterator i = m_handlers.begin();
i != m_handlers.end(); ++i )
{
handler = (wxXmlResourceHandler*)ND->GetData();
wxXmlResourceHandler *handler = *i;
if (handler->CanHandle(node))
{
return handler->CreateResource(node, parent, instance);
}
ND = ND->GetNext();
}
}