[Libreoffice-commits] core.git: include/sfx2 sc/source sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 12 06:31:36 UTC 2018


 include/sfx2/app.hxx                    |    2 +-
 include/sfx2/childwin.hxx               |    6 +++---
 include/sfx2/module.hxx                 |    2 +-
 sc/source/ui/inc/ChildWindowWrapper.hxx |    4 ++--
 sfx2/source/appl/appchild.cxx           |    8 ++++----
 sfx2/source/appl/childwin.cxx           |    4 ++--
 sfx2/source/appl/childwinimpl.cxx       |    4 ++--
 sfx2/source/appl/module.cxx             |    4 ++--
 sfx2/source/dialog/dockwin.cxx          |    4 ++--
 sfx2/source/inc/childwinimpl.hxx        |    2 +-
 10 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 0dd025a2180e7fb1bf27a71687769a61d608abf2
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 11 12:59:35 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 12 07:31:12 2018 +0100

    use unique_ptr for SfxChildWinFactory
    
    Change-Id: I4305310ea296a5326838759742b14e687158d426
    Reviewed-on: https://gerrit.libreoffice.org/64954
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 701fa90475b3..27653aed3e98 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -190,7 +190,7 @@ public:
     SAL_DLLPRIVATE SfxAppData_Impl* Get_Impl() const { return pImpl.get(); }
 
     // Object-Factories/global arrays
-    SAL_DLLPRIVATE void         RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*);
+    SAL_DLLPRIVATE void         RegisterChildWindow_Impl(SfxModule*, std::unique_ptr<SfxChildWinFactory>);
     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&);
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 74efab5857de..3ddc7a377dae 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -191,7 +191,7 @@ public:
     virtual SfxChildWinInfo GetInfo() const;
     void                SaveStatus(const SfxChildWinInfo& rInfo);
 
-    static void         RegisterChildWindow(SfxModule*, SfxChildWinFactory*);
+    static void         RegisterChildWindow(SfxModule*, std::unique_ptr<SfxChildWinFactory>);
 
     static SfxChildWindow* CreateChildWindow( sal_uInt16, vcl::Window*, SfxBindings*, SfxChildWinInfo const &);
     void                SetHideNotDelete( bool bOn );
@@ -266,11 +266,11 @@ public:
                 } \
         void    Class::RegisterChildWindow (bool bVis, SfxModule *pMod, SfxChildWindowFlags nFlags)   \
                 {   \
-                    SfxChildWinFactory *pFact = new SfxChildWinFactory( \
+                    auto pFact = o3tl::make_unique<SfxChildWinFactory>( \
                         Class::CreateImpl, MyID, Pos );   \
                     pFact->aInfo.nFlags |= nFlags;  \
                     pFact->aInfo.bVisible = bVis;         \
-                    SfxChildWindow::RegisterChildWindow(pMod, pFact); \
+                    SfxChildWindow::RegisterChildWindow(pMod, std::move(pFact)); \
                 }
 
 #define SFX_IMPL_POS_CHILDWINDOW_WITHID(Class, MyID, Pos) \
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 842cab05e4e8..5709e4a90fbb 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -75,7 +75,7 @@ public:
     SfxSlotPool*                GetSlotPool() const;
 
     void                        RegisterToolBoxControl(const SfxTbxCtrlFactory&);
-    void                        RegisterChildWindow(SfxChildWinFactory*);
+    void                        RegisterChildWindow(std::unique_ptr<SfxChildWinFactory>);
     void                        RegisterStatusBarControl(const SfxStbCtrlFactory&);
 
     virtual VclPtr<SfxTabPage>  CreateTabPage( sal_uInt16 nId,
diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx
index 1f4920d7a566..db6d0c70f73e 100644
--- a/sc/source/ui/inc/ChildWindowWrapper.hxx
+++ b/sc/source/ui/inc/ChildWindowWrapper.hxx
@@ -53,10 +53,10 @@ public:
                     SfxModule* pModule  = nullptr,
                     SfxChildWindowFlags nFlags = SfxChildWindowFlags::NONE)
     {
-        SfxChildWinFactory* pFactory = new SfxChildWinFactory(ChildWindowWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS );
+        auto pFactory = o3tl::make_unique<SfxChildWinFactory>(ChildWindowWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS );
         pFactory->aInfo.nFlags |= nFlags;
         pFactory->aInfo.bVisible = bVisible;
-        SfxChildWindow::RegisterChildWindow(pModule, pFactory);
+        SfxChildWindow::RegisterChildWindow(pModule, std::move(pFactory));
     }
 
     virtual SfxChildWinInfo GetInfo() const override
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
index 6003a8c547fb..05a0f185ab40 100644
--- a/sfx2/source/appl/appchild.cxx
+++ b/sfx2/source/appl/appchild.cxx
@@ -35,11 +35,11 @@
 #include <sfx2/sfxsids.hrc>
 
 
-void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFactory *pFact )
+void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, std::unique_ptr<SfxChildWinFactory> pFact )
 {
     if ( pMod )
     {
-        pMod->RegisterChildWindow( pFact );
+        pMod->RegisterChildWindow( std::move(pFact) );
         return;
     }
 
@@ -54,7 +54,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule *pMod, SfxChildWinFacto
         }
     }
 
