summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-29 10:11:53 +0200
committerNoel Grandin <noel@peralex.com>2015-06-29 10:11:53 +0200
commitb55166d266f31caf7bd85e54a59c7e8b49204b16 (patch)
treef4d98e90c214a6e588e2b4e22c05b9c0f44309aa /toolkit
parent39fd37f39db37a83c4a1491d68518e721b04fc5f (diff)
Revert "return and use std::vector from OInterfaceContainerHelper"
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx24
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx10
2 files changed, 18 insertions, 16 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index ce25b2bba160..cf141577038e 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1757,13 +1757,13 @@ void VCLXToolkit::callTopWindowListeners(
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
if (pWindow->IsTopWindow())
{
- std::vector< css::uno::Reference< css::uno::XInterface > >
- aListeners(m_aTopWindowListeners.getElementsAsVector());
- if (!aListeners.empty())
+ css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ aListeners(m_aTopWindowListeners.getElements());
+ if (aListeners.hasElements())
{
css::lang::EventObject aAwtEvent(
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()));
- for (::sal_Int32 i = 0; i < (sal_Int32)aListeners.size(); ++i)
+ for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
{
css::uno::Reference< css::awt::XTopWindowListener >
xListener(aListeners[i], css::uno::UNO_QUERY);
@@ -1786,10 +1786,10 @@ void VCLXToolkit::callTopWindowListeners(
long VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
bool bPressed)
{
- std::vector< css::uno::Reference< css::uno::XInterface > >
- aHandlers(m_aKeyHandlers.getElementsAsVector());
+ css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ aHandlers(m_aKeyHandlers.getElements());
- if (!aHandlers.empty())
+ if (aHandlers.hasElements())
{
vcl::Window * pWindow = static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
@@ -1809,7 +1809,7 @@ long VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
pKeyEvent->GetKeyCode().GetCode(), pKeyEvent->GetCharCode(),
sal::static_int_cast< sal_Int16 >(
pKeyEvent->GetKeyCode().GetFunction()));
- for (::sal_Int32 i = 0; i < (sal_Int32)aHandlers.size(); ++i)
+ for (::sal_Int32 i = 0; i < aHandlers.getLength(); ++i)
{
css::uno::Reference< css::awt::XKeyHandler > xHandler(
aHandlers[i], css::uno::UNO_QUERY);
@@ -1838,9 +1838,9 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
if (pWindow->IsTopWindow())
{
- std::vector< css::uno::Reference< css::uno::XInterface > >
- aListeners(m_aFocusListeners.getElementsAsVector());
- if (!aListeners.empty())
+ css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ aListeners(m_aFocusListeners.getElements());
+ if (aListeners.hasElements())
{
// Ignore the interior of compound controls when determining the
// window that gets the focus next (see implementation in
@@ -1859,7 +1859,7 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
static_cast<sal_Int16>(pWindow->GetGetFocusFlags()),
xNext, false);
- for (size_t i = 0; i < aListeners.size(); ++i)
+ for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
{
css::uno::Reference< css::awt::XFocusListener > xListener(
aListeners[i], css::uno::UNO_QUERY);
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index b064aff4c295..a7eff04a42e5 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -916,11 +916,13 @@ void ControlModelContainerBase::implNotifyTabModelChange( const OUString& _rAcce
aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
- std::vector< Reference< XInterface > > aChangeListeners( maChangeListeners.getElementsAsVector() );
- for ( Reference< XInterface > & rListener : aChangeListeners )
+ Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
+ const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
+ const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
+ for ( ; pListener != pListenerEnd; ++pListener )
{
- if ( rListener.is() )
- static_cast< XChangesListener* >( rListener.get() )->changesOccurred( aEvent );
+ if ( pListener->is() )
+ static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
}
}