sw/source/core/access/accframe.hxx | 3 ++- sw/source/core/access/accmap.cxx | 23 ++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-)
New commits: commit f9c92771af05886c2d35f4446d514488fd448109 Author: Michael Stahl <[email protected]> Date: Fri May 13 16:11:09 2016 +0200 sw: document the MoveInvalidXAccToEnd() oddity Change-Id: I9e1e3b277a75a2f8c95fa71308af6aff7d81ccc7 diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 24dae46..4c2aaae 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -516,10 +516,12 @@ public: return mbFiring; } - void MoveInvalidXAccToEnd(); + void MoveMissingXAccToEnd(); }; -void SwAccessibleEventList_Impl::MoveInvalidXAccToEnd() +// see comment in SwAccessibleMap::InvalidatePosOrSize() +// last case "else if(pParent)" for why this surprising hack exists +void SwAccessibleEventList_Impl::MoveMissingXAccToEnd() { size_t nSize = size(); if (nSize < 2 ) @@ -3085,7 +3087,7 @@ void SwAccessibleMap::FireEvents() if( mpEvents ) { mpEvents->SetFiring(); - mpEvents->MoveInvalidXAccToEnd(); + mpEvents->MoveMissingXAccToEnd(); for( auto const& aEvent : *mpEvents ) FireEvent(aEvent); commit 6afa142fdecc3a7f2f182bcd2c035bf3089f1ce8 Author: Michael Stahl <[email protected]> Date: Fri May 13 15:46:10 2016 +0200 tdf#99722 sw: avoid buffering a11y events for not-visible frames The problem with the bugdoc is that all pages are moved by 60 twips or so in CheckViewLayout(), which generates a event for every SwTextFrame but there is no SwAccessible for the SwTextFrame yet hence it is a CHILD_POS_CHANGE on the parent, which happens to be (because SwPageFrames are not accessible) the SwRootFrame so that's how we get an enormous number (~90k per 500 pages) WeakReference in the buffered SwAccessibleEvent_Impl pointing to the same object (the SwAccessible of the root frame). Then at a later stage the events are actually sent and SwAccessibleContext::InvalidateChildPosOrSize() discards all but 80 or so that are on the first page. So check the visiblility before buffering the event, to avoid scalability issues in the WeakReference. This brings the cpu-time from 1:37 to 0:17 for the 500 pager, and the full bugdoc is now just 3-4 seconds slower than with a11y disabled. Change-Id: Ia91653fd7572f32ce3cf765a4ecd2b7077ace8f6 diff --git a/sw/source/core/access/accframe.hxx b/sw/source/core/access/accframe.hxx index f128bee..337ecb3 100644 --- a/sw/source/core/access/accframe.hxx +++ b/sw/source/core/access/accframe.hxx @@ -76,16 +76,17 @@ protected: ::std::list< sw::access::SwAccessibleChild >& rChildren, bool bInPagePreview ); -protected: bool IsEditable( SwViewShell *pVSh ) const; bool IsOpaque( SwViewShell *pVSh ) const; +public: bool IsShowing( const SwAccessibleMap& rAccMap, const sw::access::SwAccessibleChild& rFrameOrObj ) const; inline bool IsShowing( const SwRect& rFrame ) const; inline bool IsShowing( const SwAccessibleMap& rAccMap ) const; +protected: inline bool IsInPagePreview() const { return mbIsInPagePreview; diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 1f0fec9..24dae46 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -2437,10 +2437,17 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrame *pFrame, { if( GetShell()->ActionPend() ) { - SwAccessibleEvent_Impl aEvent( - SwAccessibleEvent_Impl::CHILD_POS_CHANGED, - xParentAccImpl.get(), aFrameOrObj, rOldBox ); - AppendEvent( aEvent ); + assert(pParent); + // tdf#99722 faster not to buffer events that won't be sent + if (!SwAccessibleChild(pParent).IsVisibleChildrenOnly() + || xParentAccImpl->IsShowing(rOldBox) + || xParentAccImpl->IsShowing(*this, aFrameOrObj)) + { + SwAccessibleEvent_Impl aEvent( + SwAccessibleEvent_Impl::CHILD_POS_CHANGED, + xParentAccImpl.get(), aFrameOrObj, rOldBox ); + AppendEvent( aEvent ); + } } else { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
