diff options
author | Armin Le Grand <alg@apache.org> | 2012-06-28 16:30:03 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2012-06-28 16:30:03 +0000 |
commit | ec1819f218b94bed1556653e1b2b816a65da61ef (patch) | |
tree | b3a7fc1b326989e8754d48d7aacc779b411d157b /svl | |
parent | b69333045a54fb8ac0d5aabbf01b1fd125985e81 (diff) |
#120077# ALG: Reverted r1354011, adapted all usages of SfxStyleSheetIterator and CreateIterator to use boost::shared_ptr
Notes
Notes:
merged as: 858c6610f3476bb47bb7b4e621a7ac48a9e34a75
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/style.hxx | 12 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 25 |
2 files changed, 20 insertions, 17 deletions
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx index 478e966e8836..5ca3d1bd9b84 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.hxx @@ -19,33 +19,27 @@ * *************************************************************/ - - #ifndef _SFXSTYLE_HXX #define _SFXSTYLE_HXX #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> - #include <rtl/ref.hxx> #include <vector> #include <comphelper/weak.hxx> #include <cppuhelper/implbase2.hxx> -#include "svl/svldllapi.h" +#include <svl/svldllapi.h> #include <rsc/rscsfx.hxx> #include <tools/string.hxx> #include <svl/hint.hxx> #include <svl/lstner.hxx> #include <svl/brdcst.hxx> #include <svl/poolitem.hxx> - -#ifndef _SFX_STYLE_HRC #include <svl/style.hrc> -#endif +#include <boost/shared_ptr.hpp> class SfxItemSet; class SfxItemPool; - class SfxStyleSheetBasePool; class SvStream; @@ -199,6 +193,7 @@ private: friend class SfxStyleSheetBasePool; }; +typedef ::boost::shared_ptr< SfxStyleSheetIterator > SfxStyleSheetIteratorPtr; //========================================================================= class SfxStyleSheetBasePool_Impl; @@ -238,6 +233,7 @@ public: SfxItemPool& GetPool(); const SfxItemPool& GetPool() const; + virtual SfxStyleSheetIteratorPtr CreateIterator(SfxStyleFamily, sal_uInt16 nMask); virtual sal_uInt16 Count(); virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx); diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index b08555cdee21..48223b16380f 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -121,11 +121,9 @@ SfxStyleSheetHint::SfxStyleSheetHint class SfxStyleSheetBasePool_Impl { - public: +public: SfxStyles aStyles; - SfxStyleSheetIterator *pIter; - SfxStyleSheetBasePool_Impl() : pIter(0){} - ~SfxStyleSheetBasePool_Impl(){delete pIter;} + SfxStyleSheetIteratorPtr pIter; }; @@ -583,13 +581,12 @@ void SfxStyleSheetBasePool::Replace( SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl() { - SfxStyleSheetIterator*& rpIter = pImp->pIter; - if( !rpIter || (rpIter->GetSearchMask() != nMask) || (rpIter->GetSearchFamily() != nSearchFamily) ) + if( !pImp->pIter || (pImp->pIter->GetSearchMask() != nMask) || (pImp->pIter->GetSearchFamily() != nSearchFamily) ) { - delete rpIter; - rpIter = new SfxStyleSheetIterator( this, nSearchFamily, nMask ); + pImp->pIter = CreateIterator( nSearchFamily, nMask ); } - return *rpIter; + + return *pImp->pIter; } @@ -668,6 +665,16 @@ String SfxStyleSheetBasePool::GetStreamName() +SfxStyleSheetIteratorPtr SfxStyleSheetBasePool::CreateIterator +( + SfxStyleFamily eFam, + sal_uInt16 mask +) +{ + return SfxStyleSheetIteratorPtr(new SfxStyleSheetIterator(this,eFam,mask)); +} + + SfxStyleSheetBase* SfxStyleSheetBasePool::Create ( const XubString& rName, |