summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-04 20:55:51 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-05 09:41:58 +0200
commitd6acdb786c25619ed02d20dde7fe082b11d4a8dc (patch)
tree8f04bef1f1c12db714e1ce4e589b692bea0a9b43 /sfx2
parent1138adc105e18cc0ef6af5de7529fba1723e960b (diff)
drop SfxStyleSheetBasePool::Count
and use CreateIterator to make it explicit what is being counted Change-Id: I8d76aef601533960a23c056b83a48c4f130bbe75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93446 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objcont.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 5edc31456c61..b1ee8eca0bf7 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -314,10 +314,11 @@ void SfxObjectShell::LoadStyles
SfxStyleSheetBasePool *pMyPool = GetStyleSheetPool();
DBG_ASSERT(pMyPool, "Dest-DocumentShell without StyleSheetPool");
pSourcePool->SetSearchMask(SfxStyleFamily::All);
- std::unique_ptr<Styles_Impl[]> pFound(new Styles_Impl[pSourcePool->Count()]);
+ auto xIter = pSourcePool->CreateIterator(SfxStyleFamily::All);
+ std::unique_ptr<Styles_Impl[]> pFound(new Styles_Impl[xIter->Count()]);
sal_uInt16 nFound = 0;
- SfxStyleSheetBase *pSource = pSourcePool->First();
+ SfxStyleSheetBase *pSource = xIter->First();
while ( pSource )
{
SfxStyleSheetBase *pDest =
@@ -331,7 +332,7 @@ void SfxObjectShell::LoadStyles
pFound[nFound].pSource = pSource;
pFound[nFound].pDest = pDest;
++nFound;
- pSource = pSourcePool->Next();
+ pSource = xIter->Next();
}
for ( sal_uInt16 i = 0; i < nFound; ++i )