summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 10:07:05 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-31 10:30:32 +0100
commit6f17715a4fb93b1094e037872395ca9732278f43 (patch)
tree643f1d05df7792d47dc030f88f95b14cddee3de3 /sot
parentbaf1b02b49e92e71490e22f0ed39beb152d99085 (diff)
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/ucbstorage.cxx21
-rw-r--r--sot/source/unoolestorage/xolesimplestorage.cxx3
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;
}