summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-05 10:57:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-05 13:41:03 +0200
commita5bbbba632c6aecb8cf24d906b05f145dea1fc41 (patch)
treee4ee31230a6247a4932b6840bfc33e3a6fb05de3 /svl
parenta46cf617e39be24f16d074c836d558eaa7f1f336 (diff)
make the family and mask explicit in SfxStyleSheetBasePool::First
Change-Id: I36655b65ca00e5f7b8779a28d4a1778c8e35dc4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93461 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/style.cxx26
1 files changed, 11 insertions, 15 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index e0a722e42edb..be80f702e06c 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -479,7 +479,6 @@ SfxStyleSheetBase* SfxStyleSheetIterator::First()
}
}
-
SfxStyleSheetBase* SfxStyleSheetIterator::Next()
{
SfxStyleSheetBase* retval = nullptr;
@@ -548,14 +547,10 @@ SfxStyleSearchBits SfxStyleSheetIterator::GetSearchMask() const
return mask;
}
-
-SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl()
+SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl(SfxStyleFamily eFamily, SfxStyleSearchBits eMask)
{
- if( !pImpl->pIter || (pImpl->pIter->GetSearchMask() != nMask) || (pImpl->pIter->GetSearchFamily() != nSearchFamily) )
- {
- pImpl->pIter = CreateIterator( nSearchFamily, nMask );
- }
-
+ if (!pImpl->pIter || (pImpl->pIter->GetSearchMask() != eMask) || (pImpl->pIter->GetSearchFamily() != eFamily))
+ pImpl->pIter = CreateIterator(eFamily, eMask);
return *pImpl->pIter;
}
@@ -706,21 +701,22 @@ SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBas
}
SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const OUString& rName,
- SfxStyleFamily eFam,
- SfxStyleSearchBits mask)
+ SfxStyleFamily eFamily,
+ SfxStyleSearchBits eMask)
{
- SfxStyleSheetIterator aIter(this,eFam,mask);
+ SfxStyleSheetIterator aIter(this, eFamily, eMask);
return aIter.Find(rName);
}
-SfxStyleSheetBase* SfxStyleSheetBasePool::First()
+SfxStyleSheetBase* SfxStyleSheetBasePool::First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask)
{
- return GetIterator_Impl().First();
+ return GetIterator_Impl(eFamily, eMask).First();
}
SfxStyleSheetBase* SfxStyleSheetBasePool::Next()
{
- return GetIterator_Impl().Next();
+ assert(pImpl->pIter && "Next called without a previous First");
+ return pImpl->pIter->Next();
}
void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p )
@@ -811,7 +807,7 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld,
{
const SfxStyleSearchBits nTmpMask = GetSearchMask();
SetSearchMask(GetSearchFamily());
- for( SfxStyleSheetBase* p = First(); p; p = Next() )
+ for( SfxStyleSheetBase* p = First(GetSearchFamily()); p; p = Next() )
{
if( p->GetParent() == rOld )
{