[Libreoffice-commits] core.git: 2 commits - scaddins/source scripting/source sfx2/source stoc/source stoc/test

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 17 20:17:34 UTC 2019


 scaddins/source/analysis/analysis.cxx                     |    6 +-----
 scaddins/source/datefunc/datefunc.cxx                     |    6 +-----
 scaddins/source/pricing/pricing.cxx                       |    6 +-----
 scripting/source/dlgprov/dlgprov.cxx                      |    8 +++-----
 scripting/source/provider/BrowseNodeFactoryImpl.cxx       |    5 +----
 scripting/source/provider/MasterScriptProvider.cxx        |   13 ++++---------
 scripting/source/provider/MasterScriptProviderFactory.cxx |    8 ++------
 scripting/source/vbaevents/eventhelper.cxx                |    6 ++----
 sfx2/source/appl/appdispatchprovider.cxx                  |    5 +----
 sfx2/source/appl/xpackcreator.cxx                         |    5 +----
 sfx2/source/dialog/backingcomp.cxx                        |    5 +----
 sfx2/source/doc/ownsubfilterservice.cxx                   |    5 +----
 sfx2/source/view/frmload.cxx                              |    5 +----
 stoc/source/javaloader/javaloader.cxx                     |    5 +----
 stoc/source/proxy_factory/proxyfac.cxx                    |    3 +--
 stoc/source/servicemanager/servicemanager.cxx             |   10 ++--------
 stoc/test/testsmgr_cpnt.cxx                               |    5 +----
 17 files changed, 25 insertions(+), 81 deletions(-)

