summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-01 18:18:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 07:37:28 +0100
commitcd96af570352ff19b1f1a3d006750237eba8ca5c (patch)
tree8e500c9d37dc43adc2714d5e3a204487a881623f /dbaccess
parent6e334850104b2fe5d325328e64e08c190027f8d9 (diff)
create OMultiTypeInterfaceContainerHelperVar3 template
to supercede OMultiTypeInterfaceContainerHelperVar2 and add (a) type-safety (b) skip the need for doing UNO_QUERY when firing events Change-Id: Iaeb2421da5d92d2d4fd4feb45ab5019ca85d0d7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126192 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx12
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hxx6
2 files changed, 10 insertions, 8 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 16980f05bfe5..5c8ab2095d60 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -280,13 +280,14 @@ void SbaXGridPeer::NotifyStatusChanged(const css::util::URL& _rUrl, const Refere
xControl->statusChanged(aEvt);
else
{
- ::comphelper::OInterfaceContainerHelper2 * pIter = m_aStatusListeners.getContainer(_rUrl);
+ ::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener> * pIter
+ = m_aStatusListeners.getContainer(_rUrl);
if (pIter)
{
- ::comphelper::OInterfaceIteratorHelper2 aListIter(*pIter);
+ ::comphelper::OInterfaceIteratorHelper3 aListIter(*pIter);
while (aListIter.hasMoreElements())
- static_cast< css::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt);
+ aListIter.next()->statusChanged(aEvt);
}
}
}
@@ -445,7 +446,8 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa
void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
{
- ::comphelper::OInterfaceContainerHelper2* pCont = m_aStatusListeners.getContainer(aURL);
+ ::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* pCont
+ = m_aStatusListeners.getContainer(aURL);
if (!pCont)
m_aStatusListeners.addInterface(aURL,xControl);
else
@@ -455,7 +457,7 @@ void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< css::frame::XStat
void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
{
- ::comphelper::OInterfaceContainerHelper2* pCont = m_aStatusListeners.getContainer(aURL);
+ ::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* pCont = m_aStatusListeners.getContainer(aURL);
if ( pCont )
pCont->removeInterface(xControl);
}
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index fceb8d84f7ad..0d22f6dceec1 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,7 +25,7 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/util/URL.hpp>
-#include <comphelper/multiinterfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer3.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/uno3.hxx>
#include "sbamultiplex.hxx"
@@ -93,8 +93,8 @@ namespace dbaui
:public FmXGridPeer
,public css::frame::XDispatch
{
- comphelper::OMultiTypeInterfaceContainerHelperVar2<
- css::util::URL, void, SbaURLCompare> m_aStatusListeners;
+ comphelper::OMultiTypeInterfaceContainerHelperVar3< css::frame::XStatusListener,
+ css::util::URL, SbaURLCompare> m_aStatusListeners;
public:
SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext >&);