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

Mark Page aptitude at btconnect.com
Sat Jun 4 09:46:15 UTC 2016


 editeng/source/editeng/impedit4.cxx   |    2 -
 include/svl/style.hxx                 |    5 ----
 include/svl/stylepool.hxx             |    8 ++-----
 sc/source/core/data/patattr.cxx       |    2 -
 sc/source/core/data/stlsheet.cxx      |    2 -
 sc/source/filter/xml/xmlfonte.cxx     |    2 -
 sd/source/core/stlfamily.cxx          |   14 ++++++-------
 sd/source/filter/ppt/pptin.cxx        |    2 -
 svl/source/items/style.cxx            |    4 +--
 svl/source/items/stylepool.cxx        |   36 +++++++++++++++++-----------------
 sw/inc/docstyle.hxx                   |    2 -
 sw/inc/istyleaccess.hxx               |    8 +++----
 sw/inc/unostyle.hxx                   |    5 +---
 sw/source/core/doc/swstylemanager.cxx |   30 ++++++++++++++--------------
 sw/source/core/txtnode/thints.cxx     |    4 +--
 sw/source/core/unocore/unoobj.cxx     |    2 -
 sw/source/core/unocore/unostyle.cxx   |   20 +++++++++---------
 sw/source/uibase/app/docstyle.cxx     |    4 +--
 sw/source/uibase/uno/unotxdoc.cxx     |    4 +--
 19 files changed, 75 insertions(+), 81 deletions(-)

New commits:
commit 954f853c7b776719a6dfd5230d2be6ea3e948fcf
Author: Mark Page <aptitude at btconnect.com>
Date:   Fri Jun 3 08:13:31 2016 +0100

    tdf#96099 Remove sfx std::shared_ptr typedefs
    
    Removed SfxItemSet_Pointer_t and SfxStyleSheetIteratorPtr
    
    Change-Id: Ibfa6a79809fdbbe2648dacc02625e620ceaf9bf0
    Reviewed-on: https://gerrit.libreoffice.org/25851
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index f38fcbf..c8ef314 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -457,7 +457,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
     // StyleSheets...
     if ( GetStyleSheetPool() )
     {
-        SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(GetStyleSheetPool(),
+        std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(GetStyleSheetPool(),
                 SfxStyleFamily::All);
         // fill aStyleSheetToIdMap
         sal_uInt32 nId = 1;
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index bbd9c88..197c938 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -182,9 +182,6 @@ private:
 friend class SfxStyleSheetBasePool;
 };
 
-typedef std::shared_ptr< SfxStyleSheetIterator > SfxStyleSheetIteratorPtr;
-
-
 class SfxStyleSheetBasePool_Impl;
 
 class SVL_DLLPUBLIC SfxStyleSheetBasePool: public SfxBroadcaster, public comphelper::OWeakTypeObject
@@ -224,7 +221,7 @@ public:
     SfxItemPool&                GetPool() { return rPool;}
     const SfxItemPool&          GetPool() const { return rPool;}
 
-    virtual SfxStyleSheetIteratorPtr CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
+    virtual std::shared_ptr<SfxStyleSheetIterator> CreateIterator(SfxStyleFamily, sal_uInt16 nMask);
     sal_uInt16              Count();
     SfxStyleSheetBase*  operator[](sal_uInt16 nIdx);
 
diff --git a/include/svl/stylepool.hxx b/include/svl/stylepool.hxx
index 461ba2f..71b0b57 100644
--- a/include/svl/stylepool.hxx
+++ b/include/svl/stylepool.hxx
@@ -31,8 +31,6 @@ class SVL_DLLPUBLIC StylePool
 private:
     std::unique_ptr<StylePoolImpl> pImpl;
 public:
-    typedef std::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
-
     explicit StylePool( SfxItemSet* pIgnorableItems = nullptr );
 
     /** Insert a SfxItemSet into the style pool.
@@ -44,7 +42,7 @@ public:
 
         @return a shared pointer to the SfxItemSet
     */
-    SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet );
+    std::shared_ptr<SfxItemSet> insertItemSet( const SfxItemSet& rSet );
 
     /** Create an iterator
 
@@ -69,7 +67,7 @@ public:
 
     virtual ~StylePool();
 
-    static OUString nameOf( const SfxItemSet_Pointer_t& pSet );
+    static OUString nameOf( const std::shared_ptr<SfxItemSet>& pSet );
 };
 
 class SVL_DLLPUBLIC IStylePoolIteratorAccess
@@ -78,7 +76,7 @@ public:
     /** Delivers a shared pointer to the next SfxItemSet of the pool
         If there is no more SfxItemSet, the delivered share_pointer is empty.
     */
