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

Noel (via logerrit) logerrit at kemper.freedesktop.org
Sat Feb 20 06:33:42 UTC 2021


 include/svl/style.hxx             |    4 ++--
 sc/inc/stlpool.hxx                |    2 +-
 sc/source/core/data/stlpool.cxx   |    4 ++--
 sd/inc/stlpool.hxx                |    2 +-
 sd/source/core/stlpool.cxx        |    2 +-
 svl/source/config/itemholder2.cxx |    4 ++--
 svl/source/items/style.cxx        |    4 ++--
 sw/inc/docstyle.hxx               |    2 +-
 sw/source/uibase/app/docstyle.cxx |    2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 66217bc8222537d7358464131a7fa30917a3a960
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Fri Feb 19 16:00:58 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Feb 20 07:33:01 2021 +0100

    loplugin:refcounting in svl
    
    Change-Id: Iae192caa9d05f71ce02aae966ef1d71232d1a7b6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111222
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 4cc856bd5641..bd1b0adb0790 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -237,7 +237,7 @@ protected:
     SfxItemPool&                rPool;
 
     void                        ChangeParent(std::u16string_view rOld, const OUString& rNew, SfxStyleFamily eFamily, bool bVirtual = true);
-    virtual SfxStyleSheetBase*  Create( const OUString&, SfxStyleFamily, SfxStyleSearchBits );
+    virtual rtl::Reference<SfxStyleSheetBase> Create( const OUString&, SfxStyleFamily, SfxStyleSearchBits );
     virtual SfxStyleSheetBase*  Create( const SfxStyleSheetBase& );
 
     virtual                     ~SfxStyleSheetBasePool() override;
@@ -308,7 +308,7 @@ class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool
 {
 protected:
     using SfxStyleSheetBasePool::Create;
-    virtual SfxStyleSheetBase* Create(const OUString&, SfxStyleFamily, SfxStyleSearchBits mask) override;
+    virtual rtl::Reference<SfxStyleSheetBase> Create(const OUString&, SfxStyleFamily, SfxStyleSearchBits mask) override;
 
 public:
     SfxStyleSheetPool( SfxItemPool const& );
diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx
index 012d4b714658..b4a5c312d6ea 100644
--- a/sc/inc/stlpool.hxx
+++ b/sc/inc/stlpool.hxx
@@ -63,7 +63,7 @@ private:
 
     using SfxStyleSheetPool::Create;    // calcwarnings: Create(const SfxStyleSheet&) - ever used?
 
-    virtual SfxStyleSheetBase* Create( const OUString&  rName,
+    virtual rtl::Reference<SfxStyleSheetBase> Create( const OUString&  rName,
                                        SfxStyleFamily   eFamily,
                                        SfxStyleSearchBits     nMask) override;
     virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& rStyle ) override;
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index d1e831e0dd88..3654799790da 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -96,11 +96,11 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName,
     return SfxStyleSheetPool::Make( ScStyleNameConversion::ProgrammaticToDisplayName( rName, eFam), eFam, mask);
 }
 
-SfxStyleSheetBase* ScStyleSheetPool::Create( const OUString&   rName,
+rtl::Reference<SfxStyleSheetBase> ScStyleSheetPool::Create( const OUString&   rName,
                                              SfxStyleFamily  eFamily,
                                              SfxStyleSearchBits nMaskP )
 {
-    ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP );
+    rtl::Reference<ScStyleSheet> pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP );
     if ( eFamily == SfxStyleFamily::Para && ScResId(STR_STYLENAME_STANDARD) != rName )
         pSheet->SetParent( ScResId(STR_STYLENAME_STANDARD) );
 
diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx
index 6512ff74d9cc..dbe38d63828f 100644
--- a/sd/inc/stlpool.hxx
+++ b/sd/inc/stlpool.hxx
@@ -122,7 +122,7 @@ private:
     void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, StyleSheetCopyResultVector& rCreatedSheets );
     void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, StyleSheetCopyResultVector& rCreatedSheets, std::u16string_view rRenameSuffix );
 
