diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-28 13:55:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-29 08:57:08 +0200 |
commit | 7cdbde4867b14ae382262dc394ba83e609a8eecf (patch) | |
tree | 5fa180d35a8423a7857b0d57355f74a6d26b5bec /framework | |
parent | ab20a5888d3a7f964ef2fb3afe2477825da6037e (diff) |
Initialize Sequence<beans::NamedValue> from initializer_lists
Change-Id: I216dcbd983dcf3df79df9fda371b93114540a9d8
Diffstat (limited to 'framework')
8 files changed, 16 insertions, 39 deletions
diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index 93a4f6ad01fa..9c955bb14b16 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -117,10 +117,7 @@ css::uno::Any SAL_CALL ShellJob::execute(const css::uno::Sequence< css::beans::N css::uno::Any ShellJob::impl_generateAnswer4Deactivation() { - css::uno::Sequence< css::beans::NamedValue > aAnswer(1); - aAnswer[0].Name = JobConst::ANSWER_DEACTIVATE_JOB(); - aAnswer[0].Value = css::uno::makeAny(sal_True); - + css::uno::Sequence< css::beans::NamedValue > aAnswer { { JobConst::ANSWER_DEACTIVATE_JOB(), css::uno::makeAny(sal_True) } }; return css::uno::makeAny(aAnswer); } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 4ffae06bf94c..967264b743ff 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -870,17 +870,13 @@ bool LoadEnv::impl_handleContent() css::uno::Sequence< OUString > lTypeReg(1); lTypeReg[0] = sType; - css::uno::Sequence< css::beans::NamedValue > lQuery(1); - lQuery[0].Name = PROP_TYPES; - lQuery[0].Value <<= lTypeReg; - - OUString sPROP_NAME(PROP_NAME); + css::uno::Sequence< css::beans::NamedValue > lQuery { { PROP_TYPES, css::uno::makeAny(lTypeReg) } }; css::uno::Reference< css::container::XEnumeration > xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery); while(xSet->hasMoreElements()) { ::comphelper::SequenceAsHashMap lProps (xSet->nextElement()); - OUString sHandler = lProps.getUnpackedValueOrDefault(sPROP_NAME, OUString()); + OUString sHandler = lProps.getUnpackedValueOrDefault(OUString(PROP_NAME), OUString()); css::uno::Reference< css::frame::XNotifyingDispatch > xHandler; try @@ -1163,11 +1159,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader() css::uno::Sequence< OUString > lTypesReg(1); lTypesReg[0] = sType; - css::uno::Sequence< css::beans::NamedValue > lQuery(1); - lQuery[0].Name = PROP_TYPES; - lQuery[0].Value <<= lTypesReg; - - OUString sPROP_NAME(PROP_NAME); + css::uno::Sequence< css::beans::NamedValue > lQuery { { PROP_TYPES, css::uno::makeAny(lTypesReg) } }; css::uno::Reference< css::container::XEnumeration > xSet = xLoaderFactory->createSubSetEnumerationByProperties(lQuery); while(xSet->hasMoreElements()) @@ -1177,7 +1169,7 @@ css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader() // try everyone ... // Ignore any loader, which makes trouble :-) ::comphelper::SequenceAsHashMap lLoaderProps(xSet->nextElement()); - OUString sLoader = lLoaderProps.getUnpackedValueOrDefault(sPROP_NAME, OUString()); + OUString sLoader = lLoaderProps.getUnpackedValueOrDefault(OUString(PROP_NAME), OUString()); css::uno::Reference< css::uno::XInterface > xLoader; xLoader = xLoaderFactory->createInstance(sLoader); diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx index ebf7d5a6bb42..bacd8f74ad57 100644 --- a/framework/source/tabwin/tabwindow.cxx +++ b/framework/source/tabwin/tabwindow.cxx @@ -690,11 +690,11 @@ throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::ex OUString aTitle = pTabControl->GetPageText( sal_uInt16( ID )); nPos = pTabControl->GetPagePos( sal_uInt16( ID )); - css::uno::Sequence< css::beans::NamedValue > aSeq( 2 ); - aSeq[0].Name = m_aTitlePropName; - aSeq[0].Value = css::uno::makeAny( aTitle ); - aSeq[1].Name = m_aPosPropName; - aSeq[1].Value = css::uno::makeAny( sal_Int32( nPos )); + css::uno::Sequence< css::beans::NamedValue > aSeq + { + { m_aTitlePropName, css::uno::makeAny( aTitle ) }, + { m_aPosPropName, css::uno::makeAny( sal_Int32( nPos )) } + }; return aSeq; } } diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index a7ad8a36d529..5a8277f1c6d3 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -284,9 +284,7 @@ void ComboboxToolbarController::executeControlCommand( const css::frame::Control m_pComboBox->InsertEntry( aList[j] ); // send notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "List"; - aInfo[0].Value <<= aList; + uno::Sequence< beans::NamedValue > aInfo { { "List", css::uno::makeAny(aList) } }; addNotifyInfo( OUString( "ListChanged" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 6ff709d180e7..62c7edbb128d 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -320,9 +320,7 @@ void ComplexToolbarController::notifyFocusLost() void ComplexToolbarController::notifyTextChanged( const OUString& aText ) { // send text changed notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "Text"; - aInfo[0].Value <<= aText; + uno::Sequence< beans::NamedValue > aInfo { { "Text", css::uno::makeAny(aText) } }; addNotifyInfo( OUString( "TextChanged" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 4045384ec475..82e0ad8bfa17 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -221,9 +221,7 @@ void DropdownToolbarController::executeControlCommand( const css::frame::Control m_pListBoxControl->SelectEntryPos( 0 ); // send notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "List"; - aInfo[0].Value <<= aList; + uno::Sequence< beans::NamedValue > aInfo { { "List", css::uno::makeAny(aList) } }; addNotifyInfo( OUString( "ListChanged" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index ac8840c4a39d..ddf97b064fc6 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -112,9 +112,7 @@ void ImageButtonToolbarController::executeControlCommand( const css::frame::Cont m_pToolbar->SetItemImage( m_nID, aImage ); // send notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "URL"; - aInfo[0].Value <<= aURL; + uno::Sequence< beans::NamedValue > aInfo { { "URL", css::uno::makeAny(aURL) } }; addNotifyInfo( OUString( "ImageChanged" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index c4eef604393a..c590764656c2 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -144,9 +144,7 @@ void ToggleButtonToolbarController::executeControlCommand( const css::frame::Con m_aDropdownMenuList.push_back( aList[j] ); // send notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "List"; - aInfo[0].Value <<= aList; + uno::Sequence< beans::NamedValue > aInfo { { "List", css::uno::makeAny(aList) } }; addNotifyInfo( OUString( "ListChanged" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); @@ -171,9 +169,7 @@ void ToggleButtonToolbarController::executeControlCommand( const css::frame::Con m_aCurrentSelection = m_aDropdownMenuList[nPos]; // send notification - uno::Sequence< beans::NamedValue > aInfo( 1 ); - aInfo[0].Name = "ItemChecked"; - aInfo[0].Value <<= nPos; + uno::Sequence< beans::NamedValue > aInfo { { "ItemChecked", css::uno::makeAny(nPos) } }; addNotifyInfo( OUString( "Pos" ), getDispatchFromCommand( m_aCommandURL ), aInfo ); |