From 471f5ab323c5676ca22358ca67f4e6820b7e071c Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 29 Oct 2021 09:27:05 +0300 Subject: Prepare for removal of non-const operator[] from Sequence in desktop Change-Id: I76959f62d46e12d984fe4c7be74e5857399e9126 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124358 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- desktop/source/app/appinit.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'desktop/source/app/appinit.cxx') diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index cff0a684cfcf..bc4af1c681b8 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -136,9 +136,7 @@ void Desktop::createAcceptor(const OUString& aAcceptString) if (pIter != rMap.end() ) return; - Sequence< Any > aSeq( 2 ); - aSeq[0] <<= aAcceptString; - aSeq[1] <<= bAccept; + Sequence< Any > aSeq{ Any(aAcceptString), Any(bAccept) }; Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference rAcceptor( xContext->getServiceManager()->createInstanceWithContext("com.sun.star.office.Acceptor", xContext), @@ -169,11 +167,9 @@ namespace { class enable { private: - Sequence m_aSeq; + Sequence m_aSeq{ Any(true) }; public: - enable() : m_aSeq(1) { - m_aSeq[0] <<= true; - } + enable() = default; void operator() (const AcceptorMap::value_type& val) { if (val.second.is()) { val.second->initialize(m_aSeq); -- cgit