summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-02-25 23:24:53 +0100
committerMichael Stahl <mstahl@redhat.com>2016-02-26 13:09:41 +0100
commitb299aa7c64adc2de86c367888e6ccb73c4b31bc2 (patch)
tree4f7c1e957ce2afe7d2d3b17c91376c85f859466b
parentc4727a06fe16ed88f2c293aaa3506df8e6523678 (diff)
sw: restore some Dispose calls in a11y code
These were removed by commit a5c4ddcf8ed5344d9bceeffd7431cd6895a407ca but the assertions inevitably triggered by their removal in the ~SwAccessibleMap about "Frame map should be empty after disposing the root frame" were left intact, which (along the total lack of any stated reason) casts some doubt on how well thought out that change was. Basically SwAccessibleMap had the invariant that only visible frames had a valid SwAccessible in the mpFrameMap, and when the frames scrolled out of view their SwAccessible was disposed. Let's try to restore this invariant. The dispose removal has caused crashes in the past too, see commit 104ed86c382b73505b477bf3024982dd27823023. Change-Id: I4b3e7264ce76a8c6e551d68f6bc231982970dfdd
-rw-r--r--sw/source/core/access/acccontext.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 0e4252768d63..86d34cdb9347 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -240,6 +240,11 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
xAccImpl->ViewForwarderChanged(
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
+ // this DisposeShape call was removed by
+ // IAccessibility2 implementation
+ // without giving any reason why
+ DisposeShape( rLower.GetDrawObject(),
+ xAccImpl.get() );
}
break;
// coverity[dead_error_begin] - following conditions exist to avoid compiler warning
@@ -347,6 +352,11 @@ void SwAccessibleContext::ScrolledOut( const SwRect& rOldVisArea )
// It might be that the child is freshly created just to send
// the child event. In this case no listener will exist.
FireStateChangedEvent( AccessibleStateType::SHOWING, false );
+
+ // this Dispose call was removed by IAccessibility2 implementation
+ // without giving any reason why - without it we get stale
+ // entries in SwAccessibleMap::mpFrameMap.
+ Dispose(true);
}
// #i27301# - use new type definition for <_nStates>
@@ -1140,7 +1150,18 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
// note: InvalidatePosOrSize must call _InvalidateContent so that
// SwAccessibleParagraph updates its portions, or dispose it
// (see accmap.cxx: INVALID_CONTENT is contained in POS_CHANGED)
- _InvalidateContent( true );
+ if( !bIsNewShowingState &&
+ SwAccessibleChild( GetParent() ).IsVisibleChildrenOnly() )
+ {
+ // this Dispose call was removed by IAccessibility2 implementation
+ // without giving any reason why - without it we get stale
+ // entries in SwAccessibleMap::mpFrameMap.
+ Dispose(true);
+ }
+ else
+ {
+ _InvalidateContent( true );
+ }
}
void SwAccessibleContext::InvalidateChildPosOrSize(