summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-02 08:28:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-04 08:52:39 +0100
commit28239c40430ec4e613d9d936614c5c3853c332c4 (patch)
tree0fa6bc36c05f8f42a0799b884ed38eb3e569ff90 /comphelper
parent85b7e7fdd7f283a3084e2db0dd8e71a48fac228d (diff)
simplify UNO getTypes methods
Change-Id: Ia8b07edec54527fb4904536fabb03a18e8452550 Reviewed-on: https://gerrit.libreoffice.org/68659 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/proxyaggregation.cxx12
-rw-r--r--comphelper/source/property/genericpropertyset.cxx16
-rw-r--r--comphelper/source/property/propstate.cxx8
3 files changed, 13 insertions, 23 deletions
diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx
index 764dc92d91f1..3ace74436dfc 100644
--- a/comphelper/source/misc/proxyaggregation.cxx
+++ b/comphelper/source/misc/proxyaggregation.cxx
@@ -206,14 +206,10 @@ namespace comphelper
Sequence< Type > SAL_CALL OComponentProxyAggregation::getTypes( )
{
- Sequence< Type > aTypes( OComponentProxyAggregationHelper::getTypes() );
-
- // append XComponent, coming from WeakComponentImplHelperBase
- sal_Int32 nLen = aTypes.getLength();
- aTypes.realloc( nLen + 1 );
- aTypes[ nLen ] = cppu::UnoType<XComponent>::get();
-
- return aTypes;
+ return comphelper::concatSequences(
+ OComponentProxyAggregationHelper::getTypes(),
+ // append XComponent, coming from WeakComponentImplHelperBase
+ Sequence { cppu::UnoType<XComponent>::get() });
}
diff --git a/comphelper/source/property/genericpropertyset.cxx b/comphelper/source/property/genericpropertyset.cxx
index aaf94149ce40..af224f822ede 100644
--- a/comphelper/source/property/genericpropertyset.cxx
+++ b/comphelper/source/property/genericpropertyset.cxx
@@ -214,16 +214,12 @@ void SAL_CALL GenericPropertySet::release() throw()
uno::Sequence< uno::Type > SAL_CALL GenericPropertySet::getTypes()
{
- uno::Sequence< uno::Type > aTypes( 5 );
- uno::Type* pTypes = aTypes.getArray();
-
- *pTypes++ = cppu::UnoType<XAggregation>::get();
- *pTypes++ = cppu::UnoType<XServiceInfo>::get();
- *pTypes++ = cppu::UnoType<XTypeProvider>::get();
- *pTypes++ = cppu::UnoType<XPropertySet>::get();
- *pTypes++ = cppu::UnoType<XMultiPropertySet>::get();
-
- return aTypes;
+ return uno::Sequence {
+ cppu::UnoType<XAggregation>::get(),
+ cppu::UnoType<XServiceInfo>::get(),
+ cppu::UnoType<XTypeProvider>::get(),
+ cppu::UnoType<XPropertySet>::get(),
+ cppu::UnoType<XMultiPropertySet>::get() };
}
uno::Sequence< sal_Int8 > SAL_CALL GenericPropertySet::getImplementationId()
diff --git a/comphelper/source/property/propstate.cxx b/comphelper/source/property/propstate.cxx
index 346fcce44624..89cfa081df3f 100644
--- a/comphelper/source/property/propstate.cxx
+++ b/comphelper/source/property/propstate.cxx
@@ -187,12 +187,10 @@ namespace comphelper
Sequence< Type > SAL_CALL OStatefulPropertySet::getTypes()
{
- Sequence< Type > aOwnTypes( 2 );
- aOwnTypes[0] = cppu::UnoType<XWeak>::get();
- aOwnTypes[1] = cppu::UnoType<XTypeProvider>::get();
-
return concatSequences(
- aOwnTypes,
+ Sequence {
+ cppu::UnoType<XWeak>::get(),
+ cppu::UnoType<XTypeProvider>::get() },
OPropertyStateHelper::getTypes()
);
}