diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-20 17:03:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-23 15:11:27 +0200 |
commit | ec940941e0bd7db15c5cf7d43df82226e0d849dc (patch) | |
tree | a876a500dfa6a32bc8b284b3b07525480ba60765 /include/sfx2 | |
parent | 1d524bc7a331e8381e88cfd1b6dea4678ad32514 (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 'include/sfx2')
-rw-r--r-- | include/sfx2/sfxbasemodel.hxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx index 9dcba7e68542..92c69b5c3bc9 100644 --- a/include/sfx2/sfxbasemodel.hxx +++ b/include/sfx2/sfxbasemodel.hxx @@ -34,6 +34,7 @@ #include <com/sun/star/document/XUndoManagerSupplier.hpp> #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp> #include <com/sun/star/document/XEventBroadcaster.hpp> +#include <com/sun/star/document/XShapeEventBroadcaster.hpp> #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> @@ -119,7 +120,7 @@ typedef ::cppu::WeakImplHelper < css::container::XChild , css::rdf::XDocumentMetadataAccess , css::document::XDocumentRecovery , css::document::XUndoManagerSupplier - , css::document::XEventBroadcaster + , css::document::XShapeEventBroadcaster , css::document::XDocumentEventBroadcaster , css::lang::XEventListener , css::document::XEventsSupplier @@ -494,24 +495,33 @@ public: virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override; - // XEventBroadcaster - + // document::XEventBroadcaster /**___________________________________________________________________________________________________ @descr - registers the given XEventListener. */ - virtual void SAL_CALL addEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override; /**___________________________________________________________________________________________________ @descr - unregisters the given XEventListener. */ - virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::document::XEventListener >& xListener ) override; - // XDocumentEventBroadcaster + // document::XShapeEventBroadcaster + + /**___________________________________________________________________________________________________ + @descr - registers the given XEventListener. + */ + virtual void SAL_CALL addShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override; + /**___________________________________________________________________________________________________ + @descr - unregisters the given XEventListener. + */ + virtual void SAL_CALL removeShapeEventListener( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::document::XShapeEventListener >& xListener ) override; + + + // XDocumentEventBroadcaster virtual void SAL_CALL addDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override; virtual void SAL_CALL removeDocumentEventListener( const css::uno::Reference< css::document::XDocumentEventListener >& Listener ) override; |