diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-11 11:30:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-11 11:51:35 +0100 |
commit | 4015034e08d14c5fbc0b2b2e8a7e1e56f651d2f0 (patch) | |
tree | 259568e6f948b2de097bc7d6d177b6a78f711710 /include | |
parent | f009b0bda3102bb557ad72ac7cc4b398b9134fe3 (diff) |
use unique_ptr for SfxChildWinContextFactory
Change-Id: Id0e30c5e591e7fb4b21fb55d47d15a5936fe1374
Reviewed-on: https://gerrit.libreoffice.org/64934
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/app.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/childwin.hxx | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index c5ed9b880bd0..701fa90475b3 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -191,7 +191,7 @@ public: // Object-Factories/global arrays SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*); - SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*); + SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, std::unique_ptr<SfxChildWinContextFactory>); SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, const SfxStbCtrlFactory&); SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const SfxTbxCtrlFactory&); SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const; diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx index 9a12bf896071..74efab5857de 100644 --- a/include/sfx2/childwin.hxx +++ b/include/sfx2/childwin.hxx @@ -24,6 +24,7 @@ #include <sfx2/dllapi.h> #include <sal/types.h> +#include <o3tl/make_unique.hxx> #include <o3tl/typed_flags_set.hxx> #include <vcl/window.hxx> #include <com/sun/star/frame/XFrame.hpp> @@ -138,7 +139,7 @@ public: static FloatingWindow* GetFloatingWindow(vcl::Window *pParent); - static void RegisterChildWindowContext(SfxModule*, sal_uInt16, SfxChildWinContextFactory*); + static void RegisterChildWindowContext(SfxModule*, sal_uInt16, std::unique_ptr<SfxChildWinContextFactory>); }; class SFX2_DLLPUBLIC SfxChildWindow @@ -234,9 +235,9 @@ public: } \ void Class::RegisterChildWindowContext(sal_uInt16 nId, SfxModule* pMod) \ { \ - SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( \ + auto pFact = o3tl::make_unique<SfxChildWinContextFactory>( \ Class::CreateImpl, nId ); \ - SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, pFact); \ + SfxChildWindowContext::RegisterChildWindowContext(pMod, MyID, std::move(pFact)); \ } #define SFX_DECL_CHILDWINDOW(Class) \ |