tdf#127561 avoid shapes with currently invalid positions
where getAccessibleCellAt would throw and just ignore
the shape, seems to be a temporary problem and the correct
position becomes known later.
Change-Id: I736be9675a03e0a1cb98ceb29caf2d7869c84535
Reviewed-on: https://gerrit.libreoffice.org/78981
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 489ee8a..76e7f21 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1136,9 +1136,15 @@ uno::Reference<XAccessibleRelationSet> ScChildrenShapes::GetRelationSet(const Sc
uno::Reference<XAccessible> xAccessible = mpAccessibleDocument->GetAccessibleSpreadsheet(); // should be the current table
if (pData->xRelationCell && xAccessible.is())
{
uno::Reference<XAccessibleTable> xAccTable (xAccessible->getAccessibleContext(), uno::UNO_QUERY);
if (xAccTable.is())
xAccessible = xAccTable->getAccessibleCellAt(pData->xRelationCell->Row(), pData->xRelationCell->Col());
sal_Int32 nRow = pData->xRelationCell->Row();
sal_Int32 nColumn = pData->xRelationCell->Col();
bool bPositionUnset = nRow == -1 && nColumn == -1;
if (!bPositionUnset)
{
uno::Reference<XAccessibleTable> xAccTable(xAccessible->getAccessibleContext(), uno::UNO_QUERY);
if (xAccTable.is())
xAccessible = xAccTable->getAccessibleCellAt(nRow, nColumn);
}
}
AccessibleRelation aRelation;
aRelation.TargetSet.realloc(1);