From 6f17715a4fb93b1094e037872395ca9732278f43 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 29 Oct 2021 10:07:05 +0300 Subject: Prepare for removal of non-const operator[] from Sequence in sot Change-Id: I5d6da6ce158fb29ff37452281d28c297795b4cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124391 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sot/source/sdstor/ucbstorage.cxx | 21 +++++++++------------ sot/source/unoolestorage/xolesimplestorage.cxx | 3 ++- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 6a14ce1dc4e1..3f35c0b95b20 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -1865,20 +1866,18 @@ void UCBStorage_Impl::SetProps( const Sequence < Sequence < PropertyValue > >& r void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < PropertyValue > >& rSequence, const OUString& rPath ) { - // first my own properties - Sequence < PropertyValue > aProps(2); + auto pSequence = rSequence.getArray(); + // first my own properties // first property is the "FullPath" name // it's '/' for the root storage and m_aName for each element, followed by a '/' if it's a folder OUString aPath( rPath ); if ( !m_bIsRoot ) aPath += m_aName; aPath += "/"; - aProps[0].Name = "MediaType"; - aProps[0].Value <<= m_aContentType; - aProps[1].Name = "FullPath"; - aProps[1].Value <<= aPath; - rSequence[ nProps++ ] = aProps; + Sequence < PropertyValue > aProps{ comphelper::makePropertyValue("MediaType", m_aContentType), + comphelper::makePropertyValue("FullPath", aPath) }; + pSequence[nProps++] = aProps; if ( m_bIsRoot ) // the "FullPath" of a child always starts without '/' @@ -1895,11 +1894,9 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, Sequence < Sequence < Propert { // properties of streams OUString aElementPath = aPath + pElement->m_aName; - aProps[0].Name = "MediaType"; - aProps[0].Value <<= pElement->GetContentType(); - aProps[1].Name = "FullPath"; - aProps[1].Value <<= aElementPath; - rSequence[ nProps++ ] = aProps; + aProps = { comphelper::makePropertyValue("MediaType", pElement->GetContentType()), + comphelper::makePropertyValue("FullPath", aElementPath) }; + pSequence[ nProps++ ] = aProps; } } } diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index 6f2147c6415f..8ea0907b38e5 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -481,8 +481,9 @@ uno::Sequence< OUString > SAL_CALL OLESimpleStorage::getElementNames() } uno::Sequence< OUString > aSeq( aList.size() ); + auto aSeqRange = asNonConstRange(aSeq); for ( size_t nInd = 0; nInd < aList.size(); nInd++ ) - aSeq[nInd] = aList[nInd].GetName(); + aSeqRange[nInd] = aList[nInd].GetName(); return aSeq; } -- cgit > LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2014-09-15WaE: -Wshadow signals2Caolán McNamara