summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-07-27 00:43:34 +0200
committerMichael Stahl <mstahl@redhat.com>2013-07-27 00:45:21 +0200
commit3a46d91f8de420f38dd763028e91229c846dff52 (patch)
treef34ae4072fdd9ff6f06dbd4bac49072ff81f5c60 /sc
parent197010643e7e1b8c973013efa9034ffc9bdb56c0 (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 'sc')
-rw-r--r--sc/source/filter/html/htmlexp.cxx14
-rw-r--r--sc/source/ui/docshell/docsh6.cxx7
2 files changed, 14 insertions, 7 deletions
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 5cbf833ca3b3..05c3e9d4053c 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -447,13 +447,16 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab )
// remember defaults for compare in WriteCell
if ( !aHTMLStyle.bInitialized )
{
- pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
pStyleSheet = pStylePool->Find(
ScGlobal::GetRscString(STR_STYLENAME_STANDARD),
SFX_STYLE_FAMILY_PARA );
OSL_ENSURE( pStyleSheet, "ParaStyle not found! :-(" );
if (!pStyleSheet)
- pStyleSheet = pStylePool->First();
+ {
+ SfxStyleSheetIterator iter(pStylePool,
+ SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL);
+ pStyleSheet = iter.First();
+ }
const SfxItemSet& rSetPara = pStyleSheet->GetItemSet();
aHTMLStyle.nDefaultScriptType = ScGlobal::GetDefaultScriptType();
@@ -470,11 +473,14 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab )
// Page style sheet printer settings, e.g. for background graphics.
// There's only one background graphic in HTML!
- pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL );
pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE );
OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" );
if (!pStyleSheet)
- pStyleSheet = pStylePool->First();
+ {
+ SfxStyleSheetIterator iter(pStylePool,
+ SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL);
+ pStyleSheet = iter.First();
+ }
const SfxItemSet& rSet = pStyleSheet->GetItemSet();
if ( !aHTMLStyle.bInitialized )
{
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 3256980caf29..a1b29853eefc 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -231,8 +231,9 @@ SfxStyleSheetBasePool* ScDocShell::GetStyleSheetPool()
static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
{
- pStylePool->SetSearchMask(SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL);
- SfxStyleSheetBase *pStyle = pStylePool->First();
+ SfxStyleSheetIterator iter(pStylePool,
+ SFX_STYLE_FAMILY_PAGE, SFXSTYLEBIT_ALL);
+ SfxStyleSheetBase *pStyle = iter.First();
while ( pStyle )
{
SfxItemSet& rStyleSet = pStyle->GetItemSet();
@@ -253,7 +254,7 @@ static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
rStyleSet.Put(SvxSetItem(ATTR_PAGE_FOOTERSET,pDestSet));
}
- pStyle = pStylePool->Next();
+ pStyle = iter.Next();
}
}