InterfaceContainer2 with vector instead of Sequence

create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
This commit is contained in:
Noel Grandin
2016-01-25 08:52:03 +02:00
committed by Noel Grandin
parent 0e7cd653ea
commit 752cd07d08
263 changed files with 1655 additions and 707 deletions
+1
View File
@@ -26,6 +26,7 @@ $(eval $(call gb_Library_set_componentfile,animcore,animations/source/animcore/a
$(eval $(call gb_Library_use_sdk_api,animcore))
$(eval $(call gb_Library_use_libraries,animcore,\
comphelper \
cppu \
cppuhelper \
sal \
+5 -5
View File
@@ -47,7 +47,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakref.hxx>
@@ -60,8 +60,8 @@
using ::osl::Mutex;
using ::osl::Guard;
using ::cppu::OInterfaceContainerHelper;
using ::cppu::OInterfaceIteratorHelper;
using ::comphelper::OInterfaceContainerHelper2;
using ::comphelper::OInterfaceIteratorHelper2;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::XInterface;
@@ -287,7 +287,7 @@ public:
void fireChangeListener();
private:
OInterfaceContainerHelper maChangeListener;
OInterfaceContainerHelper2 maChangeListener;
static void initTypeProvider( sal_Int16 nNodeType ) throw();
@@ -2129,7 +2129,7 @@ void AnimationNode::fireChangeListener()
{
Guard< Mutex > aGuard( maMutex );
OInterfaceIteratorHelper aIterator( maChangeListener );
OInterfaceIteratorHelper2 aIterator( maChangeListener );
if( aIterator.hasMoreElements() )
{
Reference< XInterface > xSource( static_cast<OWeakObject*>(this), UNO_QUERY );
+4 -4
View File
@@ -532,7 +532,7 @@ void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventLis
void Window::fireMousePressedEvent( const css::awt::MouseEvent& rEvt )
{
::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
if( pContainer )
{
@@ -545,7 +545,7 @@ void Window::fireMousePressedEvent( const css::awt::MouseEvent& rEvt )
void Window::fireMouseReleasedEvent( const css::awt::MouseEvent& rEvt )
{
::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseListener>::get());
if( pContainer )
{
@@ -558,7 +558,7 @@ void Window::fireMouseReleasedEvent( const css::awt::MouseEvent& rEvt )
void Window::fireMouseMovedEvent( const css::awt::MouseEvent& rEvt )
{
::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseMotionListener>::get());
::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XMouseMotionListener>::get());
if( pContainer )
{
@@ -571,7 +571,7 @@ void Window::fireMouseMovedEvent( const css::awt::MouseEvent& rEvt )
void Window::fireSetFocusEvent( const css::awt::FocusEvent& rEvt )
{
::cppu::OInterfaceContainerHelper* pContainer = maListeners.getContainer( cppu::UnoType<awt::XFocusListener>::get());
::comphelper::OInterfaceContainerHelper2* pContainer = maListeners.getContainer( cppu::UnoType<awt::XFocusListener>::get());
if( pContainer )
{
+2 -2
View File
@@ -25,7 +25,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
@@ -4297,7 +4297,7 @@ class ModuleInvocationProxy : public WeakImplHelper< XInvocation, XComponent >
SbxObjectRef m_xScopeObj;
bool m_bProxyIsClassModuleObject;
::cppu::OInterfaceContainerHelper m_aListeners;
::comphelper::OInterfaceContainerHelper2 m_aListeners;
public:
ModuleInvocationProxy( const OUString& aPrefix, SbxObjectRef xScopeObj );
+3 -3
View File
@@ -79,8 +79,8 @@ class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
css::uno::Type mType;
css::uno::XInterface* mpxEventSource;
::cppu::OInterfaceContainerHelper maContainerListeners;
::cppu::OInterfaceContainerHelper maChangesListeners;
::comphelper::OInterfaceContainerHelper2 maContainerListeners;
::comphelper::OInterfaceContainerHelper2 maChangesListeners;
public:
NameContainer( const css::uno::Type& rType )
@@ -157,7 +157,7 @@ public:
class ModifiableHelper
{
private:
::cppu::OInterfaceContainerHelper m_aModifyListeners;
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
::cppu::OWeakObject& m_rEventSource;
bool mbModified;
+2 -2
View File
@@ -60,7 +60,7 @@
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <svtools/grfmgr.hxx>
#include <memory>
@@ -130,7 +130,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > m_xDocumentProperties;
::rtl::Reference< UndoManager > m_pUndoManager;
::cppu::OInterfaceContainerHelper m_aControllers;
::comphelper::OInterfaceContainerHelper2 m_aControllers;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > m_xCurrentController;
sal_uInt16 m_nControllerLockCount;
@@ -22,7 +22,7 @@
#include "WrappedPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -94,7 +94,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
};
} // namespace wrapper
@@ -23,7 +23,7 @@
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/chart/XAxis.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -131,7 +131,7 @@ private: //methods
private: //member
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
tAxisType m_eType;
@@ -607,16 +607,7 @@ void ChartDataWrapper::fireChartDataChangeEvent(
if( xSrc.is() )
aEvent.Source = xSrc;
::cppu::OInterfaceIteratorHelper aIter( m_aEventListenerContainer );
while( aIter.hasMoreElements() )
{
uno::Reference<
::com::sun::star::chart::XChartDataChangeEventListener > xListener(
aIter.next(), uno::UNO_QUERY );
if( xListener.is() )
xListener->chartDataChanged( aEvent );
}
m_aEventListenerContainer.notifyEach( &css::chart::XChartDataChangeEventListener::chartDataChanged, aEvent );
}
void ChartDataWrapper::switchToInternalDataProvider()
@@ -21,7 +21,7 @@
#include "MutexContainer.hxx"
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart/XDateCategories.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -157,7 +157,7 @@ private: //member
::com::sun::star::chart2::XAnyDescriptionAccess > m_xDataAccess;
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
};
} // namespace wrapper
@@ -23,7 +23,7 @@
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -126,7 +126,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
eType m_eType;
sal_Int32 m_nSeriesIndexInNewAPI;
@@ -241,7 +241,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
::com::sun::star::uno::Reference<
::com::sun::star::chart::XAxis > m_xXAxis;
@@ -22,7 +22,7 @@
#include "WrappedPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -89,7 +89,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
tGridType m_eType;
};
@@ -23,7 +23,7 @@
#include "ReferenceSizePropertyProvider.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -102,7 +102,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
};
} // namespace wrapper
@@ -21,7 +21,7 @@
#include "MutexContainer.hxx"
#include "WrappedIgnoreProperty.hxx"
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -115,7 +115,7 @@ private: //methods
private: //member
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
WrappedIgnoreProperty m_aWrappedLineJointProperty;
};
@@ -123,7 +123,7 @@ private:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
::chart::TitleHelper::eTitleType m_eTitleType;
};
@@ -20,7 +20,7 @@
#define INCLUDED_CHART2_SOURCE_CONTROLLER_CHARTAPIWRAPPER_UPDOWNBARWRAPPER_HXX
#include "MutexContainer.hxx"
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -114,7 +114,7 @@ private: //methods
private: //member
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
OUString m_aPropertySetName;
};
@@ -22,7 +22,7 @@
#include "WrappedPropertySet.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -76,7 +76,7 @@ protected:
private:
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::comphelper::OInterfaceContainerHelper2 m_aEventListenerContainer;
bool m_bWall;
};
@@ -86,7 +86,7 @@ void SAL_CALL CommandDispatch::addStatusListener( const Reference< frame::XStatu
{
aIt = m_aListeners.insert(
m_aListeners.begin(),
tListenerMap::value_type( URL.Complete, new ::cppu::OInterfaceContainerHelper( m_aMutex )));
tListenerMap::value_type( URL.Complete, new ::comphelper::OInterfaceContainerHelper2( m_aMutex )));
}
OSL_ASSERT( aIt != m_aListeners.end());
@@ -155,7 +155,7 @@ void CommandDispatch::fireStatusEventForURL(
{
if( aIt->second )
{
::cppu::OInterfaceIteratorHelper aIntfIt( *((*aIt).second) );
::comphelper::OInterfaceIteratorHelper2 aIntfIt( *((*aIt).second) );
while( aIntfIt.hasMoreElements())
{
@@ -21,6 +21,7 @@
#include "MutexContainer.hxx"
#include <cppuhelper/compbase.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -130,7 +131,7 @@ protected:
::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
private:
typedef ::std::map< OUString, ::cppu::OInterfaceContainerHelper* >
typedef ::std::map< OUString, ::comphelper::OInterfaceContainerHelper2* >
tListenerMap;
tListenerMap m_aListeners;
+3 -3
View File
@@ -227,10 +227,10 @@ bool ChartModel::impl_isControllerConnected( const uno::Reference< frame::XContr
{
try
{
uno::Sequence< uno::Reference<uno::XInterface> > aSeq = m_aControllers.getElements();
for( sal_Int32 nN = aSeq.getLength(); nN--; )
std::vector< uno::Reference<uno::XInterface> > aSeq = m_aControllers.getElements();
for( const auto & r : aSeq )
{
if( aSeq[nN] == xController )
if( r == xController )
return true;
}
}
@@ -0,0 +1,29 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CppunitTest_CppunitTest,comphelper_ifcontainer))
$(eval $(call gb_CppunitTest_add_exception_objects,comphelper_ifcontainer,\
comphelper/qa/container/comphelper_ifcontainer \
))
$(eval $(call gb_CppunitTest_use_api,comphelper_ifcontainer,\
udkapi \
))
$(eval $(call gb_CppunitTest_use_libraries,comphelper_ifcontainer,\
comphelper \
cppu \
cppuhelper \
sal \
$(gb_UWINAPI) \
))
# vim: set noet sw=4 ts=4:
@@ -11,6 +11,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,comphelper_test))
$(eval $(call gb_CppunitTest_add_exception_objects,comphelper_test, \
comphelper/qa/string/test_string \
comphelper/qa/container/testifcontainer \
))
$(eval $(call gb_CppunitTest_use_api,comphelper_test, \
+1
View File
@@ -60,6 +60,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/container/NamedPropertyValuesContainer \
comphelper/source/container/container \
comphelper/source/container/containermultiplexer \
comphelper/source/container/interfacecontainer2 \
comphelper/source/container/embeddedobjectcontainer \
comphelper/source/container/enumerablemap \
comphelper/source/container/enumhelper \
+1
View File
@@ -30,6 +30,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,comphelper,\
$(eval $(call gb_Module_add_check_targets,comphelper,\
CppunitTest_comphelper_syntaxhighlight_test \
CppunitTest_comphelper_variadictemplates_test \
CppunitTest_comphelper_ifcontainer \
CppunitTest_comphelper_test \
))
@@ -0,0 +1,212 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/types.h>
#include <string.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
#include <com/sun/star/lang/XEventListener.hpp>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/propshlp.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
class ContainerListener;
struct ContainerStats {
int m_nAlive;
int m_nDisposed;
ContainerStats() : m_nAlive(0), m_nDisposed(0) {}
};
class ContainerListener : public ::cppu::WeakImplHelper1< XEventListener >
{
ContainerStats *m_pStats;
public:
explicit ContainerListener(ContainerStats *pStats)
: m_pStats(pStats) { m_pStats->m_nAlive++; }
virtual ~ContainerListener() { m_pStats->m_nAlive--; }
virtual void SAL_CALL disposing( const EventObject& )
throw (RuntimeException, std::exception) override
{
m_pStats->m_nDisposed++;
}
};
namespace comphelper_ifcontainer
{
static const int nTests = 10;
class IfTest : public CppUnit::TestFixture
{
osl::Mutex m_aGuard;
public:
void testCreateDispose()
{
ContainerStats aStats;
comphelper::OInterfaceContainerHelper2 *pContainer;
pContainer = new comphelper::OInterfaceContainerHelper2(m_aGuard);
CPPUNIT_ASSERT_MESSAGE("Empty container not empty",
pContainer->getLength() == 0);
int i;
for (i = 0; i < nTests; i++)
{
Reference<XEventListener> xRef = new ContainerListener(&aStats);
int nNewLen = pContainer->addInterface(xRef);
CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
nNewLen == i + 1);
CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
pContainer->getLength() == i + 1);
}
CPPUNIT_ASSERT_MESSAGE("alive count mismatch",
aStats.m_nAlive == nTests);
EventObject aObj;
pContainer->disposeAndClear(aObj);
CPPUNIT_ASSERT_MESSAGE("dispose count mismatch",
aStats.m_nDisposed == nTests);
CPPUNIT_ASSERT_MESSAGE("leaked container left alive",
aStats.m_nAlive == 0);
delete pContainer;
}
void testEnumerate()
{
int i;
ContainerStats aStats;
comphelper::OInterfaceContainerHelper2 *pContainer;
pContainer = new comphelper::OInterfaceContainerHelper2(m_aGuard);
std::vector< Reference< XEventListener > > aListeners;
for (i = 0; i < nTests; i++)
{
Reference<XEventListener> xRef = new ContainerListener(&aStats);
pContainer->addInterface(xRef);
aListeners.push_back(xRef);
}
std::vector< Reference< XInterface > > aElements = pContainer->getElements();
CPPUNIT_ASSERT_EQUAL_MESSAGE("query contents",
(int)aElements.size(), nTests);
if ((int)aElements.size() == nTests)
{
for (i = 0; i < nTests; i++)
{
CPPUNIT_ASSERT_MESSAGE("mismatching elements",
aElements[i] == aListeners[i]);
}
}
pContainer->clear();
CPPUNIT_ASSERT_MESSAGE("non-empty container post clear",
pContainer->getLength() == 0);
delete pContainer;
}
template < typename ContainerType, typename ContainedType >
void doContainerTest(const ContainedType *pTypes)
{
ContainerStats aStats;
ContainerType *pContainer;
pContainer = new ContainerType(m_aGuard);
int i;
Reference<XEventListener> xRefs[nTests * 2];
// add these interfaces
for (i = 0; i < nTests * 2; i++)
{
xRefs[i] = new ContainerListener(&aStats);
pContainer->addInterface(pTypes[i / 2], xRefs[i]);
}
// check it is all there
for (i = 0; i < nTests; i++)
{
cppu::OInterfaceContainerHelper *pHelper;
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[1] == xRefs[i*2+1]);
}
// remove every other interface
for (i = 0; i < nTests; i++)
pContainer->removeInterface(pTypes[i], xRefs[i*2+1]);
// check it is half there
for (i = 0; i < nTests; i++)
{
cppu::OInterfaceContainerHelper *pHelper;
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
}
// remove the 1st half of the rest
for (i = 0; i < nTests / 2; i++)
pContainer->removeInterface(pTypes[i], xRefs[i*2]);
// check it is half there
for (i = 0; i < nTests / 2; i++)
{
cppu::OInterfaceContainerHelper *pHelper;
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0);
}
delete pContainer;
}
// Automatic registration code
CPPUNIT_TEST_SUITE(IfTest);
CPPUNIT_TEST(testCreateDispose);
CPPUNIT_TEST(testEnumerate);
CPPUNIT_TEST_SUITE_END();
};
} // namespace cppu_ifcontainer
CPPUNIT_TEST_SUITE_REGISTRATION(comphelper_ifcontainer::IfTest);
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+145
View File
@@ -0,0 +1,145 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <osl/mutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/beans/XVetoableChangeListener.hpp>
using namespace ::cppu;
using namespace ::osl;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::uno;
class TestListener : public WeakImplHelper1< XVetoableChangeListener >
{
public:
// Methods
virtual void SAL_CALL disposing( const css::lang::EventObject& /*Source*/ ) throw(css::uno::RuntimeException)
{
}
virtual void SAL_CALL vetoableChange( const css::beans::PropertyChangeEvent& /*aEvent*/ )
throw(css::beans::PropertyVetoException, css::uno::RuntimeException)
{
}
};
void test_interfacecontainer()
{
Mutex mutex;
{
OInterfaceContainerHelper helper( mutex );
Reference< XVetoableChangeListener > r1 = new TestListener();
Reference< XVetoableChangeListener > r2 = new TestListener();
Reference< XVetoableChangeListener > r3 = new TestListener();
helper.addInterface( r1 );
helper.addInterface( r2 );
helper.addInterface( r3 );
helper.disposeAndClear( EventObject() );
}
{
OInterfaceContainerHelper helper( mutex );
Reference< XVetoableChangeListener > r1 = new TestListener();
Reference< XVetoableChangeListener > r2 = new TestListener();
Reference< XVetoableChangeListener > r3 = new TestListener();
helper.addInterface( r1 );
helper.addInterface( r2 );
helper.addInterface( r3 );
OInterfaceIteratorHelper iterator( helper );
while( iterator.hasMoreElements() )
((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
helper.disposeAndClear( EventObject() );
}
{
OInterfaceContainerHelper helper( mutex );
Reference< XVetoableChangeListener > r1 = new TestListener();
Reference< XVetoableChangeListener > r2 = new TestListener();
Reference< XVetoableChangeListener > r3 = new TestListener();
helper.addInterface( r1 );
helper.addInterface( r2 );
helper.addInterface( r3 );
OInterfaceIteratorHelper iterator( helper );
((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
iterator.remove();
((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
iterator.remove();
((XVetoableChangeListener*)iterator.next())->vetoableChange( PropertyChangeEvent() );
iterator.remove();
OSL_ASSERT( helper.getLength() == 0 );
helper.disposeAndClear( EventObject() );
}
{
OInterfaceContainerHelper helper( mutex );
Reference< XVetoableChangeListener > r1 = new TestListener();
Reference< XVetoableChangeListener > r2 = new TestListener();
Reference< XVetoableChangeListener > r3 = new TestListener();
helper.addInterface( r1 );
helper.addInterface( r2 );
helper.addInterface( r3 );
{
OInterfaceIteratorHelper iterator( helper );
while( iterator.hasMoreElements() )
{
Reference< XVetoableChangeListener > r = ((XVetoableChangeListener*)iterator.next());
if( r == r1 )
iterator.remove();
}
}
OSL_ASSERT( helper.getLength() == 2 );
{
OInterfaceIteratorHelper iterator( helper );
while( iterator.hasMoreElements() )
{
Reference< XVetoableChangeListener > r = ((XVetoableChangeListener*)iterator.next());
OSL_ASSERT( r != r1 && ( r == r2 || r == r3 ) );
}
}
helper.disposeAndClear( EventObject() );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -0,0 +1,307 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/propshlp.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <memory>
#include <com/sun/star/lang/XEventListener.hpp>
using namespace osl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
namespace comphelper
{
OInterfaceIteratorHelper2::OInterfaceIteratorHelper2( OInterfaceContainerHelper2 & rCont_ )
: rCont( rCont_ )
{
MutexGuard aGuard( rCont.rMutex );
if( rCont.bInUse )
// worst case, two iterators at the same time
rCont.copyAndResetInUse();
bIsList = rCont_.bIsList;
aData = rCont_.aData;
if( bIsList )
{
rCont.bInUse = true;
nRemain = aData.pAsVector->size();
}
else if( aData.pAsInterface )
{
aData.pAsInterface->acquire();
nRemain = 1;
}
else
nRemain = 0;
}
OInterfaceIteratorHelper2::~OInterfaceIteratorHelper2()
{
bool bShared;
{
MutexGuard aGuard( rCont.rMutex );
// bResetInUse protect the iterator against recursion
bShared = aData.pAsVector == rCont.aData.pAsVector && rCont.bIsList;
if( bShared )
{
OSL_ENSURE( rCont.bInUse, "OInterfaceContainerHelper2 must be in use" );
rCont.bInUse = false;
}
}
if( !bShared )
{
if( bIsList )
// Sequence owned by the iterator
delete aData.pAsVector;
else if( aData.pAsInterface )
// Interface is acquired by the iterator
aData.pAsInterface->release();
}
}
XInterface * OInterfaceIteratorHelper2::next()
{
if( nRemain )
{
nRemain--;
if( bIsList )
return (*aData.pAsVector)[nRemain].get();
else if( aData.pAsInterface )
return aData.pAsInterface;
}
// exception
return nullptr;
}
void OInterfaceIteratorHelper2::remove()
{
if( bIsList )
{
OSL_ASSERT( nRemain >= 0 &&
nRemain < (sal_Int32)aData.pAsVector->size() );
rCont.removeInterface( (*aData.pAsVector)[nRemain] );
}
else
{
OSL_ASSERT( 0 == nRemain );
rCont.removeInterface( aData.pAsInterface );
}
}
OInterfaceContainerHelper2::OInterfaceContainerHelper2( Mutex & rMutex_ )
: rMutex( rMutex_ )
, bInUse( false )
, bIsList( false )
{
}
OInterfaceContainerHelper2::~OInterfaceContainerHelper2()
{
OSL_ENSURE( !bInUse, "~OInterfaceContainerHelper2 but is in use" );
if( bIsList )
delete aData.pAsVector;
else if( aData.pAsInterface )
aData.pAsInterface->release();
}
sal_Int32 OInterfaceContainerHelper2::getLength() const
{
MutexGuard aGuard( rMutex );
if( bIsList )
return aData.pAsVector->size();
else if( aData.pAsInterface )
return 1;
return 0;
}
std::vector< Reference<XInterface> > OInterfaceContainerHelper2::getElements() const
{
std::vector< Reference<XInterface> > rVec;
MutexGuard aGuard( rMutex );
if( bIsList )
rVec = *aData.pAsVector;
else if( aData.pAsInterface )
{
rVec.push_back( Reference<XInterface>( aData.pAsInterface ) );
}
return rVec;
}
void OInterfaceContainerHelper2::copyAndResetInUse()
{
OSL_ENSURE( bInUse, "OInterfaceContainerHelper2 not in use" );
if( bInUse )
{
// this should be the worst case. If a iterator is active
// and a new Listener is added.
if( bIsList )
aData.pAsVector = new std::vector< Reference< XInterface > >( *aData.pAsVector );
else if( aData.pAsInterface )
aData.pAsInterface->acquire();
bInUse = false;
}
}
sal_Int32 OInterfaceContainerHelper2::addInterface( const Reference<XInterface> & rListener )
{
OSL_ASSERT( rListener.is() );
MutexGuard aGuard( rMutex );
if( bInUse )
copyAndResetInUse();
if( bIsList )
{
aData.pAsVector->push_back( rListener );
return aData.pAsVector->size();
}
else if( aData.pAsInterface )
{
std::vector< Reference< XInterface > > * pVec = new std::vector< Reference< XInterface > >( 2 );
(*pVec)[0] = aData.pAsInterface;
(*pVec)[1] = rListener;
aData.pAsInterface->release();
aData.pAsVector = pVec;
bIsList = true;
return 2;
}
else
{
aData.pAsInterface = rListener.get();
if( rListener.is() )
rListener->acquire();
return 1;
}
}
sal_Int32 OInterfaceContainerHelper2::removeInterface( const Reference<XInterface> & rListener )
{
OSL_ASSERT( rListener.is() );
MutexGuard aGuard( rMutex );
if( bInUse )
copyAndResetInUse();
if( bIsList )
{
sal_Int32 nLen = aData.pAsVector->size();
sal_Int32 i;
for( i = 0; i < nLen; i++ )
{
// It is not valid to compare the pointer directly, but it's faster.
if( (*aData.pAsVector)[i].get() == rListener.get() )
{
aData.pAsVector->erase(aData.pAsVector->begin()+i);
break;
}
}
// interface not found, use the correct compare method
if( i == nLen )
{
for( i = 0; i < nLen; i++ )
{
if( (*aData.pAsVector)[i] == rListener )
{
aData.pAsVector->erase(aData.pAsVector->begin()+i);
break;
}
}
}
if( aData.pAsVector->size() == 1 )
{
XInterface * p = (*aData.pAsVector)[0].get();
p->acquire();
delete aData.pAsVector;
aData.pAsInterface = p;
bIsList = false;
return 1;
}
else
return aData.pAsVector->size();
}
else if( aData.pAsInterface && Reference<XInterface>( aData.pAsInterface ) == rListener )
{
aData.pAsInterface->release();
aData.pAsInterface = nullptr;
}
return aData.pAsInterface ? 1 : 0;
}
void OInterfaceContainerHelper2::disposeAndClear( const EventObject & rEvt )
{
ClearableMutexGuard aGuard( rMutex );
OInterfaceIteratorHelper2 aIt( *this );
// Release container, in case new entries come while disposing
OSL_ENSURE( !bIsList || bInUse, "OInterfaceContainerHelper2 not in use" );
if( !bIsList && aData.pAsInterface )
aData.pAsInterface->release();
// set the member to null, use the iterator to delete the values
aData.pAsInterface = nullptr;
bIsList = false;
bInUse = false;
aGuard.clear();
while( aIt.hasMoreElements() )
{
try
{
Reference<XEventListener > xLst( aIt.next(), UNO_QUERY );
if( xLst.is() )
xLst->disposing( rEvt );
}
catch ( RuntimeException & )
{
// be robust, if e.g. a remote bridge has disposed already.
// there is no way to delegate the error to the caller :o(.
}
}
}
void OInterfaceContainerHelper2::clear()
{
ClearableMutexGuard aGuard( rMutex );
OInterfaceIteratorHelper2 aIt( *this );
// Release container, in case new entries come while disposing
OSL_ENSURE( !bIsList || bInUse, "OInterfaceContainerHelper2 not in use" );
if( !bIsList && aData.pAsInterface )
aData.pAsInterface->release();
// set the member to null, use the iterator to delete the values
aData.pAsInterface = nullptr;
bIsList = false;
bInUse = false;
// release mutex before aIt destructor call
aGuard.clear();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -40,7 +40,7 @@
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/script/XScriptListener.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/implbase.hxx>
#include <deque>
@@ -82,7 +82,7 @@ class ImplEventAttacherManager
::std::deque< AttacherIndex_Impl > aIndex;
Mutex aLock;
// Container for the ScriptListener
OInterfaceContainerHelper aScriptListeners;
OInterfaceContainerHelper2 aScriptListeners;
// Instance of EventAttacher
Reference< XEventAttacher2 > xAttacher;
Reference< XComponentContext > mxContext;
@@ -193,7 +193,7 @@ void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event)
aScriptEvent.ScriptCode = aScriptCode;
// Iterate over all listeners and pass events.
OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
OInterfaceIteratorHelper2 aIt( mpManager->aScriptListeners );
while( aIt.hasMoreElements() )
static_cast<XScriptListener *>(aIt.next())->firing( aScriptEvent );
}
@@ -259,7 +259,7 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even
Any aRet;
// Iterate over all listeners and pass events.
OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
OInterfaceIteratorHelper2 aIt( mpManager->aScriptListeners );
while( aIt.hasMoreElements() )
{
aRet = static_cast<XScriptListener *>(aIt.next())->approveFiring( aScriptEvent );
@@ -20,7 +20,7 @@
#include <comphelper/accessibleeventnotifier.hxx>
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/guarding.hxx>
#include <map>
@@ -37,7 +37,7 @@ namespace
AccessibleEventObject > ClientEvent;
typedef ::std::map< AccessibleEventNotifier::TClientId,
::cppu::OInterfaceContainerHelper*,
::comphelper::OInterfaceContainerHelper2*,
::std::less< AccessibleEventNotifier::TClientId > > ClientMap;
/// key is the end of the interval, value is the start of the interval
@@ -153,8 +153,8 @@ namespace comphelper
TClientId nNewClientId = generateId( );
// the event listeners for the new client
::cppu::OInterfaceContainerHelper *const pNewListeners =
new ::cppu::OInterfaceContainerHelper( lclMutex::get() );
::comphelper::OInterfaceContainerHelper2 *const pNewListeners =
new ::comphelper::OInterfaceContainerHelper2( lclMutex::get() );
// note that we're using our own mutex here, so the listener containers for all
// our clients share this same mutex.
// this is a reminiscence to the days where the notifier was asynchronous. Today this is
@@ -187,7 +187,7 @@ namespace comphelper
void AccessibleEventNotifier::revokeClientNotifyDisposing( const TClientId _nClient,
const Reference< XInterface >& _rxEventSource )
{
::cppu::OInterfaceContainerHelper* pListeners(nullptr);
::comphelper::OInterfaceContainerHelper2* pListeners(nullptr);
{
// rhbz#1001768 drop the mutex before calling disposeAndClear
@@ -255,7 +255,7 @@ namespace comphelper
void AccessibleEventNotifier::addEvent( const TClientId _nClient, const AccessibleEventObject& _rEvent )
{
Sequence< Reference< XInterface > > aListeners;
std::vector< Reference< XInterface > > aListeners;
// --- <mutex lock> -------------------------------
{
@@ -272,20 +272,17 @@ namespace comphelper
// --- </mutex lock> ------------------------------
// default handling: loop through all listeners, and notify them
const Reference< XInterface >* pListeners = aListeners.getConstArray();
const Reference< XInterface >* pListenersEnd = pListeners + aListeners.getLength();
while ( pListeners != pListenersEnd )
for ( const auto& rListener : aListeners )
{
try
{
static_cast< XAccessibleEventListener* >( pListeners->get() )->notifyEvent( _rEvent );
static_cast< XAccessibleEventListener* >( rListener.get() )->notifyEvent( _rEvent );
}
catch( const Exception& )
{
// no assertion, because a broken access remote bridge or something like this
// can cause this exception
}
++pListeners;
}
}
+1 -1
View File
@@ -104,7 +104,7 @@ void SAL_CALL OInstanceLocker::addEventListener( const uno::Reference< lang::XEv
throw lang::DisposedException(); // TODO
if ( !m_pListenersContainer )
m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutex );
m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutex );
m_pListenersContainer->addInterface( xListener );
}
+2 -2
View File
@@ -31,7 +31,7 @@
#include <cppuhelper/weakref.hxx>
#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/interfacecontainer2.hxx>
class OLockListener;
@@ -47,7 +47,7 @@ class OInstanceLocker : public ::cppu::WeakImplHelper< css::lang::XComponent,
css::uno::Reference< css::uno::XInterface > m_xLockListener;
OLockListener* m_pLockListener;
::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list of listeners
bool m_bDisposed;
bool m_bInitialized;
@@ -48,7 +48,7 @@ namespace comphelper
void OListenerContainer::impl_removeListener( const Reference< XEventListener >& _rxListener )
{
#if OSL_DEBUG_LEVEL > 0
::cppu::OInterfaceIteratorHelper aIter( m_aListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners );
bool bFound = false;
while ( aIter.hasMoreElements() && !bFound )
{
@@ -74,7 +74,7 @@ namespace comphelper
bool OListenerContainer::impl_notify( const EventObject& _rEvent )
{
::cppu::OInterfaceIteratorHelper aIter( m_aListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners );
bool bCancelled = false;
while ( aIter.hasMoreElements() && !bCancelled )
{
+2 -1
View File
@@ -30,6 +30,7 @@
#include <boost/noncopyable.hpp>
#include <cppuhelper/implbase5.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/propstate.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/propertybag.hxx>
@@ -84,7 +85,7 @@ namespace comphelper
bool m_bAutoAddProperties;
/// for notification
::cppu::OInterfaceContainerHelper m_NotifyListeners;
::comphelper::OInterfaceContainerHelper2 m_NotifyListeners;
/// modify flag
bool m_isModified;
@@ -693,7 +693,7 @@ namespace dbtools
// TODO: shouldn't we subtract all the parameters which were already visited?
if ( nParamsLeft )
{
::cppu::OInterfaceIteratorHelper aIter( m_aParameterListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aParameterListeners );
Reference< XPropertySet > xProp = m_xComponent;
OSL_ENSURE(xProp.is(),"Some already released my component!");
DatabaseParameterEvent aEvent( xProp.get(), m_pOuterParameters.get() );
@@ -175,7 +175,7 @@ void OTables::appendNew(const OUString& _rsNewTable)
// notify our container listeners
ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
}
@@ -196,7 +196,7 @@ void OTables::appendNew(const OUString& _rsNewTable)
// notify our container listeners
ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any());
OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent);
}
@@ -27,7 +27,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <cppuhelper/compbase.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
namespace connectivity
{
@@ -57,7 +57,7 @@ namespace connectivity
,public IMethodGuardAccess
{
private:
::cppu::OInterfaceContainerHelper m_aFlushListeners;
::comphelper::OInterfaceContainerHelper2 m_aFlushListeners;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > m_xDriver;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
bool m_bIni;
+2 -2
View File
@@ -422,7 +422,7 @@ void OCollection::notifyElementRemoved(const OUString& _sName)
{
ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sName), Any(), Any());
// note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
static_cast<XContainerListener*>(aListenerLoop.next())->elementRemoved(aEvent);
}
@@ -518,7 +518,7 @@ void OCollection::renameObject(const OUString& _sOldName, const OUString& _sNewN
{
ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_sNewName), makeAny(m_pElements->getObject(_sNewName)),makeAny(_sOldName));
// note that xExistent may be empty, in case somebody removed the data source while it is not alive at this moment
OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
while (aListenerLoop.hasMoreElements())
static_cast<XContainerListener*>(aListenerLoop.next())->elementReplaced(aEvent);
}
+9 -10
View File
@@ -103,26 +103,25 @@ com_sun_star_comp_dba_ORowSet_get_implementation(css::uno::XComponentContext* co
}
#define NOTIFY_LISTENERS_CHECK(_rListeners,T,method) \
Sequence< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \
std::vector< Reference< XInterface > > aListenerSeq = _rListeners.getElements(); \
\
const Reference< XInterface >* pxIntBegin = aListenerSeq.getConstArray(); \
const Reference< XInterface >* pxInt = pxIntBegin + aListenerSeq.getLength(); \
auto it = aListenerSeq.rbegin(); \
const auto itEnd = aListenerSeq.rend(); \
\
_rGuard.clear(); \
bool bCheck = true; \
while( pxInt > pxIntBegin && bCheck ) \
for ( ; it != itEnd; ) \
{ \
try \
{ \
while( pxInt > pxIntBegin && bCheck ) \
{ \
--pxInt; \
bCheck = static_cast< T* >( pxInt->get() )->method(aEvt); \
} \
bCheck = static_cast< T* >( it->get() )->method(aEvt); \
if (!bCheck) \
break; \
} \
catch( RuntimeException& ) \
{ \
} \
++it; \
} \
_rGuard.reset();
@@ -1514,7 +1513,7 @@ void ORowSet::approveExecution() throw (RowSetVetoException, RuntimeException)
::osl::MutexGuard aGuard( m_aColumnsMutex );
EventObject aEvt(*this);
OInterfaceIteratorHelper aApproveIter( m_aApproveListeners );
OInterfaceIteratorHelper2 aApproveIter( m_aApproveListeners );
while ( aApproveIter.hasMoreElements() )
{
Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aApproveIter.next() ) );
+4 -3
View File
@@ -42,6 +42,7 @@
#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
#include <cppuhelper/compbase12.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <connectivity/paramwrapper.hxx>
#include <connectivity/FValue.hxx>
#include <connectivity/warningscontainer.hxx>
@@ -91,9 +92,9 @@ namespace dbaccess
::std::vector<bool> m_aParametersSet;
::std::vector<bool> m_aReadOnlyDataColumns;
::cppu::OInterfaceContainerHelper m_aRowsetListeners;
::cppu::OInterfaceContainerHelper m_aApproveListeners;
::cppu::OInterfaceContainerHelper m_aRowsChangeListener;
::comphelper::OInterfaceContainerHelper2 m_aRowsetListeners;
::comphelper::OInterfaceContainerHelper2 m_aApproveListeners;
::comphelper::OInterfaceContainerHelper2 m_aRowsChangeListener;
::dbtools::WarningsContainer m_aWarnings;
@@ -107,7 +107,7 @@ void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const An
if (m_aContainerListeners.getLength())
{
ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), Any());
OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
while (aListenerIterator.hasMoreElements())
static_cast< XContainerListener* >(aListenerIterator.next())->elementInserted(aEvent);
}
@@ -137,7 +137,7 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N
if (m_aContainerListeners.getLength())
{
ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sOldBookmark), Any());
OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
while (aListenerIterator.hasMoreElements())
static_cast< XContainerListener* >(aListenerIterator.next())->elementRemoved(aEvent);
}
@@ -172,7 +172,7 @@ void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const A
if (m_aContainerListeners.getLength())
{
ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), makeAny(sOldLink));
OInterfaceIteratorHelper aListenerIterator(m_aContainerListeners);
OInterfaceIteratorHelper2 aListenerIterator(m_aContainerListeners);
while (aListenerIterator.hasMoreElements())
static_cast< XContainerListener* >(aListenerIterator.next())->elementReplaced(aEvent);
}
@@ -25,7 +25,7 @@
#include <map>
#include <vector>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/implbase.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/container/XChild.hpp>
@@ -64,7 +64,7 @@ protected:
protected:
::cppu::OWeakObject& m_rParent; // for the ref counting
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aContainerListeners;
::osl::Mutex& m_rMutex;
@@ -106,7 +106,7 @@ protected:
// recreated afterwards. So it's our (the context's) responsibility to store the session-persistent
// properties.
::cppu::OInterfaceContainerHelper m_aContainerListeners;
::comphelper::OInterfaceContainerHelper2 m_aContainerListeners;
DatabaseDocumentLoader* m_pDatabaseDocumentLoader;
public:
@@ -165,9 +165,9 @@ class ODatabaseDocument :public ModelDependentComponent // ModelDepe
typedef std::map< OUString, css::uno::Reference< css::frame::XUntitledNumbers > > TNumberedController;
css::uno::Reference< css::ui::XUIConfigurationManager2> m_xUIConfigurationManager;
::cppu::OInterfaceContainerHelper m_aModifyListeners;
::cppu::OInterfaceContainerHelper m_aCloseListener;
::cppu::OInterfaceContainerHelper m_aStorageListeners;
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
::comphelper::OInterfaceContainerHelper2 m_aCloseListener;
::comphelper::OInterfaceContainerHelper2 m_aStorageListeners;
DocumentEvents* m_pEventContainer;
::rtl::Reference< DocumentEventExecutor > m_pEventExecutor;
@@ -20,7 +20,7 @@
#include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/implbase1.hxx>
#include <rtl/ustrbuf.hxx>
#include <unotools/pathoptions.hxx>
@@ -134,7 +134,7 @@ namespace dbaccess
private:
Reference<XComponentContext> m_aContext;
::utl::OConfigurationTreeRoot m_aConfigurationRoot;
::cppu::OInterfaceContainerHelper m_aRegistrationListeners;
::comphelper::OInterfaceContainerHelper2 m_aRegistrationListeners;
};
// DatabaseRegistrations - implementation
@@ -83,7 +83,7 @@ class ODatabaseSource :public ModelDependentComponent // must be first
private:
using ODatabaseSource_Base::rBHelper;
css::uno::Reference<OBookmarkContainer> m_xBookmarks;
::cppu::OInterfaceContainerHelper m_aFlushListeners;
::comphelper::OInterfaceContainerHelper2 m_aFlushListeners;
private:
virtual ~ODatabaseSource();
@@ -289,7 +289,7 @@ void ODefinitionContainer::notifyByName( ResettableMutexGuard& _rGuard, const OU
{
bool bApprove = ( _eType == ApproveListeners );
::cppu::OInterfaceContainerHelper& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners );
::comphelper::OInterfaceContainerHelper2& rContainer( bApprove ? m_aApproveListeners : m_aContainerListeners );
if ( !rContainer.getLength() )
return;
@@ -22,7 +22,7 @@
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <comphelper/asyncnotification.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/weak.hxx>
#include <tools/diagnose_ex.h>
@@ -59,8 +59,8 @@ namespace dbaccess
bool m_bInitialized;
bool m_bDisposed;
::rtl::Reference< ::comphelper::AsyncEventNotifier > m_pEventBroadcaster;
::cppu::OInterfaceContainerHelper m_aLegacyEventListeners;
::cppu::OInterfaceContainerHelper m_aDocumentEventListeners;
::comphelper::OInterfaceContainerHelper2 m_aLegacyEventListeners;
::comphelper::OInterfaceContainerHelper2 m_aDocumentEventListeners;
public:
DocumentEventNotifier_Impl( ::cppu::OWeakObject& _rBroadcasterDocument, ::osl::Mutex& _rMutex )
@@ -131,7 +131,7 @@ private:
css::uno::Sequence< OUString > m_aInterceptedURL;
cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners;
PropertyChangeListenerContainer* m_pStatCL;
};
+2 -1
View File
@@ -32,6 +32,7 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/compbase.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/beans/Property.hpp>
@@ -101,7 +102,7 @@ namespace dbaccess
void impl_rename_throw(const OUString& _sNewName,bool _bNotify = true);
protected:
::cppu::OInterfaceContainerHelper m_aContentListeners;
::comphelper::OInterfaceContainerHelper2 m_aContentListeners;
PropertyChangeListenerContainer m_aPropertyChangeListeners;
css::uno::Reference< css::uno::XInterface >
m_xParentContainer;
@@ -120,9 +120,9 @@ protected:
DocumentsIndexAccess m_aDocuments; // for a efficient index access
Documents m_aDocumentMap; // for a efficient name access
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aApproveListeners;
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aContainerListeners;
bool m_bInPropertyChange;
+2 -2
View File
@@ -187,7 +187,7 @@ Reference< XInterface > SAL_CALL OApplicationController::Create(const Reference<
class SelectionNotifier : public ::boost::noncopyable
{
private:
::cppu::OInterfaceContainerHelper m_aSelectionListeners;
::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners;
::cppu::OWeakObject& m_rContext;
sal_Int32 m_nSelectionNestingLevel;
@@ -2340,7 +2340,7 @@ IController& OApplicationController::getCommandController()
return *this;
}
::cppu::OInterfaceContainerHelper* OApplicationController::getContextMenuInterceptors()
::comphelper::OInterfaceContainerHelper2* OApplicationController::getContextMenuInterceptors()
{
return &m_aContextMenuInterceptors;
}
+3 -2
View File
@@ -38,6 +38,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase5.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <sot/storage.hxx>
#include <svtools/transfer.hxx>
#include <svx/dataaccessdescriptor.hxx>
@@ -99,7 +100,7 @@ namespace dbaui
m_xDataSource;
css::uno::Reference< css::frame::XModel >
m_xModel;
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aContextMenuInterceptors;
TContainerVector m_aCurrentContainers; // the containers where we are listener on
@@ -536,7 +537,7 @@ namespace dbaui
// IContextMenuProvider
virtual PopupMenu* getContextMenu( Control& _rControl ) const override;
virtual IController& getCommandController() override;
virtual ::cppu::OInterfaceContainerHelper*
virtual ::comphelper::OInterfaceContainerHelper2*
getContextMenuInterceptors() override;
virtual css::uno::Any
getCurrentSelection( Control& _rControl ) const override;
+3 -3
View File
@@ -154,7 +154,7 @@ class SbaXDataBrowserController::FormControllerImpl
css::frame::XFrameActionListener >
{
friend class SbaXDataBrowserController;
::cppu::OInterfaceContainerHelper m_aActivateListeners;
::comphelper::OInterfaceContainerHelper2 m_aActivateListeners;
SbaXDataBrowserController* m_pOwner;
public:
@@ -935,7 +935,7 @@ void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/) th
{
// notify our activate listeners (registered on the form controller aggregate)
EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners);
while (aIter.hasMoreElements())
static_cast<XFormControllerListener*>(aIter.next())->formActivated(aEvt);
}
@@ -961,7 +961,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) throw( R
// notify the listeners that the "form" we represent has been deactivated
EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIter(m_pFormControllerImpl->m_aActivateListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_pFormControllerImpl->m_aActivateListeners);
while (aIter.hasMoreElements())
static_cast<XFormControllerListener*>(aIter.next())->formDeactivated(aEvt);
+1 -1
View File
@@ -123,7 +123,7 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent) th
// multiplex this event to all my listeners
css::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aModifyListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aModifyListeners);
while (aIt.hasMoreElements())
static_cast< css::util::XModifyListener*>(aIt.next())->modified(aEvt);
}
+5 -5
View File
@@ -168,7 +168,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
if (xLoadable->isLoaded())
{
css::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
while (aIt.hasMoreElements())
static_cast< css::form::XLoadListener*>(aIt.next())->unloaded(aEvt);
}
@@ -185,7 +185,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast
if (xLoadable->isLoaded())
{
css::lang::EventObject aEvt(*this);
::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aLoadListeners);
while (aIt.hasMoreElements())
static_cast< css::form::XLoadListener*>(aIt.next())->loaded(aEvt);
}
@@ -1421,7 +1421,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
aEvt.Source = *this;
aEvt.Accessor <<= nIndex;
aEvt.Element <<= xElement;
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
static_cast< css::container::XContainerListener*>(aIt.next())->elementInserted(aEvt);
}
@@ -1526,7 +1526,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( css::lang
css::container::ContainerEvent aEvt;
aEvt.Source = *this;
aEvt.Element <<= xAffected;
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
static_cast< css::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt);
@@ -1589,7 +1589,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem
aEvt.Element <<= xElement;
aEvt.ReplacedElement <<= xOld;
::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners);
::comphelper::OInterfaceIteratorHelper2 aIt(m_aContainerListeners);
while (aIt.hasMoreElements())
static_cast< css::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt);
}
+2 -2
View File
@@ -29,7 +29,7 @@ void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStat
{
m_aLastKnownStatus = e;
m_aLastKnownStatus.Source = &m_rParent;
::cppu::OInterfaceIteratorHelper aIt( *this );
::comphelper::OInterfaceIteratorHelper2 aIt( *this );
while ( aIt.hasMoreElements() )
static_cast< css::frame::XStatusListener* >( aIt.next() )->statusChanged( m_aLastKnownStatus );
} \
@@ -89,7 +89,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence<
for (sal_Int32 i=0; i<aMulti.getLength(); ++i, ++pMulti)
pMulti->Source = &m_rParent;
::cppu::OInterfaceIteratorHelper aIt(*this);
::comphelper::OInterfaceIteratorHelper2 aIt(*this);
while (aIt.hasMoreElements())
static_cast< css::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti);
}
+1 -1
View File
@@ -3491,7 +3491,7 @@ IController& SbaTableQueryBrowser::getCommandController()
return *this;
}
::cppu::OInterfaceContainerHelper* SbaTableQueryBrowser::getContextMenuInterceptors()
::comphelper::OInterfaceContainerHelper2* SbaTableQueryBrowser::getContextMenuInterceptors()
{
return &m_aContextMenuInterceptors;
}
+3 -3
View File
@@ -29,7 +29,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/URL.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <vcl/help.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <dbaccess/IController.hxx>
@@ -565,7 +565,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu()
// set images
lcl_insertMenuItemImages( *pContextMenu, m_pContextMenuProvider->getCommandController() );
// allow context menu interception
::cppu::OInterfaceContainerHelper* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors();
::comphelper::OInterfaceContainerHelper2* pInterceptors = m_pContextMenuProvider->getContextMenuInterceptors();
if ( !pInterceptors || !pInterceptors->getLength() )
return pContextMenu;
@@ -577,7 +577,7 @@ std::unique_ptr<PopupMenu> DBTreeListBox::CreateContextMenu()
pContextMenu.get(), nullptr );
aEvent.Selection = new SelectionSupplier( m_pContextMenuProvider->getCurrentSelection( *this ) );
::cppu::OInterfaceIteratorHelper aIter( *pInterceptors );
::comphelper::OInterfaceIteratorHelper2 aIter( *pInterceptors );
bool bModifiedMenu = false;
bool bAskInterceptors = true;
while ( aIter.hasMoreElements() && bAskInterceptors )
+2 -2
View File
@@ -31,7 +31,7 @@ class Control;
struct AcceptDropEvent;
struct ExecuteDropEvent;
namespace cppu { class OInterfaceContainerHelper; }
namespace comphelper { class OInterfaceContainerHelper2; }
namespace dbaui
{
@@ -84,7 +84,7 @@ namespace dbaui
/** returns the container of registered context menu interceptors, or NULL if the implementation
does not support context menu interception
*/
virtual ::cppu::OInterfaceContainerHelper*
virtual ::comphelper::OInterfaceContainerHelper2*
getContextMenuInterceptors() = 0;
/** returns the current selection in the given control
+1 -1
View File
@@ -34,7 +34,7 @@ namespace dbaui
:public SbaXDataBrowserController
,public css::util::XModifyBroadcaster
{
::cppu::OInterfaceContainerHelper m_aModifyListeners;
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
// for multiplexing the modify events
SbaXFormAdapter* m_pDataSourceImpl;
bool m_bInQueryDispatch;
+2 -2
View File
@@ -136,8 +136,8 @@ namespace dbaui
SbaXVetoableChangeMultiplexer m_aVetoablePropertyChangeListeners;
SbaXPropertiesChangeMultiplexer m_aPropertiesChangeListeners;
::cppu::OInterfaceContainerHelper m_aDisposeListeners;
::cppu::OInterfaceContainerHelper m_aContainerListeners;
::comphelper::OInterfaceContainerHelper2 m_aDisposeListeners;
::comphelper::OInterfaceContainerHelper2 m_aContainerListeners;
// hierarchy administration
css::uno::Reference< css::uno::XInterface > m_xParent;
+6 -5
View File
@@ -41,6 +41,7 @@
#include <com/sun/star/frame/XStatusListener.hpp>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/weak.hxx>
@@ -64,7 +65,7 @@ namespace dbaui
class classname \
:public OSbaWeakSubObject \
,public listenerclass \
,public ::cppu::OInterfaceContainerHelper \
,public ::comphelper::OInterfaceContainerHelper2 \
{ \
public: \
classname( ::cppu::OWeakObject& rSource, \
@@ -83,7 +84,7 @@ namespace dbaui
virtual sal_Bool SAL_CALL methodname(const eventtype& e) throw (css::uno::RuntimeException, std::exception) override; \
#define END_DECLARE_LISTENER_MULTIPLEXER() \
/* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators */ \
/* resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators */ \
void * SAL_CALL operator new( size_t size ) throw() { return OSbaWeakSubObject::operator new(size); } \
void SAL_CALL operator delete( void * p ) throw() { OSbaWeakSubObject::operator delete(p); } \
}; \
@@ -94,7 +95,7 @@ namespace dbaui
\
classname::classname(::cppu::OWeakObject& rSource, ::osl::Mutex& _rMutex) \
:OSbaWeakSubObject(rSource) \
,OInterfaceContainerHelper(_rMutex) \
,OInterfaceContainerHelper2(_rMutex) \
{ \
} \
\
@@ -120,7 +121,7 @@ namespace dbaui
{ \
eventtype aMulti(e); \
aMulti.Source = &m_rParent; \
::cppu::OInterfaceIteratorHelper aIt(*this); \
::comphelper::OInterfaceIteratorHelper2 aIt(*this); \
while (aIt.hasMoreElements()) \
static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
} \
@@ -130,7 +131,7 @@ namespace dbaui
{ \
eventtype aMulti(e); \
aMulti.Source = &m_rParent; \
::cppu::OInterfaceIteratorHelper aIt(*this); \
::comphelper::OInterfaceIteratorHelper2 aIt(*this); \
bool bResult = true; \
while (bResult && aIt.hasMoreElements()) \
bResult = static_cast< listenerclass*>(aIt.next())->methodname(aMulti); \
+3 -3
View File
@@ -91,8 +91,8 @@ namespace dbaui
svx::ODataAccessDescriptor m_aDocumentDataSource;
// if we're part of a document, this is the state of the DocumentDataSource slot
::cppu::OInterfaceContainerHelper m_aSelectionListeners;
::cppu::OInterfaceContainerHelper m_aContextMenuInterceptors;
::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners;
::comphelper::OInterfaceContainerHelper2 m_aContextMenuInterceptors;
OTableCopyHelper::DropDescriptor m_aAsyncDrop;
OTableCopyHelper m_aTableCopyHelper;
@@ -232,7 +232,7 @@ namespace dbaui
// IContextMenuProvider
virtual PopupMenu* getContextMenu( Control& _rControl ) const override;
virtual IController& getCommandController() override;
virtual ::cppu::OInterfaceContainerHelper*
virtual ::comphelper::OInterfaceContainerHelper2*
getContextMenuInterceptors() override;
virtual css::uno::Any
getCurrentSelection( Control& _rControl ) const override;
@@ -41,6 +41,7 @@
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <rtl/ustrbuf.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/debug.hxx>
@@ -126,7 +127,7 @@ namespace dbaui
OModuleClient m_aModuleClient;
::dbtools::SQLExceptionInfo m_aCurrentError;
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aModifyListeners;
// <properties>
+3 -2
View File
@@ -64,6 +64,7 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <rtl/ustrbuf.hxx>
#include <svtools/genericunodialog.hxx>
#include <tools/diagnose_ex.h>
@@ -346,7 +347,7 @@ private:
// other
Reference< XInteractionHandler > m_xInteractionHandler;
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aCopyTableListeners;
sal_Int16 m_nOverrideExecutionResult;
};
@@ -1016,7 +1017,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r
Reference< XCopyTableListener > xListener;
try
{
::cppu::OInterfaceIteratorHelper aIter( m_aCopyTableListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aCopyTableListeners );
while ( aIter.hasMoreElements() )
{
xListener.set( aIter.next(), UNO_QUERY_THROW );
+1 -1
View File
@@ -189,7 +189,7 @@ void SAL_CALL CWinClipboard::notifyAllClipboardListener( )
{
aGuard.clear( );
OInterfaceContainerHelper* pICHelper = rBHelper.aLC.getContainer(
OInterfaceContainerHelper2* pICHelper = rBHelper.aLC.getContainer(
cppu::UnoType<XClipboardListener>::get());
if ( pICHelper )
+2 -2
View File
@@ -94,7 +94,7 @@ void SourceContext::fire_dragDropEnd( sal_Bool success, sal_Int8 effect)
e.DragSourceContext= static_cast<XDragSourceContext*>( this);
e.Source.set( static_cast<XDragSourceContext*>( this), UNO_QUERY);
OInterfaceContainerHelper* pContainer= rBHelper.getContainer(
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer(
cppu::UnoType<XDragSourceListener>::get());
if( pContainer)
@@ -121,7 +121,7 @@ void SourceContext::fire_dropActionChanged( sal_Int8 dropAction, sal_Int8 userAc
e.DragSourceContext= static_cast<XDragSourceContext*>( this);
e.Source.set( static_cast<XDragSourceContext*>( this), UNO_QUERY);
OInterfaceContainerHelper* pContainer= rBHelper.getContainer(
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer(
cppu::UnoType<XDragSourceListener>::get());
if( pContainer)
+5 -5
View File
@@ -488,7 +488,7 @@ HRESULT DropTarget::Drop( IDataObject * /*pDataObj*/,
void DropTarget::fire_drop( const DropTargetDropEvent& dte)
{
OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
@@ -502,7 +502,7 @@ void DropTarget::fire_drop( const DropTargetDropEvent& dte)
void DropTarget::fire_dragEnter( const DropTargetDragEnterEvent& e )
{
OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
@@ -516,7 +516,7 @@ void DropTarget::fire_dragEnter( const DropTargetDragEnterEvent& e )
void DropTarget::fire_dragExit( const DropTargetEvent& dte )
{
OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
if( pContainer)
{
@@ -531,7 +531,7 @@ void DropTarget::fire_dragExit( const DropTargetEvent& dte )
void DropTarget::fire_dragOver( const DropTargetDragEvent& dtde )
{
OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer );
@@ -545,7 +545,7 @@ void DropTarget::fire_dragOver( const DropTargetDragEvent& dtde )
void DropTarget::fire_dropActionChanged( const DropTargetDragEvent& dtde )
{
OInterfaceContainerHelper* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
OInterfaceContainerHelper2* pContainer= rBHelper.getContainer( cppu::UnoType<XDropTargetListener>::get());
if( pContainer)
{
OInterfaceIteratorHelper iter( *pContainer);
@@ -38,6 +38,7 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <vcl/svapp.hxx>
+1
View File
@@ -19,6 +19,7 @@
#include <com/sun/star/embed/EmbedStates.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include "intercept.hxx"
#include "docholder.hxx"
+2 -2
View File
@@ -22,7 +22,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -140,7 +140,7 @@ private:
static css::uno::Sequence< OUString > m_aInterceptedURL;
cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners;
StatusChangeListenerContainer* m_pStatCL;
};
+2 -2
View File
@@ -1437,7 +1437,7 @@ void SAL_CALL OleComponent::close( sal_Bool bDeliverOwnership )
if ( m_pInterfaceContainer )
{
::cppu::OInterfaceContainerHelper* pContainer =
::comphelper::OInterfaceContainerHelper2* pContainer =
m_pInterfaceContainer->getContainer( cppu::UnoType<util::XCloseListener>::get());
if ( pContainer != NULL )
{
@@ -1729,7 +1729,7 @@ void SAL_CALL OleComponent::setModified( sal_Bool bModified )
if ( bModified && m_pInterfaceContainer )
{
::cppu::OInterfaceContainerHelper* pContainer =
::comphelper::OInterfaceContainerHelper2* pContainer =
m_pInterfaceContainer->getContainer( cppu::UnoType<util::XModifyListener>::get());
if ( pContainer != NULL )
{
+1 -1
View File
@@ -190,7 +190,7 @@ void OleEmbeddedObject::StateChangeNotification_Impl( sal_Bool bBeforeChange, sa
{
if ( m_pInterfaceContainer )
{
::cppu::OInterfaceContainerHelper* pContainer = m_pInterfaceContainer->getContainer(
::comphelper::OInterfaceContainerHelper2* pContainer = m_pInterfaceContainer->getContainer(
cppu::UnoType<embed::XStateChangeListener>::get());
if ( pContainer != NULL )
{
+2 -2
View File
@@ -52,7 +52,7 @@ Interceptor::addEventListener(
if ( ! m_pDisposeEventListeners )
m_pDisposeEventListeners =
new cppu::OInterfaceContainerHelper( m_aMutex );
new comphelper::OInterfaceContainerHelper2( m_aMutex );
m_pDisposeEventListeners->addInterface( Listener );
}
@@ -216,7 +216,7 @@ void Interceptor::generateFeatureStateEvent()
if( i == 1 || (m_bLink && i != 5) )
continue;
cppu::OInterfaceContainerHelper* pICH =
comphelper::OInterfaceContainerHelper2* pICH =
m_pStatCL->getContainer(m_aInterceptedURL[i]);
uno::Sequence<uno::Reference<uno::XInterface> > aSeq;
if(pICH)
+1 -1
View File
@@ -166,7 +166,7 @@ private:
static css::uno::Sequence< OUString > m_aInterceptedURL;
cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners;
StatusChangeListenerContainer* m_pStatCL;
sal_Bool m_bLink;
+1 -1
View File
@@ -224,7 +224,7 @@ public:
private:
osl::Mutex m_aMutex;
cppu::OInterfaceContainerHelper *m_pDisposeEventListeners;
comphelper::OInterfaceContainerHelper2 *m_pDisposeEventListeners;
HWND m_aHwnd;
};
+2 -2
View File
@@ -26,7 +26,7 @@
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
#include <com/sun/star/form/runtime/XFormController.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <comphelper/interfacecontainer2.hxx>
#include <com/sun/star/form/XLoadable.hpp>
#include <comphelper/broadcasthelper.hxx>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
@@ -94,7 +94,7 @@ private:
css::uno::Any aUID;
css::uno::Reference< css::sdbc::XResultSet > xBibCursor;
::cppu::OInterfaceContainerHelper m_aLoadListeners;
::comphelper::OInterfaceContainerHelper2 m_aLoadListeners;
VclPtr< ::bib::BibView> pBibView;
VclPtr<BibToolBar> pToolbar;
+2 -2
View File
@@ -28,7 +28,7 @@
#include <com/sun/star/logging/XLoggerPool.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakref.hxx>
@@ -56,7 +56,7 @@ namespace logging
public cppu::WeakImplHelper<css::logging::XLogger>
{
private:
cppu::OInterfaceContainerHelper m_aHandlers;
comphelper::OInterfaceContainerHelper2 m_aHandlers;
oslInterlockedCount m_nEventNumber;
// <attributes>
+2 -2
View File
@@ -242,7 +242,7 @@ namespace pcr
{
if ( !_bDoListen )
{
::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > pListenerIterator = m_aPropertyListeners.createIterator();
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > pListenerIterator = m_aPropertyListeners.createIterator();
while ( pListenerIterator->hasMoreElements() )
{
PropertyEventTranslation* pTranslator = dynamic_cast< PropertyEventTranslation* >( pListenerIterator->next() );
@@ -276,7 +276,7 @@ namespace pcr
}
else
{
::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > pListenerIterator = m_aPropertyListeners.createIterator();
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > pListenerIterator = m_aPropertyListeners.createIterator();
while ( pListenerIterator->hasMoreElements() )
{
Reference< XPropertyChangeListener > xListener( pListenerIterator->next(), UNO_QUERY );
@@ -194,7 +194,7 @@ namespace pcr
private:
::cppu::OWeakObject& m_rParent;
::cppu::OInterfaceContainerHelper m_aPropertyChangeListeners;
::comphelper::OInterfaceContainerHelper2 m_aPropertyChangeListeners;
Reference< XShape > m_xShape;
};
@@ -305,8 +305,8 @@ namespace pcr
throw NullPointerException();
// revoke old property change listeners
::cppu::OInterfaceIteratorHelper iterRemove( m_aPropertyListeners );
::cppu::OInterfaceIteratorHelper iterReAdd( m_aPropertyListeners ); // this holds a copy of the container ...
::comphelper::OInterfaceIteratorHelper2 iterRemove( m_aPropertyListeners );
::comphelper::OInterfaceIteratorHelper2 iterReAdd( m_aPropertyListeners ); // this holds a copy of the container ...
while ( iterRemove.hasMoreElements() )
m_xComponent->removePropertyChangeListener( OUString(), static_cast< XPropertyChangeListener* >( iterRemove.next() ) );
@@ -72,7 +72,7 @@ namespace pcr
/// cache of our supported properties
PropertyMap m_aProperties;
/// property change listeners
::cppu::OInterfaceContainerHelper m_aPropertyListeners;
::comphelper::OInterfaceContainerHelper2 m_aPropertyListeners;
::std::map< css::uno::Type, ::rtl::Reference< IPropertyEnumRepresentation >, TypeLess >
m_aEnumConverters;
@@ -101,8 +101,8 @@ namespace pcr
css::uno::Reference< css::frame::XFrame > m_xFrame;
css::uno::Reference< css::awt::XWindow > m_xView;
::cppu::OInterfaceContainerHelper m_aDisposeListeners;
::cppu::OInterfaceContainerHelper m_aControlObservers;
::comphelper::OInterfaceContainerHelper2 m_aDisposeListeners;
::comphelper::OInterfaceContainerHelper2 m_aControlObservers;
// meta data about the properties
VclPtr<OPropertyBrowserView> m_pView;
@@ -78,8 +78,8 @@ namespace pcr
return;
// remove all old property change listeners
::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > removeListener = m_aPropertyListeners.createIterator();
::std::unique_ptr< ::cppu::OInterfaceIteratorHelper > readdListener = m_aPropertyListeners.createIterator(); // will copy the container as needed
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > removeListener = m_aPropertyListeners.createIterator();
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > readdListener = m_aPropertyListeners.createIterator(); // will copy the container as needed
while ( removeListener->hasMoreElements() )
removePropertyChangeListener( static_cast< XPropertyChangeListener* >( removeListener->next() ) );
OSL_ENSURE( m_aPropertyListeners.empty(), "PropertyHandler::inspect: derived classes are expected to forward the removePropertyChangeListener call to their base class (me)!" );
@@ -178,7 +178,7 @@ namespace pcr
class OHyperlinkControl : public OHyperlinkControl_Base
{
private:
::cppu::OInterfaceContainerHelper m_aActionListeners;
::comphelper::OInterfaceContainerHelper2 m_aActionListeners;
public:
OHyperlinkControl( vcl::Window* _pParent, WinBits _nWinStyle );
+1 -1
View File
@@ -448,7 +448,7 @@ IMPL_LINK_NOARG_TYPED(OButtonControl, OnClick, void*, void)
if (FormButtonType_PUSH == *static_cast<FormButtonType const *>(xSet->getPropertyValue(PROPERTY_BUTTONTYPE).getValue()))
{
// notify the action listeners for a push button
::cppu::OInterfaceIteratorHelper aIter(m_aActionListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aActionListeners);
ActionEvent aEvt(static_cast<XWeak*>(this), m_aActionCommand);
while(aIter.hasMoreElements() )
{
+6 -6
View File
@@ -2151,7 +2151,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a
if (_bAproveByListeners)
{
::cppu::OInterfaceIteratorHelper aIter(m_aSubmitListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aSubmitListeners);
EventObject aEvt(static_cast<XWeak*>(this));
bool bCanceled = false;
while (aIter.hasMoreElements() && !bCanceled)
@@ -2944,7 +2944,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction
// the approvement is done by the aggregate
if (!m_aRowSetApproveListeners.getLength())
{
::cppu::OInterfaceIteratorHelper aIter(m_aLoadListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aLoadListeners);
aGuard.clear();
while (aIter.hasMoreElements())
@@ -2967,7 +2967,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction
if (bSuccess)
{
::cppu::OInterfaceIteratorHelper aIter(m_aLoadListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aLoadListeners);
aGuard.clear();
while (aIter.hasMoreElements())
static_cast<XLoadListener*>(aIter.next())->reloaded(aEvent);
@@ -3047,7 +3047,7 @@ void SAL_CALL ODatabaseForm::rowSetChanged(const EventObject& /*event*/) throw(
bool ODatabaseForm::impl_approveRowChange_throw( const EventObject& _rEvent, const bool _bAllowSQLException,
::osl::ClearableMutexGuard& _rGuard )
{
::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners );
_rGuard.clear();
while ( aIter.hasMoreElements() )
{
@@ -3092,7 +3092,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveCursorMove(const EventObject& event) thr
// Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface
// for XRowSetApproveBroadcaster-interface.
// So we have to multiplex this approve request.
::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners );
while ( aIter.hasMoreElements() )
{
Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aIter.next() ) );
@@ -3141,7 +3141,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowChange(const RowChangeEvent& event) t
// Our aggregate doesn't have any ApproveRowSetListeners (expect ourself), as we re-routed the queryInterface
// for XRowSetApproveBroadcaster-interface.
// So we have to multiplex this approve request.
::cppu::OInterfaceIteratorHelper aIter( m_aRowSetApproveListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aRowSetApproveListeners );
while ( aIter.hasMoreElements() )
{
Reference< XRowSetApproveListener > xListener( static_cast< XRowSetApproveListener* >( aIter.next() ) );
+4 -4
View File
@@ -160,10 +160,10 @@ class ODatabaseForm :public OFormComponents
friend class OFormSubmitResetThread;
// listener administration
::cppu::OInterfaceContainerHelper m_aLoadListeners;
::cppu::OInterfaceContainerHelper m_aRowSetApproveListeners;
::cppu::OInterfaceContainerHelper m_aSubmitListeners;
::cppu::OInterfaceContainerHelper m_aErrorListeners;
::comphelper::OInterfaceContainerHelper2 m_aLoadListeners;
::comphelper::OInterfaceContainerHelper2 m_aRowSetApproveListeners;
::comphelper::OInterfaceContainerHelper2 m_aSubmitListeners;
::comphelper::OInterfaceContainerHelper2 m_aErrorListeners;
ResetListeners m_aResetListeners;
::osl::Mutex m_aResetSafety;
css::uno::Any m_aCycle;
+1 -1
View File
@@ -124,7 +124,7 @@ typedef ::cppu::ImplHelper3< css::awt::XFocusListener,
class OEditControl : public OBoundControl
,public OEditControl_BASE
{
::cppu::OInterfaceContainerHelper
::comphelper::OInterfaceContainerHelper2
m_aChangeListeners;
OUString m_aHtmlChangeValue;
+1 -1
View File
@@ -238,7 +238,7 @@ void OFileControlModel::read(const Reference<css::io::XObjectInputStream>& _rxIn
void SAL_CALL OFileControlModel::reset() throw ( css::uno::RuntimeException, std::exception)
{
::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aResetListeners);
EventObject aEvt(static_cast<XWeak*>(this));
bool bContinue = true;
while (aIter.hasMoreElements() && bContinue)
+1 -1
View File
@@ -30,7 +30,7 @@ class OFileControlModel
:public OControlModel
,public css::form::XReset
{
::cppu::OInterfaceContainerHelper m_aResetListeners;
::comphelper::OInterfaceContainerHelper2 m_aResetListeners;
OUString m_sDefaultValue;
protected:
+2 -2
View File
@@ -361,7 +361,7 @@ namespace frm
m_aText = sText;
TextEvent aEvt;
aEvt.Source = *this;
::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners );
::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners );
while( aIt.hasMoreElements() )
static_cast<XTextListener *>(aIt.next())->textChanged( aEvt );
}
@@ -537,7 +537,7 @@ namespace frm
setText(aNewText);
TextEvent aEvt;
aEvt.Source = *this;
::cppu::OInterfaceIteratorHelper aIt( m_aTextListeners );
::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners );
while( aIt.hasMoreElements() )
static_cast< XTextListener* >( aIt.next() )->textChanged( aEvt );
}
+1 -1
View File
@@ -1883,7 +1883,7 @@ sal_Bool SAL_CALL OBoundControlModel::commit() throw(RuntimeException, std::exce
// we reach this only if we're not working with an external binding
if ( !hasField() )
return sal_True;
::cppu::OInterfaceIteratorHelper aIter( m_aUpdateListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aUpdateListeners );
EventObject aEvent;
aEvent.Source = static_cast< XWeak* >( this );
bool bSuccess = true;
+1 -1
View File
@@ -349,7 +349,7 @@ css::uno::Sequence<OUString> SAL_CALL OGridControlModel::getColumnTypes() throw
// XReset
void SAL_CALL OGridControlModel::reset() throw ( css::uno::RuntimeException, std::exception)
{
::cppu::OInterfaceIteratorHelper aIter(m_aResetListeners);
::comphelper::OInterfaceIteratorHelper2 aIter(m_aResetListeners);
EventObject aEvt(static_cast<XWeak*>(this));
bool bContinue = true;
while (aIter.hasMoreElements() && bContinue)
+1 -1
View File
@@ -64,7 +64,7 @@ class OGridControlModel :public OControlModel
,public FontControlModel
,public OGridControlModel_BASE
{
::cppu::OInterfaceContainerHelper m_aSelectListeners,
::comphelper::OInterfaceContainerHelper2 m_aSelectListeners,
m_aResetListeners,
m_aRowSetChangeListeners;
+1 -1
View File
@@ -150,7 +150,7 @@ class OImageControlControl : public OBoundControl
, public OImageControlControl_Base
{
private:
::cppu::OInterfaceContainerHelper m_aModifyListeners;
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
+2 -2
View File
@@ -252,8 +252,8 @@ class OListBoxControl :public OBoundControl
,public IEventProcessor
{
private:
::cppu::OInterfaceContainerHelper m_aChangeListeners;
::cppu::OInterfaceContainerHelper m_aItemListeners;
::comphelper::OInterfaceContainerHelper2 m_aChangeListeners;
::comphelper::OInterfaceContainerHelper2 m_aItemListeners;
css::uno::Any m_aCurrentSelection;
Idle m_aChangeIdle;
+1 -1
View File
@@ -178,7 +178,7 @@ namespace frm
bool bCancelled = false;
EventObject aEvent( static_cast< XWeak* >( this ) );
::cppu::OInterfaceIteratorHelper aIter( m_aApproveActionListeners );
::comphelper::OInterfaceIteratorHelper2 aIter( m_aApproveActionListeners );
while( !bCancelled && aIter.hasMoreElements() )
{
// Every approveAction method must be thread-safe!

Some files were not shown because too many files have changed in this diff Show More