summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/sbamultiplex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/browser/sbamultiplex.cxx')
-rw-r--r--dbaccess/source/ui/browser/sbamultiplex.cxx78
1 files changed, 26 insertions, 52 deletions
diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx
index 732b730c2b3d..8bf7ed747c03 100644
--- a/dbaccess/source/ui/browser/sbamultiplex.cxx
+++ b/dbaccess/source/ui/browser/sbamultiplex.cxx
@@ -18,6 +18,8 @@
*/
#include <sbamultiplex.hxx>
+#include <cppuhelper/queryinterface.hxx>
+
using namespace dbaui;
// the listener multiplexers
@@ -49,9 +51,7 @@ void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStat
{
m_aLastKnownStatus = e;
m_aLastKnownStatus.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt( *this );
- while ( aIt.hasMoreElements() )
- aIt.next()->statusChanged( m_aLastKnownStatus );
+ notifyEach( &XStatusListener::statusChanged, m_aLastKnownStatus );
}
// LoadListener
@@ -80,44 +80,34 @@ void SAL_CALL SbaXLoadMultiplexer::loaded(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->loaded(aMulti);
+ notifyEach( &XLoadListener::loaded, aMulti );
}
void SAL_CALL SbaXLoadMultiplexer::unloaded(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->unloaded(aMulti);
+ notifyEach( &XLoadListener::unloaded, aMulti );
}
void SAL_CALL SbaXLoadMultiplexer::unloading(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->unloading(aMulti);
+ notifyEach( &XLoadListener::unloading, aMulti );
}
void SAL_CALL SbaXLoadMultiplexer::reloading(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->reloading(aMulti);
+ notifyEach( &XLoadListener::reloading, aMulti );
}
void SAL_CALL SbaXLoadMultiplexer::reloaded(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->reloaded(aMulti);
+ notifyEach( &XLoadListener::reloaded, aMulti );
}
@@ -147,27 +137,21 @@ void SAL_CALL SbaXRowSetMultiplexer::cursorMoved(const css::lang::EventObject& e
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->cursorMoved(aMulti);
+ notifyEach( &XRowSetListener::cursorMoved, aMulti );
}
void SAL_CALL SbaXRowSetMultiplexer::rowChanged(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->rowChanged(aMulti);
+ notifyEach( &XRowSetListener::rowChanged, aMulti );
}
void SAL_CALL SbaXRowSetMultiplexer::rowSetChanged(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->rowSetChanged(aMulti);
+ notifyEach( &XRowSetListener::rowSetChanged, aMulti );
}
// css::sdb::XRowSetApproveListener
@@ -251,9 +235,7 @@ void SAL_CALL SbaXSQLErrorMultiplexer::errorOccured(const css::sdb::SQLErrorEven
{
css::sdb::SQLErrorEvent aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->errorOccured(aMulti);
+ notifyEach( &XSQLErrorListener::errorOccured, aMulti );
}
// css::form::XDatabaseParameterListener
@@ -362,9 +344,7 @@ void SAL_CALL SbaXResetMultiplexer::resetted(const css::lang::EventObject& e)
{
css::lang::EventObject aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->resetted(aMulti);
+ notifyEach( &XResetListener::resetted, aMulti );
}
// css::beans::XPropertyChangeListener
@@ -390,7 +370,7 @@ void SAL_CALL SbaXPropertyChangeMultiplexer::disposing(const css::lang::EventObj
}
void SAL_CALL SbaXPropertyChangeMultiplexer::propertyChange(const css::beans::PropertyChangeEvent& e)
{
- ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(e.PropertyName);
+ ::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>* pListeners = m_aListeners.getContainer(e.PropertyName);
if (pListeners)
Notify(*pListeners, e);
@@ -401,13 +381,13 @@ void SAL_CALL SbaXPropertyChangeMultiplexer::propertyChange(const css::beans::Pr
}
void SbaXPropertyChangeMultiplexer::addInterface(const OUString& rName,
- const css::uno::Reference< css::uno::XInterface > & rListener)
+ const css::uno::Reference< css::beans::XPropertyChangeListener > & rListener)
{
m_aListeners.addInterface(rName, rListener);
}
void SbaXPropertyChangeMultiplexer::removeInterface(const OUString& rName,
- const css::uno::Reference< css::uno::XInterface > & rListener)
+ const css::uno::Reference< css::beans::XPropertyChangeListener > & rListener)
{
m_aListeners.removeInterface(rName, rListener);
}
@@ -424,7 +404,7 @@ sal_Int32 SbaXPropertyChangeMultiplexer::getOverallLen() const
const std::vector< OUString > aContained = m_aListeners.getContainedTypes();
for ( OUString const & s : aContained)
{
- ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(s);
+ ::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>* pListeners = m_aListeners.getContainer(s);
if (!pListeners)
continue;
nLen += pListeners->getLength();
@@ -432,13 +412,11 @@ sal_Int32 SbaXPropertyChangeMultiplexer::getOverallLen() const
return nLen;
}
-void SbaXPropertyChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const css::beans::PropertyChangeEvent& e)
+void SbaXPropertyChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper3<XPropertyChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e)
{
css::beans::PropertyChangeEvent aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper2 aIt(rListeners);
- while (aIt.hasMoreElements())
- static_cast< css::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aMulti);
+ rListeners.notifyEach( &XPropertyChangeListener::propertyChange, aMulti );
}
// css::beans::XVetoableChangeListener
@@ -464,7 +442,7 @@ void SAL_CALL SbaXVetoableChangeMultiplexer::disposing(const css::lang::EventObj
}
void SAL_CALL SbaXVetoableChangeMultiplexer::vetoableChange(const css::beans::PropertyChangeEvent& e)
{
- ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(e.PropertyName);
+ ::comphelper::OInterfaceContainerHelper3<css::beans::XVetoableChangeListener>* pListeners = m_aListeners.getContainer(e.PropertyName);
if (pListeners)
Notify(*pListeners, e);
@@ -475,13 +453,13 @@ void SAL_CALL SbaXVetoableChangeMultiplexer::vetoableChange(const css::beans::Pr
}
void SbaXVetoableChangeMultiplexer::addInterface(const OUString& rName,
- const css::uno::Reference< css::uno::XInterface > & rListener)
+ const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener)
{
m_aListeners.addInterface(rName, rListener);
}
void SbaXVetoableChangeMultiplexer::removeInterface(const OUString& rName,
- const css::uno::Reference< css::uno::XInterface > & rListener)
+ const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener)
{
m_aListeners.removeInterface(rName, rListener);
}
@@ -498,7 +476,7 @@ sal_Int32 SbaXVetoableChangeMultiplexer::getOverallLen() const
const std::vector< OUString > aContained = m_aListeners.getContainedTypes();
for ( OUString const & s : aContained)
{
- ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(s);
+ ::comphelper::OInterfaceContainerHelper3<XVetoableChangeListener>* pListeners = m_aListeners.getContainer(s);
if (!pListeners)
continue;
nLen += pListeners->getLength();
@@ -506,13 +484,11 @@ sal_Int32 SbaXVetoableChangeMultiplexer::getOverallLen() const
return nLen;
}
-void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const css::beans::PropertyChangeEvent& e)
+void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper3<XVetoableChangeListener>& rListeners, const css::beans::PropertyChangeEvent& e)
{
css::beans::PropertyChangeEvent aMulti(e);
aMulti.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper2 aIt(rListeners);
- while (aIt.hasMoreElements())
- static_cast< css::beans::XVetoableChangeListener*>(aIt.next())->vetoableChange(aMulti);
+ rListeners.notifyEach( &XVetoableChangeListener::vetoableChange, aMulti );
}
// css::beans::XPropertiesChangeListener
@@ -546,9 +522,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence<
for (css::beans::PropertyChangeEvent & rEvent : asNonConstRange(aMulti))
rEvent.Source = &m_rParent;
- ::comphelper::OInterfaceIteratorHelper3 aIt(*this);
- while (aIt.hasMoreElements())
- aIt.next()->propertiesChange(aMulti);
+ notifyEach( &css::beans::XPropertiesChangeListener::propertiesChange, aMulti );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */