]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_animatctrl.cpp
Reflect changes in stc.cpp in stc.cpp.in from which it's generated.
[wxWidgets.git] / src / xrc / xh_animatctrl.cpp
index 6bded88fdca7730daf4f48269a9fccd80221dffb..aabcb53a7be0388995e0a9e6ad54f6046ca3a152 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     XML resource handler for wxAnimationCtrl
 // Author:      Francesco Montorsi
 // Created:     2006-10-15
 // Purpose:     XML resource handler for wxAnimationCtrl
 // Author:      Francesco Montorsi
 // Created:     2006-10-15
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 Francesco Montorsi
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2006 Francesco Montorsi
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -19,6 +18,7 @@
 
 #include "wx/xrc/xh_animatctrl.h"
 #include "wx/animate.h"
 
 #include "wx/xrc/xh_animatctrl.h"
 #include "wx/animate.h"
+#include "wx/scopedptr.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxAnimationCtrlXmlHandler, wxXmlResourceHandler)
 
 
 IMPLEMENT_DYNAMIC_CLASS(wxAnimationCtrlXmlHandler, wxXmlResourceHandler)
 
@@ -33,9 +33,11 @@ wxObject *wxAnimationCtrlXmlHandler::DoCreateResource()
 {
     XRC_MAKE_INSTANCE(ctrl, wxAnimationCtrl)
 
 {
     XRC_MAKE_INSTANCE(ctrl, wxAnimationCtrl)
 
+    wxScopedPtr<wxAnimation> animation(GetAnimation(wxT("animation")));
+
     ctrl->Create(m_parentAsWindow,
                   GetID(),
     ctrl->Create(m_parentAsWindow,
                   GetID(),
-                  GetAnimation(wxT("animation")),
+                  animation ? *animation : wxNullAnimation,
                   GetPosition(), GetSize(),
                   GetStyle(wxT("style"), wxAC_DEFAULT_STYLE),
                   GetName());
                   GetPosition(), GetSize(),
                   GetStyle(wxT("style"), wxAC_DEFAULT_STYLE),
                   GetName());