sw/source/core/txtnode/atrflyin.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 214e6ed5286566e689a4ef13a9115e2ad38fff57
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Thu Mar 7 15:53:36 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Sun Mar 10 01:21:23 2019 +0100

    tdf#123259 sw_redlinehide: fix reanchoring of drawing objects
    
    ... in SplitNode.
    
    The problem is that first the new anchor position is set in the
    SwFrameFormat, then SwDrawContact::DisconnectFromLayout() is called
    (implicitly from its SwClientNotify()).
    
    This then cause the a11y wrapper to be disposed and an event to be sent,
    which then ATKListener::notifyEvent() immediately processes by
    retrieving all of the children of the anchor SwTextFrame.
    
    At this point, we get an assert from SwTextFrame::MapModelToView,
    because the layout anchor frame is still the old one, but the model
    format already has the new position, so the frame can't map the
    anchor position.
    
    Avoid this by explicitly disconnecting from the layout before setting
    the anchor on the SwFrameFormat.
    
    Change-Id: Iba8960729dd041e13de4963d1b2ab6b223c8a427
    Reviewed-on: https://gerrit.libreoffice.org/68880
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 468ac1bdf1dcdc1f0d679ae2a7bf75102333c0af)
    Reviewed-on: https://gerrit.libreoffice.org/68910
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/source/core/txtnode/atrflyin.cxx 
b/sw/source/core/txtnode/atrflyin.cxx
index 45cc6bdf48d1..a8fe920630a3 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -34,6 +34,7 @@
 #include <flyfrms.hxx>
 #include <objectformatter.hxx>
 #include <calbck.hxx>
+#include <dcontact.hxx>
 
 SwFormatFlyCnt::SwFormatFlyCnt( SwFrameFormat *pFrameFormat )
     : SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -193,6 +194,13 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
     else
     {
         assert(!pFormat->IsModifyLocked()); // need to notify anchor node
+        if (RES_DRAWFRMFMT == pFormat->Which())
+        {
+            if (SdrObject const*const pObj = pFormat->FindSdrObject())
+            {   // tdf#123259 disconnect with *old* anchor position
+                
static_cast<SwDrawContact*>(::GetUserCall(pObj))->DisconnectFromLayout();
+            }
+        }
         pFormat->SetFormatAttr( aAnchor );  // only set the anchor
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to