tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: Ib06c8ed707bdfd87b294b2597614249fac2c1f18
Reviewed-on: https://gerrit.libreoffice.org/56342
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
This commit is contained in:
Jacek Fraczek
2018-06-23 21:28:30 +02:00
committed by Michael Stahl
parent 74b33394c4
commit 10b34eb9f3
2 changed files with 14 additions and 23 deletions

View File

@@ -240,10 +240,9 @@ bool MigrationImpl::doMigration()
if (sModuleIdentifier.isEmpty()) if (sModuleIdentifier.isEmpty())
continue; continue;
uno::Sequence< uno::Any > lArgs(2);
OUString aOldCfgDataPath = m_aInfo.userdata + "/user/config/soffice.cfg/modules/"; OUString aOldCfgDataPath = m_aInfo.userdata + "/user/config/soffice.cfg/modules/" + i.sModuleShortName;
lArgs[0] <<= aOldCfgDataPath + i.sModuleShortName; uno::Sequence< uno::Any > lArgs {uno::makeAny(aOldCfgDataPath), uno::makeAny(embed::ElementModes::READ)};
lArgs[1] <<= embed::ElementModes::READ;
uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext()); uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
uno::Reference< lang::XSingleServiceFactory > xStorageFactory(embed::FileSystemStorageFactory::create(xContext)); uno::Reference< lang::XSingleServiceFactory > xStorageFactory(embed::FileSystemStorageFactory::create(xContext));
@@ -769,8 +768,7 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa
comphelper::getProcessComponentContext())); comphelper::getProcessComponentContext()));
// access the provider // access the provider
uno::Sequence< uno::Any > theArgs(1); uno::Sequence< uno::Any > theArgs {uno::makeAny(sConfigURL)};
theArgs[ 0 ] <<= sConfigURL;
xNameAccess.set( xNameAccess.set(
theConfigProvider->createInstanceWithArguments( theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW ); sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW );
@@ -870,9 +868,8 @@ std::vector< MigrationModuleInfo > MigrationImpl::dectectUIChangesForAllModules(
const OUString MENUBAR("menubar"); const OUString MENUBAR("menubar");
const OUString TOOLBAR("toolbar"); const OUString TOOLBAR("toolbar");
uno::Sequence< uno::Any > lArgs(2); uno::Sequence< uno::Any > lArgs {uno::makeAny(m_aInfo.userdata + "/user/config/soffice.cfg/modules"),
lArgs[0] <<= m_aInfo.userdata + "/user/config/soffice.cfg/modules"; uno::makeAny(embed::ElementModes::READ)};
lArgs[1] <<= embed::ElementModes::READ;
uno::Reference< lang::XSingleServiceFactory > xStorageFactory( uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
embed::FileSystemStorageFactory::create(comphelper::getProcessComponentContext())); embed::FileSystemStorageFactory::create(comphelper::getProcessComponentContext()));
@@ -1049,14 +1046,11 @@ void MigrationImpl::mergeOldToNewVersion(const uno::Reference< ui::XUIConfigurat
} while (nIndex >= 0); } while (nIndex >= 0);
if (nIndex == -1) { if (nIndex == -1) {
uno::Sequence< beans::PropertyValue > aPropSeq(3); uno::Sequence< beans::PropertyValue > aPropSeq {
beans::PropertyValue(ITEM_DESCRIPTOR_COMMANDURL, 0, uno::makeAny(elem.m_sCommandURL), beans::PropertyState_DIRECT_VALUE),
aPropSeq[0].Name = ITEM_DESCRIPTOR_COMMANDURL; beans::PropertyValue(ITEM_DESCRIPTOR_LABEL, 0, uno::makeAny(retrieveLabelFromCommand(elem.m_sCommandURL, sModuleIdentifier)), beans::PropertyState_DIRECT_VALUE),
aPropSeq[0].Value <<= elem.m_sCommandURL; beans::PropertyValue(ITEM_DESCRIPTOR_CONTAINER, 0, uno::makeAny(elem.m_xPopupMenu), beans::PropertyState_DIRECT_VALUE)
aPropSeq[1].Name = ITEM_DESCRIPTOR_LABEL; };
aPropSeq[1].Value <<= retrieveLabelFromCommand(elem.m_sCommandURL, sModuleIdentifier);
aPropSeq[2].Name = ITEM_DESCRIPTOR_CONTAINER;
aPropSeq[2].Value <<= elem.m_xPopupMenu;
if (elem.m_sPrevSibling.isEmpty()) if (elem.m_sPrevSibling.isEmpty())
xTemp->insertByIndex(0, uno::makeAny(aPropSeq)); xTemp->insertByIndex(0, uno::makeAny(aPropSeq));

View File

@@ -353,16 +353,13 @@ Reference<XComponentContext> connectToOffice(
Reference<XComponentContext> const & xLocalComponentContext, Reference<XComponentContext> const & xLocalComponentContext,
bool verbose ) bool verbose )
{ {
Sequence<OUString> args( 3 );
args[ 0 ] = "--nologo";
args[ 1 ] = "--nodefault";
OUString pipeId( ::dp_misc::generateRandomPipeId() ); OUString pipeId( ::dp_misc::generateRandomPipeId() );
OUStringBuffer buf; OUStringBuffer buf;
buf.append( "--accept=pipe,name=" ); buf.append( "--accept=pipe,name=" );
buf.append( pipeId ); buf.append( pipeId );
buf.append( ";urp;" ); buf.append( ";urp;" );
args[ 2 ] = buf.makeStringAndClear();
Sequence<OUString> args { "--nologo", "--nodefault", buf.makeStringAndClear() };
OUString appURL( getExecutableDir() + "/soffice" ); OUString appURL( getExecutableDir() + "/soffice" );
if (verbose) if (verbose)