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 /editeng/source | |
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 'editeng/source')
-rw-r--r-- | editeng/source/accessibility/AccessibleComponentBase.cxx | 13 | ||||
-rw-r--r-- | editeng/source/uno/unofield.cxx | 18 |
2 files changed, 11 insertions, 20 deletions
diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx index 69052ea4dd65..4647f074ab76 100644 --- a/editeng/source/accessibility/AccessibleComponentBase.cxx +++ b/editeng/source/accessibility/AccessibleComponentBase.cxx @@ -143,16 +143,9 @@ OUString SAL_CALL AccessibleComponentBase::getToolTipText() uno::Sequence<uno::Type> AccessibleComponentBase::getTypes() { - // Get list of types from the context base implementation... - uno::Sequence<uno::Type> aTypeList (2); - // ...and add the additional type for the component. - const uno::Type aComponentType = - cppu::UnoType<XAccessibleComponent>::get(); - const uno::Type aExtendedComponentType = - cppu::UnoType<XAccessibleExtendedComponent>::get(); - aTypeList[0] = aComponentType; - aTypeList[1] = aExtendedComponentType; - + static const uno::Sequence aTypeList { + cppu::UnoType<XAccessibleComponent>::get(), + cppu::UnoType<XAccessibleExtendedComponent>::get() }; return aTypeList; } diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index de977939f430..ea19e3e5e5aa 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -30,6 +30,7 @@ #include <editeng/measfld.hxx> #include <editeng/unofield.hxx> #include <editeng/unotext.hxx> +#include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <sal/log.hxx> @@ -577,16 +578,13 @@ uno::Sequence< uno::Type > SAL_CALL SvxUnoTextField::getTypes() { if( maTypeSequence.getLength() == 0 ) { - maTypeSequence = OComponentHelper::getTypes(); - sal_Int32 nOldCount = maTypeSequence.getLength(); - - maTypeSequence.realloc( nOldCount + 4 ); // !DANGER! keep this updated - uno::Type* pTypes = &maTypeSequence.getArray()[nOldCount]; - - *pTypes++ = cppu::UnoType<text::XTextField>::get(); - *pTypes++ = cppu::UnoType<beans::XPropertySet>::get(); - *pTypes++ = cppu::UnoType<lang::XServiceInfo>::get(); - *pTypes++ = cppu::UnoType<lang::XUnoTunnel>::get(); + maTypeSequence = comphelper::concatSequences( + OComponentHelper::getTypes(), + uno::Sequence { + cppu::UnoType<text::XTextField>::get(), + cppu::UnoType<beans::XPropertySet>::get(), + cppu::UnoType<lang::XServiceInfo>::get(), + cppu::UnoType<lang::XUnoTunnel>::get() }); } return maTypeSequence; } |