summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-20 17:03:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-23 15:11:27 +0200
commitec940941e0bd7db15c5cf7d43df82226e0d849dc (patch)
treea876a500dfa6a32bc8b284b3b07525480ba60765 /sd
parent1d524bc7a331e8381e88cfd1b6dea4678ad32514 (diff)
tdf#119388 add new UNO listener/broadcaster
so that we only need to fire each event to the exact shape that wants it, instead of spamming all the shapes. Takes deleting a column from 20s to 10s for me. Note that none of the broadcasters are calling disposing(EventObject), so I did not make XShapeEventListener extend lang::XEventListener. If a memory leak regression points at this commit, possibly I missed something. Change-Id: I2b8db08247d3e0203d41faf77491368168994e4d Reviewed-on: https://gerrit.libreoffice.org/77857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx6
-rw-r--r--sd/source/ui/accessibility/AccessiblePageShape.cxx14
-rw-r--r--sd/source/ui/inc/AccessiblePageShape.hxx5
3 files changed, 3 insertions, 22 deletions
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 1d2d1016b594..fe808039929e 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -20,7 +20,7 @@
#include <AccessibleDocumentViewBase.hxx>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/document/XShapeEventBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
@@ -76,8 +76,8 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase (
// Fill the shape tree info.
maShapeTreeInfo.SetModelBroadcaster (
- uno::Reference<document::XEventBroadcaster>(
- mxModel, uno::UNO_QUERY));
+ uno::Reference<document::XShapeEventBroadcaster>(
+ mxModel, uno::UNO_QUERY_THROW));
maShapeTreeInfo.SetController (mxController);
maShapeTreeInfo.SetSdrView (pViewShell->GetView());
maShapeTreeInfo.SetDevice (pSdWindow);
diff --git a/sd/source/ui/accessibility/AccessiblePageShape.cxx b/sd/source/ui/accessibility/AccessiblePageShape.cxx
index 5e22d74c1c00..6390ce18e3b5 100644
--- a/sd/source/ui/accessibility/AccessiblePageShape.cxx
+++ b/sd/source/ui/accessibility/AccessiblePageShape.cxx
@@ -216,24 +216,10 @@ css::uno::Sequence< OUString> SAL_CALL
return AccessibleShape::getSupportedServiceNames();
}
-//===== lang::XEventListener ================================================
-
-void SAL_CALL
- AccessiblePageShape::disposing (const css::lang::EventObject& aEvent)
-{
- ThrowIfDisposed ();
- AccessibleShape::disposing (aEvent);
-}
-
//===== XComponent ==========================================================
void AccessiblePageShape::dispose()
{
- // Unregister listeners.
- Reference<lang::XComponent> xComponent (mxShape, uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->removeEventListener (this);
-
// Cleanup.
mxShape = nullptr;
diff --git a/sd/source/ui/inc/AccessiblePageShape.hxx b/sd/source/ui/inc/AccessiblePageShape.hxx
index 71cc0a769be8..ced504f020d3 100644
--- a/sd/source/ui/inc/AccessiblePageShape.hxx
+++ b/sd/source/ui/inc/AccessiblePageShape.hxx
@@ -95,11 +95,6 @@ public:
virtual css::uno::Sequence< OUString> SAL_CALL
getSupportedServiceNames() override;
- //===== lang::XEventListener ============================================
-
- virtual void SAL_CALL
- disposing (const css::lang::EventObject& Source) override;
-
using AccessibleShape::disposing;
protected: