X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3b9c43bbc6bf71b6b618d4e2a71231e9cd431dc..07aaf32633ecf18ec3edfbb41793a112914792d0:/src/xrc/xmladv.cpp?ds=sidebyside diff --git a/src/xrc/xmladv.cpp b/src/xrc/xmladv.cpp index 6f6f36067a..729c5b2892 100644 --- a/src/xrc/xmladv.cpp +++ b/src/xrc/xmladv.cpp @@ -33,42 +33,45 @@ #include "wx/log.h" #endif // WX_PRECOMP +#include "wx/animate.h" +#include "wx/scopedptr.h" + // ============================================================================ // implementation // ============================================================================ #if wxUSE_ANIMATIONCTRL -wxAnimation wxXmlResourceHandlerImpl::GetAnimation(const wxString& param) +wxAnimation* wxXmlResourceHandlerImpl::GetAnimation(const wxString& param) { const wxString name = GetParamValue(param); if ( name.empty() ) - return wxNullAnimation; + return NULL; // load the animation from file - wxAnimation ani; + wxScopedPtr ani(new wxAnimation); #if wxUSE_FILESYSTEM wxFSFile * const fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE); if ( fsfile ) { - ani.Load(*fsfile->GetStream()); + ani->Load(*fsfile->GetStream()); delete fsfile; } #else - ani.LoadFile(name); + ani->LoadFile(name); #endif - if ( !ani.IsOk() ) + if ( !ani->IsOk() ) { ReportParamError ( param, wxString::Format("cannot create animation from \"%s\"", name) ); - return wxNullAnimation; + return NULL; } - return ani; + return ani.release(); } #endif // wxUSE_ANIMATIONCTRL