Kaydet (Commit) 468ac1bd authored tarafından Michael Stahl's avatar Michael Stahl

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: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst 01fbc622
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment