summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocument.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-27 15:41:16 +0100
committerAndras Timar <andras.timar@collabora.com>2017-07-31 12:03:56 +0200
commite9258ca4aa431f1d3fefbd4d5b1068568adb3045 (patch)
treef5e605dbff88f27dfb39cfbc37a562489e22bddc /sc/source/ui/Accessibility/AccessibleDocument.cxx
parentfb4f195349e95d8624028cf0bb26589885c226aa (diff)
Resolves: tdf#106872 only request selected shapes
that way we can avoid the super slow code path for filtered rows when we only care about selected shapes Reviewed-on: https://gerrit.libreoffice.org/40496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 192d97cdf091af08a492416824918ea447bfb16f) Related: tdf#106872 factor out getting selected shapes (cherry picked from commit 221dae68df80298e81e6e6549636f3528f5c8bc3) Reviewed-on: https://gerrit.libreoffice.org/40519 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 5e2ffa0b2eb7623d0c9ed37c30caea1452810646) Change-Id: I175fa841e406dbbe7075296f2e0a0e79fa115fb7 765c482a41e9681a1eb145c1833cc94f35a27db3
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 664f0cf951aa..611b3337f771 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -347,7 +347,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();
}
@@ -364,7 +364,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, false);
}
@@ -660,8 +660,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())
{
@@ -696,7 +696,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, true);
@@ -717,8 +717,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(
@@ -786,9 +785,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());
@@ -873,8 +871,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);
@@ -1260,7 +1257,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();