diff options
-rw-r--r-- | include/sfx2/app.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/childwin.hxx | 7 | ||||
-rw-r--r-- | sfx2/source/appl/appchild.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/childwinimpl.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/childwinimpl.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 4 |
7 files changed, 14 insertions, 13 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) \ diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx index 4a629036c975..6003a8c547fb 100644 --- a/sfx2/source/appl/appchild.cxx +++ b/sfx2/source/appl/appchild.cxx @@ -58,7 +58,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto } void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt16 nId, - SfxChildWinContextFactory *pFact) + std::unique_ptr<SfxChildWinContextFactory> pFact) { SfxChildWinFactArr_Impl *pFactories; SfxChildWinFactory *pF = nullptr; @@ -116,7 +116,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1 { if ( !pF->pArr ) pF->pArr.reset( new SfxChildWinContextArr_Impl ); - pF->pArr->push_back( pFact ); + pF->pArr->push_back( std::move(pFact) ); return; } diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 6b64540fc120..ec50cf640a74 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -720,9 +720,9 @@ void SfxChildWindow::SetFrame( const css::uno::Reference< css::frame::XFrame > & } } -void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, sal_uInt16 nId, SfxChildWinContextFactory* pFact) +void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, sal_uInt16 nId, std::unique_ptr<SfxChildWinContextFactory> pFact) { - SfxGetpApp()->RegisterChildWindowContext_Impl( pMod, nId, pFact ); + SfxGetpApp()->RegisterChildWindowContext_Impl( pMod, nId, std::move(pFact) ); } void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, SfxChildWinFactory* pFact) diff --git a/sfx2/source/appl/childwinimpl.cxx b/sfx2/source/appl/childwinimpl.cxx index 6299edc88305..313ef0e91d8b 100644 --- a/sfx2/source/appl/childwinimpl.cxx +++ b/sfx2/source/appl/childwinimpl.cxx @@ -35,9 +35,9 @@ SfxChildWinContextFactory& SfxChildWinContextArr_Impl::operator []( size_t i ) return *maData[i].get(); } -void SfxChildWinContextArr_Impl::push_back( SfxChildWinContextFactory* p ) +void SfxChildWinContextArr_Impl::push_back( std::unique_ptr<SfxChildWinContextFactory> p ) { - maData.push_back(std::unique_ptr<SfxChildWinContextFactory>(p)); + maData.push_back(std::move(p)); } size_t SfxChildWinFactArr_Impl::size() const diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx index 4b5c3ac1576a..9d361e212597 100644 --- a/sfx2/source/inc/childwinimpl.hxx +++ b/sfx2/source/inc/childwinimpl.hxx @@ -36,7 +36,7 @@ public: size_t size() const; const SfxChildWinContextFactory& operator []( size_t i ) const; SfxChildWinContextFactory& operator []( size_t i ); - void push_back( SfxChildWinContextFactory* p ); + void push_back( std::unique_ptr<SfxChildWinContextFactory> p ); }; class SfxChildWinFactArr_Impl diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index c3253ac29e60..4015bd1aa922 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -73,10 +73,10 @@ SfxChildWindowContext* SwNavigationChild::CreateImpl( vcl::Window *pParent, } void SwNavigationChild::RegisterChildWindowContext(SfxModule* pMod) { - SfxChildWinContextFactory *pFact = new SfxChildWinContextFactory( + auto pFact = o3tl::make_unique<SfxChildWinContextFactory>( SwNavigationChild::CreateImpl, /* cast is safe here! */static_cast< sal_uInt16 >(SwView::GetInterfaceId()) ); - SfxChildWindowContext::RegisterChildWindowContext(pMod, SID_NAVIGATOR, pFact); + SfxChildWindowContext::RegisterChildWindowContext(pMod, SID_NAVIGATOR, std::move(pFact)); } |