From 4073994154fbcb3b3ae7ff396fee916a994265c7 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 17 Aug 2019 20:53:12 +0200 Subject: [PATCH] tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor in svx Change-Id: I70cba5dbfed9b2bbfe82d89c9dc6a5875c953bd3 Reviewed-on: https://gerrit.libreoffice.org/77649 Tested-by: Jenkins Reviewed-by: Julien Nabet --- .../GraphCtlAccessibleContext.cxx | 10 +++----- svx/source/fmcomp/fmgridif.cxx | 5 +--- svx/source/form/legacyformcontroller.cxx | 5 +--- svx/source/table/tabledesign.cxx | 8 ++----- .../tbxctrls/tbunosearchcontrollers.cxx | 5 +--- .../chinese_translation_unodialog.cxx | 3 +-- svx/source/unodraw/XPropertyTable.cxx | 24 +++++-------------- svx/source/unodraw/unomod.cxx | 8 ++----- svx/source/unodraw/unoshcol.cxx | 5 +--- svx/source/xml/xmlgrhlp.cxx | 8 +++---- 10 files changed, 21 insertions(+), 60 deletions(-) diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index cd90f449c9bb..f37c14b873a1 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -501,13 +501,9 @@ sal_Bool SAL_CALL SvxGraphCtrlAccessibleContext::supportsService( const OUString Sequence< OUString > SAL_CALL SvxGraphCtrlAccessibleContext::getSupportedServiceNames() { - Sequence< OUString > aSNs( 3 ); - - aSNs[0] = "com.sun.star.accessibility.Accessible"; - aSNs[1] = "com.sun.star.accessibility.AccessibleContext"; - aSNs[2] = "com.sun.star.drawing.AccessibleGraphControl"; - - return aSNs; + return { "com.sun.star.accessibility.Accessible", + "com.sun.star.accessibility.AccessibleContext", + "com.sun.star.drawing.AccessibleGraphControl" }; } // XTypeProvider diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index fb89600530f8..e5c5b4e0ae4d 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -381,10 +381,7 @@ OUString SAL_CALL FmXGridControl::getImplementationName() css::uno::Sequence SAL_CALL FmXGridControl::getSupportedServiceNames() { - Sequence< OUString > aServiceNames(2); - aServiceNames[0] = FM_SUN_CONTROL_GRIDCONTROL; - aServiceNames[1] = "com.sun.star.awt.UnoControl"; - return aServiceNames; + return { FM_SUN_CONTROL_GRIDCONTROL, "com.sun.star.awt.UnoControl" }; } diff --git a/svx/source/form/legacyformcontroller.cxx b/svx/source/form/legacyformcontroller.cxx index a310423da8d0..9e14d3758cd1 100644 --- a/svx/source/form/legacyformcontroller.cxx +++ b/svx/source/form/legacyformcontroller.cxx @@ -185,10 +185,7 @@ namespace svxform Sequence< OUString > SAL_CALL LegacyFormController::getSupportedServiceNames( ) { - Sequence< OUString > aServices(2); - aServices.getArray()[0] = "com.sun.star.form.FormController"; - aServices.getArray()[1] = "com.sun.star.awt.control.TabController"; - return aServices; + return { "com.sun.star.form.FormController", "com.sun.star.awt.control.TabController" }; } } diff --git a/svx/source/table/tabledesign.cxx b/svx/source/table/tabledesign.cxx index a27a8d810fc0..0a4f81417f63 100644 --- a/svx/source/table/tabledesign.cxx +++ b/svx/source/table/tabledesign.cxx @@ -214,9 +214,7 @@ sal_Bool SAL_CALL TableDesignStyle::supportsService( const OUString& ServiceName Sequence< OUString > SAL_CALL TableDesignStyle::getSupportedServiceNames() { - OUString aServiceName("com.sun.star.style.Style"); - Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; + return { "com.sun.star.style.Style" }; } // XStyle @@ -464,9 +462,7 @@ sal_Bool SAL_CALL TableDesignFamily::supportsService( const OUString& ServiceNam Sequence< OUString > SAL_CALL TableDesignFamily::getSupportedServiceNames() { - OUString aServiceName("com.sun.star.style.StyleFamily"); - Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; + return { "com.sun.star.style.StyleFamily" }; } // XNamed diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 1beda67e61d6..9499da1a99fa 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -1372,10 +1372,7 @@ sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceNam css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() { - css::uno::Sequence< OUString > aSNS( 2 ); - aSNS[0] = "com.sun.star.comp.svx.FindbarDispatcher"; - aSNS[1] = "com.sun.star.frame.ProtocolHandler"; - return aSNS; + return { "com.sun.star.comp.svx.FindbarDispatcher", "com.sun.star.frame.ProtocolHandler" }; } // XInitialization diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx index 27ae4e6002e5..3ea8a2cfff26 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx @@ -77,8 +77,7 @@ uno::Sequence< OUString > SAL_CALL ChineseTranslation_UnoDialog::getSupportedSer uno::Sequence< OUString > ChineseTranslation_UnoDialog::getSupportedServiceNames_Static() { - uno::Sequence aSNS { "com.sun.star.linguistic2.ChineseTranslationDialog" }; - return aSNS; + return { "com.sun.star.linguistic2.ChineseTranslationDialog" }; } // ui::dialogs::XExecutableDialog diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 02bcc3f23378..fc2ce754652f 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -282,9 +282,7 @@ OUString SAL_CALL SvxUnoXColorTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXColorTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.ColorTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.ColorTable" }; } @@ -349,9 +347,7 @@ OUString SAL_CALL SvxUnoXLineEndTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXLineEndTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.LineEndTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.LineEndTable" }; } @@ -426,9 +422,7 @@ OUString SAL_CALL SvxUnoXDashTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXDashTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.DashTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.DashTable" }; } @@ -498,9 +492,7 @@ OUString SAL_CALL SvxUnoXHatchTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXHatchTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.HatchTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.HatchTable" }; } @@ -582,9 +574,7 @@ OUString SAL_CALL SvxUnoXGradientTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXGradientTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.GradientTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.GradientTable" }; } @@ -653,9 +643,7 @@ OUString SAL_CALL SvxUnoXBitmapTable::getImplementationName( ) uno::Sequence< OUString > SAL_CALL SvxUnoXBitmapTable::getSupportedServiceNames( ) { - const OUString aServiceName( "com.sun.star.drawing.BitmapTable" ); - uno::Sequence< OUString > aServices( &aServiceName, 1 ); - return aServices; + return { "com.sun.star.drawing.BitmapTable" }; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 92472f094fbb..e3017b41ecfb 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -533,9 +533,7 @@ sal_Bool SAL_CALL SvxUnoDrawingModel::supportsService( const OUString& ServiceNa uno::Sequence< OUString > SAL_CALL SvxUnoDrawingModel::getSupportedServiceNames() { - OUString aSN("com.sun.star.drawing.DrawingDocument"); - uno::Sequence< OUString > aSeq( &aSN, 1 ); - return aSeq; + return { "com.sun.star.drawing.DrawingDocument" }; } // XAnyCompareFactory @@ -666,9 +664,7 @@ sal_Bool SAL_CALL SvxUnoDrawPagesAccess::supportsService( const OUString& Servic uno::Sequence< OUString > SAL_CALL SvxUnoDrawPagesAccess::getSupportedServiceNames( ) { - OUString aService( "com.sun.star.drawing.DrawPages" ); - uno::Sequence< OUString > aSeq( &aService, 1 ); - return aSeq; + return { "com.sun.star.drawing.DrawPages" }; } css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(SdrModel* pModel) diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 8f0c98ef9a6a..75f733028746 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -246,10 +246,7 @@ sal_Bool SAL_CALL SvxShapeCollection::supportsService( const OUString& ServiceNa uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames() { - uno::Sequence< OUString > aSeq(2); - aSeq.getArray()[0] = "com.sun.star.drawing.Shapes"; - aSeq.getArray()[1] = "com.sun.star.drawing.ShapeCollection"; - return aSeq; + return { "com.sun.star.drawing.Shapes", "com.sun.star.drawing.ShapeCollection" }; } } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 0490a7008132..1b2536a6a509 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -1102,11 +1102,9 @@ sal_Bool SAL_CALL SvXMLGraphicImportExportHelper::supportsService( const OUStrin Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServiceNames() { - Sequence< OUString > aSupportedServiceNames(3); - aSupportedServiceNames[0] = "com.sun.star.document.GraphicObjectResolver"; - aSupportedServiceNames[1] = "com.sun.star.document.GraphicStorageHandler"; - aSupportedServiceNames[2] = "com.sun.star.document.BinaryStreamResolver"; - return aSupportedServiceNames; + return { "com.sun.star.document.GraphicObjectResolver", + "com.sun.star.document.GraphicStorageHandler", + "com.sun.star.document.BinaryStreamResolver" }; } }