diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-11 14:02:42 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-12 09:40:38 +0100 |
commit | 936a49646738452f7331ed9a47ac015db9ee7295 (patch) | |
tree | 7dff1a6db99e3e28b8bc2226d07b29d5f2b5cd0b /include | |
parent | ab81e3bff2a1844be67209bc8947d539edbaf8e6 (diff) |
Switch VclBuilder constructors to use VclPtr.
Change-Id: Id35a86eb52bbde6ca09a5e61a0b1a79b23be8faf
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/builder.hxx | 4 | ||||
-rw-r--r-- | include/vcl/builderfactory.hxx | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 4b7683d467ae..518d8a87b9ac 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -46,8 +46,8 @@ class VCL_DLLPUBLIC VclBuilder { public: typedef std::map<OString, OString> stringmap; - /// These functions return a vcl::Window with a reference count of one. - typedef vcl::Window* (*customMakeWidget)(vcl::Window *pParent, stringmap &rVec); + /// These functions create a new widget with parent @pParent and return it in @rRet + typedef void (*customMakeWidget)(VclPtr<vcl::Window> &rRet, VclPtr<vcl::Window> &pParent, stringmap &rVec); public: VclBuilder( diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx index b50a557f4065..f2d0c4cf96ff 100644 --- a/include/vcl/builderfactory.hxx +++ b/include/vcl/builderfactory.hxx @@ -10,24 +10,25 @@ #ifndef INCLUDED_VCL_BUILDER_FACTORY_HXX #define INCLUDED_VCL_BUILDER_FACTORY_HXX +#include <vcl/vclptr.hxx> #include <vcl/builder.hxx> #define VCL_BUILDER_DECL_FACTORY(typeName) \ - extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL \ - make##typeName(vcl::Window *pParent, VclBuilder::stringmap &rMap) + extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL \ + make##typeName(VclPtr<vcl::Window> &rRet, VclPtr<vcl::Window> &pParent, VclBuilder::stringmap &rMap) #define VCL_BUILDER_FACTORY(typeName) \ VCL_BUILDER_DECL_FACTORY(typeName) \ { \ (void)rMap; \ - return new typeName(pParent); \ + rRet = VclPtr<typeName>::Create(pParent); \ } #define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \ VCL_BUILDER_DECL_FACTORY(typeName) \ { \ (void)rMap; \ - return new typeName(pParent,arg1); \ + rRet = VclPtr<typeName>::Create(pParent,arg1); \ } #endif |