diff options
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 21 | ||||
-rw-r--r-- | sot/source/unoolestorage/xolesimplestorage.cxx | 3 |
2 files changed, 11 insertions, 13 deletions
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 <unotools/ucbhelper.hxx> #include <tools/urlobj.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <cppuhelper/implbase.hxx> #include <ucbhelper/commandenvironment.hxx> @@ -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; } |