diff --git a/lotuswordpro/inc/lwpobjid.hxx b/lotuswordpro/inc/lwpobjid.hxx index b35e58450e77..fe79616ff54a 100644 --- a/lotuswordpro/inc/lwpobjid.hxx +++ b/lotuswordpro/inc/lwpobjid.hxx @@ -100,6 +100,10 @@ public: sal_uInt32 GetLow() const ; sal_uInt16 GetHigh() const ; + sal_uInt64 GetIdentity() const + { + return (static_cast(m_nHigh) << 32) | m_nLow; + } bool operator == (const LwpObjectID &Other) const; bool operator != (const LwpObjectID &Other) const; diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 8de8757c07b1..0204b9d2396f 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -127,8 +127,11 @@ void LwpStory::XFConvert(XFContentContainer* pCont) //Release Lwp Objects rtl::Reference xCur(dynamic_cast(GetFirstPara().obj().get())); rtl::Reference xNext; + o3tl::sorted_vector aReleased; while (xCur.is()) { + if (!aReleased.insert(xCur->GetObjectID().GetIdentity()).second) + break; xNext.set(dynamic_cast(xCur->GetNext().obj().get())); LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(); LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();