diff options
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); } } |