From c99f72bebdce6d294eb47e070fa1397a98ba2087 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 21 Apr 2017 23:50:23 +0200 Subject: sw: fix a11y crash on double Dispose When testing with the bugdoc for tdf#107126, it happend that upon applying a page style, SwAccessibleContext::Dispose() was called twice, and that's not supposed to happen (and crashes, too, at least inside an assertion). There was an Action that queued up a bunch of events, but the Action did not complete formatting the document, so right after that during Paint more formatting happened and then the FireEvents() called Dispose() and InvalidatePosOrSize() called it again. Guess we shouldn't generate events for objects that we know are disposed due to not being visible. Change-Id: I5a0f04c0f32ee5e949b552f7a373c10ceee5c279 --- sw/source/core/access/accmap.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 0e3d01b66f45..bf530abb7349 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -2390,7 +2390,10 @@ void SwAccessibleMap::InvalidatePosOrSize( const SwFrame *pFrame, else { FireEvents(); - xAccImpl->InvalidatePosOrSize( rOldBox ); + if (xAccImpl->GetMap()) // not if disposed by FireEvents() + { + xAccImpl->InvalidatePosOrSize(rOldBox); + } } } else if( xParentAccImpl.is() ) -- cgit