summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-07 18:17:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-08 17:04:03 +0200
commit9104017e1bf76857d2b9686363013e1e7c49e355 (patch)
tree949e30187049ed6d177405c8261b206a9b9088e2 /dbaccess
parent5e69c5fbdb44cd782080e7f4d9ad89dc48b2d1b1 (diff)
create comphelper:OMultiTypeInterfaceContainerHelperVar2 and use it
based on OInterfaceContainerHelper2 which is considerably faster than the original OInterfaceContainerHelper Change-Id: Ia8cdbc5ef877a7af3d9193e1bb2faf1595c15470 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ContentHelper.cxx8
-rw-r--r--dbaccess/source/core/inc/ContentHelper.hxx4
-rw-r--r--dbaccess/source/ui/browser/formadapter.cxx2
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx8
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hxx3
-rw-r--r--dbaccess/source/ui/inc/sbamultiplex.hxx18
6 files changed, 22 insertions, 21 deletions
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 7de159b2d095..e08fc61b65bb 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -486,10 +486,10 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
return;
// First, notify listeners interested in changes of every property.
- OInterfaceContainerHelper* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
+ comphelper::OInterfaceContainerHelper2* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
if ( pAllPropsContainer )
{
- OInterfaceIteratorHelper aIter( *pAllPropsContainer );
+ comphelper::OInterfaceIteratorHelper2 aIter( *pAllPropsContainer );
while ( aIter.hasMoreElements() )
{
// Propagate event.
@@ -507,10 +507,10 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
const PropertyChangeEvent& rEvent = *propertyChangeEvent;
const OUString& rName = rEvent.PropertyName;
- OInterfaceContainerHelper* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
+ comphelper::OInterfaceContainerHelper2* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
if ( pPropsContainer )
{
- OInterfaceIteratorHelper aIter( *pPropsContainer );
+ comphelper::OInterfaceIteratorHelper2 aIter( *pPropsContainer );
while ( aIter.hasMoreElements() )
{
Sequence< PropertyChangeEvent >* propertyEvents;
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index b7d275481ec1..f23dd4ca2b2d 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -29,7 +29,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/sdbcx/XRename.hpp>
@@ -71,7 +71,7 @@ namespace dbaccess
typedef std::shared_ptr<OContentHelper_Impl> TContentPtr;
- typedef cppu::OMultiTypeInterfaceContainerHelperVar<OUString>
+ typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
PropertyChangeListenerContainer;
typedef ::cppu::WeakComponentImplHelper< css::ucb::XContent
, css::ucb::XCommandProcessor
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index ee38f63609b0..7a07f0a9d206 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -1134,7 +1134,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any
aValue >>= m_sName;
- ::cppu::OInterfaceIteratorHelper aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
+ ::comphelper::OInterfaceIteratorHelper2 aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME));
while (aIt.hasMoreElements())
static_cast< css::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aEvt);
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index b65ba2b45d73..5a1f2f9767ea 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -279,11 +279,11 @@ void SbaXGridPeer::NotifyStatusChanged(const css::util::URL& _rUrl, const Refere
xControl->statusChanged(aEvt);
else
{
- ::cppu::OInterfaceContainerHelper * pIter = m_aStatusListeners.getContainer(_rUrl);
+ ::comphelper::OInterfaceContainerHelper2 * pIter = m_aStatusListeners.getContainer(_rUrl);
if (pIter)
{
- ::cppu::OInterfaceIteratorHelper aListIter(*pIter);
+ ::comphelper::OInterfaceIteratorHelper2 aListIter(*pIter);
while (aListIter.hasMoreElements())
static_cast< css::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt);
}
@@ -444,7 +444,7 @@ 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)
{
- ::cppu::OInterfaceContainerHelper* pCont = m_aStatusListeners.getContainer(aURL);
+ ::comphelper::OInterfaceContainerHelper2* pCont = m_aStatusListeners.getContainer(aURL);
if (!pCont)
m_aStatusListeners.addInterface(aURL,xControl);
else
@@ -454,7 +454,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)
{
- ::cppu::OInterfaceContainerHelper* pCont = m_aStatusListeners.getContainer(aURL);
+ ::comphelper::OInterfaceContainerHelper2* 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 841925734c5e..fceb8d84f7ad 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <comphelper/multiinterfacecontainer2.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/uno3.hxx>
#include "sbamultiplex.hxx"
@@ -92,7 +93,7 @@ namespace dbaui
:public FmXGridPeer
,public css::frame::XDispatch
{
- cppu::OMultiTypeInterfaceContainerHelperVar<
+ comphelper::OMultiTypeInterfaceContainerHelperVar2<
css::util::URL, void, SbaURLCompare> m_aStatusListeners;
public:
diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx
index a61aa79e9793..a83d5543b61d 100644
--- a/dbaccess/source/ui/inc/sbamultiplex.hxx
+++ b/dbaccess/source/ui/inc/sbamultiplex.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/frame/XStatusListener.hpp>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer2.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
@@ -176,7 +176,7 @@ namespace dbaui
:public OSbaWeakSubObject \
,public listenerclass \
{ \
- typedef ::cppu::OMultiTypeInterfaceContainerHelperVar< \
+ typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar2< \
OUString > ListenerContainerMap; \
ListenerContainerMap m_aListeners; \
\
@@ -198,11 +198,11 @@ namespace dbaui
\
sal_Int32 getOverallLen() const; \
\
- ::cppu::OInterfaceContainerHelper* getContainer(const OUString& rName) \
+ ::comphelper::OInterfaceContainerHelper2* getContainer(const OUString& rName) \
{ return m_aListeners.getContainer(rName); } \
\
private: \
- void Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e); \
+ void Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const eventtype& e); \
}; \
// implementation of property listener multiplexers
@@ -232,7 +232,7 @@ namespace dbaui
\
void SAL_CALL classname::methodname(const eventtype& e) \
{ \
- ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(e.PropertyName); \
+ ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(e.PropertyName); \
if (pListeners) \
Notify(*pListeners, e); \
\
@@ -263,10 +263,10 @@ namespace dbaui
sal_Int32 classname::getOverallLen() const \
{ \
sal_Int32 nLen = 0; \
- const css::uno::Sequence< OUString > aContained = m_aListeners.getContainedTypes(); \
+ const std::vector< OUString > aContained = m_aListeners.getContainedTypes(); \
for ( OUString const & s : aContained) \
{ \
- ::cppu::OInterfaceContainerHelper* pListeners = m_aListeners.getContainer(s); \
+ ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(s); \
if (!pListeners) \
continue; \
nLen += pListeners->getLength(); \
@@ -274,11 +274,11 @@ namespace dbaui
return nLen; \
} \
\
- void classname::Notify(::cppu::OInterfaceContainerHelper& rListeners, const eventtype& e) \
+ void classname::Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const eventtype& e) \
{ \
eventtype aMulti(e); \
aMulti.Source = &m_rParent; \
- ::cppu::OInterfaceIteratorHelper aIt(rListeners); \
+ ::comphelper::OInterfaceIteratorHelper2 aIt(rListeners); \
while (aIt.hasMoreElements()) \
static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
} \