diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-02 08:28:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-04 08:52:39 +0100 |
commit | 28239c40430ec4e613d9d936614c5c3853c332c4 (patch) | |
tree | 0fa6bc36c05f8f42a0799b884ed38eb3e569ff90 /svx/source/unodraw | |
parent | 85b7e7fdd7f283a3084e2db0dd8e71a48fac228d (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 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 23 | ||||
-rw-r--r-- | svx/source/unodraw/unopool.cxx | 17 |
2 files changed, 13 insertions, 27 deletions
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index f6e60d5b022a..bbbf62c9b398 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -301,24 +301,13 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawingModel::getTypes( ) { if( maTypeSequence.getLength() == 0 ) { - const uno::Sequence< uno::Type > aBaseTypes( SfxBaseModel::getTypes() ); - const sal_Int32 nBaseTypes = aBaseTypes.getLength(); - const uno::Type* pBaseTypes = aBaseTypes.getConstArray(); - - const sal_Int32 nOwnTypes = 4; // !DANGER! Keep this updated! - - maTypeSequence.realloc( nBaseTypes + nOwnTypes ); - uno::Type* pTypes = maTypeSequence.getArray(); - - *pTypes++ = cppu::UnoType<lang::XServiceInfo>::get(); - *pTypes++ = cppu::UnoType<lang::XMultiServiceFactory>::get(); - *pTypes++ = cppu::UnoType<drawing::XDrawPagesSupplier>::get(); - *pTypes++ = cppu::UnoType<css::ucb::XAnyCompareFactory>::get(); - - for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ ) - *pTypes++ = *pBaseTypes++; + maTypeSequence = comphelper::concatSequences( SfxBaseModel::getTypes(), + uno::Sequence { + cppu::UnoType<lang::XServiceInfo>::get(), + cppu::UnoType<lang::XMultiServiceFactory>::get(), + cppu::UnoType<drawing::XDrawPagesSupplier>::get(), + cppu::UnoType<css::ucb::XAnyCompareFactory>::get() }); } - return maTypeSequence; } diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index 9e78b7ea574d..d09758602172 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -358,16 +358,13 @@ void SAL_CALL SvxUnoDrawPool::release() throw ( ) uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawPool::getTypes() { - uno::Sequence< uno::Type > aTypes( 6 ); - uno::Type* pTypes = aTypes.getArray(); - - *pTypes++ = cppu::UnoType<uno::XAggregation>::get(); - *pTypes++ = cppu::UnoType<lang::XServiceInfo>::get(); - *pTypes++ = cppu::UnoType<lang::XTypeProvider>::get(); - *pTypes++ = cppu::UnoType<beans::XPropertySet>::get(); - *pTypes++ = cppu::UnoType<beans::XPropertyState>::get(); - *pTypes++ = cppu::UnoType<beans::XMultiPropertySet>::get(); - + static const uno::Sequence aTypes { + cppu::UnoType<uno::XAggregation>::get(), + cppu::UnoType<lang::XServiceInfo>::get(), + cppu::UnoType<lang::XTypeProvider>::get(), + cppu::UnoType<beans::XPropertySet>::get(), + cppu::UnoType<beans::XPropertyState>::get(), + cppu::UnoType<beans::XMultiPropertySet>::get() }; return aTypes; } |