diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-27 00:43:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-27 00:45:21 +0200 |
commit | 3a46d91f8de420f38dd763028e91229c846dff52 (patch) | |
tree | f34ae4072fdd9ff6f06dbd4bac49072ff81f5c60 /svl | |
parent | 197010643e7e1b8c973013efa9034ffc9bdb56c0 (diff) |
SfxStyleSheetBasePool: remove internal iterator
The clients always start with First() anyway so they might as well use
external iterators, which makes calling First() in certain situations
just so the internal iterator is invalidated unnecessary.
Change-Id: I0948576c20410136448e8b85311c21a257469bc7
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/style.cxx | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 1c0465581b5a..57f202466bc1 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -83,8 +83,7 @@ SfxStyleSheetHint::SfxStyleSheetHint class SfxStyleSheetBasePool_Impl { -public: - SfxStyleSheetIteratorPtr pIter; + // TODO: move members here }; @@ -531,16 +530,6 @@ void SfxStyleSheetBasePool::Replace( SfxStyleSheetBase& rSource, SfxStyleSheetBa rTargetSet.Put( rSourceSet ); } -SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl() -{ - if( !pImp->pIter || (pImp->pIter->GetSearchMask() != nMask) || (pImp->pIter->GetSearchFamily() != nSearchFamily) ) - { - pImp->pIter = CreateIterator( nSearchFamily, nMask ); - } - - return *pImp->pIter; -} - SfxStyleSheetBasePool::SfxStyleSheetBasePool( SfxItemPool& r ) : aAppName(r.GetName()) , rPool(r) @@ -682,16 +671,6 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas return *this; } -sal_uInt16 SfxStyleSheetBasePool::Count() -{ - return GetIterator_Impl().Count(); -} - -SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](sal_uInt16 nIdx) -{ - return GetIterator_Impl()[nIdx]; -} - SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask) @@ -705,16 +684,6 @@ const SfxStyles& SfxStyleSheetBasePool::GetStyles() return aStyles; } -SfxStyleSheetBase* SfxStyleSheetBasePool::First() -{ - return GetIterator_Impl().First(); -} - -SfxStyleSheetBase* SfxStyleSheetBasePool::Next() -{ - return GetIterator_Impl().Next(); -} - void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p ) { if( p ) @@ -791,9 +760,8 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld, const OUString& rNew, bool bVirtual) { - const sal_uInt16 nTmpMask = GetSearchMask(); - SetSearchMask(GetSearchFamily(), SFXSTYLEBIT_ALL); - for( SfxStyleSheetBase* p = First(); p; p = Next() ) + SfxStyleSheetIterator iter(this, GetSearchFamily(), SFXSTYLEBIT_ALL); + for (SfxStyleSheetBase* p = iter.First(); p; p = iter.Next()) { if( p->GetParent() == rOld ) { @@ -803,7 +771,6 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld, p->aParent = rNew; } } - SetSearchMask(GetSearchFamily(), nTmpMask); } void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 ) |