summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-12-05 17:26:06 +0100
committerMichael Stahl <mstahl@redhat.com>2016-12-07 14:46:07 +0100
commitb346439637b7d03a3eb1d6e67dfb585b357567f4 (patch)
tree4b62f38fb8bdfb982234193efcbda3f3b4ed3778 /sw
parent474051a0efad9d4e7825ab78625b0fc561837c68 (diff)
tdf#101464 sw: if a drawing object is moved, notify SwAccessibleMap
When a drawing object is moved from one SwPageFrame to another, of course its position is going to change, but unfortunately nobody tells the a11y code about it, so it may happen that the document view is closed but there is still an entry in SwAccessibleMap::mpShapeMap referencing the possibly dead SdrObject. So we need to add a notification somewhere here: 0 in SwSortedObjs::Remove(SwAnchoredObject&) (this=0x398fd60, _rAnchoredObj=...) at sw/source/core/layout/sortedobjs.cxx:234 1 in SwPageFrame::RemoveDrawObjFromPage(SwAnchoredObject&) (this=0x3fc1130, _rToRemoveObj=...) at sw/source/core/layout/flylay.cxx:849 2 in SwAnchoredDrawObject::RegisterAtCorrectPage() (this=0x4251040) at sw/source/core/layout/anchoreddrawobject.cxx:841 3 in SwAnchoredObject::SetVertPosOrientFrame(SwLayoutFrame const&) (this=this@entry=0x4251040, _rVertPosOrientFrame=...) at sw/source/core/layout/anchoredobject.cxx:194 4 in SwAnchoredDrawObject::MakeObjPosAnchoredAtPara() (this=this@entry=0x4251040) at sw/source/core/layout/anchoreddrawobject.cxx:419 5 in SwAnchoredDrawObject::MakeObjPos() (this=0x4251040) at sw/source/core/layout/anchoreddrawobject.cxx:313 6 in SwObjectFormatter::FormatObj_(SwAnchoredObject&) (this=this@entry=0x35da590, _rAnchoredObj=...) at sw/source/core/layout/objectformatter.cxx:375 For comparison, for text frames the stack looks a bit different and the a11y notification happens here: 0 in SwAccessibleMap::InvalidatePosOrSize(SwFrame const*, SdrObject const*, vcl::Window*, SwRect const&) (this=0x36a92e0, pFrame=pFrame@entry=0x4845b30, pObj=pObj@entry=0x0, pWindow=pWindow@entry=0x0, rOldBox=SwRect = {...}) at sw/source/core/access/accmap.cxx:2352 1 in SwViewShellImp::MoveAccessible(SwFrame const*, SdrObject const*, SwRect const&) (this=this@entry=0x45a5ea0, pFrame=pFrame@entry=0x4845b30, pObj=pObj@entry=0x0, rOldFrame=SwRect = {...}) at sw/source/core/view/viewimp.cxx:324 2 in SwViewShellImp::AddAccessibleFrame(SwFrame const*) (this=0x45a5ea0, pFrame=pFrame@entry=0x4845b30) at sw/source/core/inc/viewimp.hxx:298 3 in SwPageFrame::MoveFly(SwFlyFrame*, SwPageFrame*) (this=0x4597d10, pToMove=pToMove@entry=0x4845b30, pDest=pDest@entry=0x480cb40) at sw/source/core/layout/flylay.cxx:759 4 in SwFlyAtContentFrame::RegisterAtCorrectPage() (this=0x4845b30) at sw/source/core/layout/flycnt.cxx:1399 5 in SwAnchoredObject::SetVertPosOrientFrame(SwLayoutFrame const&) (this=this@entry=0x4845c18, _rVertPosOrientFrame=...) at sw/source/core/layout/anchoredobject.cxx:194 6 in SwFlyAtContentFrame::MakeObjPos() (this=0x4845b30) at sw/source/core/layout/flycnt.cxx:1433 7 in SwFlyFreeFrame::MakeAll(OutputDevice*) (this=this@entry=0x4845b30) at sw/source/core/layout/flylay.cxx:186 8 in SwFlyAtContentFrame::MakeAll(OutputDevice*) (this=0x4845b30, pRenderContext=0x459ea80) at sw/source/core/layout/flycnt.cxx:389 9 in SwFrame::PrepareMake(OutputDevice*) (this=0x4845b30, pRenderContext=0x459ea80) at sw/source/core/layout/calcmove.cxx:345 10 in SwFlyFrame::Calc(OutputDevice*) const (this=<optimized out>, pRenderContext=<optimized out>) at sw/source/core/layout/fly.cxx:2641 Change-Id: Iac33a7527dd514f150b2f2f4b0daa0a8a1fc23b6
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 9559b30adbae..acaebcb1b71f 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -31,6 +31,7 @@
#include <DocumentSettingManager.hxx>
#include <IDocumentState.hxx>
#include <txtfly.hxx>
+#include <viewimp.hxx>
using namespace ::com::sun::star;
@@ -113,6 +114,12 @@ SwPosNotify::~SwPosNotify()
mpAnchoredDrawObj->AnchorFrame()->InvalidatePos();
}
}
+ // tdf#101464 notify SwAccessibleMap about new drawing object position
+ if (mpOldPageFrame->getRootFrame()->IsAnyShellAccessible())
+ {
+ mpOldPageFrame->getRootFrame()->GetCurrShell()->Imp()->MoveAccessible(
+ nullptr, mpAnchoredDrawObj->GetDrawObj(), maOldObjRect);
+ }
}
// --> #i32795#