wxXmlResourceHandlerImplBase::GetAnimation() returned wxAnimation by value
which created references to wxAnimationCtrlNameStr and wxNullAnimation
symbols, defined in the "adv" library, in "core" when using Sun CC even though
they were not referenced directly.
Fix this by returning wxAnimation by pointer to keep it opaque for "core" code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72782
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/icon.h"
#include "wx/artprov.h"
#include "wx/colour.h"
#include "wx/icon.h"
#include "wx/artprov.h"
#include "wx/colour.h"
#include "wx/vector.h"
#include "wx/xrc/xmlreshandler.h"
#include "wx/vector.h"
#include "wx/xrc/xmlreshandler.h"
#if wxUSE_ANIMATIONCTRL
// Gets an animation.
#if wxUSE_ANIMATIONCTRL
// Gets an animation.
- wxAnimation GetAnimation(const wxString& param = wxT("animation"));
+ wxAnimation* GetAnimation(const wxString& param = wxT("animation"));
#include "wx/string.h"
#include "wx/artprov.h"
#include "wx/colour.h"
#include "wx/string.h"
#include "wx/artprov.h"
#include "wx/colour.h"
#include "wx/filesys.h"
#include "wx/imaglist.h"
#include "wx/filesys.h"
#include "wx/imaglist.h"
+class WXDLLIMPEXP_FWD_ADV wxAnimation;
+
class WXDLLIMPEXP_FWD_XML wxXmlNode;
class WXDLLIMPEXP_FWD_XML wxXmlResource;
class WXDLLIMPEXP_FWD_XML wxXmlNode;
class WXDLLIMPEXP_FWD_XML wxXmlResource;
virtual wxImageList *GetImageList(const wxString& param = wxT("imagelist")) = 0;
#if wxUSE_ANIMATIONCTRL
virtual wxImageList *GetImageList(const wxString& param = wxT("imagelist")) = 0;
#if wxUSE_ANIMATIONCTRL
- virtual wxAnimation GetAnimation(const wxString& param = wxT("animation")) = 0;
+ virtual wxAnimation* GetAnimation(const wxString& param = wxT("animation")) = 0;
#endif
virtual wxFont GetFont(const wxString& param = wxT("font"), wxWindow* parent = NULL) = 0;
#endif
virtual wxFont GetFont(const wxString& param = wxT("font"), wxWindow* parent = NULL) = 0;
}
#if wxUSE_ANIMATIONCTRL
}
#if wxUSE_ANIMATIONCTRL
- wxAnimation GetAnimation(const wxString& param = wxT("animation"))
+ wxAnimation* GetAnimation(const wxString& param = wxT("animation"))
{
return GetImpl()->GetAnimation(param);
}
{
return GetImpl()->GetAnimation(param);
}
#include "custclas.h"
// And our objref dialog, for the object reference and ID range example.
#include "objrefdlg.h"
#include "custclas.h"
// And our objref dialog, for the object reference and ID range example.
#include "objrefdlg.h"
-// For functions to manipulate our wxTreeCtrl and wxListCtrl
+// For functions to manipulate the corresponding controls.
+#include "wx/animate.h"
#include "wx/treectrl.h"
#include "wx/listctrl.h"
#include "wx/treectrl.h"
#include "wx/listctrl.h"
#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)
{
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());
#include "wx/log.h"
#endif // WX_PRECOMP
#include "wx/log.h"
#endif // WX_PRECOMP
+#include "wx/animate.h"
+#include "wx/scopedptr.h"
+
// ============================================================================
// implementation
// ============================================================================
#if wxUSE_ANIMATIONCTRL
// ============================================================================
// implementation
// ============================================================================
#if wxUSE_ANIMATIONCTRL
-wxAnimation wxXmlResourceHandlerImpl::GetAnimation(const wxString& param)
+wxAnimation* wxXmlResourceHandlerImpl::GetAnimation(const wxString& param)
{
const wxString name = GetParamValue(param);
if ( name.empty() )
{
const wxString name = GetParamValue(param);
if ( name.empty() )
- return wxNullAnimation;
// load the animation from file
// load the animation from file
+ wxScopedPtr<wxAnimation> ani(new wxAnimation);
#if wxUSE_FILESYSTEM
wxFSFile * const
fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE);
if ( fsfile )
{
#if wxUSE_FILESYSTEM
wxFSFile * const
fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE);
if ( fsfile )
{
- ani.Load(*fsfile->GetStream());
+ ani->Load(*fsfile->GetStream());
{
ReportParamError
(
param,
wxString::Format("cannot create animation from \"%s\"", name)
);
{
ReportParamError
(
param,
wxString::Format("cannot create animation from \"%s\"", name)
);
- return wxNullAnimation;
}
#endif // wxUSE_ANIMATIONCTRL
}
#endif // wxUSE_ANIMATIONCTRL