New commits:
commit c5be21da5072a78525ee07bb16dfcf391b8dbf32
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Aug 17 21:02:20 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Aug 17 22:16:38 2019 +0200

    tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
    
    in scaddins, scripting
    
    Change-Id: I92e6380f535aec12c1f1c5c51d8b544c8a7d9611
    Reviewed-on: https://gerrit.libreoffice.org/77650
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index f9a398a8abb7..9e7cf05aa91c 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -148,11 +148,7 @@ OUString AnalysisAddIn::getImplementationName_Static()
 
 uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static()
 {
-    uno::Sequence< OUString >   aRet(2);
-    OUString*         pArray = aRet.getArray();
-    pArray[0] = ADDIN_SERVICE;
-    pArray[1] = MY_SERVICE;
-    return aRet;
+    return { ADDIN_SERVICE, MY_SERVICE };
 }
 
 uno::Reference< uno::XInterface > AnalysisAddIn_CreateInstance(
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index 32c785643470..8f3832869266 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -177,11 +177,7 @@ OUString ScaDateAddIn::getImplementationName_Static()
 
 uno::Sequence< OUString > ScaDateAddIn::getSupportedServiceNames_Static()
 {
-    uno::Sequence< OUString > aRet( 2 );
-    OUString* pArray = aRet.getArray();
-    pArray[0] = ADDIN_SERVICE;
-    pArray[1] = MY_SERVICE;
-    return aRet;
+    return { ADDIN_SERVICE, MY_SERVICE };
 }
 
 // XServiceName
diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 6c3a6449b0d1..1d0fb69a1011 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -177,11 +177,7 @@ OUString ScaPricingAddIn::getImplementationName_Static()
 
 uno::Sequence< OUString > ScaPricingAddIn::getSupportedServiceNames_Static()
 {
-    uno::Sequence< OUString > aRet( 2 );
-    OUString* pArray = aRet.getArray();
-    pArray[0] = ADDIN_SERVICE;
-    pArray[1] = MY_SERVICE;
-    return aRet;
+    return { ADDIN_SERVICE, MY_SERVICE };
 }
 
 // XServiceName
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 59bfbdfe041f..ef5673bafbfd 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -166,11 +166,9 @@ namespace dlgprov
 
     static Sequence< OUString > getSupportedServiceNames_DialogProviderImpl()
     {
-        Sequence< OUString > aNames(3);
-        aNames[0] = "com.sun.star.awt.DialogProvider";
-        aNames[1] = "com.sun.star.awt.DialogProvider2";
-        aNames[2] = "com.sun.star.awt.ContainerWindowProvider";
-        return aNames;
+        return { "com.sun.star.awt.DialogProvider",
+                 "com.sun.star.awt.DialogProvider2",
+                 "com.sun.star.awt.ContainerWindowProvider" };
     }
 
 
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index e89452c3c971..92ce1be6c273 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -623,10 +623,7 @@ BrowseNodeFactoryImpl::getOrganizerHierarchy()
 Sequence< OUString >
 bnf_getSupportedServiceNames( )
 {
-    OUString str_name(
-        "com.sun.star.script.browse.BrowseNodeFactory");
-
-    return Sequence< OUString >( &str_name, 1 );
+    return { "com.sun.star.script.browse.BrowseNodeFactory" };
 }
 
 OUString
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index ca84b2599888..8fb19dc8ac09 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -688,13 +688,9 @@ static Reference< XInterface > sp_create(
 
 static Sequence< OUString > sp_getSupportedServiceNames( )
 {
-    OUString names[3];
-
-    names[0] = "com.sun.star.script.provider.MasterScriptProvider";
-    names[1] = "com.sun.star.script.browse.BrowseNode";
-    names[2] = "com.sun.star.script.provider.ScriptProvider";
-
-    return Sequence< OUString >( names, 3 );
+    return { "com.sun.star.script.provider.MasterScriptProvider",
+             "com.sun.star.script.browse.BrowseNode",
+             "com.sun.star.script.provider.ScriptProvider" };
 }
 
 
@@ -718,8 +714,7 @@ static Sequence< OUString > urihelper_getSupportedServiceNames( )
 
 static OUString urihelper_getImplementationName( )
 {
-    return
-        "com.sun.star.script.provider.ScriptURIHelper";
+    return "com.sun.star.script.provider.ScriptURIHelper";
 }
 
 static const struct cppu::ImplementationEntry s_entries [] =
diff --git a/scripting/source/provider/MasterScriptProviderFactory.cxx b/scripting/source/provider/MasterScriptProviderFactory.cxx
index 3a6d74ac9598..fd93894b6e94 100644
--- a/scripting/source/provider/MasterScriptProviderFactory.cxx
+++ b/scripting/source/provider/MasterScriptProviderFactory.cxx
@@ -64,16 +64,12 @@ MasterScriptProviderFactory::getActiveMSPList() const
 
 Sequence< OUString > mspf_getSupportedServiceNames( )
 {
-    OUString str_name(
-        "com.sun.star.script.provider.MasterScriptProviderFactory");
-
-    return Sequence< OUString >( &str_name, 1 );
+    return { "com.sun.star.script.provider.MasterScriptProviderFactory" };
 }
 
 OUString mspf_getImplementationName( )
 {
-    return
-        "com.sun.star.script.provider.MasterScriptProviderFactory";
+    return "com.sun.star.script.provider.MasterScriptProviderFactory";
 }
 
 Reference< XInterface >
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 7696956fdcc2..c6ba9161a549 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -585,8 +585,7 @@ public:
 
     css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
     {
-        const OUString strName( getImplementationName() );
-        return Sequence< OUString >( &strName, 1 );
+        return { getImplementationName() };
     }
 
 protected:
@@ -931,8 +930,7 @@ public:
 
     css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
     {
-        const OUString strName( getImplementationName() );
-        return Sequence< OUString >( &strName, 1 );
+        return { getImplementationName() };
     }
 
 };
commit cc70a9dec7730661aacd5fe7ed62f0a29ebf1084
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Aug 17 20:32:59 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Aug 17 22:16:31 2019 +0200

    tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
    
    in sfx2, stoc
    
    Change-Id: I7138f702317d0e693438216732bf181f1972cdc1
    Reviewed-on: https://gerrit.libreoffice.org/77648
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx
index ccca8d4be667..60d0cbefa21e 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -112,10 +112,7 @@ sal_Bool SAL_CALL SfxAppDispatchProvider::supportsService( const OUString& sServ
 
 css::uno::Sequence< OUString > SAL_CALL SfxAppDispatchProvider::getSupportedServiceNames()
 {
-    css::uno::Sequence< OUString > seqServiceNames( 2 );
-    seqServiceNames.getArray()[0] = "com.sun.star.frame.ProtocolHandler";
-    seqServiceNames.getArray()[1] = "com.sun.star.frame.AppDispatchProvider";
-    return seqServiceNames;
+    return { "com.sun.star.frame.ProtocolHandler", "com.sun.star.frame.AppDispatchProvider" };
 }
 
 Reference < XDispatch > SAL_CALL SfxAppDispatchProvider::queryDispatch(
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index 2434cabbef7c..607d4f0993cd 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -158,10 +158,7 @@ sal_Bool SAL_CALL OPackageStructureCreator::supportsService( const OUString& Ser
 
 uno::Sequence< OUString > SAL_CALL OPackageStructureCreator::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    aRet[0] = "com.sun.star.embed.PackageStructureCreator";
-    aRet[1] = "com.sun.star.comp.embed.PackageStructureCreator";
-    return aRet;
+    return { "com.sun.star.embed.PackageStructureCreator", "com.sun.star.comp.embed.PackageStructureCreator" };
 }
 
 }
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 2e36f8f18887..1de9a2daa698 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -281,10 +281,7 @@ sal_Bool SAL_CALL BackingComp::supportsService( /*IN*/ const OUString& sServiceN
 
 css::uno::Sequence< OUString > SAL_CALL BackingComp::getSupportedServiceNames()
 {
-    css::uno::Sequence< OUString > lNames(2);
-    lNames[0] = "com.sun.star.frame.StartModule";
-    lNames[1] = "com.sun.star.frame.ProtocolHandler";
-    return lNames;
+    return { "com.sun.star.frame.StartModule", "com.sun.star.frame.ProtocolHandler" };
 }
 
 
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index abe4b5c63c44..598ff03bc18e 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -106,10 +106,7 @@ sal_Bool SAL_CALL OwnSubFilterService::supportsService( const OUString& ServiceN
 
 uno::Sequence< OUString > SAL_CALL OwnSubFilterService::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    aRet[0] = "com.sun.star.document.OwnSubFilter";
-    aRet[1] = "com.sun.star.comp.document.OwnSubFilter";
-    return aRet;
+    return { "com.sun.star.document.OwnSubFilter", "com.sun.star.comp.document.OwnSubFilter" };
 }
 
 }
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 499149c54b83..e6885694a944 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -765,10 +765,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const OUString& sService
 /* XServiceInfo */
 Sequence< OUString > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames()
 {
-    Sequence< OUString > seqServiceNames( 2 );
-    seqServiceNames.getArray() [0] = "com.sun.star.frame.SynchronousFrameLoader";
-    seqServiceNames.getArray() [1] = "com.sun.star.frame.OfficeFrameLoader";
-    return seqServiceNames ;
+    return { "com.sun.star.frame.SynchronousFrameLoader", "com.sun.star.frame.OfficeFrameLoader" };
 }
 
 }
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 4832b4c346d6..06332c73329f 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -68,10 +68,7 @@ static Mutex & getInitMutex();
 
 static Sequence< OUString > loader_getSupportedServiceNames()
 {
-    Sequence< OUString > seqNames(2);
-    seqNames.getArray()[0] = "com.sun.star.loader.Java";
-    seqNames.getArray()[1] = "com.sun.star.loader.Java2";
-    return seqNames;
+    return { "com.sun.star.loader.Java", "com.sun.star.loader.Java2" };
 }
 
 static OUString loader_getImplementationName()
diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx
index 55d53661dccd..38da29b3485a 100644
--- a/stoc/source/proxy_factory/proxyfac.cxx
+++ b/stoc/source/proxy_factory/proxyfac.cxx
@@ -56,8 +56,7 @@ OUString proxyfac_getImplementationName()
 
 Sequence< OUString > proxyfac_getSupportedServiceNames()
 {
-    OUString str_name = SERVICE_NAME;
-    return Sequence< OUString >( &str_name, 1 );
+    return { SERVICE_NAME };
 }
 
 
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 880b478ec847..264285d75174 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -906,10 +906,7 @@ sal_Bool OServiceManager::supportsService(const OUString& ServiceName)
 // XServiceInfo
 Sequence< OUString > OServiceManager::getSupportedServiceNames()
 {
-    Sequence< OUString > seqNames(2);
-    seqNames[0] = "com.sun.star.lang.MultiServiceFactory";
-    seqNames[1] = "com.sun.star.lang.ServiceManager";
-    return seqNames;
+    return { "com.sun.star.lang.MultiServiceFactory", "com.sun.star.lang.ServiceManager" };
 }
 
 
@@ -1377,10 +1374,7 @@ Sequence< OUString > ORegistryServiceManager::getAvailableServiceNames()
 // XServiceInfo
 Sequence< OUString > ORegistryServiceManager::getSupportedServiceNames()
 {
-    Sequence< OUString > seqNames(2);
-    seqNames[0] = "com.sun.star.lang.MultiServiceFactory";
-    seqNames[1] = "com.sun.star.lang.RegistryServiceManager";
-    return seqNames;
+    return { "com.sun.star.lang.MultiServiceFactory", "com.sun.star.lang.RegistryServiceManager" };
 }
 
 
diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx
index b09bb7ea3a45..7faf7fea9686 100644
--- a/stoc/test/testsmgr_cpnt.cxx
+++ b/stoc/test/testsmgr_cpnt.cxx
@@ -148,10 +148,7 @@ Sequence< OUString > Test_Manager_Impl::getSupportedServiceNames() throw ()
 
 Sequence< OUString > Test_Manager_Impl::getSupportedServiceNames_Static() throw ()
 {
-    Sequence< OUString > aSNS( 2 );
-    aSNS.getArray()[0] = SERVICE_NAME;
-    aSNS.getArray()[1] = "com.sun.star.bridge.Bridge";
-    return aSNS;
+    return { SERVICE_NAME, "com.sun.star.bridge.Bridge" };
 }
 
 


More information about the Libreoffice-commits mailing list