From f28c4ae3c676554723ae5959f15b5766e322cee6 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 13 Oct 2021 21:59:05 +0200 Subject: Directly initialize vectors in uui Change-Id: Ifca1362d8ee97640b31ce75b3dc8e819fe32588d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123567 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- uui/source/iahndl-locking.cxx | 9 +++------ uui/source/iahndl-ssl.cxx | 3 +-- uui/source/iahndl.cxx | 23 ++++++++--------------- 3 files changed, 12 insertions(+), 23 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx index 23493c16053c..47b15dc5e9da 100644 --- a/uui/source/iahndl-locking.cxx +++ b/uui/source/iahndl-locking.cxx @@ -72,8 +72,7 @@ void handleReadOnlyOpenRequest_( std::locale aResLocale = Translate::Create("uui"); OUString aMessage; - std::vector aArguments; - aArguments.push_back(aDocumentURL); + std::vector aArguments { aDocumentURL }; aMessage = Translate::get(STR_READONLYOPEN_MSG, aResLocale); aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, aArguments); @@ -102,8 +101,7 @@ void handleReloadEditableRequest_( std::locale aResLocale = Translate::Create("uui"); OUString aMessage; - std::vector aArguments; - aArguments.push_back(aDocumentURL); + std::vector aArguments { aDocumentURL }; aMessage = Translate::get(STR_RELOADEDITABLE_MSG, aResLocale); aMessage = UUIInteractionHelper::replaceMessageWithArguments(aMessage, aArguments); @@ -140,8 +138,7 @@ handleLockedDocumentRequest_( std::locale aResLocale = Translate::Create("uui"); OUString aMessage; - std::vector< OUString > aArguments; - aArguments.push_back( aDocumentURL ); + std::vector< OUString > aArguments { aDocumentURL }; bool bAllowOverride = xRetry.is() && officecfg::Office::Common::Misc::AllowOverrideLocking::get(); diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 136907da7cc2..bf4e8811f949 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -146,8 +146,7 @@ executeUnknownAuthDialog( // Get correct resource string OUString aMessage; - std::vector< OUString > aArguments; - aArguments.push_back( getContentPart( rXCert->getSubjectName()) ); + std::vector< OUString > aArguments { getContentPart( rXCert->getSubjectName()) }; std::locale aResLocale(Translate::Create("uui")); diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 1fb003796682..e36598605b8f 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -463,7 +463,6 @@ UUIInteractionHelper::handleRequest_impl( ucb::UnsupportedNameClashException aUORequest; if (aAnyRequest >>= aUORequest) { - std::vector< OUString > aArguments; uno::Reference< task::XInteractionApprove > xApprove; uno::Reference< task::XInteractionDisapprove > xDisapprove; @@ -472,6 +471,7 @@ UUIInteractionHelper::handleRequest_impl( if ( xApprove.is() && xDisapprove.is() ) { + std::vector< OUString > aArguments; handleErrorHandlerRequest( task::InteractionClassification_QUERY, ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE, aArguments, @@ -553,8 +553,7 @@ UUIInteractionHelper::handleRequest_impl( { sal_Int32 nMedium = 0; aWrongMediumException.Medium >>= nMedium; - std::vector< OUString > aArguments; - aArguments.push_back(OUString::number(nMedium + 1)); + std::vector< OUString > aArguments { OUString::number(nMedium + 1) }; handleErrorHandlerRequest(aWrongMediumException.Classification, ERRCODE_UUI_WRONGMEDIUM, aArguments, @@ -607,8 +606,7 @@ UUIInteractionHelper::handleRequest_impl( ? ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE : ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE; - std::vector< OUString > aArguments; - aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId); + std::vector< OUString > aArguments { aMergeRecoveryRequest.ErrorLayerId }; handleErrorHandlerRequest(task::InteractionClassification_ERROR, nErrorCode, @@ -631,8 +629,7 @@ UUIInteractionHelper::handleRequest_impl( if (aStratum.isEmpty()) aStratum = aStratumCreationException.StratumService; - std::vector< OUString > aArguments; - aArguments.push_back(aStratum); + std::vector< OUString > aArguments { aStratum }; handleErrorHandlerRequest(task::InteractionClassification_ERROR, nErrorCode, @@ -667,8 +664,7 @@ UUIInteractionHelper::handleRequest_impl( { ErrCode nErrorCode = aLLException.SelfOwned ? ERRCODE_UUI_LOCKING_LOCKED_SELF : ERRCODE_UUI_LOCKING_LOCKED; - std::vector< OUString > aArguments; - aArguments.push_back( aLLException.Url ); + std::vector< OUString > aArguments { aLLException.Url }; handleErrorHandlerRequest( aLLException.Classification, nErrorCode, @@ -683,8 +679,7 @@ UUIInteractionHelper::handleRequest_impl( ucb::InteractiveLockingNotLockedException aLNLException; if (aAnyRequest >>= aLNLException) { - std::vector< OUString > aArguments; - aArguments.push_back( aLNLException.Url ); + std::vector< OUString > aArguments { aLNLException.Url }; handleErrorHandlerRequest( aLNLException.Classification, ERRCODE_UUI_LOCKING_NOT_LOCKED, @@ -699,8 +694,7 @@ UUIInteractionHelper::handleRequest_impl( ucb::InteractiveLockingLockExpiredException aLLEException; if (aAnyRequest >>= aLLEException) { - std::vector< OUString > aArguments; - aArguments.push_back( aLLEException.Url ); + std::vector< OUString > aArguments { aLLEException.Url }; handleErrorHandlerRequest( aLLEException.Classification, ERRCODE_UUI_LOCKING_LOCK_EXPIRED, @@ -753,8 +747,7 @@ UUIInteractionHelper::handleRequest_impl( loader::CannotActivateFactoryException aCannotActivateFactoryException; if (aAnyRequest >>= aCannotActivateFactoryException) { - std::vector< OUString > aArguments; - aArguments.push_back( aCannotActivateFactoryException.Message ); + std::vector< OUString > aArguments { aCannotActivateFactoryException.Message }; handleErrorHandlerRequest( task::InteractionClassification_ERROR, ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY, -- cgit