summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl
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 /sd/source/ui/unoidl
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 'sd/source/ui/unoidl')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx46
-rw-r--r--sd/source/ui/unoidl/unopage.cxx26
2 files changed, 26 insertions, 46 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index b9e8463f38d3..ca453c80d2b5 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -375,35 +375,29 @@ uno::Sequence< uno::Type > SAL_CALL SdXImpressDocument::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 = mbImpressDoc ? 14 : 11; // !DANGER! Keep this updated!
-
- maTypeSequence.realloc( nBaseTypes + nOwnTypes );
- uno::Type* pTypes = maTypeSequence.getArray();
-
- *pTypes++ = cppu::UnoType<beans::XPropertySet>::get();
- *pTypes++ = cppu::UnoType<lang::XServiceInfo>::get();
- *pTypes++ = cppu::UnoType<lang::XMultiServiceFactory>::get();
- *pTypes++ = cppu::UnoType<drawing::XDrawPageDuplicator>::get();
- *pTypes++ = cppu::UnoType<drawing::XLayerSupplier>::get();
- *pTypes++ = cppu::UnoType<drawing::XMasterPagesSupplier>::get();
- *pTypes++ = cppu::UnoType<drawing::XDrawPagesSupplier>::get();
- *pTypes++ = cppu::UnoType<document::XLinkTargetSupplier>::get();
- *pTypes++ = cppu::UnoType<style::XStyleFamiliesSupplier>::get();
- *pTypes++ = cppu::UnoType<css::ucb::XAnyCompareFactory>::get();
- *pTypes++ = cppu::UnoType<view::XRenderable>::get();
+ uno::Sequence< uno::Type > aTypes( SfxBaseModel::getTypes() );
+ aTypes = comphelper::concatSequences(aTypes,
+ uno::Sequence {
+ cppu::UnoType<beans::XPropertySet>::get(),
+ cppu::UnoType<lang::XServiceInfo>::get(),
+ cppu::UnoType<lang::XMultiServiceFactory>::get(),
+ cppu::UnoType<drawing::XDrawPageDuplicator>::get(),
+ cppu::UnoType<drawing::XLayerSupplier>::get(),
+ cppu::UnoType<drawing::XMasterPagesSupplier>::get(),
+ cppu::UnoType<drawing::XDrawPagesSupplier>::get(),
+ cppu::UnoType<document::XLinkTargetSupplier>::get(),
+ cppu::UnoType<style::XStyleFamiliesSupplier>::get(),
+ cppu::UnoType<css::ucb::XAnyCompareFactory>::get(),
+ cppu::UnoType<view::XRenderable>::get() });
if( mbImpressDoc )
{
- *pTypes++ = cppu::UnoType<presentation::XPresentationSupplier>::get();
- *pTypes++ = cppu::UnoType<presentation::XCustomPresentationSupplier>::get();
- *pTypes++ = cppu::UnoType<presentation::XHandoutMasterSupplier>::get();
+ aTypes = comphelper::concatSequences(aTypes,
+ uno::Sequence {
+ cppu::UnoType<presentation::XPresentationSupplier>::get(),
+ cppu::UnoType<presentation::XCustomPresentationSupplier>::get(),
+ cppu::UnoType<presentation::XHandoutMasterSupplier>::get() });
}
-
- for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
- *pTypes++ = *pBaseTypes++;
+ maTypeSequence = aTypes;
}
return maTypeSequence;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 48d6c0a56e43..7cf3e87c4a6c 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2081,17 +2081,10 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes()
aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get());
// Get types of base class.
- const Sequence< uno::Type > aBaseTypes( SdGenericDrawPage::getTypes() );
- const sal_Int32 nBaseTypes = aBaseTypes.getLength();
- const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
-
// Join those types in a sequence.
- maTypeSequence.realloc(aTypes.size() + nBaseTypes);
- uno::Type* pTypes = maTypeSequence.getArray();
- for (const auto& rType : aTypes)
- *pTypes++ = rType;
- for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
- *pTypes++ = *pBaseTypes++;
+ return comphelper::concatSequences(
+ comphelper::containerToSequence(aTypes),
+ SdGenericDrawPage::getTypes() );
}
return maTypeSequence;
@@ -2705,17 +2698,10 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes()
aTypes.push_back(cppu::UnoType<XAnimationNodeSupplier>::get());
// Get types of base class.
- const Sequence< uno::Type > aBaseTypes( SdGenericDrawPage::getTypes() );
- const sal_Int32 nBaseTypes = aBaseTypes.getLength();
- const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
-
// Join those types in a sequence.
- maTypeSequence.realloc(aTypes.size() + nBaseTypes);
- uno::Type* pTypes = maTypeSequence.getArray();
- for (const auto& rType : aTypes)
- *pTypes++ = rType;
- for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
- *pTypes++ = *pBaseTypes++;
+ return comphelper::concatSequences(
+ comphelper::containerToSequence(aTypes),
+ SdGenericDrawPage::getTypes() );
}
return maTypeSequence;