summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-01 16:42:19 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-02-02 12:07:12 +0100
commitd27ef675ec23f45562972da66bde02d99d778141 (patch)
treee6623a0e739b104f2f96ce30dd7e5f2b84c79945 /sw
parent1287081fa5c132057e01c60a26c6f64156e5bc73 (diff)
Replace some front/pop_front by for-range loops+clear
Change-Id: I8a9239667b0d80ee2fa6ebbc8a19ba4c0076c2fb Reviewed-on: https://gerrit.libreoffice.org/49107 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/docnode/finalthreadmanager.cxx6
-rw-r--r--sw/source/core/text/redlnitr.cxx11
-rw-r--r--sw/source/filter/html/swhtml.cxx16
3 files changed, 15 insertions, 18 deletions
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index 4d90b7fa158b..83d0fe3fff13 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -337,11 +337,11 @@ void SAL_CALL FinalThreadManager::cancelAllJobs()
{
delete mpCancelJobsThread;
mpCancelJobsThread = nullptr;
- while ( !aThreads.empty() )
+ for (auto const& elem : aThreads)
{
- aThreads.front()->cancel();
- aThreads.pop_front();
+ elem->cancel();
}
+ aThreads.clear();
}
}
else
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index da8da1b27e90..e16d7b3b1e34 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -316,16 +316,15 @@ void SwRedlineItr::Clear_( SwFont* pFnt )
{
OSL_ENSURE( bOn, "SwRedlineItr::Clear: Off?" );
bOn = false;
- while (!m_Hints.empty())
+ for (auto const& hint : m_Hints)
{
- SwTextAttr *pPos = m_Hints.front();
- m_Hints.pop_front();
if( pFnt )
- rAttrHandler.PopAndChg( *pPos, *pFnt );
+ rAttrHandler.PopAndChg( *hint, *pFnt );
else
- rAttrHandler.Pop( *pPos );
- SwTextAttr::Destroy(pPos, const_cast<SwDoc&>(rDoc).GetAttrPool() );
+ rAttrHandler.Pop( *hint );
+ SwTextAttr::Destroy(hint, const_cast<SwDoc&>(rDoc).GetAttrPool() );
}
+ m_Hints.clear();
}
sal_Int32 SwRedlineItr::GetNextRedln_( sal_Int32 nNext )
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index a02448657dd5..c21a373315ed 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2971,13 +2971,11 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
m_aMoveFlyCnts.erase( m_aMoveFlyCnts.begin() + n );
}
}
- while( !aFields.empty() )
+ for (auto const& field : aFields)
{
- pAttr = aFields[0];
-
- pCNd = pAttr->nSttPara.GetNode().GetContentNode();
- pAttrPam->GetPoint()->nNode = pAttr->nSttPara;
- pAttrPam->GetPoint()->nContent.Assign( pCNd, pAttr->nSttContent );
+ pCNd = field->nSttPara.GetNode().GetContentNode();
+ pAttrPam->GetPoint()->nNode = field->nSttPara;
+ pAttrPam->GetPoint()->nContent.Assign( pCNd, field->nSttContent );
if( bBeforeTable &&
pAttrPam->GetPoint()->nNode.GetIndex() == rEndIdx.GetIndex() )
@@ -2989,11 +2987,11 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
pAttrPam->Move( fnMoveBackward );
}
- m_xDoc->getIDocumentContentOperations().InsertPoolItem( *pAttrPam, *pAttr->pItem );
+ m_xDoc->getIDocumentContentOperations().InsertPoolItem( *pAttrPam, *field->pItem );
- aFields.pop_front();
- delete pAttr;
+ delete field;
}
+ aFields.clear();
}
void SwHTMLParser::NewAttr(const std::shared_ptr<HTMLAttrTable>& rAttrTable, HTMLAttr **ppAttr, const SfxPoolItem& rItem )