summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorMichael Warner <michael.warner.ut+libreoffice@gmail.com>2020-05-30 22:18:29 -0400
committerStephan Bergmann <sbergman@redhat.com>2020-06-10 08:17:31 +0200
commit8d414f3a8de5c25bcd830b1d4d8a7be3c34a2ed4 (patch)
tree691330daeb9d5512933a752a67b705cd2b7dcdc8 /forms
parent7f6d7a0eb624d67421cd5af6462ee2a662fdff3a (diff)
tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
Change-Id: Id747848b222f69af3293a2095a62542f1e1116d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95215 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Date.cxx43
1 files changed, 15 insertions, 28 deletions
diff --git a/forms/source/component/Date.cxx b/forms/source/component/Date.cxx
index cca3e06821d7..1d16109ce672 100644
--- a/forms/source/component/Date.cxx
+++ b/forms/source/component/Date.cxx
@@ -55,16 +55,10 @@ Sequence<Type> ODateControl::_getTypes()
return OBoundControl::_getTypes();
}
-
css::uno::Sequence<OUString> SAL_CALL ODateControl::getSupportedServiceNames()
{
- css::uno::Sequence<OUString> aSupported = OBoundControl::getSupportedServiceNames();
- aSupported.realloc(aSupported.getLength() + 2);
-
- OUString*pArray = aSupported.getArray();
- pArray[aSupported.getLength()-1] = FRM_SUN_CONTROL_DATEFIELD;
- pArray[aSupported.getLength()-2] = STARDIV_ONE_FORM_CONTROL_DATEFIELD;
- return aSupported;
+ const css::uno::Sequence<OUString> vals { FRM_SUN_CONTROL_DATEFIELD, STARDIV_ONE_FORM_CONTROL_DATEFIELD };
+ return comphelper::concatSequences(OBoundControl::getSupportedServiceNames(), vals);
}
@@ -122,26 +116,19 @@ IMPLEMENT_DEFAULT_CLONING( ODateModel )
css::uno::Sequence<OUString> SAL_CALL ODateModel::getSupportedServiceNames()
{
- css::uno::Sequence<OUString> aSupported = OBoundControlModel::getSupportedServiceNames();
-
- sal_Int32 nOldLen = aSupported.getLength();
- aSupported.realloc( nOldLen + 9 );
- OUString* pStoreTo = aSupported.getArray() + nOldLen;
-
- *pStoreTo++ = BINDABLE_CONTROL_MODEL;
- *pStoreTo++ = DATA_AWARE_CONTROL_MODEL;
- *pStoreTo++ = VALIDATABLE_CONTROL_MODEL;
-
- *pStoreTo++ = BINDABLE_DATA_AWARE_CONTROL_MODEL;
- *pStoreTo++ = VALIDATABLE_BINDABLE_CONTROL_MODEL;
-
- *pStoreTo++ = FRM_SUN_COMPONENT_DATEFIELD;
- *pStoreTo++ = FRM_SUN_COMPONENT_DATABASE_DATEFIELD;
- *pStoreTo++ = BINDABLE_DATABASE_DATE_FIELD;
-
- *pStoreTo++ = FRM_COMPONENT_DATEFIELD;
-
- return aSupported;
+ const css::uno::Sequence<OUString> vals {
+ BINDABLE_CONTROL_MODEL,
+ DATA_AWARE_CONTROL_MODEL,
+ VALIDATABLE_CONTROL_MODEL,
+ BINDABLE_DATA_AWARE_CONTROL_MODEL,
+ VALIDATABLE_BINDABLE_CONTROL_MODEL,
+ FRM_SUN_COMPONENT_DATEFIELD,
+ FRM_SUN_COMPONENT_DATABASE_DATEFIELD,
+ BINDABLE_DATABASE_DATE_FIELD,
+ FRM_COMPONENT_DATEFIELD
+ };
+
+ return comphelper::concatSequences(OBoundControlModel::getSupportedServiceNames(), vals);
}