From 3a46d91f8de420f38dd763028e91229c846dff52 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 27 Jul 2013 00:43:34 +0200 Subject: 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 --- sw/source/ui/chrdlg/pardlg.cxx | 7 ++++--- sw/source/ui/chrdlg/swuiccoll.cxx | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'sw/source/ui/chrdlg') diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 20b4f957de30..17e39a58a313 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -240,13 +240,14 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) ((SwParagraphNumTabPage&)rPage).EnableNewStart(); ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); - const SfxStyleSheetBase* pBase = pPool->First(); + SfxStyleSheetIterator iter(pPool, + SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); + SfxStyleSheetBase const* pBase = iter.First(); std::set aNames; while(pBase) { aNames.insert(pBase->GetName()); - pBase = pPool->Next(); + pBase = iter.Next(); } for(std::set::const_iterator it = aNames.begin(); it != aNames.end(); ++it) rBox.InsertEntry(*it); diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index beb916efbc8a..c46eceb7eb20 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -184,14 +184,14 @@ void SwCondCollPage::Reset(const SfxItemSet &/*rSet*/) aTbLinks.Clear(); SfxStyleSheetBasePool* pPool = rSh.GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL); aStyleLB.Clear(); - const SfxStyleSheetBase* pBase = pPool->First(); + SfxStyleSheetIterator iter(pPool, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL); + const SfxStyleSheetBase* pBase = iter.First(); while( pBase ) { if(!pFmt || pBase->GetName() != pFmt->GetName()) aStyleLB.InsertEntry(pBase->GetName()); - pBase = pPool->Next(); + pBase = iter.Next(); } aStyleLB.SelectEntryPos(0); @@ -274,14 +274,14 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) sal_uInt16 nSearchFlags = pBox->GetSelectEntryPos(); nSearchFlags = *(sal_uInt16*)aFilterLB.GetEntryData(nSearchFlags); SfxStyleSheetBasePool* pPool = rSh.GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, nSearchFlags); - const SfxStyleSheetBase* pBase = pPool->First(); + SfxStyleSheetIterator iter(pPool, SFX_STYLE_FAMILY_PARA, nSearchFlags); + const SfxStyleSheetBase* pBase = iter.First(); while( pBase ) { if(!pFmt || pBase->GetName() != pFmt->GetName()) aStyleLB.InsertEntry(pBase->GetName()); - pBase = pPool->Next(); + pBase = iter.Next(); } aStyleLB.SelectEntryPos(0); SelectHdl(&aStyleLB); -- cgit