summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/source/graphic/renderer.cxx19
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx10
-rw-r--r--svtools/source/uno/unoimap.cxx19
3 files changed, 18 insertions, 30 deletions
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index e39b860e3649..d8b971566980 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -158,17 +158,14 @@ uno::Sequence< OUString > SAL_CALL GraphicRendererVCL::getSupportedServiceNames(
uno::Sequence< uno::Type > SAL_CALL GraphicRendererVCL::getTypes()
{
- uno::Sequence< uno::Type > aTypes( 7 );
- 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();
- *pTypes++ = cppu::UnoType<graphic::XGraphicRenderer>::get();
-
+ static const uno::Sequence< uno::Type > 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(),
+ cppu::UnoType<graphic::XGraphicRenderer>::get() };
return aTypes;
}
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 60a11d427659..e73dce78c1ee 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -149,14 +149,8 @@ void SAL_CALL ToolboxController::release() throw ()
css::uno::Sequence<css::uno::Type> ToolboxController::getTypes()
{
- css::uno::Sequence<css::uno::Type> s1(ToolboxController_Base::getTypes());
- css::uno::Sequence<css::uno::Type> s2(getBaseTypes());
- sal_Int32 n = s1.getLength();
- s1.realloc(n + s2.getLength());
- for (sal_Int32 i = 0; i != s2.getLength(); ++i) {
- s1[n + i] = s2[i];
- }
- return s1;
+ return comphelper::concatSequences(ToolboxController_Base::getTypes(),
+ getBaseTypes());
}
void SAL_CALL ToolboxController::initialize( const Sequence< Any >& aArguments )
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index cbfe92690b66..5e86ecf5c7df 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -338,17 +338,14 @@ void SAL_CALL SvUnoImageMapObject::release() throw()
uno::Sequence< uno::Type > SAL_CALL SvUnoImageMapObject::getTypes()
{
- uno::Sequence< uno::Type > aTypes( 7 );
- uno::Type* pTypes = aTypes.getArray();
-
- *pTypes++ = cppu::UnoType<XAggregation>::get();
- *pTypes++ = cppu::UnoType<XEventsSupplier>::get();
- *pTypes++ = cppu::UnoType<XServiceInfo>::get();
- *pTypes++ = cppu::UnoType<XPropertySet>::get();
- *pTypes++ = cppu::UnoType<XMultiPropertySet>::get();
- *pTypes++ = cppu::UnoType<XTypeProvider>::get();
- *pTypes++ = cppu::UnoType<XUnoTunnel>::get();
-
+ static const uno::Sequence< uno::Type > aTypes {
+ cppu::UnoType<XAggregation>::get(),
+ cppu::UnoType<XEventsSupplier>::get(),
+ cppu::UnoType<XServiceInfo>::get(),
+ cppu::UnoType<XPropertySet>::get(),
+ cppu::UnoType<XMultiPropertySet>::get(),
+ cppu::UnoType<XTypeProvider>::get(),
+ cppu::UnoType<XUnoTunnel>::get() };
return aTypes;
}