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/fmtui/tmpdlg.cxx | |
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/fmtui/tmpdlg.cxx')
-rw-r--r-- | sw/source/ui/fmtui/tmpdlg.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index af1c631843e9..ca6da1fae5dc 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -420,13 +420,14 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) }//<-end ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); - const SfxStyleSheetBase* pBase = pPool->First(); + SfxStyleSheetIterator iter(pPool, + SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); + const SfxStyleSheetBase* 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); @@ -488,12 +489,13 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell-> GetView().GetDocShell()->GetStyleSheetPool(); - pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA); - SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First(); + SfxStyleSheetIterator iter(pStyleSheetPool, + SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL); + SfxStyleSheetBase *pFirstStyle = iter.First(); while(pFirstStyle) { aList.push_back( pFirstStyle->GetName() ); - pFirstStyle = pStyleSheetPool->Next(); + pFirstStyle = iter.Next(); } } aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList)); |