summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-01 18:43:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 10:30:03 +0100
commit8ef60f89bae290d8c38acacfc792b32176f9afa9 (patch)
treed3781b436a7b02ca1758216cf36360c8756dda97 /dbaccess
parent2b256c84aa4c063c8161b32a7b424daa28b5741b (diff)
use OMultiTypeInterfaceContainerHelperVar3 in OContentHelper
Change-Id: I04e8c5fd38618689ad148ba6fbe823971881cbb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126194 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ContentHelper.cxx12
-rw-r--r--dbaccess/source/core/dataaccess/intercept.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/intercept.hxx4
-rw-r--r--dbaccess/source/core/inc/ContentHelper.hxx4
-rw-r--r--dbaccess/source/core/inc/definitioncontainer.hxx1
5 files changed, 15 insertions, 12 deletions
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index bbf910cbf641..beb75c3d40dd 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -503,14 +503,14 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
return;
// First, notify listeners interested in changes of every property.
- comphelper::OInterfaceContainerHelper2* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
+ comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() );
if ( pAllPropsContainer )
{
- comphelper::OInterfaceIteratorHelper2 aIter( *pAllPropsContainer );
+ comphelper::OInterfaceIteratorHelper3 aIter( *pAllPropsContainer );
while ( aIter.hasMoreElements() )
{
// Propagate event.
- static_cast< XPropertiesChangeListener* >( aIter.next() )->propertiesChange( evt );
+ aIter.next()->propertiesChange( evt );
}
}
@@ -524,15 +524,15 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
const PropertyChangeEvent& rEvent = *propertyChangeEvent;
const OUString& rName = rEvent.PropertyName;
- comphelper::OInterfaceContainerHelper2* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
+ comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName );
if ( pPropsContainer )
{
- comphelper::OInterfaceIteratorHelper2 aIter( *pPropsContainer );
+ comphelper::OInterfaceIteratorHelper3 aIter( *pPropsContainer );
while ( aIter.hasMoreElements() )
{
Sequence< PropertyChangeEvent >* propertyEvents;
- XPropertiesChangeListener* pListener = static_cast< XPropertiesChangeListener * >( aIter.next() );
+ XPropertiesChangeListener* pListener = aIter.next().get();
PropertiesEventListenerMap::iterator it = aListeners.find( pListener );
if ( it == aListeners.end() )
{
diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx
index 3e7f309976f9..6ca2bf4c70b5 100644
--- a/dbaccess/source/core/dataaccess/intercept.cxx
+++ b/dbaccess/source/core/dataaccess/intercept.cxx
@@ -208,7 +208,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
@@ -225,7 +225,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
@@ -249,7 +249,7 @@ void SAL_CALL OInterceptor::addStatusListener(
{
osl::MutexGuard aGuard(m_aMutex);
if(!m_pStatCL)
- m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) );
+ m_pStatCL.reset( new StatusListenerContainer(m_aMutex) );
}
m_pStatCL->addInterface(URL.Complete,Control);
diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx
index 16077c3c9e52..7ce53752f19d 100644
--- a/dbaccess/source/core/dataaccess/intercept.hxx
+++ b/dbaccess/source/core/dataaccess/intercept.hxx
@@ -103,7 +103,9 @@ private:
css::uno::Sequence< OUString > m_aInterceptedURL;
- std::unique_ptr<PropertyChangeListenerContainer> m_pStatCL;
+ typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::frame::XStatusListener, OUString>
+ StatusListenerContainer;
+ std::unique_ptr<StatusListenerContainer> m_pStatCL;
};
} // namespace dbaccess
diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx
index 471729982b9d..5168f1307824 100644
--- a/dbaccess/source/core/inc/ContentHelper.hxx
+++ b/dbaccess/source/core/inc/ContentHelper.hxx
@@ -30,7 +30,7 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <comphelper/interfacecontainer3.hxx>
-#include <comphelper/multiinterfacecontainer2.hxx>
+#include <comphelper/multiinterfacecontainer3.hxx>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/sdbcx/XRename.hpp>
@@ -72,7 +72,7 @@ namespace dbaccess
typedef std::shared_ptr<OContentHelper_Impl> TContentPtr;
- typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>
+ typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertiesChangeListener, OUString>
PropertyChangeListenerContainer;
typedef ::cppu::WeakComponentImplHelper< css::ucb::XContent
, css::ucb::XCommandProcessor
diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx
index bcb6bd364470..9c871601ad6f 100644
--- a/dbaccess/source/core/inc/definitioncontainer.hxx
+++ b/dbaccess/source/core/inc/definitioncontainer.hxx
@@ -36,6 +36,7 @@
#include "ContentHelper.hxx"
#include "containerapprove.hxx"
#include <comphelper/uno3.hxx>
+#include <comphelper/interfacecontainer2.hxx>
namespace dbaccess
{