diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-27 16:54:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-27 17:15:55 +0200 |
commit | a1c081a7c213a56321b0b60651a1dbd63bcaec80 (patch) | |
tree | 52d8070fc39e37d42f5d9c9a4c0147757859fab8 /sfx2/source/doc/objcont.cxx | |
parent | 21a4f5df04849a943764918147183ffba3710e87 (diff) |
Revert "SfxStyleSheetBasePool: remove internal iterator"
This reverts commit 3a46d91f8de420f38dd763028e91229c846dff52.
This breaks the Stylist, not sure why (does it depend on something
setting the search flags before?) so revert for now.
Change-Id: Ia50feeebae8bf852c827e4f270e81e9f08d2b1ac
Diffstat (limited to 'sfx2/source/doc/objcont.cxx')
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index da71fafe3133..49f9745f4f96 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -319,15 +319,21 @@ void SfxObjectShell::LoadStyles */ { + struct Styles_Impl + { + SfxStyleSheetBase *pSource; + SfxStyleSheetBase *pDest; + }; + SfxStyleSheetBasePool *pSourcePool = rSource.GetStyleSheetPool(); DBG_ASSERT(pSourcePool, "Source-DocumentShell ohne StyleSheetPool"); SfxStyleSheetBasePool *pMyPool = GetStyleSheetPool(); DBG_ASSERT(pMyPool, "Dest-DocumentShell ohne StyleSheetPool"); - SfxStyleSheetIterator iter(pSourcePool, - SFX_STYLE_FAMILY_ALL, SFXSTYLEBIT_ALL); - std::vector<std::pair<SfxStyleSheetBase*, SfxStyleSheetBase*> > found; + pSourcePool->SetSearchMask(SFX_STYLE_FAMILY_ALL, SFXSTYLEBIT_ALL); + Styles_Impl *pFound = new Styles_Impl[pSourcePool->Count()]; + sal_uInt16 nFound = 0; - SfxStyleSheetBase *pSource = iter.First(); + SfxStyleSheetBase *pSource = pSourcePool->First(); while ( pSource ) { SfxStyleSheetBase *pDest = @@ -338,19 +344,21 @@ void SfxObjectShell::LoadStyles pSource->GetFamily(), pSource->GetMask()); // Setting of Parents, the next style } - found.push_back(std::make_pair(pSource, pDest)); - pSource = iter.Next(); + pFound[nFound].pSource = pSource; + pFound[nFound].pDest = pDest; + ++nFound; + pSource = pSourcePool->Next(); } - for (size_t i = 0; i < found.size(); ++i) + for ( sal_uInt16 i = 0; i < nFound; ++i ) { - found[i].second->GetItemSet().PutExtended(found[i].first->GetItemSet(), - SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT); - if (found[i].first->HasParentSupport()) - found[i].second->SetParent(found[i].first->GetParent()); - if (found[i].first->HasFollowSupport()) - found[i].second->SetFollow(found[i].first->GetParent()); + pFound[i].pDest->GetItemSet().PutExtended(pFound[i].pSource->GetItemSet(), SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT); + if(pFound[i].pSource->HasParentSupport()) + pFound[i].pDest->SetParent(pFound[i].pSource->GetParent()); + if(pFound[i].pSource->HasFollowSupport()) + pFound[i].pDest->SetFollow(pFound[i].pSource->GetParent()); } + delete [] pFound; } //-------------------------------------------------------------------- |