summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocument.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/Accessibility/AccessibleDocument.cxx')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 0f967955b11d..73bd5935733c 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -333,7 +333,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc
{
if (mpAccessibleDocument)
xSelectionSupplier->addSelectionChangeListener(mpAccessibleDocument);
- uno::Reference<drawing::XShapes> xShapes (xSelectionSupplier->getSelection(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
if (xShapes.is())
mnShapesSelected = xShapes->getCount();
}
@@ -350,7 +350,7 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc
if (!xSelectionSupplier.is())
throw uno::RuntimeException();
- uno::Reference<drawing::XShapes> xShapes(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
if (xShapes.is())
FindSelectedShapesChanges(xShapes);
}
@@ -644,8 +644,8 @@ bool ScChildrenShapes::IsSelected(sal_Int32 nIndex,
#if OSL_DEBUG_LEVEL > 0 // test whether it is truly selected by a slower method
uno::Reference< drawing::XShape > xReturnShape;
bool bDebugResult(false);
- uno::Reference<container::XIndexAccess> xIndexAccess;
- xSelectionSupplier->getSelection() >>= xIndexAccess;
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
+ uno::Reference<container::XIndexAccess> xIndexAccess(xShapes, uno::UNO_QUERY);
if (xIndexAccess.is())
{
@@ -680,7 +680,7 @@ bool ScChildrenShapes::SelectionChanged()
if (!xSelectionSupplier.is())
throw uno::RuntimeException();
- uno::Reference<drawing::XShapes> xShapes(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
bResult = FindSelectedShapesChanges(xShapes);
@@ -701,8 +701,7 @@ void ScChildrenShapes::Select(sal_Int32 nIndex)
uno::Reference<drawing::XShape> xShape;
if (!IsSelected(nIndex, xShape) && maZOrderedShapes[nIndex]->bSelectable)
{
- uno::Reference<drawing::XShapes> xShapes;
- xSelectionSupplier->getSelection() >>= xShapes;
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
if (!xShapes.is())
xShapes = drawing::ShapeCollection::create(
@@ -770,9 +769,8 @@ void ScChildrenShapes::SelectAll()
void ScChildrenShapes::FillShapes(std::vector < uno::Reference < drawing::XShape > >& rShapes) const
{
- uno::Reference<container::XIndexAccess> xIndexAccess;
- xSelectionSupplier->getSelection() >>= xIndexAccess;
-
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
+ uno::Reference<container::XIndexAccess> xIndexAccess(xShapes, uno::UNO_QUERY);
if (xIndexAccess.is())
{
sal_uInt32 nCount(xIndexAccess->getCount());
@@ -857,8 +855,7 @@ void ScChildrenShapes::Deselect(sal_Int32 nChildIndex)
{
if (xShape.is())
{
- uno::Reference<drawing::XShapes> xShapes;
- xSelectionSupplier->getSelection() >>= xShapes;
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
if (xShapes.is())
xShapes->remove(xShape);
@@ -1243,7 +1240,8 @@ void ScChildrenShapes::AddShape(const uno::Reference<drawing::XShape>& xShape, b
if (!xSelectionSupplier.is())
throw uno::RuntimeException();
- uno::Reference<container::XEnumerationAccess> xEnumAcc(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
+ uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes());
+ uno::Reference<container::XEnumerationAccess> xEnumAcc(xShapes, uno::UNO_QUERY);
if (xEnumAcc.is())
{
uno::Reference<container::XEnumeration> xEnum = xEnumAcc->createEnumeration();