diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-27 00:43:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-27 00:45:21 +0200 |
commit | 3a46d91f8de420f38dd763028e91229c846dff52 (patch) | |
tree | f34ae4072fdd9ff6f06dbd4bac49072ff81f5c60 /sw/source/ui/chrdlg | |
parent | 197010643e7e1b8c973013efa9034ffc9bdb56c0 (diff) |
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
Diffstat (limited to 'sw/source/ui/chrdlg')
-rw-r--r-- | sw/source/ui/chrdlg/pardlg.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/swuiccoll.cxx | 12 |
2 files changed, 10 insertions, 9 deletions
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<String> aNames; while(pBase) { aNames.insert(pBase->GetName()); - pBase = pPool->Next(); + pBase = iter.Next(); } for(std::set<String>::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); |