-    pImpl->pFactArr->push_back( pFact );
+    pImpl->pFactArr->push_back( std::move(pFact) );
 }
 
 void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt16 nId,
@@ -103,7 +103,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( SfxModule *pMod, sal_uInt1
                     // DLL-exit
                     pF = new SfxChildWinFactory( pFac->pCtor, pFac->nId,
                             pFac->nPos );
-                    pMod->RegisterChildWindow( pF );
+                    pMod->RegisterChildWindow( std::unique_ptr<SfxChildWinFactory>(pF) );
                 }
                 else
                     pF = pFac;
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index ec50cf640a74..2c53919f1c38 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -725,9 +725,9 @@ void SfxChildWindowContext::RegisterChildWindowContext(SfxModule* pMod, sal_uInt
     SfxGetpApp()->RegisterChildWindowContext_Impl( pMod, nId, std::move(pFact) );
 }
 
-void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, SfxChildWinFactory* pFact)
+void SfxChildWindow::RegisterChildWindow(SfxModule* pMod, std::unique_ptr<SfxChildWinFactory> pFact)
 {
-    SfxGetpApp()->RegisterChildWindow_Impl( pMod, pFact );
+    SfxGetpApp()->RegisterChildWindow_Impl( pMod, std::move(pFact) );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/childwinimpl.cxx b/sfx2/source/appl/childwinimpl.cxx
index 313ef0e91d8b..447df7319f8e 100644
--- a/sfx2/source/appl/childwinimpl.cxx
+++ b/sfx2/source/appl/childwinimpl.cxx
@@ -55,9 +55,9 @@ SfxChildWinFactory& SfxChildWinFactArr_Impl::operator []( size_t i )
     return *maData[i].get();
 }
 
-void SfxChildWinFactArr_Impl::push_back( SfxChildWinFactory* p )
+void SfxChildWinFactArr_Impl::push_back( std::unique_ptr<SfxChildWinFactory> p )
 {
-    maData.push_back(std::unique_ptr<SfxChildWinFactory>(p));
+    maData.push_back(std::move(p));
 }
 
 void SfxChildWinFactArr_Impl::erase( const iterator& it )
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 9624a991a9a3..f208b5ae0686 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -108,7 +108,7 @@ SfxSlotPool* SfxModule::GetSlotPool() const
 }
 
 
-void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
+void SfxModule::RegisterChildWindow(std::unique_ptr<SfxChildWinFactory> pFact)
 {
     DBG_ASSERT( pImpl, "No real Module!" );
 
@@ -125,7 +125,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
         }
     }
 
-    pImpl->pFactArr->push_back( pFact );
+    pImpl->pFactArr->push_back( std::move(pFact) );
 }
 
 
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 8b0a5eb839c8..5df504293d0e 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -216,10 +216,10 @@ void SfxDockingWrapper::RegisterChildWindow (bool bVis, SfxModule *pMod, SfxChil
     for (int i=0; i < NUM_OF_DOCKINGWINDOWS; i++ )
     {
         sal_uInt16 nID = sal_uInt16(SID_DOCKWIN_START+i);
-        SfxChildWinFactory *pFact = new SfxChildWinFactory( SfxDockingWrapper::CreateImpl, nID, 0xffff );
+        auto pFact = o3tl::make_unique<SfxChildWinFactory>( SfxDockingWrapper::CreateImpl, nID, 0xffff );
         pFact->aInfo.nFlags |= nFlags;
         pFact->aInfo.bVisible = bVis;
-        SfxChildWindow::RegisterChildWindow(pMod, pFact);
+        SfxChildWindow::RegisterChildWindow(pMod, std::move(pFact));
     }
 }
 
diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx
index 9d361e212597..c9211edac063 100644
--- a/sfx2/source/inc/childwinimpl.hxx
+++ b/sfx2/source/inc/childwinimpl.hxx
@@ -51,7 +51,7 @@ public:
     size_t size() const;
     const SfxChildWinFactory& operator []( size_t i ) const;
     SfxChildWinFactory& operator []( size_t i );
-    void push_back( SfxChildWinFactory* p );
+    void push_back( std::unique_ptr<SfxChildWinFactory> p );
     void erase( const iterator& it );
 
     iterator begin();


More information about the Libreoffice-commits mailing list