-    virtual SfxStyleSheetBase* Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits nMask) override;
+    virtual rtl::Reference<SfxStyleSheetBase> Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits nMask) override;
 
     using  SfxStyleSheetPool::Create;
     virtual ~SdStyleSheetPool() override;
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 8345ba75ed60..e03b4ca17399 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -130,7 +130,7 @@ SdStyleSheetPool::~SdStyleSheetPool()
     DBG_ASSERT( mpDoc == nullptr, "sd::SdStyleSheetPool::~SdStyleSheetPool(), dispose me first!" );
 }
 
-SfxStyleSheetBase* SdStyleSheetPool::Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits _nMask )
+rtl::Reference<SfxStyleSheetBase> SdStyleSheetPool::Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits _nMask )
 {
     return new SdStyleSheet(rName, *this, eFamily, _nMask);
 }
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index 564f11c88f33..35e9e3da2550 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -24,7 +24,7 @@
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
-
+#include <rtl/ref.hxx>
 #include <svl/cjkoptions.hxx>
 #include <svl/ctloptions.hxx>
 #include <tools/diagnose_ex.h>
@@ -65,7 +65,7 @@ ItemHolder2::~ItemHolder2()
 
 void ItemHolder2::holdConfigItem(EItem eItem)
 {
-    static ItemHolder2* pHolder = new ItemHolder2();
+    static rtl::Reference<ItemHolder2> pHolder = new ItemHolder2();
     pHolder->impl_addItem(eItem);
 }
 
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 617b42e41cdc..5b430259de2a 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -605,7 +605,7 @@ std::unique_ptr<SfxStyleSheetIterator> SfxStyleSheetBasePool::CreateIterator
     return std::make_unique<SfxStyleSheetIterator>(this,eFam,mask);
 }
 
-SfxStyleSheetBase* SfxStyleSheetBasePool::Create
+rtl::Reference<SfxStyleSheetBase> SfxStyleSheetBasePool::Create
 (
     const OUString& rName,
     SfxStyleFamily eFam,
@@ -873,7 +873,7 @@ SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool const& rSet)
 {
 }
 
-SfxStyleSheetBase* SfxStyleSheetPool::Create( const OUString& rName,
+rtl::Reference<SfxStyleSheetBase> SfxStyleSheetPool::Create( const OUString& rName,
                                               SfxStyleFamily eFam, SfxStyleSearchBits mask )
 {
     return new SfxStyleSheet( rName, *this, eFam, mask );
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 30f176bf0633..90ad2f61ff7c 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -197,7 +197,7 @@ class SwDocStyleSheetPool : public SfxStyleSheetBasePool
     SwDoc&              rDoc;
     bool                bOrganizer : 1;     ///< Organizer
 
-    virtual SfxStyleSheetBase* Create( const OUString&, SfxStyleFamily, SfxStyleSearchBits nMask) override;
+    virtual rtl::Reference<SfxStyleSheetBase> Create( const OUString&, SfxStyleFamily, SfxStyleSearchBits nMask) override;
     virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ) override;
 
     using SfxStyleSheetBasePool::Find;
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 9d27ef06338b..102afc1a3253 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2434,7 +2434,7 @@ SfxStyleSheetBase*   SwDocStyleSheetPool::Create( const SfxStyleSheetBase& /*rOr
     return nullptr;
 }
 
-SfxStyleSheetBase*   SwDocStyleSheetPool::Create( const OUString &,
+rtl::Reference<SfxStyleSheetBase> SwDocStyleSheetPool::Create( const OUString &,
                                                   SfxStyleFamily, SfxStyleSearchBits )
 {
     OSL_ENSURE( false, "Create in SW-Stylesheet-Pool not possible" );


More information about the Libreoffice-commits mailing list