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

Noel Grandin noel.grandin at collabora.co.uk
Mon Jun 4 08:07:24 UTC 2018


 include/sfx2/module.hxx           |    2 +-
 sc/inc/scmod.hxx                  |    2 +-
 sc/source/ui/app/scmod.cxx        |    4 ++--
 sd/inc/sdmod.hxx                  |    2 +-
 sd/source/ui/app/sdmod2.cxx       |    4 ++--
 sfx2/source/dialog/mgetempl.cxx   |    2 +-
 sfx2/source/dialog/templdlg.cxx   |    2 +-
 sw/inc/swmodule.hxx               |    2 +-
 sw/source/uibase/app/swmodule.cxx |    4 ++--
 9 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 5ad5f5ec62cc259f054b7343d7b4edce372e95e2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed May 2 14:21:41 2018 +0200

    make CreateStyleFamilies return std::unique_ptr
    
    Change-Id: Ibb7bec9ede8045a6cea42c02f61f14ad36d2b434
    Reviewed-on: https://gerrit.libreoffice.org/53730
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index ef60ed219326..1eb9ef1f414f 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -83,7 +83,7 @@ public:
                                                const SfxItemSet& rSet );
     virtual void                Invalidate(sal_uInt16 nId = 0) override;
 
-    virtual SfxStyleFamilies*   CreateStyleFamilies() { return nullptr; }
+    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() { return nullptr; }
 
     static SfxModule*           GetActiveModule( SfxViewFrame* pFrame=nullptr );
     static FieldUnit            GetCurrentFieldUnit();
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index be90897627be..6d75e15807e6 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -239,7 +239,7 @@ public:
     virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
     virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
     virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
-    virtual SfxStyleFamilies* CreateStyleFamilies() override;
+    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
 
     void                SetInSharedDocLoading( bool bNew )  { m_bIsInSharedDocLoading = bNew; }
     bool                IsInSharedDocLoading() const        { return m_bIsInSharedDocLoading; }
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index fcf1e889bc05..d87fe6dfdc06 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2271,9 +2271,9 @@ bool ScModule::HasThesaurusLanguage( LanguageType nLang )
     return bHasLang;
 }
 
-SfxStyleFamilies* ScModule::CreateStyleFamilies()
+std::unique_ptr<SfxStyleFamilies> ScModule::CreateStyleFamilies()
 {
-    SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+    std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
 
     pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
                                                     ScResId(STR_STYLE_FAMILY_CELL),
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 74160c6a512b..3196bafe07da 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -111,7 +111,7 @@ public:
     virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
     virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
     virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
-    virtual SfxStyleFamilies* CreateStyleFamilies() override;
+    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
 
     SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
     SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 6392abf9bc5d..e3291634a35e 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -808,9 +808,9 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
     return pRet;
 }
 
-SfxStyleFamilies* SdModule::CreateStyleFamilies()
+std::unique_ptr<SfxStyleFamilies> SdModule::CreateStyleFamilies()
 {
-    SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+    std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
 
     pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
                                                     SdResId(STR_GRAPHICS_STYLE_FAMILY),
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 2b29c7e335d1..d930bab81598 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -92,7 +92,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
     else
         m_pEditLinkStyleBtn->Enable();
 
-    pFamilies.reset(SfxApplication::GetModule_Impl()->CreateStyleFamilies());
+    pFamilies = SfxApplication::GetModule_Impl()->CreateStyleFamilies();
 
     SfxStyleSheetBasePool* pPool = nullptr;
     SfxObjectShell* pDocShell = SfxObjectShell::Current();
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 3b9f53f6431c..07e52540baba 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -704,7 +704,7 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
     pCurObjShell = pViewFrame->GetObjectShell();
     pModule = pCurObjShell ? pCurObjShell->GetModule() : nullptr;
     if (pModule)
-        pStyleFamilies.reset(pModule->CreateStyleFamilies());
+        pStyleFamilies = pModule->CreateStyleFamilies();
     if (!pStyleFamilies)
         pStyleFamilies.reset(new SfxStyleFamilies);
 
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 8539f7fd479c..4cca346229eb 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -226,7 +226,7 @@ public:
     virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
     virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
     virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
-    virtual SfxStyleFamilies* CreateStyleFamilies() override;
+    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
 
     // Pool is created here and set at SfxShell.
     void    InitAttrPool();
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 4209f7dba0a9..99775d994d6a 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -400,9 +400,9 @@ void    SwModule::RemoveAttrPool()
     SfxItemPool::Free(m_pAttrPool);
 }
 
-SfxStyleFamilies* SwModule::CreateStyleFamilies()
+std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies()
 {
-    SfxStyleFamilies *pStyleFamilies = new SfxStyleFamilies;
+    std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
 
     pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para,
                                                     SwResId(STR_PARAGRAPHSTYLEFAMILY),


More information about the Libreoffice-commits mailing list