summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 09:38:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 20:42:00 +0100
commitf9f5c9f0d6af2cb2f39d5bc1513216b8d892977c (patch)
tree38a38137eb99b1177e5dd85d0e948388307e850d /basic
parentff2068892d88091b26f3a3c034bcca49727d5840 (diff)
replace comphelper::OListenerContainer with OInterfaceContainerHelper3
OInterfaceContainerHelper3 is in wide use and can do the same thing with less ceremony Change-Id: I5252738d6b7bda6245c66da46352944ead79bd52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/inc/namecont.hxx18
-rw-r--r--basic/source/uno/namecont.cxx19
2 files changed, 6 insertions, 31 deletions
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 6a3b020d00a4..11c5febe0a04 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -50,7 +50,6 @@
#include <cppuhelper/basemutex.hxx>
#include <rtl/ref.hxx>
#include <comphelper/interfacecontainer3.hxx>
-#include <comphelper/listenernotification.hxx>
#include <xmlscript/xmllib_imexp.hxx>
#include <comphelper/interfacecontainer3.hxx>
@@ -158,21 +157,8 @@ public:
};
-typedef ::comphelper::OListenerContainerBase<
- css::script::vba::XVBAScriptListener,
- css::script::vba::VBAScriptEvent > VBAScriptListenerContainer_BASE;
-
-class VBAScriptListenerContainer final : public VBAScriptListenerContainer_BASE
-{
-public:
- explicit VBAScriptListenerContainer( ::osl::Mutex& rMutex );
-
-private:
- virtual bool implTypedNotify(
- const css::uno::Reference< css::script::vba::XVBAScriptListener >& rxListener,
- const css::script::vba::VBAScriptEvent& rEvent ) override;
-};
-
+typedef ::comphelper::OInterfaceContainerHelper3<
+ css::script::vba::XVBAScriptListener > VBAScriptListenerContainer;
class SfxLibrary;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 87b33ea9be66..b92f5a590617 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -338,17 +338,6 @@ void ModifiableHelper::setModified( bool _bModified )
}
-VBAScriptListenerContainer::VBAScriptListenerContainer( ::osl::Mutex& rMutex ) :
- VBAScriptListenerContainer_BASE( rMutex )
-{
-}
-
-bool VBAScriptListenerContainer::implTypedNotify( const Reference< vba::XVBAScriptListener >& rxListener, const vba::VBAScriptEvent& rEvent )
-{
- rxListener->notifyVBAScriptEvent( rEvent );
- return true; // notify all other listeners too
-}
-
// Ctor
SfxLibraryContainer::SfxLibraryContainer()
: SfxLibraryContainer_BASE( m_aMutex )
@@ -2675,7 +2664,7 @@ void SAL_CALL SfxLibraryContainer::disposing()
{
Reference< XModel > xModel = mxOwnerDocument;
EventObject aEvent( xModel );
- maVBAScriptListeners.disposing( aEvent );
+ maVBAScriptListeners.disposeAndClear( aEvent );
stopAllComponentListening();
mxOwnerDocument.clear();
}
@@ -2850,12 +2839,12 @@ sal_Int32 SAL_CALL SfxLibraryContainer::getRunningVBAScripts()
void SAL_CALL SfxLibraryContainer::addVBAScriptListener( const Reference< vba::XVBAScriptListener >& rxListener )
{
- maVBAScriptListeners.addTypedListener( rxListener );
+ maVBAScriptListeners.addInterface( rxListener );
}
void SAL_CALL SfxLibraryContainer::removeVBAScriptListener( const Reference< vba::XVBAScriptListener >& rxListener )
{
- maVBAScriptListeners.removeTypedListener( rxListener );
+ maVBAScriptListeners.removeInterface( rxListener );
}
void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifier, const OUString& rModuleName )
@@ -2875,7 +2864,7 @@ void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifie
Reference< XModel > xModel = mxOwnerDocument; // weak-ref -> ref
vba::VBAScriptEvent aEvent( Reference<XInterface>(xModel, UNO_QUERY), nIdentifier, rModuleName );
- maVBAScriptListeners.notify( aEvent );
+ maVBAScriptListeners.notifyEach( &css::script::vba::XVBAScriptListener::notifyVBAScriptEvent, aEvent );
}
// Methods XServiceInfo