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 /sfx2 | |
parent | ab20a5888d3a7f964ef2fb3afe2477825da6037e (diff) |
Initialize Sequence<beans::NamedValue> from initializer_lists
Change-Id: I216dcbd983dcf3df79df9fda371b93114540a9d8
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 9 |
6 files changed, 31 insertions, 51 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 7c5d308b14c7..fbac0dc0795c 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -319,9 +319,8 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) SvtViewOptions aWinOpt(E_WINDOW, sName); aWinOpt.SetWindowState(OStringToOUString(rInfo.aWinState, RTL_TEXTENCODING_UTF8)); - css::uno::Sequence < css::beans::NamedValue > aSeq(1); - aSeq[0].Name = "Data"; - aSeq[0].Value <<= aWinData.makeStringAndClear(); + css::uno::Sequence < css::beans::NamedValue > aSeq + { { "Data", css::uno::makeAny(aWinData.makeStringAndClear()) } }; aWinOpt.SetUserData( aSeq ); // ... but save status at runtime! diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 7ed2c6e2f2cd..580de689ce55 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -506,9 +506,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c // If there is no acceptable type for this document at all, the type detection has possibly returned something else. // The DocumentService property is only a preselection, and all preselections are considered as optional! // This "wrong" type will be sorted out now because we match only allowed filters to the detected type - uno::Sequence< beans::NamedValue > lQuery(1); - lQuery[0].Name = "Name"; - lQuery[0].Value <<= sTypeName; + uno::Sequence< beans::NamedValue > lQuery { { "Name", css::uno::makeAny(sTypeName) } }; pFilter = GetFilterForProps(lQuery, nMust, nDont); } @@ -699,9 +697,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const OUString& rMediaType, S return 0; } - css::uno::Sequence < css::beans::NamedValue > aSeq(1); - aSeq[0].Name = "MediaType"; - aSeq[0].Value <<= rMediaType; + css::uno::Sequence < css::beans::NamedValue > aSeq { { "MediaType", css::uno::makeAny(rMediaType) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -728,9 +724,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const OUString& rType, SfxFilte return 0; } - css::uno::Sequence < css::beans::NamedValue > aSeq(1); - aSeq[0].Name = "Name"; - aSeq[0].Value <<= OUString( rType ); + css::uno::Sequence < css::beans::NamedValue > aSeq { { "Name", css::uno::makeAny(rType) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -767,11 +761,8 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const OUString& rExt, Sf if ( sExt.startsWith(".") ) sExt = sExt.copy(1); - css::uno::Sequence < css::beans::NamedValue > aSeq(1); - aSeq[0].Name = "Extensions"; - uno::Sequence < OUString > aExts(1); - aExts[0] = sExt; - aSeq[0].Value <<= aExts; + css::uno::Sequence < css::beans::NamedValue > aSeq + { { "Extensions", css::uno::makeAny(uno::Sequence < OUString > { sExt } ) } }; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -780,10 +771,8 @@ const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( SotClipboardFormatId n if (nId == SotClipboardFormatId::NONE) return 0; - css::uno::Sequence < css::beans::NamedValue > aSeq(1); - OUString aName = SotExchange::GetFormatName( nId ); - aSeq[0].Name = "ClipboardFormat"; - aSeq[0].Value <<= aName; + css::uno::Sequence < css::beans::NamedValue > aSeq + { { "ClipboardFormat", css::uno::makeAny(SotExchange::GetFormatName( nId )) } }; return GetFilterForProps( aSeq, nMust, nDont ); } diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index c85cbabbc255..f8727533895e 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -534,9 +534,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceAnyFilter( SfxFilterFlags nMust, SfxFilterFlags nDont ) { - uno::Sequence< beans::NamedValue > aSearchRequest( 1 ); - aSearchRequest[0].Name = "DocumentService"; - aSearchRequest[0].Value <<= GetDocServiceName(); + uno::Sequence< beans::NamedValue > aSearchRequest { { "DocumentService", css::uno::makeAny(GetDocServiceName()) } }; return ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont ); } @@ -555,11 +553,11 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl( if ( ( nStoreMode != SAVEASREMOTE_REQUESTED ) && ( nStoreMode & PDFEXPORT_REQUESTED ) ) { // Preselect PDF-Filter for EXPORT - uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); - aSearchRequest[0].Name = "Type"; - aSearchRequest[0].Value <<= OUString("pdf_Portable_Document_Format"); - aSearchRequest[1].Name = "DocumentService"; - aSearchRequest[1].Value <<= GetDocServiceName(); + uno::Sequence< beans::NamedValue > aSearchRequest + { + { "Type", css::uno::makeAny(OUString("pdf_Portable_Document_Format")) }, + { "DocumentService", css::uno::makeAny(GetDocServiceName()) } + }; aFilterProps = ::comphelper::MimeConfigurationHelper::SearchForFilter( m_pOwner->GetFilterQuery(), aSearchRequest, nMust, nDont ); } @@ -802,9 +800,7 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& aFilterName ) bool ModelData_Impl::CheckFilterOptionsDialogExistence() { - uno::Sequence< beans::NamedValue > aSearchRequest( 1 ); - aSearchRequest[0].Name = "DocumentService"; - aSearchRequest[0].Value <<= GetDocServiceName(); + uno::Sequence< beans::NamedValue > aSearchRequest { { "DocumentService", css::uno::makeAny(GetDocServiceName()) } }; uno::Reference< container::XEnumeration > xFilterEnum = m_pOwner->GetFilterQuery()->createSubSetEnumerationByProperties( aSearchRequest ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 778f51bbaf36..8b2916c72617 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -381,14 +381,13 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto bUseBlowfishInODF12 = aSaveOpt.IsUseBlowfishInODF12(); } - uno::Sequence< beans::NamedValue > aEncryptionAlgs( 3 ); - aEncryptionAlgs[0].Name = "StartKeyGenerationAlgorithm"; - aEncryptionAlgs[1].Name = "EncryptionAlgorithm"; - aEncryptionAlgs[2].Name = "ChecksumAlgorithm"; // the default values, that should be used for ODF1.1 and older formats - aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA1; - aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8; - aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA1_1K; + uno::Sequence< beans::NamedValue > aEncryptionAlgs + { + { "StartKeyGenerationAlgorithm", css::uno::makeAny(xml::crypto::DigestID::SHA1) }, + { "EncryptionAlgorithm", css::uno::makeAny(xml::crypto::CipherID::BLOWFISH_CFB_8) }, + { "ChecksumAlgorithm", css::uno::makeAny(xml::crypto::DigestID::SHA1_1K) } + }; if ( nDefVersion >= SvtSaveOptions::ODFVER_012 ) { diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 731e3a8a4a06..e87cc5cf5eed 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -432,19 +432,17 @@ void SfxTemplateManagerDlg::readSettings () void SfxTemplateManagerDlg::writeSettings () { - Sequence< NamedValue > aSettings(2); - OUString aLastFolder; if (mpCurView == mpLocalView && mpLocalView->getCurRegionId()) aLastFolder = mpLocalView->getRegionName(mpLocalView->getCurRegionId()-1); // last folder - aSettings[0].Name = TM_SETTING_LASTFOLDER; - aSettings[0].Value <<= aLastFolder; - - aSettings[1].Name = TM_SETTING_FILTER; - aSettings[1].Value <<= sal_uInt16(getCurrentFilter()); + Sequence< NamedValue > aSettings + { + { TM_SETTING_LASTFOLDER, css::uno::makeAny(aLastFolder) }, + { TM_SETTING_FILTER, css::uno::makeAny(sal_uInt16(getCurrentFilter())) } + }; // write SvtViewOptions aViewSettings(E_DIALOG, TM_SETTING_MANAGER); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index cfd9e90d4919..d2061e3b223a 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -342,11 +342,10 @@ static OUString impl_retrieveFilterNameFromTypeAndModule( const sal_Int32 nFlags ) { // Retrieve filter from type - css::uno::Sequence< css::beans::NamedValue > aQuery( 2 ); - aQuery[0].Name = "Type"; - aQuery[0].Value = css::uno::makeAny( rType ); - aQuery[1].Name = "DocumentService"; - aQuery[1].Value = css::uno::makeAny( rModuleIdentifier ); + css::uno::Sequence< css::beans::NamedValue > aQuery { + { "Type", css::uno::makeAny( rType ) }, + { "DocumentService", css::uno::makeAny( rModuleIdentifier ) } + }; css::uno::Reference< css::container::XEnumeration > xEnumeration = rContainerQuery->createSubSetEnumerationByProperties( aQuery ); |