diff options
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 |