diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-24 23:33:18 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-25 12:34:32 +0100 |
commit | 015b2cce565b335dfb644ea1dfe44dede8d60815 (patch) | |
tree | 29e5330f992e6a911c114f8b99eed55cf3b8b0e1 /sw | |
parent | 789bfa540f8e01606f5d6c2defe04fbba3217432 (diff) |
sw: avoid creating SwAccessibles for 0-sized layout frames
During layout it happens that a page is deleted and therefore
the footer of the next page moves upward by a pagesize, so a
CHILD_POS_CHANGED accessibility event is generated.
The footer still has 0 size (and 0 position) at that point, so
it's highly questionable that anybody would be interested in
seeing such events.
The event causes a SwAcessible to be created, but for the
parent SwPageFrame no SwAccessible has been created, so the
recursive dispose in ~SwAccessibleMap will leave these
still in the mpFrameMap, as they happen to be invisible then,
and only visible children of SwPageFrames are disposed,
so that's a bit unlucky.
Unfortunately this can't explain the crash in tdf#58624
because there is actually code in ~SwAccessibleMap to clear
the m_pMap back-pointer in all entries of mpFrameMap.
Change-Id: Ic75254310af1bf8eca382c3745c4fe31c6b6f4a0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/acccontext.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/access/accframe.hxx | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index e200104967dc..0e4252768d63 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -1149,9 +1149,11 @@ void SwAccessibleContext::InvalidateChildPosOrSize( { SolarMutexGuard aGuard; - OSL_ENSURE( !rChildFrameOrObj.GetSwFrame() || - !rChildFrameOrObj.GetSwFrame()->Frame().IsEmpty(), - "child context should have a size" ); + // this happens during layout, e.g. when a page is deleted and next page's + // header/footer moves backward such an event is generated + SAL_INFO_IF(rChildFrameOrObj.GetSwFrame() && + rChildFrameOrObj.GetSwFrame()->Frame().IsEmpty(), + "sw.a11y", "child context should have a size"); if ( rChildFrameOrObj.AlwaysIncludeAsChild() ) { diff --git a/sw/source/core/access/accframe.hxx b/sw/source/core/access/accframe.hxx index 55d9e2497043..f128bee19276 100644 --- a/sw/source/core/access/accframe.hxx +++ b/sw/source/core/access/accframe.hxx @@ -148,7 +148,7 @@ protected: inline bool SwAccessibleFrame::IsShowing( const SwRect& rFrame ) const { - return rFrame.IsOver( maVisArea ); + return !rFrame.IsEmpty() && rFrame.IsOver( maVisArea ); } inline bool SwAccessibleFrame::IsShowing( const SwAccessibleMap& rAccMap ) const |