-    virtual StylePool::SfxItemSet_Pointer_t getNext() = 0;
+    virtual std::shared_ptr<SfxItemSet> getNext() = 0;
     virtual ~IStylePoolIteratorAccess() {};
 };
 #endif
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index ba4476a..002decf 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1252,7 +1252,7 @@ void ScPatternAttr::UpdateStyleSheet(ScDocument* pDoc)
         //  Assumes that "Standard" is always the 1st entry!
         if (!pStyle)
         {
-            SfxStyleSheetIteratorPtr pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SFXSTYLEBIT_ALL );
+            std::shared_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SFXSTYLEBIT_ALL );
             pStyle = dynamic_cast< ScStyleSheet* >(pIter->First());
         }
 
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 30f302d..4ec5248 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -94,7 +94,7 @@ bool ScStyleSheet::SetParent( const OUString& rParentName )
     SfxStyleSheetBase* pStyle = pPool->Find( aEffName, nFamily );
     if (!pStyle)
     {
-        SfxStyleSheetIteratorPtr pIter = pPool->CreateIterator( nFamily, SFXSTYLEBIT_ALL );
+        std::shared_ptr<SfxStyleSheetIterator> pIter = pPool->CreateIterator( nFamily, SFXSTYLEBIT_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 4654add..cc1f82f 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);
 
-    SfxStyleSheetIteratorPtr pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, 0xFFFF);
+    std::shared_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, 0xFFFF);
 
     if(pItr)
     {
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index cb2876c..7d7e5fc 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -74,7 +74,7 @@ PresStyleMap& SdStyleFamilyImpl::getStyleSheets()
             maStyleSheets.clear();
 
             // The iterator will return only style sheets of family master page
-            SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), SD_STYLE_FAMILY_MASTERPAGE);
+            std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), SD_STYLE_FAMILY_MASTERPAGE);
             for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                      pStyle = aSSSIterator->Next() )
             {
@@ -144,7 +144,7 @@ SdStyleSheet* SdStyleFamily::GetSheetByName( const OUString& rName ) throw(NoSuc
         }
         else
         {
-            SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+            std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
             for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                      pStyle = aSSSIterator->Next() )
             {
@@ -245,7 +245,7 @@ Sequence< OUString > SAL_CALL SdStyleFamily::getElementNames() throw(RuntimeExce
     else
     {
         std::vector< OUString > aNames;
-        SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+        std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
         for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                  pStyle = aSSSIterator->Next() )
         {
@@ -275,7 +275,7 @@ sal_Bool SAL_CALL SdStyleFamily::hasByName( const OUString& aName ) throw(Runtim
         }
         else
         {
-            SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+            std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
             for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                      pStyle = aSSSIterator->Next() )
             {
@@ -313,7 +313,7 @@ sal_Bool SAL_CALL SdStyleFamily::hasElements() throw(RuntimeException, std::exce
     }
     else
     {
-        SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+        std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
         if (aSSSIterator->First())
         {
             return true;
@@ -337,7 +337,7 @@ sal_Int32 SAL_CALL SdStyleFamily::getCount() throw(RuntimeException, std::except
     }
     else
     {
-        SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+        std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
         for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                  pStyle = aSSSIterator->Next() )
         {
@@ -370,7 +370,7 @@ Any SAL_CALL SdStyleFamily::getByIndex( sal_Int32 Index ) throw(IndexOutOfBounds
         }
         else
         {
-            SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
+            std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(mxPool.get(), mnFamily);
             for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle;
                                      pStyle = aSSSIterator->Next() )
             {
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index f8d2d04..bf856db 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -141,7 +141,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt
     {
         // iterate over all styles
         SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool();
-        SfxStyleSheetIteratorPtr aIter =
+        std::shared_ptr<SfxStyleSheetIterator> aIter =
                 std::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SfxStyleFamily::All);
 
         for (SfxStyleSheetBase *pSheet = aIter->First(); pSheet; pSheet = aIter->Next())
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 37de8ad..aed9c53 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -87,7 +87,7 @@ private:
     SfxStyleSheetBasePool_Impl(const SfxStyleSheetBasePool_Impl&) = delete;
     SfxStyleSheetBasePool_Impl& operator=(const SfxStyleSheetBasePool_Impl&) = delete;
 public:
-    SfxStyleSheetIteratorPtr pIter;
+    std::shared_ptr<SfxStyleSheetIterator> pIter;
 
     /** This member holds the indexed style sheets.
      *
@@ -630,7 +630,7 @@ void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n)
 }
 
 
-SfxStyleSheetIteratorPtr SfxStyleSheetBasePool::CreateIterator
+std::shared_ptr<SfxStyleSheetIterator> SfxStyleSheetBasePool::CreateIterator
 (
  SfxStyleFamily eFam,
  sal_uInt16 mask
diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx
index f260672..6df2501 100644
--- a/svl/source/items/stylepool.cxx
+++ b/svl/source/items/stylepool.cxx
@@ -36,7 +36,7 @@ namespace {
         std::vector<Node*> mChildren; // child nodes, create by findChildNode(..)
         // container of shared pointers of inserted item sets; for non-poolable
         // items more than one item set is needed
-        std::vector< StylePool::SfxItemSet_Pointer_t > maItemSet;
+        std::vector< std::shared_ptr<SfxItemSet> > maItemSet;
         const SfxPoolItem *mpItem;   // my pool item
         Node *mpUpper;               // if I'm a child node that's my parent node
         // #i86923#
@@ -61,12 +61,12 @@ namespace {
         // #i86923#
         bool hasItemSet( const bool bCheckUsage ) const;
         // #i87808#
-        const StylePool::SfxItemSet_Pointer_t getItemSet() const
+        const std::shared_ptr<SfxItemSet> getItemSet() const
         {
             return maItemSet.back();
         }
-        const StylePool::SfxItemSet_Pointer_t getUsedOrLastAddedItemSet() const;
-        void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( StylePool::SfxItemSet_Pointer_t( rSet.Clone() ) ); }
+        const std::shared_ptr<SfxItemSet> getUsedOrLastAddedItemSet() const;
+        void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( std::shared_ptr<SfxItemSet>( rSet.Clone() ) ); }
         // #i86923#
         Node* findChildNode( const SfxPoolItem& rItem,
                              const bool bIsItemIgnorable = false );
@@ -76,14 +76,14 @@ namespace {
         const SfxPoolItem& getPoolItem() const { return *mpItem; }
         // #i86923#
         bool hasIgnorableChildren( const bool bCheckUsage ) const;
-        const StylePool::SfxItemSet_Pointer_t getItemSetOfIgnorableChild(
+        const std::shared_ptr<SfxItemSet> getItemSetOfIgnorableChild(
                                         const bool bSkipUnusedItemSets ) const;
     };
 
     // #i87808#
-    const StylePool::SfxItemSet_Pointer_t Node::getUsedOrLastAddedItemSet() const
+    const std::shared_ptr<SfxItemSet> Node::getUsedOrLastAddedItemSet() const
     {
-        std::vector< StylePool::SfxItemSet_Pointer_t >::const_reverse_iterator aIter;
+        std::vector< std::shared_ptr<SfxItemSet> >::const_reverse_iterator aIter;
 
         for ( aIter = maItemSet.rbegin(); aIter != maItemSet.rend(); ++aIter )
         {
@@ -105,7 +105,7 @@ namespace {
         {
             if ( bCheckUsage )
             {
-                std::vector< StylePool::SfxItemSet_Pointer_t >::const_reverse_iterator aIter;
+                std::vector< std::shared_ptr<SfxItemSet> >::const_reverse_iterator aIter;
 
                 for ( aIter = maItemSet.rbegin(); aIter != maItemSet.rend(); ++aIter )
                 {
@@ -230,7 +230,7 @@ namespace {
         return bHasIgnorableChildren;
     }
 
-    const StylePool::SfxItemSet_Pointer_t Node::getItemSetOfIgnorableChild(
+    const std::shared_ptr<SfxItemSet> Node::getItemSetOfIgnorableChild(
                                         const bool bSkipUnusedItemSets ) const
     {
         DBG_ASSERT( hasIgnorableChildren( bSkipUnusedItemSets ),
@@ -258,7 +258,7 @@ namespace {
             ++aIter;
         }
 
-        StylePool::SfxItemSet_Pointer_t pReturn;
+        std::shared_ptr<SfxItemSet> pReturn;
         return pReturn;
     }
 
@@ -291,12 +291,12 @@ namespace {
               mbSkipUnusedItemSets( bSkipUnusedItemSets ),
               mbSkipIgnorable( bSkipIgnorable )
         {}
-        virtual StylePool::SfxItemSet_Pointer_t getNext() override;
+        virtual std::shared_ptr<SfxItemSet> getNext() override;
     };
 
-    StylePool::SfxItemSet_Pointer_t Iterator::getNext()
+    std::shared_ptr<SfxItemSet> Iterator::getNext()
     {
-        StylePool::SfxItemSet_Pointer_t pReturn;
+        std::shared_ptr<SfxItemSet> pReturn;
         while( mpNode || mpCurrNode != mrRoot.end() )
         {
             if( !mpNode )
@@ -332,7 +332,7 @@ namespace {
  * This static method creates a unique name from a shared pointer to a SfxItemSet
  * The name is the memory address of the SfxItemSet itself.
  */
-OUString StylePool::nameOf( const SfxItemSet_Pointer_t& pSet )
+OUString StylePool::nameOf( const std::shared_ptr<SfxItemSet>& pSet )
 {
     return OUString::number( reinterpret_cast<sal_IntPtr>( pSet.get() ), 16 );
 }
@@ -368,14 +368,14 @@ public:
         delete mpIgnorableItems;
     }
 
-    StylePool::SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet );
+    std::shared_ptr<SfxItemSet> insertItemSet( const SfxItemSet& rSet );
 
     // #i86923#
     IStylePoolIteratorAccess* createIterator( bool bSkipUnusedItemSets = false,
                                               bool bSkipIgnorableItems = false );
 };
 
-StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& rSet )
+std::shared_ptr<SfxItemSet> StylePoolImpl::insertItemSet( const SfxItemSet& rSet )
 {
     bool bNonPoolable = false;
     Node* pCurNode = &maRoot[ rSet.GetParent() ];
@@ -428,7 +428,7 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet&
     {
         sal_Int32 nCheck = -1;
         IStylePoolIteratorAccess* pIter = createIterator();
-        StylePool::SfxItemSet_Pointer_t pTemp;
+        std::shared_ptr<SfxItemSet> pTemp;
         do
         {
             ++nCheck;
@@ -454,7 +454,7 @@ StylePool::StylePool( SfxItemSet* pIgnorableItems )
     : pImpl( new StylePoolImpl( pIgnorableItems ) )
 {}
 
-StylePool::SfxItemSet_Pointer_t StylePool::insertItemSet( const SfxItemSet& rSet )
+std::shared_ptr<SfxItemSet> StylePool::insertItemSet( const SfxItemSet& rSet )
 { return pImpl->insertItemSet( rSet ); }
 
 // #i86923#
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index df1d070..a58ba3a 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -213,7 +213,7 @@ public:
 
     bool    IsOrganizerMode() const         { return bOrganizer; }
 
-    virtual SfxStyleSheetIteratorPtr CreateIterator( SfxStyleFamily, sal_uInt16 nMask ) override;
+    virtual std::shared_ptr<SfxStyleSheetIterator> CreateIterator( SfxStyleFamily, sal_uInt16 nMask ) override;
 
     SwDoc& GetDoc() const { return rDoc; }
 
diff --git a/sw/inc/istyleaccess.hxx b/sw/inc/istyleaccess.hxx
index f961ea4..1f47ee8 100644
--- a/sw/inc/istyleaccess.hxx
+++ b/sw/inc/istyleaccess.hxx
@@ -36,17 +36,17 @@ public:
 
     virtual ~IStyleAccess() {}
 
-    virtual StylePool::SfxItemSet_Pointer_t getAutomaticStyle( const SfxItemSet& rSet,
+    virtual std::shared_ptr<SfxItemSet> getAutomaticStyle( const SfxItemSet& rSet,
                                                                SwAutoStyleFamily eFamily ) = 0;
-    virtual void getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t> &rStyles,
+    virtual void getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rStyles,
                                                                SwAutoStyleFamily eFamily ) = 0;
     /** It's slow to iterate through a stylepool looking for a special name, but if
      the style has been inserted via "cacheAutomaticStyle" instead of "getAutomaticStyle",
      it's faster */
-    virtual StylePool::SfxItemSet_Pointer_t getByName( const OUString& rName,
+    virtual std::shared_ptr<SfxItemSet> getByName( const OUString& rName,
                                                                SwAutoStyleFamily eFamily ) = 0;
     /// insert the style to the pool and the cache (used during import)
-    virtual StylePool::SfxItemSet_Pointer_t cacheAutomaticStyle( const SfxItemSet& rSet,
+    virtual std::shared_ptr<SfxItemSet> cacheAutomaticStyle( const SfxItemSet& rSet,
                                                                SwAutoStyleFamily eFamily ) = 0;
     /// To release the cached styles (shared_pointer!)
     virtual void clearCaches() = 0;
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 9b59091..43e438d 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -53,7 +53,6 @@ namespace sw
 {
     class XStyleFamily;
 };
-typedef std::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
 
 class SwXStyleFamilies :  public cppu::WeakImplHelper
 <
@@ -202,7 +201,7 @@ class SwXAutoStyle : public cppu::WeakImplHelper
     public SwClient
 {
 private:
-    SfxItemSet_Pointer_t                mpSet;
+    std::shared_ptr<SfxItemSet>                mpSet;
     IStyleAccess::SwAutoStyleFamily     meFamily;
     SwDoc&                              mrDoc;
 
@@ -210,7 +209,7 @@ private:
 
 public:
 
-    SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam );
+    SwXAutoStyle( SwDoc* pDoc, std::shared_ptr<SfxItemSet> pInitSet, IStyleAccess::SwAutoStyleFamily eFam );
     virtual ~SwXAutoStyle();
 
     //XPropertySet
diff --git a/sw/source/core/doc/swstylemanager.cxx b/sw/source/core/doc/swstylemanager.cxx
index e5be8bc..a4fbc5c 100644
--- a/sw/source/core/doc/swstylemanager.cxx
+++ b/sw/source/core/doc/swstylemanager.cxx
@@ -27,7 +27,7 @@
 #include <unordered_map>
 
 typedef std::unordered_map< OUString,
-                            StylePool::SfxItemSet_Pointer_t,
+                            std::shared_ptr<SfxItemSet>,
                             OUStringHash > SwStyleNameCache;
 
 class SwStyleCache
@@ -35,16 +35,16 @@ class SwStyleCache
     SwStyleNameCache mMap;
 public:
     SwStyleCache() {}
-    void addStyleName( const StylePool::SfxItemSet_Pointer_t& pStyle )
+    void addStyleName( const std::shared_ptr<SfxItemSet>& pStyle )
         { mMap[ StylePool::nameOf(pStyle) ] = pStyle; }
     void addCompletePool( StylePool& rPool );
-    StylePool::SfxItemSet_Pointer_t getByName( const OUString& rName ) { return mMap[rName]; }
+    std::shared_ptr<SfxItemSet> getByName( const OUString& rName ) { return mMap[rName]; }
 };
 
 void SwStyleCache::addCompletePool( StylePool& rPool )
 {
     IStylePoolIteratorAccess *pIter = rPool.createIterator();
-    StylePool::SfxItemSet_Pointer_t pStyle = pIter->getNext();
+    std::shared_ptr<SfxItemSet> pStyle = pIter->getNext();
     while( pStyle.get() )
     {
         OUString aName( StylePool::nameOf(pStyle) );
@@ -70,13 +70,13 @@ public:
           mpParaCache(nullptr)
     {}
     virtual ~SwStyleManager();
-    virtual StylePool::SfxItemSet_Pointer_t getAutomaticStyle( const SfxItemSet& rSet,
+    virtual std::shared_ptr<SfxItemSet> getAutomaticStyle( const SfxItemSet& rSet,
                                                                IStyleAccess::SwAutoStyleFamily eFamily ) override;
-    virtual StylePool::SfxItemSet_Pointer_t getByName( const OUString& rName,
+    virtual std::shared_ptr<SfxItemSet> getByName( const OUString& rName,
                                                                IStyleAccess::SwAutoStyleFamily eFamily ) override;
-    virtual void getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t> &rStyles,
+    virtual void getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rStyles,
                                                                IStyleAccess::SwAutoStyleFamily eFamily ) override;
-    virtual StylePool::SfxItemSet_Pointer_t cacheAutomaticStyle( const SfxItemSet& rSet,
+    virtual std::shared_ptr<SfxItemSet> cacheAutomaticStyle( const SfxItemSet& rSet,
                                                                SwAutoStyleFamily eFamily ) override;
     virtual void clearCaches() override;
 };
@@ -100,18 +100,18 @@ void SwStyleManager::clearCaches()
     mpParaCache = nullptr;
 }
 
-StylePool::SfxItemSet_Pointer_t SwStyleManager::getAutomaticStyle( const SfxItemSet& rSet,
+std::shared_ptr<SfxItemSet> SwStyleManager::getAutomaticStyle( const SfxItemSet& rSet,
                                                                    IStyleAccess::SwAutoStyleFamily eFamily )
 {
     StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
     return rAutoPool.insertItemSet( rSet );
 }
 
-StylePool::SfxItemSet_Pointer_t SwStyleManager::cacheAutomaticStyle( const SfxItemSet& rSet,
+std::shared_ptr<SfxItemSet> SwStyleManager::cacheAutomaticStyle( const SfxItemSet& rSet,
                                                                    IStyleAccess::SwAutoStyleFamily eFamily )
 {
     StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
-    StylePool::SfxItemSet_Pointer_t pStyle = rAutoPool.insertItemSet( rSet );
+    std::shared_ptr<SfxItemSet> pStyle = rAutoPool.insertItemSet( rSet );
     SwStyleCache* &rpCache = eFamily == IStyleAccess::AUTO_STYLE_CHAR ?
                              mpCharCache : mpParaCache;
     if( !rpCache )
@@ -120,14 +120,14 @@ StylePool::SfxItemSet_Pointer_t SwStyleManager::cacheAutomaticStyle( const SfxIt
     return pStyle;
 }
 
-StylePool::SfxItemSet_Pointer_t SwStyleManager::getByName( const OUString& rName,
+std::shared_ptr<SfxItemSet> SwStyleManager::getByName( const OUString& rName,
                                                            IStyleAccess::SwAutoStyleFamily eFamily )
 {
     StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
     SwStyleCache* &rpCache = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? mpCharCache : mpParaCache;
     if( !rpCache )
         rpCache = new SwStyleCache();
-    StylePool::SfxItemSet_Pointer_t pStyle = rpCache->getByName( rName );
+    std::shared_ptr<SfxItemSet> pStyle = rpCache->getByName( rName );
     if( !pStyle.get() )
     {
         // Ok, ok, it's allowed to ask for uncached styles (from UNO) but it should not be done
@@ -139,13 +139,13 @@ StylePool::SfxItemSet_Pointer_t SwStyleManager::getByName( const OUString& rName
     return pStyle;
 }
 
-void SwStyleManager::getAllStyles( std::vector<StylePool::SfxItemSet_Pointer_t> &rStyles,
+void SwStyleManager::getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rStyles,
                                    IStyleAccess::SwAutoStyleFamily eFamily )
 {
     StylePool& rAutoPool = eFamily == IStyleAccess::AUTO_STYLE_CHAR ? aAutoCharPool : aAutoParaPool;
     // setup <StylePool> iterator, which skips unused styles and ignorable items
     IStylePoolIteratorAccess *pIter = rAutoPool.createIterator( true, true );
-    StylePool::SfxItemSet_Pointer_t pStyle = pIter->getNext();
+    std::shared_ptr<SfxItemSet> pStyle = pIter->getNext();
     while( pStyle.get() )
     {
         rStyles.push_back( pStyle );
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index fa2f73c..b2228ec5 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1004,7 +1004,7 @@ SwTextAttr* MakeTextAttr(
     {
         // If the attribute is an auto-style which refers to a pool that is
         // different from rDoc's pool, we have to correct this:
-        const StylePool::SfxItemSet_Pointer_t pAutoStyle = static_cast<const SwFormatAutoFormat&>(rAttr).GetStyleHandle();
+        const std::shared_ptr<SfxItemSet> pAutoStyle = static_cast<const SwFormatAutoFormat&>(rAttr).GetStyleHandle();
         std::unique_ptr<const SfxItemSet> pNewSet(
                 pAutoStyle->SfxItemSet::Clone( true, &rDoc.GetAttrPool() ));
         SwTextAttr* pNew = MakeTextAttr( rDoc, *pNewSet, nStt, nEnd );
@@ -1105,7 +1105,7 @@ SwTextAttr* MakeTextAttr( SwDoc & rDoc, const SfxItemSet& rSet,
                         sal_Int32 nStt, sal_Int32 nEnd )
 {
     IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess();
-    const StylePool::SfxItemSet_Pointer_t pAutoStyle = rStyleAccess.getAutomaticStyle( rSet, IStyleAccess::AUTO_STYLE_CHAR );
+    const std::shared_ptr<SfxItemSet> pAutoStyle = rStyleAccess.getAutomaticStyle( rSet, IStyleAccess::AUTO_STYLE_CHAR );
     SwFormatAutoFormat aNewAutoFormat;
     aNewAutoFormat.SetStyleHandle( pAutoStyle );
     SwTextAttr* pNew = MakeTextAttr( rDoc, aNewAutoFormat, nStt, nEnd );
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 600c393..658a5c2 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -241,7 +241,7 @@ throw (lang::IllegalArgumentException)
     {
          throw lang::IllegalArgumentException();
     }
-    StylePool::SfxItemSet_Pointer_t pStyle = bPara ?
+    std::shared_ptr<SfxItemSet> pStyle = bPara ?
         rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_PARA ):
         rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_CHAR );
     if(pStyle.get())
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 07c0c518..0adfc3f 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -817,7 +817,7 @@ uno::Any XStyleFamily::getByName(const OUString& rName)
     SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId, true);
     if(!m_pBasePool)
         throw uno::RuntimeException();
-    SfxStyleSheetIteratorPtr pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
+    std::shared_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
     SfxStyleSheetBase* pBase = pIt->Find(sStyleName);
     if(!pBase)
         throw container::NoSuchElementException();
@@ -833,7 +833,7 @@ uno::Sequence<OUString> XStyleFamily::getElementNames() throw( uno::RuntimeExcep
     if(!m_pBasePool)
         throw uno::RuntimeException();
     std::vector<OUString> vRet;
-    SfxStyleSheetIteratorPtr pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
+    std::shared_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
     for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next())
     {
         OUString sName;
@@ -850,7 +850,7 @@ sal_Bool XStyleFamily::hasByName(const OUString& rName) throw( uno::RuntimeExcep
         throw uno::RuntimeException();
     OUString sStyleName;
     SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.m_aPoolId, true);
-    SfxStyleSheetIteratorPtr pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
+    std::shared_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->CreateIterator(m_rEntry.m_eFamily, SFXSTYLEBIT_ALL);
     SfxStyleSheetBase* pBase = pIt->Find(sStyleName);
     return nullptr != pBase;
 }
@@ -3261,14 +3261,14 @@ const IStyleAccess::SwAutoStyleFamily aAutoStyleByIndex[] =
 
 class SwAutoStylesEnumImpl
 {
-    std::vector<SfxItemSet_Pointer_t> mAutoStyles;
-    std::vector<SfxItemSet_Pointer_t>::iterator aIter;
+    std::vector<std::shared_ptr<SfxItemSet>> mAutoStyles;
+    std::vector<std::shared_ptr<SfxItemSet>>::iterator aIter;
     SwDoc* pDoc;
     IStyleAccess::SwAutoStyleFamily eFamily;
 public:
     SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAutoStyleFamily eFam );
     bool hasMoreElements() { return aIter != mAutoStyles.end(); }
-    SfxItemSet_Pointer_t nextElement() { return *(aIter++); }
+    std::shared_ptr<SfxItemSet> nextElement() { return *(aIter++); }
     IStyleAccess::SwAutoStyleFamily getFamily() const { return eFamily; }
     SwDoc* getDoc() const { return pDoc; }
 };
@@ -3624,7 +3624,7 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle(
     m_pDocShell->GetDoc()->CheckForUniqueItemForLineFillNameOrIndex(aSet);
 
     // AutomaticStyle creation
-    SfxItemSet_Pointer_t pSet = m_pDocShell->GetDoc()->GetIStyleAccess().cacheAutomaticStyle( aSet, m_eFamily );
+    std::shared_ptr<SfxItemSet> pSet = m_pDocShell->GetDoc()->GetIStyleAccess().cacheAutomaticStyle( aSet, m_eFamily );
     uno::Reference<style::XAutoStyle> xRet = new SwXAutoStyle(m_pDocShell->GetDoc(), pSet, m_eFamily);
 
     return xRet;
@@ -3668,7 +3668,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut
                 if ( aRubyMap.find( aPair ) == aRubyMap.end() )
                 {
                     aRubyMap.insert( aPair );
-                    SfxItemSet_Pointer_t pItemSet( new SfxItemSet( rAttrPool, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY ) );
+                    std::shared_ptr<SfxItemSet> pItemSet( new SfxItemSet( rAttrPool, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY ) );
                     pItemSet->Put( *pItem );
                     mAutoStyles.push_back( pItemSet );
                 }
@@ -3721,7 +3721,7 @@ uno::Any SwXAutoStylesEnumerator::nextElement(  )
     uno::Any aRet;
     if( m_pImpl->hasMoreElements() )
     {
-        SfxItemSet_Pointer_t pNextSet = m_pImpl->nextElement();
+        std::shared_ptr<SfxItemSet> pNextSet = m_pImpl->nextElement();
         uno::Reference< style::XAutoStyle > xAutoStyle = new SwXAutoStyle(m_pImpl->getDoc(),
                                                         pNextSet, m_pImpl->getFamily());
         aRet <<= xAutoStyle;
@@ -3738,7 +3738,7 @@ uno::Any SwXAutoStylesEnumerator::nextElement(  )
 
 SwXAutoStyle::SwXAutoStyle(
     SwDoc* pDoc,
-    SfxItemSet_Pointer_t pInitSet,
+    std::shared_ptr<SfxItemSet> pInitSet,
     IStyleAccess::SwAutoStyleFamily eFam)
 :   mpSet(pInitSet),
     meFamily(eFam),
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 52001b9..dde0a14 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2326,9 +2326,9 @@ SfxStyleSheetBase*   SwDocStyleSheetPool::Create( const OUString &,
     return nullptr;
 }
 
-SfxStyleSheetIteratorPtr SwDocStyleSheetPool::CreateIterator( SfxStyleFamily eFam, sal_uInt16 _nMask )
+std::shared_ptr<SfxStyleSheetIterator> SwDocStyleSheetPool::CreateIterator( SfxStyleFamily eFam, sal_uInt16 _nMask )
 {
-    return SfxStyleSheetIteratorPtr(new SwStyleSheetIterator( this, eFam, _nMask ));
+    return std::shared_ptr<SfxStyleSheetIterator>(new SwStyleSheetIterator( this, eFam, _nMask ));
 }
 
 void SwDocStyleSheetPool::dispose()
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 28ecfb6..57a9bc9 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3602,11 +3602,11 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
     };
     for (IStyleAccess::SwAutoStyleFamily i : aFam)
     {
-        std::vector< SfxItemSet_Pointer_t > rStyles;
+        std::vector< std::shared_ptr<SfxItemSet> > rStyles;
         pDoc->GetIStyleAccess().getAllStyles(rStyles, i);
         while (!rStyles.empty())
         {
-            SfxItemSet_Pointer_t pStyle = rStyles.back();
+            std::shared_ptr<SfxItemSet> pStyle = rStyles.back();
             rStyles.pop_back();
             const SfxItemSet *pSet = dynamic_cast< const SfxItemSet * >(pStyle.get());
 


More information about the Libreoffice-commits mailing list