From 46c767daec1fd419c20769bb4065c68d2a045eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 19 Jul 2026 11:50:49 +0000 Subject: [PATCH] ofz#523387973 Timeout Change-Id: Iccc25a6fb069324c271ea0260ca544a6ce84d8b2 Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7271 Tested-by: Jenkins CPCI Reviewed-by: Miklos Vajna (cherry picked from commit 9d51fc581e96737e2460d663e459439c0dd4f396) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211406 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- lotuswordpro/inc/lwpobjid.hxx | 4 ++++ lotuswordpro/source/filter/lwpstory.cxx | 3 +++ 2 files changed, 7 insertions(+) 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();