diff options
-rw-r--r-- | lotuswordpro/source/filter/lwpchangemgr.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpfrib.cxx | 18 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpfrib.hxx | 4 |
3 files changed, 23 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpchangemgr.cxx b/lotuswordpro/source/filter/lwpchangemgr.cxx index ee1906865eb0..3816d8f52339 100644 --- a/lotuswordpro/source/filter/lwpchangemgr.cxx +++ b/lotuswordpro/source/filter/lwpchangemgr.cxx @@ -89,6 +89,7 @@ LwpChangeMgr::LwpChangeMgr() m_pFribMap = &m_DocFribMap; m_ChangeList.clear(); } + LwpChangeMgr::~LwpChangeMgr() { m_pFribMap=nullptr; @@ -102,6 +103,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib) m_nCounter++; OUString sID = "ct"+ OUString::number(m_nCounter); m_pFribMap->insert(std::pair<LwpFrib*,OUString>(pFrib,sID)); + pFrib->Register(m_pFribMap); } OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 3b41993f735f..6cb34aa2167a 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -86,7 +86,8 @@ LwpFrib::LwpFrib(LwpPara* pPara) - : m_pPara(pPara) + : m_pFribMap(nullptr) + , m_pPara(pPara) , m_pNext(nullptr) , m_nFribType(0) , m_pModifiers(nullptr) @@ -99,6 +100,7 @@ LwpFrib::LwpFrib(LwpPara* pPara) LwpFrib::~LwpFrib() { + Deregister(); } LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag,sal_uInt8 editID) @@ -447,4 +449,18 @@ XFColor LwpFrib::GetHighlightColor() return pGlobal->GetHighlightColor(m_nEditor); } +void LwpFrib::Register(std::map<LwpFrib*,OUString>* pFribMap) +{ + m_pFribMap = pFribMap; +} + +void LwpFrib::Deregister() +{ + if (m_pFribMap) + { + m_pFribMap->erase(this); + m_pFribMap = nullptr; + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/source/filter/lwpfrib.hxx b/lotuswordpro/source/filter/lwpfrib.hxx index 70258c8e86be..a51be22f50ba 100644 --- a/lotuswordpro/source/filter/lwpfrib.hxx +++ b/lotuswordpro/source/filter/lwpfrib.hxx @@ -96,6 +96,7 @@ public: OUString GetEditor(); XFColor GetHighlightColor(); protected: + std::map<LwpFrib*,OUString>* m_pFribMap; LwpPara* m_pPara; LwpFrib* m_pNext; sal_uInt8 m_nFribType; @@ -118,6 +119,9 @@ public: REV_INSERT =0, REV_DELETE = 1, }; + + void Register(std::map<LwpFrib*,OUString>* pFribMap); + void Deregister(); private: static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo); protected: |