ucbhelper/source/client/proxydecider.cxx                         |    4 -
 ucbhelper/source/provider/authenticationfallback.cxx             |    7 ---
 ucbhelper/source/provider/cancelcommandexecution.cxx             |    7 ---
 ucbhelper/source/provider/simpleauthenticationrequest.cxx        |   21 
+++-------
 ucbhelper/source/provider/simplecertificatevalidationrequest.cxx |    7 ---
 ucbhelper/source/provider/simpleioerrorrequest.cxx               |    6 --
 ucbhelper/source/provider/simplenameclashresolverequest.cxx      |    9 ----
 7 files changed, 14 insertions(+), 47 deletions(-)

New commits:
commit 51b75b2eae36272289230bd63b546d527c18df19
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Oct 29 10:21:30 2021 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Oct 31 21:28:26 2021 +0100

    Prepare for removal of non-const operator[] from Sequence in ucbhelper
    
    Change-Id: I06b04e3eed46aba8aac528b2c394d60e733533a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124405
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/ucbhelper/source/client/proxydecider.cxx 
b/ucbhelper/source/client/proxydecider.cxx
index 7a363a0962f7..211711b556d1 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -301,9 +301,7 @@ InternetProxyDecider_Impl::InternetProxyDecider_Impl(
         uno::Reference< lang::XMultiServiceFactory > xConfigProv =
                 configuration::theDefaultProvider::get( rxContext );
 
-        uno::Sequence< uno::Any > aArguments( 1 );
-        aArguments[ 0 ] <<= OUString( CONFIG_ROOT_KEY );
-
+        uno::Sequence< uno::Any > aArguments{ uno::Any(OUString( 
CONFIG_ROOT_KEY )) };
         uno::Reference< uno::XInterface > xInterface(
                     xConfigProv->createInstanceWithArguments(
                         "com.sun.star.configuration.ConfigurationAccess",
diff --git a/ucbhelper/source/provider/authenticationfallback.cxx 
b/ucbhelper/source/provider/authenticationfallback.cxx
index eee4b04b39e7..70fd0ecbf6b5 100644
--- a/ucbhelper/source/provider/authenticationfallback.cxx
+++ b/ucbhelper/source/provider/authenticationfallback.cxx
@@ -25,12 +25,7 @@ AuthenticationFallbackRequest::AuthenticationFallbackRequest(
     setRequest( uno::makeAny( aRequest ) );
     m_xAuthFallback = new InteractionAuthFallback( this );
 
-    uno::Sequence<
-        uno::Reference< task::XInteractionContinuation > > aContinuations( 2 );
-    aContinuations[ 0 ] = new InteractionAbort( this );
-    aContinuations[ 1 ] = m_xAuthFallback.get( );
-
-    setContinuations( aContinuations );
+    setContinuations({ new InteractionAbort(this), m_xAuthFallback });
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/cancelcommandexecution.cxx 
b/ucbhelper/source/provider/cancelcommandexecution.cxx
index 8aac85c240aa..89245ca78492 100644
--- a/ucbhelper/source/provider/cancelcommandexecution.cxx
+++ b/ucbhelper/source/provider/cancelcommandexecution.cxx
@@ -51,12 +51,7 @@ void cancelCommandExecution( const uno::Any & rException,
             rtl::Reference< ucbhelper::InteractionRequest > xRequest
                 = new ucbhelper::InteractionRequest( rException );
 
-            uno::Sequence< uno::Reference< task::XInteractionContinuation > >
-                aContinuations( 1 );
-            aContinuations[ 0 ]
-                = new ucbhelper::InteractionAbort( xRequest.get() );
-
-            xRequest->setContinuations( aContinuations );
+            xRequest->setContinuations({ new 
ucbhelper::InteractionAbort(xRequest.get()) });
 
             xIH->handle( xRequest );
 
diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx 
b/ucbhelper/source/provider/simpleauthenticationrequest.cxx
index 96608c784c9b..c6eee708bbd3 100644
--- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx
+++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx
@@ -112,21 +112,19 @@ void SimpleAuthenticationRequest::initialize(
     setRequest( uno::makeAny( rRequest ) );
 
     // Fill continuations...
-    unsigned int nSize = 1;
-    unsigned int nPos = 0;
+    unsigned int nSize = 2;
 
     if( bAllowSessionStoring )
         nSize++;
 
-    nSize++;
-
     uno::Sequence< ucb::RememberAuthentication > aRememberModes( nSize );
-    aRememberModes[ nPos++ ] = ucb::RememberAuthentication_NO;
+    auto it = aRememberModes.getArray();
+    *it++ = ucb::RememberAuthentication_NO;
 
     if( bAllowSessionStoring )
-        aRememberModes[ nPos++ ] = ucb::RememberAuthentication_SESSION;
+        *it++ = ucb::RememberAuthentication_SESSION;
 
-    aRememberModes[ nPos++ ] = ucb::RememberAuthentication_PERSISTENT;
+    *it = ucb::RememberAuthentication_PERSISTENT;
 
     m_xAuthSupplier
         = new InteractionSupplyAuthentication(
@@ -142,13 +140,8 @@ void SimpleAuthenticationRequest::initialize(
                 bAllowUseSystemCredentials // bCanUseSystemCredentials,
             );
 
-    uno::Sequence<
-        uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
-    aContinuations[ 0 ] = new InteractionAbort( this );
-    aContinuations[ 1 ] = new InteractionRetry( this );
-    aContinuations[ 2 ] = m_xAuthSupplier.get();
-
-    setContinuations( aContinuations );
+    setContinuations(
+        { new InteractionAbort(this), new InteractionRetry(this), 
m_xAuthSupplier });
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/simplecertificatevalidationrequest.cxx 
b/ucbhelper/source/provider/simplecertificatevalidationrequest.cxx
index 6b9e7a3d1d0c..af39fdf03f16 100644
--- a/ucbhelper/source/provider/simplecertificatevalidationrequest.cxx
+++ b/ucbhelper/source/provider/simplecertificatevalidationrequest.cxx
@@ -36,12 +36,7 @@ 
SimpleCertificateValidationRequest::SimpleCertificateValidationRequest( sal_Int3
 
     setRequest( uno::makeAny( aRequest ) );
 
-    uno::Sequence< uno::Reference< task::XInteractionContinuation > > 
aContinuations( 2 );
-    aContinuations[ 0 ] = new InteractionAbort( this );
-    aContinuations[ 1 ] = new InteractionApprove( this );
-
-    setContinuations( aContinuations );
-    certificate.get();
+    setContinuations({ new InteractionAbort(this), new 
InteractionApprove(this) });
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/simpleioerrorrequest.cxx 
b/ucbhelper/source/provider/simpleioerrorrequest.cxx
index 492c736a60ff..7a18c6474295 100644
--- a/ucbhelper/source/provider/simpleioerrorrequest.cxx
+++ b/ucbhelper/source/provider/simpleioerrorrequest.cxx
@@ -42,11 +42,7 @@ SimpleIOErrorRequest::SimpleIOErrorRequest(
     setRequest( uno::makeAny( aRequest ) );
 
     // Fill continuations...
-    uno::Sequence< uno::Reference<
-            task::XInteractionContinuation > > aContinuations( 1 );
-    aContinuations[ 0 ] = new InteractionAbort( this );
-
-    setContinuations( aContinuations );
+    setContinuations({ new InteractionAbort(this) });
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/simplenameclashresolverequest.cxx 
b/ucbhelper/source/provider/simplenameclashresolverequest.cxx
index 51517f93dd51..e5118d536033 100644
--- a/ucbhelper/source/provider/simplenameclashresolverequest.cxx
+++ b/ucbhelper/source/provider/simplenameclashresolverequest.cxx
@@ -143,13 +143,8 @@ 
SimpleNameClashResolveRequest::SimpleNameClashResolveRequest(
     // Fill continuations...
     m_xNameSupplier = new InteractionSupplyName( this );
 
-    uno::Sequence< uno::Reference< task::XInteractionContinuation > >
-                            aContinuations( 3 );
-    aContinuations[ 0 ] = new InteractionAbort( this );
-    aContinuations[ 1 ] = m_xNameSupplier.get();
-    aContinuations[ 2 ] = new InteractionReplaceExistingData( this );
-
-    setContinuations( aContinuations );
+    setContinuations({ new InteractionAbort(this), m_xNameSupplier,
+                       new InteractionReplaceExistingData(this) });
 }
 
 OUString const & SimpleNameClashResolveRequest::getNewName() const

Reply via email to