summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-27 16:54:50 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-27 17:15:55 +0200
commita1c081a7c213a56321b0b60651a1dbd63bcaec80 (patch)
tree52d8070fc39e37d42f5d9c9a4c0147757859fab8 /svl
parent21a4f5df04849a943764918147183ffba3710e87 (diff)
Revert "SfxStyleSheetBasePool: remove internal iterator"
This reverts commit 3a46d91f8de420f38dd763028e91229c846dff52. This breaks the Stylist, not sure why (does it depend on something setting the search flags before?) so revert for now. Change-Id: Ia50feeebae8bf852c827e4f270e81e9f08d2b1ac
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/style.cxx39
1 files changed, 36 insertions, 3 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 57f202466bc1..1c0465581b5a 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -83,7 +83,8 @@ SfxStyleSheetHint::SfxStyleSheetHint
class SfxStyleSheetBasePool_Impl
{
- // TODO: move members here
+public:
+ SfxStyleSheetIteratorPtr pIter;
};
@@ -530,6 +531,16 @@ 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)
@@ -671,6 +682,16 @@ 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)
@@ -684,6 +705,16 @@ 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 )
@@ -760,8 +791,9 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld,
const OUString& rNew,
bool bVirtual)
{
- SfxStyleSheetIterator iter(this, GetSearchFamily(), SFXSTYLEBIT_ALL);
- for (SfxStyleSheetBase* p = iter.First(); p; p = iter.Next())
+ const sal_uInt16 nTmpMask = GetSearchMask();
+ SetSearchMask(GetSearchFamily(), SFXSTYLEBIT_ALL);
+ for( SfxStyleSheetBase* p = First(); p; p = Next() )
{
if( p->GetParent() == rOld )
{
@@ -771,6 +803,7 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld,
p->aParent = rNew;
}
}
+ SetSearchMask(GetSearchFamily(), nTmpMask);
}
void SfxStyleSheetBase::Load( SvStream&, sal_uInt16 )