[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Tue Dec 20 22:16:41 UTC 2016


 sw/source/core/attr/calbck.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 654b86cf3425d7a49b13a97e4b11223d43b9e86e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Dec 20 23:08:31 2016 +0100

    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=<optimized out>) at sw/source/core/attr/format.cxx:239
     5 in SwFrameFormat::~SwFrameFormat() (this=0x39e6320, __in_chrg=<optimized out>) 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 "<SwDraw Contact::Modify(..)> - unhandled attribute?".
    
    Change-Id: Ifba7fa8a1f41f09b1a3fcbb4cdf17f340e0fbe33

diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 10d0af7..18a795a 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


More information about the Libreoffice-commits mailing list