[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sw/inc sw/source
Caolán McNamara
caolanm at redhat.com
Mon May 28 11:53:19 UTC 2018
sw/inc/accmap.hxx | 3 +++
sw/source/core/access/acccontext.cxx | 6 +++++-
sw/source/core/access/accmap.cxx | 11 ++++++++---
3 files changed, 16 insertions(+), 4 deletions(-)
New commits:
commit bab7384c005921768a9499550c1525d211aeddf9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 25 14:37:03 2018 +0100
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/54903
Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 2739b1a78a01..8582e2354347 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -292,6 +292,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 46e0be9ce220..176358fd4907 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 98a50e784b5b..7047b4ddce47 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2162,6 +2162,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,
@@ -2177,9 +2182,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;
More information about the Libreoffice-commits
mailing list