[Libreoffice-commits] core.git: sw/source
Mario J. Rugiero
mrugiero at gmail.com
Tue Nov 10 22:50:56 PST 2015
sw/source/core/access/accmap.cxx | 4 +-
sw/source/core/doc/DocumentDeviceManager.cxx | 4 +-
sw/source/core/doc/DocumentSettingManager.cxx | 8 ++---
sw/source/core/doc/doc.cxx | 16 +++++++----
sw/source/core/doc/docdesc.cxx | 16 +++++------
sw/source/core/doc/docfmt.cxx | 4 +-
sw/source/core/doc/docftn.cxx | 17 +++++++-----
sw/source/core/doc/ftnidx.cxx | 3 +-
sw/source/core/doc/lineinfo.cxx | 11 +++----
sw/source/core/doc/number.cxx | 8 ++---
sw/source/core/inc/rolbck.hxx | 2 -
sw/source/core/txtnode/thints.cxx | 36 ++++++++++----------------
sw/source/filter/ww8/wrtw8nds.cxx | 4 +-
sw/source/filter/ww8/wrtw8sty.cxx | 12 ++++----
sw/source/uibase/dbui/dbmgr.cxx | 14 ++++------
15 files changed, 79 insertions(+), 80 deletions(-)
New commits:
commit 2ce9e4be4a438203382cb9cca824ce3e90647f3a
Author: Mario J. Rugiero <mrugiero at gmail.com>
Date: Tue Nov 10 23:16:03 2015 -0300
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 at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index b771417..2af9cd1 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 7032101..234a0e2 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 67c3f12..4944eac 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 3557c66..38631b1 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 be1606c..60547a4 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 08d0dc5..6e95614 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 f2711e6..8cca4cd 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 8709453..2b54c13 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 920a6d6..1e736cf 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 a7ddc4e..f529315 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 c955e61..3d137e0 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 63d64f2..a51afa3 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 32a90d1..84c83c9 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 d3ed0bc..12d92ea 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 eb2ef3c..66dd87c 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();
More information about the Libreoffice-commits
mailing list