summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario J. Rugiero <mrugiero@gmail.com>2015-11-10 23:16:03 -0300
committerNoel Grandin <noelgrandin@gmail.com>2015-11-11 06:50:34 +0000
commit2ce9e4be4a438203382cb9cca824ce3e90647f3a (patch)
treee35e8b9401e92515c15a9c4713aa18466260a3a0
parent591903a1b1b64e68322f7454d3e61b2503028b9a (diff)
Replace several for_each by range based fors and functors by lambdas in sw.
It also corrects one whitespace and an outdated comment. Change-Id: Ife1c45d42b059353d3c98d68518d44a1379a96fa Reviewed-on: https://gerrit.libreoffice.org/19899 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sw/source/core/access/accmap.cxx4
-rw-r--r--sw/source/core/doc/DocumentDeviceManager.cxx4
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx8
-rw-r--r--sw/source/core/doc/doc.cxx16
-rw-r--r--sw/source/core/doc/docdesc.cxx16
-rw-r--r--sw/source/core/doc/docfmt.cxx4
-rw-r--r--sw/source/core/doc/docftn.cxx17
-rw-r--r--sw/source/core/doc/ftnidx.cxx3
-rw-r--r--sw/source/core/doc/lineinfo.cxx11
-rw-r--r--sw/source/core/doc/number.cxx8
-rw-r--r--sw/source/core/inc/rolbck.hxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx36
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx12
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx14
15 files changed, 79 insertions, 80 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index b771417b3156..2af9cd10a54c 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -3093,8 +3093,8 @@ void SwAccessibleMap::FireEvents()
{
mpEvents->SetFiring();
mpEvents->MoveInvalidXAccToEnd();
- ::std::for_each(mpEvents->begin(), mpEvents->end(),
- [this] (SwAccessibleEvent_Impl const& rEvent) { this->FireEvent(rEvent); } );
+ for( auto const& aEvent : *mpEvents )
+ FireEvent(aEvent);
delete mpEventMap;
mpEventMap = nullptr;
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx
index 7032101e894a..234a0e2f04b6 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -339,8 +339,8 @@ void DocumentDeviceManager::PrtDataChanged()
pFntCache->Flush();
- std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_SIZE));
+ for(SwRootFrm* aLayout : m_rDoc.GetAllLayouts())
+ aLayout->InvalidateAllContent(INV_SIZE);
for(SwViewShell& rShell : pSh->GetRingContainer())
rShell.InitPrt(getPrinter(false));
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 67c3f1256f64..4944eac525e7 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -434,8 +434,8 @@ void sw::DocumentSettingManager::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLan
if( pTmpRoot && !m_rDoc.IsInReading() )
{
pTmpRoot->StartAllAction();
- std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_SIZE));
+ for(SwRootFrm* aLayout : m_rDoc.GetAllLayouts())
+ aLayout->InvalidateAllContent(INV_SIZE);
pTmpRoot->EndAllAction();
}
m_rDoc.getIDocumentState().SetModified();
@@ -504,8 +504,8 @@ void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharComp
if( pTmpRoot && !m_rDoc.IsInReading() )
{
pTmpRoot->StartAllAction();
- std::set<SwRootFrm*> aAllLayouts = m_rDoc.GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_SIZE));
+ for( auto aLayout : m_rDoc.GetAllLayouts() )
+ aLayout->InvalidateAllContent(INV_SIZE);
pTmpRoot->EndAllAction();
}
m_rDoc.getIDocumentState().SetModified();
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 3557c66b8353..38631b1e68ea 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1144,14 +1144,18 @@ void SwDoc::SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags )
OSL_ENSURE( getIDocumentLayoutAccess().GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
if( bInvalid )
{
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::AllInvalidateSmartTagsOrSpelling),bSmartTags));
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::SetNeedGrammarCheck), true) );
+ for ( auto aLayout : aAllLayouts )
+ {
+ aLayout->AllInvalidateSmartTagsOrSpelling(bSmartTags);
+ aLayout->SetNeedGrammarCheck(true);
+ }
if ( bSmartTags )
GetNodes().ForEach( lcl_CheckSmartTagsAgain, &bOnlyWrong );
GetNodes().ForEach( lcl_SpellAndGrammarAgain, &bOnlyWrong );
}
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));
+ for ( auto aLayout : aAllLayouts )
+ aLayout->SetIdleFlags();
}
void SwDoc::InvalidateAutoCompleteFlag()
@@ -1160,14 +1164,16 @@ void SwDoc::InvalidateAutoCompleteFlag()
if( pTmpRoot )
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));
+ for( auto aLayout : aAllLayouts )
+ aLayout->AllInvalidateAutoCompleteWords();
for( sal_uLong nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
{
SwTextNode* pTextNode = GetNodes()[ nNd ]->GetTextNode();
if ( pTextNode ) pTextNode->SetAutoCompleteWordDirty( true );
}
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));
+ for( auto aLayout : aAllLayouts )
+ aLayout->SetIdleFlags();
}
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index be1606cd420d..60547a4371fc 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -499,8 +499,8 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
if ( (bUseOn || bFollow) && pTmpRoot)
// Inform layout!
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->AllCheckPageDescs();
}
// Take over the page attributes.
@@ -564,8 +564,8 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
mpFootnoteInfo->ChgPageDesc(m_PageDescs[0].get());
if ( bHasLayout )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFootnotePageDescs), false));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->CheckFootnotePageDescs(false);
}
}
else if ( mpEndNoteInfo->DependsOn( pDel ) )
@@ -573,8 +573,8 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
mpEndNoteInfo->ChgPageDesc(m_PageDescs[0].get());
if ( bHasLayout )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFootnotePageDescs), true));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->CheckFootnotePageDescs(true);
}
}
@@ -585,8 +585,8 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
m_PageDescs[j]->SetFollow(nullptr);
if( bHasLayout )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->AllCheckPageDescs();
}
}
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 08d0dc5146d6..6e95614aec77 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1502,8 +1502,8 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
if( bNotifyLayout && pTmpRoot )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->AllCheckPageDescs();
}
// If foot notes change the pages have to be triggered
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index f2711e6d50d8..8cca4cd8b0ba 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -279,12 +279,15 @@ void SwDoc::SetFootnoteInfo(const SwFootnoteInfo& rInfo)
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
if ( bFootnotePos )
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllRemoveFootnotes));
+ for( auto aLayout : aAllLayouts )
+ aLayout->AllRemoveFootnotes();
else
{
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFootnoteNums));
+ for( auto aLayout : aAllLayouts )
+ aLayout->UpdateFootnoteNums();
if ( bFootnoteDesc )
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFootnotePageDescs), false));
+ for( auto aLayout : aAllLayouts )
+ aLayout->CheckFootnotePageDescs(false);
if ( bExtra )
{
// For messages regarding ErgoSum etc. we save the extra code and use the
@@ -351,8 +354,8 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
{
if ( bFootnoteDesc )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFootnotePageDescs), true));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->CheckFootnotePageDescs(true);
}
if ( bExtra )
{
@@ -487,8 +490,8 @@ bool SwDoc::SetCurFootnote( const SwPaM& rPam, const OUString& rNumStr,
}
else if( pTmpRoot )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFootnoteNums));
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->UpdateFootnoteNums();
}
getIDocumentState().SetModified();
}
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 8709453ef209..2b54c13a72c7 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -240,7 +240,8 @@ void SwFootnoteIdxs::UpdateAllFootnote()
}
if( pTmpRoot && FTNNUM_PAGE == rFootnoteInfo.eNum )
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFootnoteNums));
+ for( auto aLayout : aAllLayouts )
+ aLayout->UpdateFootnoteNums();
}
SwTextFootnote* SwFootnoteIdxs::SeekEntry( const SwNodeIndex& rPos, size_t* pFndPos ) const
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 920a6d6d9260..1e736cf00187 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -35,13 +35,13 @@ void SwDoc::SetLineNumberInfo( const SwLineNumberInfo &rNew )
(rNew.IsCountBlankLines() != mpLineNumberInfo->IsCountBlankLines() ||
rNew.IsRestartEachPage() != mpLineNumberInfo->IsRestartEachPage()) )
{
- std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
pTmpRoot->StartAllAction();
// FME 2007-08-14 #i80120# Invalidate size, because ChgThisLines()
// is only (and may only be) called by the formatting routines
//pTmpRoot->InvalidateAllContent( INV_LINENUM | INV_SIZE );
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllContent), INV_LINENUM | INV_SIZE));
- pTmpRoot->EndAllAction();
+ for( auto aLayout : GetAllLayouts() )
+ aLayout->InvalidateAllContent( INV_LINENUM | INV_SIZE );
+ pTmpRoot->EndAllAction();
}
*mpLineNumberInfo = rNew;
getIDocumentState().SetModified();
@@ -140,9 +140,8 @@ void SwLineNumberInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
if( pRoot )
{
pRoot->StartAllAction();
- std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllAddPaintRect));
- //pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() );
+ for( auto aLayout : pDoc->GetAllLayouts() )
+ aLayout->AllAddPaintRect();
pRoot->EndAllAction();
}
}
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index a7ddc4e318b1..f529315bbaff 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -883,8 +883,8 @@ void SwNumRule::SetInvalidRule(bool bFlag)
aLists.insert( pList );
}
}
- std::for_each( aLists.begin(), aLists.end(),
- std::mem_fun( &SwList::InvalidateListTree ) );
+ for ( auto aList : aLists )
+ aList->InvalidateListTree();
}
mbInvalidRuleFlag = bFlag;
@@ -992,8 +992,8 @@ void SwNumRule::Validate()
const SwTextNode* pTextNode = *aIter;
aLists.insert( pTextNode->GetDoc()->getIDocumentListsAccess().getListByName( pTextNode->GetListId() ) );
}
- std::for_each( aLists.begin(), aLists.end(),
- std::mem_fun( &SwList::ValidateListTree ) );
+ for ( auto aList : aLists )
+ aList->ValidateListTree();
SetInvalidRule(false);
}
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index c955e61eaa42..3d137e0c1471 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -131,7 +131,7 @@ public:
class SwHistorySetTextField : public SwHistoryHint
{
- //!! beware of the order for the declation of the auto_ptrs.
+ //!! beware of the order for the declation of the unique_ptrs.
//!! If they get destroyed in the wrong order sw may crash (namely mail-merge as well)
::std::unique_ptr<SwFieldType> m_pFieldType;
const ::std::unique_ptr<SwFormatField> m_pField;
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 63d64f267603..a51afa3c5031 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -96,30 +96,20 @@ SwpHints::SwpHints()
{
}
-struct TextAttrDeleter
+static void TextAttrDelete( SwDoc & rDoc, SwTextAttr * const pAttr )
{
- SwAttrPool & m_rPool;
- explicit TextAttrDeleter( SwDoc & rDoc ) : m_rPool( rDoc.GetAttrPool() ) { }
- void operator() (SwTextAttr * const pAttr)
+ if (RES_TXTATR_META == pAttr->Which() ||
+ RES_TXTATR_METAFIELD == pAttr->Which())
{
- if (RES_TXTATR_META == pAttr->Which() ||
- RES_TXTATR_METAFIELD == pAttr->Which())
- {
- static_txtattr_cast<SwTextMeta *>(pAttr)->ChgTextNode(nullptr); // prevents ASSERT
- }
- SwTextAttr::Destroy( pAttr, m_rPool );
+ static_txtattr_cast<SwTextMeta *>(pAttr)->ChgTextNode(nullptr); // prevents ASSERT
}
-};
+ SwTextAttr::Destroy( pAttr, rDoc.GetAttrPool() );
+}
-struct TextAttrContains
+static bool TextAttrContains(const sal_Int32 nPos, SwTextAttrEnd * const pAttr)
{
- sal_Int32 m_nPos;
- explicit TextAttrContains( const sal_Int32 nPos ) : m_nPos( nPos ) { }
- bool operator() (SwTextAttrEnd * const pAttr)
- {
- return (pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->End());
- }
-};
+ return (pAttr->GetStart() < nPos) && (nPos < *pAttr->End());
+}
// a: |-----|
// b:
@@ -264,7 +254,9 @@ lcl_DoSplitNew(NestList_t & rSplits, SwTextNode & rNode,
// first find the portion that is split (not necessarily the last one!)
NestList_t::iterator const iter(
::std::find_if( rSplits.begin(), rSplits.end(),
- TextAttrContains(nSplitPos) ) );
+ [nSplitPos](SwTextAttrEnd * const pAttr) {
+ return TextAttrContains(nSplitPos, pAttr);
+ } ) );
if (iter != rSplits.end()) // already split here?
{
const sal_Int32 nStartPos( // skip other's dummy character!
@@ -390,8 +382,8 @@ SwpHints::TryInsertNesting( SwTextNode & rNode, SwTextAttrNesting & rNewHint )
{
case FAIL:
SAL_INFO("sw.core", "cannot insert hint: overlap");
- ::std::for_each(SplitNew.begin(), SplitNew.end(),
- TextAttrDeleter(*rNode.GetDoc()));
+ for (const auto& aSplit : SplitNew)
+ TextAttrDelete(*rNode.GetDoc(), aSplit);
return false;
case SPLIT_NEW:
lcl_DoSplitNew(SplitNew, rNode, nNewStart,
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 32a90d11e965..84c83c94bdf9 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -210,8 +210,8 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) :
*/
if (rWr.m_bInWriteEscher)
{
- std::for_each(maFlyFrms.begin(), maFlyFrms.end(),
- std::mem_fun_ref(&ww8::Frame::ForceTreatAsInline));
+ for ( auto& aFlyFrm : maFlyFrms )
+ aFlyFrm.ForceTreatAsInline();
}
maFlyIter = maFlyFrms.begin();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index d3ed0bc4aa4d..12d92ea2a2b4 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -910,8 +910,8 @@ void wwFontHelper::WriteFontTable(SvStream *pTableStream, WW8Fib& rFib)
/*
* Write them all to pTableStream
*/
- ::std::for_each(aFontList.begin(), aFontList.end(),
- ::std::bind2nd(::std::mem_fun(&wwFont::Write),pTableStream));
+ for ( auto aFont : aFontList )
+ aFont->Write(pTableStream);
/*
* Write the position and len in the FIB
@@ -924,16 +924,16 @@ void wwFontHelper::WriteFontTable( DocxAttributeOutput& rAttrOutput )
{
::std::vector<const wwFont *> aFontList( AsVector() );
- ::std::for_each( aFontList.begin(), aFontList.end(),
- ::std::bind2nd( ::std::mem_fun( &wwFont::WriteDocx ), &rAttrOutput ) );
+ for ( auto aFont : aFontList )
+ aFont->WriteDocx(&rAttrOutput);
}
void wwFontHelper::WriteFontTable( const RtfAttributeOutput& rAttrOutput )
{
::std::vector<const wwFont *> aFontList( AsVector() );
- ::std::for_each( aFontList.begin(), aFontList.end(),
- ::std::bind2nd( ::std::mem_fun( &wwFont::WriteRtf ), &rAttrOutput ) );
+ for ( auto aFont : aFontList )
+ aFont->WriteRtf(&rAttrOutput);
}
WW8_WrPlc0::WW8_WrPlc0( sal_uLong nOffset )
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index eb2ef3c7b676..66dd87c346d8 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1441,9 +1441,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
// sub-document, to get the correct PageDesc.
if(!bFreezedLayouts && bCreateSingleFile)
{
- std::set<SwRootFrm*> aAllLayouts = pTargetShell->GetDoc()->GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),
- [](SwRootFrm* pLayout) { pLayout->FreezeLayout(true); });
+ for ( auto aLayout : pTargetShell->GetDoc()->GetAllLayouts() )
+ aLayout->FreezeLayout(true);
bFreezedLayouts = true;
}
} while( !bCancel &&
@@ -1483,12 +1482,11 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
if(bCreateSingleFile)
{
pTargetShell->CalcLayout();
- std::set<SwRootFrm*> aAllLayouts = pTargetShell->GetDoc()->GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(), [](SwRootFrm* pLayout)
+ for ( auto aLayout : pTargetShell->GetDoc()->GetAllLayouts() )
{
- pLayout->FreezeLayout(false);
- pLayout->AllCheckPageDescs();
- });
+ aLayout->FreezeLayout(false);
+ aLayout->AllCheckPageDescs();
+ }
}
pProgressDlg.disposeAndClear();