diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-22 10:35:18 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-04-07 17:46:40 +0200 |
commit | 0ccd5d24e78649b8ca8ae9e378395fe590410441 (patch) | |
tree | b1e44b942caf9a0dfe9e43e9d1d27239d13a987d /lotuswordpro | |
parent | ce0b421339f208363867d14810ba067124367101 (diff) |
ofz#7063 ensure lifecycle
Reviewed-on: https://gerrit.libreoffice.org/51734
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit 919ff229ff33b0b23b30ee963e9f96f46fe9e1a2)
Change-Id: I18d62bc3bd409ca65c85ea47e8d5b3930481edf9
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpbookmarkmgr.cxx | 34 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpbookmarkmgr.hxx | 4 |
2 files changed, 16 insertions, 22 deletions
diff --git a/lotuswordpro/source/filter/lwpbookmarkmgr.cxx b/lotuswordpro/source/filter/lwpbookmarkmgr.cxx index b3b01f916916..19586f4cbe7c 100644 --- a/lotuswordpro/source/filter/lwpbookmarkmgr.cxx +++ b/lotuswordpro/source/filter/lwpbookmarkmgr.cxx @@ -57,48 +57,42 @@ void LwpBookmarkMgr::AddXFBookmarkStart(const OUString& sName,XFBookmarkStart* pMark) { - std::map<OUString,XFBookmarkStart*>::iterator iter; - iter = m_MapStart.find(sName); + auto iter = m_MapStart.find(sName); if (iter == m_MapStart.end())//not find { m_MapStart[sName] = pMark; } else //have exist the same bookmark name { - XFBookmarkStart* pFind = iter->second; - OUString totalName = pFind->GetDivision() + ":"; - totalName += pFind->GetName(); - pFind->SetName(totalName); - m_MapStart[totalName] = pFind; + auto xFind = iter->second; + OUString totalName = xFind->GetDivision() + ":"; + totalName += xFind->GetName(); + xFind->SetName(totalName); + m_MapStart[totalName] = xFind; m_MapStart[sName] = pMark; } } void LwpBookmarkMgr::AddXFBookmarkEnd(const OUString& sName,XFBookmarkEnd* pMark) { - std::map<OUString,XFBookmarkEnd*>::iterator iter; - iter = m_MapEnd.find(sName); + auto iter = m_MapEnd.find(sName); if (iter == m_MapEnd.end())//not find { m_MapEnd[sName] = pMark; } else //have exist the same bookmark name { - XFBookmarkEnd* pFind = iter->second; - OUString totalName = pFind->GetDivision() + ":"; - totalName += pFind->GetName(); - pFind->SetName(totalName); - m_MapEnd[totalName] = pFind; + auto xFind = iter->second; + OUString totalName = xFind->GetDivision() + ":"; + totalName += xFind->GetName(); + xFind->SetName(totalName); + m_MapEnd[totalName] = xFind; m_MapEnd[sName] = pMark; } } bool LwpBookmarkMgr::FindBookmark(const OUString& sName) { - std::map<OUString,XFBookmarkStart*>::iterator iter; - iter = m_MapStart.find(sName); - if (iter != m_MapStart.end()) - return true; - else - return false; + auto iter = m_MapStart.find(sName); + return iter != m_MapStart.end(); } LwpBookmarkMgr::LwpBookmarkMgr() diff --git a/lotuswordpro/source/filter/lwpbookmarkmgr.hxx b/lotuswordpro/source/filter/lwpbookmarkmgr.hxx index 6f471b7302b1..509a75ce7a91 100644 --- a/lotuswordpro/source/filter/lwpbookmarkmgr.hxx +++ b/lotuswordpro/source/filter/lwpbookmarkmgr.hxx @@ -75,8 +75,8 @@ public: ~LwpBookmarkMgr(); LwpBookmarkMgr(); private: - std::map<OUString,XFBookmarkStart*> m_MapStart; - std::map<OUString,XFBookmarkEnd*> m_MapEnd; + std::map<OUString, rtl::Reference<XFBookmarkStart>> m_MapStart; + std::map<OUString, rtl::Reference<XFBookmarkEnd>> m_MapEnd; }; #endif |