[Libreoffice-commits] core.git: hwpfilter/source include/test io/test linguistic/source oox/source pyuno/source reportdesign/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 17 18:11:38 UTC 2019


 hwpfilter/source/hwpreader.hxx                  |    9 ++-------
 include/test/testinteractionhandler.hxx         |    8 +++-----
 io/test/stm/pumptest.cxx                        |    4 +---
 linguistic/source/dlistimp.cxx                  |    3 +--
 linguistic/source/gciterator.cxx                |    3 +--
 linguistic/source/lngopt.cxx                    |    3 +--
 linguistic/source/lngsvcmgr.cxx                 |    3 +--
 oox/source/core/filterbase.cxx                  |    5 +----
 pyuno/source/loader/pyuno_loader.cxx            |    3 +--
 reportdesign/source/core/api/FormattedField.cxx |    6 +-----
 reportdesign/source/core/api/Shape.cxx          |    4 +---
 11 files changed, 14 insertions(+), 37 deletions(-)

New commits:
commit 7d3041beb90de4f3495addf139463860049740fb
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Aug 17 18:52:37 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Aug 17 20:10:43 2019 +0200

    tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
    
    in hwpfilter, include/test, io, linguistic, oox, pyuno, reportdesign
    
    Change-Id: I5c265c4fde85dd6d7faab8ae82809c4a0e6dd69b
    Reviewed-on: https://gerrit.libreoffice.org/77646
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index 6d6bf2c27204..16459320a4d1 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -194,8 +194,7 @@ Reference< XInterface > HwpImportFilter_CreateInstance(
 
 Sequence< OUString > HwpImportFilter::getSupportedServiceNames_Static() throw ()
 {
-    Sequence< OUString > aRet { HwpImportFilter::getImplementationName_Static() };
-    return aRet;
+    return { HwpImportFilter::getImplementationName_Static() };
 }
 
 HwpImportFilter::HwpImportFilter(const Reference< XMultiServiceFactory >& rFact)
@@ -284,11 +283,7 @@ OUString HwpImportFilter::detect( css::uno::Sequence< css::beans::PropertyValue
 
 Sequence< OUString> HwpImportFilter::getSupportedServiceNames()
 {
-    Sequence < OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = SERVICE_NAME1;
-    pArray[1] = SERVICE_NAME2;
-    return aRet;
+    return { SERVICE_NAME1, SERVICE_NAME2 };
 }
 
 extern "C"
diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx
index 5e871c68af12..8d63b7ae9546 100644
--- a/include/test/testinteractionhandler.hxx
+++ b/include/test/testinteractionhandler.hxx
@@ -57,13 +57,11 @@ public:
 
     virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
     {
-        css::uno::Sequence<OUString> aNames(3);
-        aNames[0] = "com.sun.star.task.InteractionHandler";
+        return { "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";
+                 "com.sun.star.configuration.backend.InteractionHandler",
         // for backwards compatibility
-        return aNames;
+                 "com.sun.star.uui.InteractionHandler" };
     }
 
     virtual void SAL_CALL initialize(css::uno::Sequence<css::uno::Any> const & /*rArguments*/) override
diff --git a/io/test/stm/pumptest.cxx b/io/test/stm/pumptest.cxx
index d337bc21a81a..a2bdf4ff804f 100644
--- a/io/test/stm/pumptest.cxx
+++ b/io/test/stm/pumptest.cxx
@@ -414,9 +414,7 @@ Reference< XInterface > SAL_CALL OPumpTest_CreateInstance( const Reference< XMul
 
 Sequence<OUString> OPumpTest_getSupportedServiceNames() throw()
 {
-    OUString s = OPumpTest_getServiceName();
-    Sequence< OUString > seq( &s , 1 );
-    return seq;
+    return { OPumpTest_getServiceName() };
 
 }
 OUString     OPumpTest_getServiceName() throw()
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index e9b5da8d4e95..062e2ad0b017 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -694,8 +694,7 @@ uno::Sequence< OUString > SAL_CALL DicList::getSupportedServiceNames(  )
 
 uno::Sequence< OUString > DicList::getSupportedServiceNames_Static() throw()
 {
-    uno::Sequence< OUString > aSNS { "com.sun.star.linguistic2.DictionaryList" };
-    return aSNS;
+    return { "com.sun.star.linguistic2.DictionaryList" };
 }
 
 void * DicList_getFactory( const sal_Char * pImplName,
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 247f430d9c06..0b284d660abc 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -1188,8 +1188,7 @@ static OUString GrammarCheckingIterator_getImplementationName() throw()
 
 static uno::Sequence< OUString > GrammarCheckingIterator_getSupportedServiceNames() throw()
 {
-    uno::Sequence<OUString> aSNS { "com.sun.star.linguistic2.ProofreadingIterator" };
-    return aSNS;
+    return { "com.sun.star.linguistic2.ProofreadingIterator" };
 }
 
 /// @throws uno::Exception
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index cf89b437f98c..f97cb6cf5073 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -422,8 +422,7 @@ uno::Sequence< OUString > SAL_CALL LinguProps::getSupportedServiceNames()
 uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static()
         throw()
 {
-    uno::Sequence< OUString > aSNS { "com.sun.star.linguistic2.LinguProperties" };
-    return aSNS;
+    return { "com.sun.star.linguistic2.LinguProperties" };
 }
 
 bool LinguProps::getPropertyBool(const OUString& aPropertyName)
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 2ecb7ba7387d..4b7c65ac2761 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1916,8 +1916,7 @@ uno::Sequence< OUString > SAL_CALL
 uno::Sequence< OUString > LngSvcMgr::getSupportedServiceNames_Static()
         throw()
 {
-    uno::Sequence< OUString > aSNS { "com.sun.star.linguistic2.LinguServiceManager" };
-    return aSNS;
+    return { "com.sun.star.linguistic2.LinguServiceManager" };
 }
 
 /// @throws uno::Exception
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 8bcf91e53b4c..1346353c9d22 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -405,10 +405,7 @@ sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName )
 
 Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames()
 {
-    Sequence< OUString > aServiceNames( 2 );
-    aServiceNames[ 0 ] = "com.sun.star.document.ImportFilter";
-    aServiceNames[ 1 ] = "com.sun.star.document.ExportFilter";
-    return aServiceNames;
+    return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExportFilter" };
 }
 
 // com.sun.star.lang.XInitialization interface
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index 9da2f615a05a..ffdb81143961 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -113,8 +113,7 @@ static OUString getImplementationName()
 
 static Sequence< OUString > getSupportedServiceNames()
 {
-    OUString serviceName( "com.sun.star.loader.Python" );
-    return Sequence< OUString > ( &serviceName, 1 );
+    return { "com.sun.star.loader.Python" };
 }
 
 static void setPythonHome ( const OUString & pythonHome )
diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx
index c6ea55d5360a..a4342fad3fbe 100644
--- a/reportdesign/source/core/api/FormattedField.cxx
+++ b/reportdesign/source/core/api/FormattedField.cxx
@@ -112,11 +112,7 @@ OUString SAL_CALL OFormattedField::getImplementationName(  )
 
 uno::Sequence< OUString > OFormattedField::getSupportedServiceNames_Static(  )
 {
-    uno::Sequence< OUString > aServices(2);
-    aServices[0] = SERVICE_FORMATTEDFIELD;
-    aServices[1] = "com.sun.star.awt.UnoControlFormattedFieldModel";
-
-    return aServices;
+    return { SERVICE_FORMATTEDFIELD, "com.sun.star.awt.UnoControlFormattedFieldModel" };
 }
 
 uno::Sequence< OUString > SAL_CALL OFormattedField::getSupportedServiceNames(  )
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
index f718394957e2..b89ca2022b87 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -132,9 +132,7 @@ OUString SAL_CALL OShape::getImplementationName(  )
 
 uno::Sequence< OUString > OShape::getSupportedServiceNames_Static(  )
 {
-    uno::Sequence< OUString > aServices { SERVICE_SHAPE };
-
-    return aServices;
+    return { SERVICE_SHAPE };
 }
 
 uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames(  )


More information about the Libreoffice-commits mailing list