diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-28 15:44:38 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-29 10:54:23 +0200 |
commit | e76b00978187486876cdc2adde14ef5043b2a9b0 (patch) | |
tree | 2a84ad1a4c7ac2a366b731a0e0bf8aea12f222f6 | |
parent | 31f12941635f52d34497b9af1361c0e81906762d (diff) |
sequence->vector in OInteractionRequest
Change-Id: I995cb96e514e1aaa05a96f29344ef51e4ca83c64
-rw-r--r-- | comphelper/source/misc/interaction.cxx | 8 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_interact.cxx | 8 | ||||
-rw-r--r-- | include/comphelper/interaction.hxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/file/filinsreq.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpintreq.cxx | 2 |
5 files changed, 13 insertions, 16 deletions
diff --git a/comphelper/source/misc/interaction.cxx b/comphelper/source/misc/interaction.cxx index d16aed741ccd..745320e523f2 100644 --- a/comphelper/source/misc/interaction.cxx +++ b/comphelper/source/misc/interaction.cxx @@ -45,7 +45,7 @@ namespace comphelper } OInteractionRequest::OInteractionRequest(const Any& rRequestDescription, - Sequence<Reference<XInteractionContinuation>> const& rContinuations) + std::vector<Reference<XInteractionContinuation>> const& rContinuations) : m_aRequest(rRequestDescription) , m_aContinuations(rContinuations) { @@ -56,9 +56,7 @@ namespace comphelper OSL_ENSURE(_rxContinuation.is(), "OInteractionRequest::addContinuation: invalid argument!"); if (_rxContinuation.is()) { - sal_Int32 nOldLen = m_aContinuations.getLength(); - m_aContinuations.realloc(nOldLen + 1); - m_aContinuations[nOldLen] = _rxContinuation; + m_aContinuations.push_back(_rxContinuation); } } @@ -71,7 +69,7 @@ namespace comphelper Sequence< Reference< XInteractionContinuation > > SAL_CALL OInteractionRequest::getContinuations( ) throw(RuntimeException, std::exception) { - return m_aContinuations; + return comphelper::containerToSequence(m_aContinuations); } diff --git a/desktop/source/deployment/misc/dp_interact.cxx b/desktop/source/deployment/misc/dp_interact.cxx index 254adedae0b2..f6c35e80468e 100644 --- a/desktop/source/deployment/misc/dp_interact.cxx +++ b/desktop/source/deployment/misc/dp_interact.cxx @@ -108,11 +108,9 @@ bool interactContinuation( Any const & request, if (xInteractionHandler.is()) { bool cont = false; bool abort = false; - Sequence< Reference<task::XInteractionContinuation> > conts( 2 ); - conts[ 0 ] = new InteractionContinuationImpl( - continuation, &cont ); - conts[ 1 ] = new InteractionContinuationImpl( - cppu::UnoType<task::XInteractionAbort>::get(), &abort ); + std::vector< Reference<task::XInteractionContinuation> > conts { + new InteractionContinuationImpl(continuation, &cont ), + new InteractionContinuationImpl( cppu::UnoType<task::XInteractionAbort>::get(), &abort ) }; xInteractionHandler->handle( new ::comphelper::OInteractionRequest( request, conts ) ); if (cont || abort) { diff --git a/include/comphelper/interaction.hxx b/include/comphelper/interaction.hxx index f0d9683bfbbc..3ec18f893019 100644 --- a/include/comphelper/interaction.hxx +++ b/include/comphelper/interaction.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/task/XInteractionPassword.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <comphelper/comphelperdllapi.h> +#include <vector> namespace comphelper @@ -38,8 +39,8 @@ namespace comphelper //= OInteraction - /** template for instantiating concret interaction handlers<p/> - the template argument must eb an interface derived from XInteractionContinuation + /** template for instantiating concrete interaction handlers<p/> + the template argument must be an interface derived from XInteractionContinuation */ template <class INTERACTION> class OInteraction @@ -119,13 +120,13 @@ namespace comphelper { css::uno::Any m_aRequest; /// the request we represent - css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > + std::vector< css::uno::Reference< css::task::XInteractionContinuation > > m_aContinuations; /// all registered continuations public: OInteractionRequest(const css::uno::Any& _rRequestDescription); OInteractionRequest(const css::uno::Any& rRequestDescription, - css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> const& rContinuations); + std::vector<css::uno::Reference<css::task::XInteractionContinuation>> const& rContinuations); /// add a new continuation void addContinuation(const css::uno::Reference< css::task::XInteractionContinuation >& _rxContinuation); diff --git a/ucb/source/ucp/file/filinsreq.cxx b/ucb/source/ucp/file/filinsreq.cxx index e6466b9a59d3..664c45cb06af 100644 --- a/ucb/source/ucp/file/filinsreq.cxx +++ b/ucb/source/ucp/file/filinsreq.cxx @@ -53,7 +53,7 @@ XInteractionRequestImpl::XInteractionRequestImpl( { if( pShell ) pShell->retrieveError(CommandId,m_nErrorCode,m_nMinorError); - uno::Sequence<uno::Reference<task::XInteractionContinuation>> continuations{ + std::vector<uno::Reference<task::XInteractionContinuation>> continuations{ Reference<XInteractionContinuation>(p1), Reference<XInteractionContinuation>(p2) }; Any aAny; diff --git a/ucb/source/ucp/ftp/ftpintreq.cxx b/ucb/source/ucp/ftp/ftpintreq.cxx index 4cb1c9beb3d0..9698080bb8db 100644 --- a/ucb/source/ucp/ftp/ftpintreq.cxx +++ b/ucb/source/ucp/ftp/ftpintreq.cxx @@ -69,7 +69,7 @@ XInteractionRequestImpl::XInteractionRequestImpl() : p1( new XInteractionApproveImpl ) , p2( new XInteractionDisapproveImpl ) { - uno::Sequence<uno::Reference<task::XInteractionContinuation>> continuations{ + std::vector<uno::Reference<task::XInteractionContinuation>> continuations{ Reference<XInteractionContinuation>(p1), Reference<XInteractionContinuation>(p2) }; Any aAny; |