From 0cf5d53208e487f98f4351b4ca40110079914288 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 20 Dec 2016 23:08:31 +0100 Subject: assert SwDrawContact unhandled attr. on exporting ooo67621-1.odt to DOCX Check in SwModify::Remove() that unrelated clients aren't inserted into an active SwClientIter. Old value = (sw::WriterListener *) 0x0 New value = (SwDrawFrameFormat *) 0x72d83f0 SwModify::Remove (this=0x37fd850, pDepend=0x6ca85a8) at sw/source/core/attr/calbck.cxx:220 0 in SwModify::Remove(SwClient*) (this=0x37fd850, pDepend=0x6ca85a8) at sw/source/core/attr/calbck.cxx:220 1 in ClientModify(SwClient*, SfxPoolItem const*, SfxPoolItem const*) (pClient=0x6ca85a8, pOld=0x7ffe9d041bf0, pNew=0x7ffe9d041c10) at sw/source/core/unocore/unoobj2.cxx:326 2 in SwXShape::Modify(SfxPoolItem const*, SfxPoolItem const*) (this=0x6ca8540, pOld=0x7ffe9d041bf0, pNew=0x7ffe9d041c10) at sw/source/core/unocore/unodraw.cxx:2037 3 in SwClient::ModifyNotification(SfxPoolItem const*, SfxPoolItem const*) (this=0x6ca85a8, pOldValue=0x7ffe9d041bf0, pNewValue=0x7ffe9d041c10) at sw/inc/calbck.hxx:130 4 in SwFormat::~SwFormat() (this=0x39e6320, __in_chrg=) at sw/source/core/attr/format.cxx:239 5 in SwFrameFormat::~SwFrameFormat() (this=0x39e6320, __in_chrg=) at sw/source/core/layout/atrfrm.cxx:2519 So the SwXShape was a client of the SwFrameFormat that is deleted, then is removed and added at the parent SwFrameFormat by ~SwFormat, then it is removed *again* when its own Modify handles the SwFormatChg notification, but this time it messes up the SwClientIter in ~SwFormat, putting in a m_pPosition SwFrameFormat that is actually a client of the parent SwFrameFormat, not the deleted one! Thus the deleted SwFrameFormat is confused and sends a "sibling" of itself the SwFormatChg notification and that then asserts with dcontact.cxx:1468 " - unhandled attribute?". Change-Id: Ifba7fa8a1f41f09b1a3fcbb4cdf17f340e0fbe33 (cherry picked from commit 654b86cf3425d7a49b13a97e4b11223d43b9e86e) Reviewed-on: https://gerrit.libreoffice.org/32260 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/source/core/attr/calbck.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 54a036bdb110..a9598b8cf082 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -219,7 +219,8 @@ SwClient* SwModify::Remove( SwClient* pDepend ) { for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) { - if( rIter.m_pCurrent == pDepend || rIter.m_pPosition == pDepend ) + if (&rIter.m_rRoot == this && + (rIter.m_pCurrent == pDepend || rIter.m_pPosition == pDepend)) { // if object being removed is the current or next object in an // iterator, advance this iterator -- cgit