From b55166d266f31caf7bd85e54a59c7e8b49204b16 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 29 Jun 2015 10:11:53 +0200 Subject: Revert "return and use std::vector from OInterfaceContainerHelper" This reverts commit e57314f61f67b093510c5a8a8f34a62126ba8734. --- toolkit/source/awt/vclxtoolkit.cxx | 24 +++++++++++----------- .../source/controls/controlmodelcontainerbase.cxx | 10 +++++---- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'toolkit') 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(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 ); } } -- cgit v1.2.3