summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-25 14:37:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-28 10:45:22 +0200
commitc12bfe9296b5db66ae7326f1dd99b1aa8fb9d2bb (patch)
tree9d78b30d10eed0b9d2918c4cc9c5087d7ccd8ab1
parente7fe9094831036c295bf448737869a47f1873e3f (diff)
tdf#117601 a11y crash after merging cells
this is similar to tdf#87199, in this case the accessibiles for the merged cells are not visible so not removed when their frame is deleted, but remain in the cache pointing to invalid frames. Change-Id: Ibc5b9f27541683b8f3604839fa3d1431380a4039 Reviewed-on: https://gerrit.libreoffice.org/54808 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/inc/accmap.hxx3
-rw-r--r--sw/source/core/access/acccontext.cxx6
-rw-r--r--sw/source/core/access/accmap.cxx11
3 files changed, 16 insertions, 4 deletions
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index fc7f665da383..c78bea3e0e51 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -277,6 +277,9 @@ public:
Point PixelToCore (const Point& rPoint) const;
tools::Rectangle CoreToPixel (const tools::Rectangle& rRect) const;
+ // is there a known accessibility impl cached for the frame
+ bool Contains(const SwFrame *pFrame) const;
+
private:
/** get mapping mode for LogicToPixel and PixelToLogic conversions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 628ad727dc47..efb6b415d372 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -402,8 +402,12 @@ void SwAccessibleContext::DisposeChildren(const SwFrame *pFrame,
if( pLower )
{
::rtl::Reference< SwAccessibleContext > xAccImpl;
- if( rLower.IsAccessible( GetShell()->IsPreview() ) )
+ if (rLower.IsAccessible(GetShell()->IsPreview())
+ // tdf#117601 dispose the darn thing if it ever was accessible
+ || GetMap()->Contains(pLower))
+ {
xAccImpl = GetMap()->GetContextImpl( pLower, false );
+ }
if( xAccImpl.is() )
xAccImpl->Dispose( bRecursive );
else
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 712b70873507..43cc0974625e 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2158,6 +2158,11 @@ void SwAccessibleMap::RemoveContext( const SdrObject *pObj )
}
}
+bool SwAccessibleMap::Contains(const SwFrame *pFrame) const
+{
+ return (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end());
+}
+
void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
const SdrObject *pObj,
vcl::Window* pWindow,
@@ -2173,9 +2178,9 @@ void SwAccessibleMap::A11yDispose( const SwFrame *pFrame,
OSL_ENSURE( !aFrameOrObj.GetSwFrame() || aFrameOrObj.GetSwFrame()->IsAccessibleFrame(),
"non accessible frame should be disposed" );
- if (aFrameOrObj.IsAccessible( GetShell()->IsPreview() )
- // fdo#87199 dispose the darn thing if it ever was accessible
- || (pFrame && mpFrameMap && mpFrameMap->find(pFrame) != mpFrameMap->end()))
+ if (aFrameOrObj.IsAccessible(GetShell()->IsPreview())
+ // fdo#87199 dispose the darn thing if it ever was accessible
+ || Contains(pFrame))
{
::rtl::Reference< SwAccessibleContext > xAccImpl;
::rtl::Reference< SwAccessibleContext > xParentAccImpl;