diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-29 20:33:12 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-30 07:04:39 +0200 |
commit | 3d14fb1ef44144d69e73d047c547508219a57b62 (patch) | |
tree | 043f61cecd5602540e9e6e80883d389489c75298 /lotuswordpro/source/filter/lwpchangemgr.cxx | |
parent | 932c9065ee09d94fa14248f49b2cb1b190a91a1d (diff) |
Use for-range loops in lotuswordpro
Change-Id: Ib14bc1f00914253f000a2bb9c3f780b04fdd126c
Reviewed-on: https://gerrit.libreoffice.org/52125
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'lotuswordpro/source/filter/lwpchangemgr.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwpchangemgr.cxx | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/lotuswordpro/source/filter/lwpchangemgr.cxx b/lotuswordpro/source/filter/lwpchangemgr.cxx index c04241aaccb4..1c2816fceba2 100644 --- a/lotuswordpro/source/filter/lwpchangemgr.cxx +++ b/lotuswordpro/source/filter/lwpchangemgr.cxx @@ -108,8 +108,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib) OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) { - std::map<LwpFrib*,OUString>::iterator iter; - iter = m_pFribMap->find(pFrib); + auto iter = m_pFribMap->find(pFrib); if (iter == m_pFribMap->end()) return OUString(); else @@ -118,41 +117,38 @@ OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) void LwpChangeMgr::ConvertAllChange(IXFStream* pStream) { - std::map<LwpFrib*,OUString>::iterator iter; - for (iter=m_DocFribMap.begin();iter !=m_DocFribMap.end();++iter) + for (auto const& docFrib : m_DocFribMap) { - if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT) + if (docFrib.first->GetRevisionType() == LwpFrib::REV_INSERT) { XFChangeInsert* pInsert = new XFChangeInsert; - pInsert->SetChangeID(iter->second); - pInsert->SetEditor(iter->first->GetEditor()); + pInsert->SetChangeID(docFrib.second); + pInsert->SetEditor(docFrib.first->GetEditor()); m_ChangeList.push_back(pInsert); } - else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE) + else if (docFrib.first->GetRevisionType() == LwpFrib::REV_DELETE) { XFChangeDelete* pDelete = new XFChangeDelete; - pDelete->SetChangeID(iter->second); - pDelete->SetEditor(iter->first->GetEditor()); + pDelete->SetChangeID(docFrib.second); + pDelete->SetEditor(docFrib.first->GetEditor()); m_ChangeList.push_back(pDelete); } } - std::vector<XFChangeRegion*>::iterator iter1; pStream->GetAttrList()->Clear(); if (m_ChangeList.empty()) return; // Add for disable change tracking pStream->GetAttrList()->AddAttribute( "text:track-changes","false"); pStream->StartElement( "text:tracked-changes" ); - for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();++iter1) - (*iter1)->ToXml(pStream); + for (auto const& elem : m_ChangeList) + elem->ToXml(pStream); pStream->EndElement("text:tracked-changes"); - for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();++iter1) + for (auto const& elem : m_ChangeList) { - delete *iter1; - *iter1=nullptr; + delete elem; } m_ChangeList.clear(); } @@ -169,23 +165,22 @@ void LwpChangeMgr::SetHeadFootFribMap(bool bFlag) void LwpChangeMgr::SetHeadFootChange(XFContentContainer* pCont) { - std::map<LwpFrib*,OUString>::iterator iter; XFChangeList* pChangeList = new XFChangeList; - for (iter=m_HeadFootFribMap.begin();iter !=m_HeadFootFribMap.end();++iter) + for (auto const& headFootFrib : m_HeadFootFribMap) { - if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT) + if (headFootFrib.first->GetRevisionType() == LwpFrib::REV_INSERT) { XFChangeInsert* pInsert = new XFChangeInsert; - pInsert->SetChangeID(iter->second); - pInsert->SetEditor(iter->first->GetEditor()); + pInsert->SetChangeID(headFootFrib.second); + pInsert->SetEditor(headFootFrib.first->GetEditor()); pChangeList->Add(pInsert); } - else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE) + else if (headFootFrib.first->GetRevisionType() == LwpFrib::REV_DELETE) { XFChangeDelete* pDelete = new XFChangeDelete; - pDelete->SetChangeID(iter->second); - pDelete->SetEditor(iter->first->GetEditor()); + pDelete->SetChangeID(headFootFrib.second); + pDelete->SetEditor(headFootFrib.first->GetEditor()); pChangeList->Add(pDelete); } } |