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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jul 19 13:41:09 UTC 2018


 include/svl/style.hxx               |    2 +-
 sc/source/core/data/patattr.cxx     |    2 +-
 sc/source/core/data/stlsheet.cxx    |    2 +-
 sc/source/filter/xml/xmlfonte.cxx   |    2 +-
 svl/source/items/style.cxx          |    4 ++--
 sw/inc/docstyle.hxx                 |    2 +-
 sw/source/core/unocore/unostyle.cxx |    2 +-
 sw/source/uibase/app/docstyle.cxx   |    5 +++--
 8 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit db85d367c266898d4b98fc18c9318b6bcc83725a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 17 16:13:12 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 19 15:40:45 2018 +0200

    return SfxStyleSheetIterator by std::unique_ptr
    
    std::shared_ptr overkill here
    
    Change-Id: I9bd6ee5b92f9c04e0ca48d25eba99e5c232643c7
    Reviewed-on: https://gerrit.libreoffice.org/57570
    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 6f328a2b7143..4bf91c357765 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -255,7 +255,7 @@ public:
     SfxItemPool&                GetPool() { return rPool;}
     const SfxItemPool&          GetPool() const { return rPool;}
 
-    virtual std::shared_ptr<SfxStyleSheetIterator> CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask);
+    virtual std::unique_ptr<SfxStyleSheetIterator> CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask);
     sal_uInt16              Count();
     SfxStyleSheetBase*  operator[](sal_uInt16 nIdx);
 
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 70070fa52ac4..9dbf1bf83773 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1173,7 +1173,7 @@ void ScPatternAttr::UpdateStyleSheet(const ScDocument* pDoc)
         //  Assumes that "Standard" is always the 1st entry!
         if (!pStyle)
         {
-            std::shared_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SfxStyleSearchBits::All );
+            std::unique_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SfxStyleSearchBits::All );
             pStyle = dynamic_cast< ScStyleSheet* >(pIter->First());
         }
 
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index d9a42eb06778..21c24e4ec913 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -97,7 +97,7 @@ bool ScStyleSheet::SetParent( const OUString& rParentName )
     SfxStyleSheetBase* pStyle = m_pPool->Find( aEffName, nFamily );
     if (!pStyle)
     {
-        std::shared_ptr<SfxStyleSheetIterator> pIter = m_pPool->CreateIterator( nFamily, SfxStyleSearchBits::All );
+        std::unique_ptr<SfxStyleSheetIterator> pIter = m_pPool->CreateIterator( nFamily, SfxStyleSearchBits::All );
         pStyle = pIter->First();
         if (pStyle)
             aEffName = pStyle->GetName();
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx
index b4c7e7a8808c..eeb50130fbbc 100644
--- a/sc/source/filter/xml/xmlfonte.cxx
+++ b/sc/source/filter/xml/xmlfonte.cxx
@@ -86,7 +86,7 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP,
     const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool());
     AddFontItems(aEditWhichIds, 3, pEditPool, false);
 
-    std::shared_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, SfxStyleSearchBits::All);
+    std::unique_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, SfxStyleSearchBits::All);
 
     m_bEmbedUsedOnly = rExportP.GetDocument()->IsEmbedUsedFontsOnly();
     m_bEmbedLatinScript = rExportP.GetDocument()->IsEmbedFontScriptLatin();
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 01873c282455..5856393f57e9 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -613,13 +613,13 @@ void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, SfxStyleSearchBit
 }
 
 
-std::shared_ptr<SfxStyleSheetIterator> SfxStyleSheetBasePool::CreateIterator
+std::unique_ptr<SfxStyleSheetIterator> SfxStyleSheetBasePool::CreateIterator
 (
  SfxStyleFamily eFam,
  SfxStyleSearchBits mask
 )
 {
-    return std::make_shared<SfxStyleSheetIterator>(this,eFam,mask);
+    return o3tl::make_unique<SfxStyleSheetIterator>(this,eFam,mask);
 }
 
 SfxStyleSheetBase* SfxStyleSheetBasePool::Create
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 85c7fa4ea558..0e159ac881ca 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -216,7 +216,7 @@ public:
 
     bool    IsOrganizerMode() const         { return bOrganizer; }
 
-    virtual std::shared_ptr<SfxStyleSheetIterator> CreateIterator( SfxStyleFamily, SfxStyleSearchBits nMask ) override;
+    virtual std::unique_ptr<SfxStyleSheetIterator> CreateIterator( SfxStyleFamily, SfxStyleSearchBits nMask ) override;
 
     SwDoc& GetDoc() const { return rDoc; }
 
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index e126864d756d..1f341cad9b35 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -863,7 +863,7 @@ uno::Sequence<OUString> XStyleFamily::getElementNames()
     if(!m_pBasePool)
         throw uno::RuntimeException();
     std::vector<OUString> vRet;
-    std::shared_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SfxStyleSearchBits::All);
+    std::unique_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SfxStyleSearchBits::All);
     for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next())
     {
         OUString sName;
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 2dd0be561f25..0abb4e461d3e 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -68,6 +68,7 @@
 #include <svx/xflftrit.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/drawitem.hxx>
+#include <o3tl/make_unique.hxx>
 
 // The Format names in the list of all names have the
 // following family as their first character:
@@ -2430,9 +2431,9 @@ SfxStyleSheetBase*   SwDocStyleSheetPool::Create( const OUString &,
     return nullptr;
 }
 
-std::shared_ptr<SfxStyleSheetIterator> SwDocStyleSheetPool::CreateIterator( SfxStyleFamily eFam, SfxStyleSearchBits _nMask )
+std::unique_ptr<SfxStyleSheetIterator> SwDocStyleSheetPool::CreateIterator( SfxStyleFamily eFam, SfxStyleSearchBits _nMask )
 {
-    return std::shared_ptr<SfxStyleSheetIterator>(new SwStyleSheetIterator( this, eFam, _nMask ));
+    return o3tl::make_unique<SwStyleSheetIterator>( this, eFam, _nMask );
 }
 
 void SwDocStyleSheetPool::dispose()


More information about the Libreoffice-commits mailing list