diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-12-16 15:49:19 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-12-16 17:37:57 +0100 |
commit | bdd1a03b450f9f8a0ead46c38bec58f6879b2c5d (patch) | |
tree | 05b4060e917f90e7b6c810989692230d2f94ed65 | |
parent | c175620c312652b521694547d335f4f70cb11661 (diff) |
It turns out that draw objects in header/footer often don't have
AnchoredObject::mpPageFrame set, so use FindPageFrameOfAnchor()
instead.
(regression from ae06f4be6bbdebc10a88c386064d548848e57f80)
Change-Id: I6d54baa3acffa6775d5b57a1517c77a964065dd0
-rw-r--r-- | sw/source/core/access/accfrmobj.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index bc7f06d2cf61..3c6b3e5ab7f4 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -257,14 +257,19 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& rAccMap ) const } else if( mpDrawObj ) { - aBox = SwRect( mpDrawObj->GetCurrentBoundRect() ); SwDrawContact const*const pContact(dynamic_cast<SwDrawContact const*>(::GetUserCall(mpDrawObj))); // assume that a) the SwVirt* objects that don't have this are handled // by the mpFrame case above b) for genuine SdrObject this must be set // if it's connected to layout assert(pContact); - // tdf#91260 drawing object may be partially off-page - aBox.Intersection(pContact->GetPageFrame()->Frame()); + SwPageFrame const*const pPage(const_cast<SwAnchoredObject *>( + pContact->GetAnchoredObj(mpDrawObj))->FindPageFrameOfAnchor()); + if (pPage) // may end up here with partial layout -> not visible + { + aBox = SwRect( mpDrawObj->GetCurrentBoundRect() ); + // tdf#91260 drawing object may be partially off-page + aBox.Intersection(pPage->Frame()); + } } else if ( mpWindow ) { |