summaryrefslogtreecommitdiff
path: root/sw/source
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 /sw/source
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 'sw/source')
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index c944f01c2602..eb3fb95c989b 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -111,14 +111,15 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt )
SfxStyleSheetBasePool* pPool = pView->GetDocShell()->
GetStyleSheetPool();
pPool->SetSearchMask(SfxStyleFamily::Page);
- if( pPool->Count() > 1 )
+ auto xIter = pPool->CreateIterator(SfxStyleFamily::Page);
+ if (xIter->Count() > 1)
{
sal_uInt16 nCount = 0;
- SfxStyleSheetBase* pStyle = pPool->First();
+ SfxStyleSheetBase* pStyle = xIter->First();
while( pStyle )
{
aPop->InsertItem( ++nCount, pStyle->GetName() );
- pStyle = pPool->Next();
+ pStyle = xIter->Next();
}
aPop->Execute( &GetStatusBar(), rCEvt.GetMousePosPixel());
@@ -126,7 +127,7 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt )
if( nCurrId != USHRT_MAX)
{
// looks a bit awkward, but another way is not possible
- pStyle = pPool->operator[]( nCurrId - 1 );
+ pStyle = xIter->operator[]( nCurrId - 1 );
SfxStringItem aStyle( FN_SET_PAGE_STYLE, pStyle->GetName() );
pWrtShell->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(
FN_SET_PAGE_STYLE,