cppuhelper/source/servicemanager.cxx | 5 --- desktop/source/app/officeipcthread.cxx | 3 - desktop/source/lib/lokinteractionhandler.cxx | 12 +++---- desktop/test/deployment/active/active_native.cxx | 3 - desktop/test/deployment/passive/passive_native.cxx | 3 - drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx | 2 - embeddedobj/source/commonembedding/xfactory.cxx | 5 --- extensions/source/bibliography/bibload.cxx | 7 ---- forms/source/component/FormComponent.cxx | 5 --- forms/source/component/FormsCollection.cxx | 7 ---- forms/source/component/scrollbar.cxx | 4 -- forms/source/component/spinbutton.cxx | 4 -- forms/source/richtext/richtextmodel.cxx | 18 +++++------ fpicker/source/aqua/SalAquaFilePicker.mm | 8 +--- fpicker/source/aqua/SalAquaFolderPicker.mm | 5 --- fpicker/source/win32/VistaFilePicker.cxx | 9 ++--- 16 files changed, 33 insertions(+), 67 deletions(-)
New commits: commit 2674cf29a87c8f56ccf9f491c496e36ce4e8e367 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Aug 17 16:08:25 2019 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sat Aug 17 17:03:14 2019 +0200 tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor in forms and fpicker Change-Id: Ifa931bed6de434a2ee183c78e8e1be852ca06a56 Reviewed-on: https://gerrit.libreoffice.org/77637 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index e0c7b3e04bd6..e8c8efca5c6c 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -682,10 +682,7 @@ Sequence<OUString> SAL_CALL OControlModel::getSupportedServiceNames() Sequence< OUString > OControlModel::getSupportedServiceNames_Static() { - Sequence< OUString > aServiceNames( 2 ); - aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT; - aServiceNames[ 1 ] = "com.sun.star.form.FormControlModel"; - return aServiceNames; + return { FRM_SUN_FORMCOMPONENT, "com.sun.star.form.FormControlModel" }; } // XEventListener diff --git a/forms/source/component/FormsCollection.cxx b/forms/source/component/FormsCollection.cxx index 753deca90143..2b2b52c2545d 100644 --- a/forms/source/component/FormsCollection.cxx +++ b/forms/source/component/FormsCollection.cxx @@ -95,12 +95,7 @@ sal_Bool SAL_CALL OFormsCollection::supportsService( const OUString& _rServiceNa css::uno::Sequence<OUString> SAL_CALL OFormsCollection::getSupportedServiceNames() { - css::uno::Sequence<OUString> aReturn(2); - - aReturn[0] = "com.sun.star.form.Forms"; - aReturn[1] = "com.sun.star.form.FormComponents"; - - return aReturn; + return { "com.sun.star.form.Forms", "com.sun.star.form.FormComponents" }; } // XCloneable diff --git a/forms/source/component/scrollbar.cxx b/forms/source/component/scrollbar.cxx index 2e153c3d71f3..b478a58c69e2 100644 --- a/forms/source/component/scrollbar.cxx +++ b/forms/source/component/scrollbar.cxx @@ -118,9 +118,7 @@ namespace frm // to benefit from the functionality for binding to spreadsheet cells Sequence< OUString > SAL_CALL OScrollBarModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames( 2 ); - aOwnNames[ 0 ] = FRM_SUN_COMPONENT_SCROLLBAR; - aOwnNames[ 1 ] = BINDABLE_INTEGER_VALUE_RANGE; + Sequence< OUString > aOwnNames { FRM_SUN_COMPONENT_SCROLLBAR, BINDABLE_INTEGER_VALUE_RANGE }; return ::comphelper::combineSequences( getAggregateServiceNames(), diff --git a/forms/source/component/spinbutton.cxx b/forms/source/component/spinbutton.cxx index 9d6b618c3506..d9504a55b616 100644 --- a/forms/source/component/spinbutton.cxx +++ b/forms/source/component/spinbutton.cxx @@ -71,9 +71,7 @@ namespace frm // to benefit from the functionality for binding to spreadsheet cells Sequence< OUString > SAL_CALL OSpinButtonModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames( 2 ); - aOwnNames[ 0 ] = FRM_SUN_COMPONENT_SPINBUTTON; - aOwnNames[ 1 ] = BINDABLE_INTEGER_VALUE_RANGE; + Sequence< OUString > aOwnNames { FRM_SUN_COMPONENT_SPINBUTTON, BINDABLE_INTEGER_VALUE_RANGE }; return ::comphelper::combineSequences( getAggregateServiceNames(), diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index 3d1e7a75e834..9ec22b913924 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -233,15 +233,15 @@ namespace frm Sequence< OUString > SAL_CALL ORichTextModel::getSupportedServiceNames() { - Sequence< OUString > aOwnNames( 8 ); - aOwnNames[ 0 ] = FRM_SUN_COMPONENT_RICHTEXTCONTROL; - aOwnNames[ 1 ] = "com.sun.star.text.TextRange"; - aOwnNames[ 2 ] = "com.sun.star.style.CharacterProperties"; - aOwnNames[ 3 ] = "com.sun.star.style.ParagraphProperties"; - aOwnNames[ 4 ] = "com.sun.star.style.CharacterPropertiesAsian"; - aOwnNames[ 5 ] = "com.sun.star.style.CharacterPropertiesComplex"; - aOwnNames[ 6 ] = "com.sun.star.style.ParagraphPropertiesAsian"; - aOwnNames[ 7 ] = "com.sun.star.style.ParagraphPropertiesComplex"; + Sequence< OUString > aOwnNames { + FRM_SUN_COMPONENT_RICHTEXTCONTROL, + "com.sun.star.text.TextRange", + "com.sun.star.style.CharacterProperties", + "com.sun.star.style.ParagraphProperties", + "com.sun.star.style.CharacterPropertiesAsian", + "com.sun.star.style.CharacterPropertiesComplex", + "com.sun.star.style.ParagraphPropertiesAsian", + "com.sun.star.style.ParagraphPropertiesComplex" }; return ::comphelper::combineSequences( getAggregateServiceNames(), diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index e0137e0d665d..ac54fca0cc98 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -65,11 +65,9 @@ namespace { uno::Sequence<OUString> FilePicker_getSupportedServiceNames() { - uno::Sequence<OUString> aRet(3); - aRet[0] = "com.sun.star.ui.dialogs.FilePicker"; - aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker"; - aRet[2] = "com.sun.star.ui.dialogs.AquaFilePicker"; - return aRet; + return { "com.sun.star.ui.dialogs.FilePicker", + "com.sun.star.ui.dialogs.SystemFilePicker", + "com.sun.star.ui.dialogs.AquaFilePicker" }; } } diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm index b47d8138018d..3d2259cbcdbf 100644 --- a/fpicker/source/aqua/SalAquaFolderPicker.mm +++ b/fpicker/source/aqua/SalAquaFolderPicker.mm @@ -53,10 +53,7 @@ namespace // controlling event notifications uno::Sequence<OUString> FolderPicker_getSupportedServiceNames() { - uno::Sequence<OUString> aRet(2); - aRet[0] = "com.sun.star.ui.dialogs.SystemFolderPicker"; - aRet[1] = "com.sun.star.ui.dialogs.AquaFolderPicker"; - return aRet; + return { "com.sun.star.ui.dialogs.SystemFolderPicker", "com.sun.star.ui.dialogs.AquaFolderPicker" }; } } diff --git a/fpicker/source/win32/VistaFilePicker.cxx b/fpicker/source/win32/VistaFilePicker.cxx index c100dd5b1885..1c888b44a6d5 100644 --- a/fpicker/source/win32/VistaFilePicker.cxx +++ b/fpicker/source/win32/VistaFilePicker.cxx @@ -47,11 +47,10 @@ namespace { css::uno::Sequence< OUString > VistaFilePicker_getSupportedServiceNames() { - css::uno::Sequence< OUString > aRet(3); - aRet[0] = "com.sun.star.ui.dialogs.FilePicker"; - aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker"; - aRet[2] = "com.sun.star.ui.dialogs.SystemFolderPicker"; - return aRet; + return { + "com.sun.star.ui.dialogs.FilePicker", + "com.sun.star.ui.dialogs.SystemFilePicker", + "com.sun.star.ui.dialogs.SystemFolderPicker" }; } } commit b1d8262dad9939ffbf38f288d0ec60727e3742fb Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Aug 17 15:53:39 2019 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sat Aug 17 17:03:04 2019 +0200 tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor in cppuhelper, desktop, drawinglayer, embeddedobj, extensions Change-Id: I4c970f08c0723299f79c9e18bc71b7372a7092e4 Reviewed-on: https://gerrit.libreoffice.org/77636 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 9f235f4fe772..8f49b4ecb908 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -907,10 +907,7 @@ sal_Bool cppuhelper::ServiceManager::supportsService( css::uno::Sequence< OUString > cppuhelper::ServiceManager::getSupportedServiceNames() { - css::uno::Sequence< OUString > names(2); - names[0] = "com.sun.star.lang.MultiServiceFactory"; - names[1] = "com.sun.star.lang.ServiceManager"; - return names; + return { "com.sun.star.lang.MultiServiceFactory", "com.sun.star.lang.ServiceManager" }; } css::uno::Reference< css::uno::XInterface > diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index acc3b7034077..6d4fe1a3c525 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -328,8 +328,7 @@ sal_Bool RequestHandlerController::supportsService( Sequence< OUString > SAL_CALL RequestHandlerController::getSupportedServiceNames() { - Sequence< OUString > aSeq( 0 ); - return aSeq; + return { }; } // XEventListener diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index b41d17737b16..cebfcb72f579 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -74,13 +74,11 @@ sal_Bool SAL_CALL LOKInteractionHandler::supportsService(OUString const & rServi uno::Sequence< OUString > SAL_CALL LOKInteractionHandler::getSupportedServiceNames() { - uno::Sequence< OUString > aNames(3); - aNames[0] = "com.sun.star.task.InteractionHandler"; - // added to indicate support for configuration.backend.MergeRecoveryRequest - aNames[1] = "com.sun.star.configuration.backend.InteractionHandler"; - aNames[2] = "com.sun.star.uui.InteractionHandler"; - // for backwards compatibility - return aNames; + return { "com.sun.star.task.InteractionHandler", + // added to indicate support for configuration.backend.MergeRecoveryRequest + "com.sun.star.configuration.backend.InteractionHandler", + // for backwards compatibility + "com.sun.star.uui.InteractionHandler" }; } void SAL_CALL LOKInteractionHandler::initialize(uno::Sequence<uno::Any> const & /*rArguments*/) diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx index 0f12544b6a6b..40ac55caa736 100644 --- a/desktop/test/deployment/active/active_native.cxx +++ b/desktop/test/deployment/active/active_native.cxx @@ -107,8 +107,7 @@ rtl::OUString Provider::static_getImplementationName() { css::uno::Sequence< rtl::OUString > Provider::static_getSupportedServiceNames() { - rtl::OUString name("com.sun.star.test.deployment.active_native"); - return css::uno::Sequence< rtl::OUString >(&name, 1); + return { "com.sun.star.test.deployment.active_native" }; } css::uno::Reference< css::frame::XDispatch > Provider::queryDispatch( diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx index 83b955a00313..4a631726aa1f 100644 --- a/desktop/test/deployment/passive/passive_native.cxx +++ b/desktop/test/deployment/passive/passive_native.cxx @@ -104,8 +104,7 @@ rtl::OUString Provider::static_getImplementationName() { css::uno::Sequence< rtl::OUString > Provider::static_getSupportedServiceNames() { - rtl::OUString name("com.sun.star.test.deployment.passive_native"); - return css::uno::Sequence< rtl::OUString >(&name, 1); + return { "com.sun.star.test.deployment.passive_native" }; } css::uno::Reference< css::frame::XDispatch > Provider::queryDispatch( diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx index 6c712748d10d..3834fa65ff0e 100644 --- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx +++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx @@ -82,7 +82,7 @@ namespace drawinglayer { uno::Sequence< OUString > XPrimitive2DRenderer_getSupportedServiceNames() { - return uno::Sequence< OUString > { "com.sun.star.graphic.Primitive2DTools" }; + return { "com.sun.star.graphic.Primitive2DTools" }; } OUString XPrimitive2DRenderer_getImplementationName() diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx index 1c0209460774..e5b855fa80b9 100644 --- a/embeddedobj/source/commonembedding/xfactory.cxx +++ b/embeddedobj/source/commonembedding/xfactory.cxx @@ -384,10 +384,7 @@ uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::getSupportedService uno::Sequence< OUString > OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames() { - uno::Sequence< OUString > aRet(2); - aRet[0] = "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory"; - aRet[1] = "com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"; - return aRet; + return { "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory", "com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory" }; } OUString OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName() diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 21676f75e10b..04f2860d3951 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -182,12 +182,7 @@ Sequence< OUString > BibliographyLoader::getSupportedServiceNames() // ORegistryServiceManager_Static Sequence< OUString > BibliographyLoader::getSupportedServiceNames_Static() throw( ) { - Sequence< OUString > aSNS( 2 ); - aSNS.getArray()[0] = "com.sun.star.frame.FrameLoader"; - //! - aSNS.getArray()[1] = "com.sun.star.frame.Bibliography"; - //! - return aSNS; + return { "com.sun.star.frame.FrameLoader", "com.sun.star.frame.Bibliography" }; } extern "C" _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits