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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Mar 8 10:56:02 UTC 2019


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

New commits:
commit 468ac1bdf1dcdc1f0d679ae2a7bf75102333c0af
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Mar 7 15:53:36 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 11:55:29 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.Stahl at 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
     }
 


More information about the Libreoffice-commits mailing list