[Libreoffice-commits] core.git: sc/source sd/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 18 08:35:29 UTC 2019


 sc/source/filter/xml/xmlimprt.cxx           |   15 ++++---------
 sd/source/core/stlfamily.cxx                |    4 ---
 sd/source/core/stlsheet.cxx                 |   25 ++++++++-------------
 sd/source/ui/slideshow/slideshow.cxx        |    4 ---
 sd/source/ui/unoidl/SdUnoDrawView.cxx       |    4 ---
 sd/source/ui/unoidl/SdUnoOutlineView.cxx    |    4 ---
 sd/source/ui/unoidl/SdUnoSlideView.cxx      |    4 ---
 sd/source/ui/unoidl/UnoDocumentSettings.cxx |   14 +-----------
 sd/source/ui/unoidl/randomnode.cxx          |    5 ----
 sd/source/ui/unoidl/unocpres.cxx            |    8 +------
 sd/source/ui/unoidl/unodoc.cxx              |    6 -----
 sd/source/ui/unoidl/unolayer.cxx            |    4 ---
 sd/source/ui/unoidl/unomodel.cxx            |   32 +++++++---------------------
 sd/source/ui/unoidl/unopback.cxx            |    8 -------
 14 files changed, 36 insertions(+), 101 deletions(-)

New commits:
commit 52e086c336cc52dcea410f0c3b8ada8439ebe969
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Aug 18 09:45:11 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun Aug 18 10:34:30 2019 +0200

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

diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 96c348d34f35..5475bd06df9a 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -116,8 +116,7 @@ OUString ScXMLImport_getImplementationName() throw()
 
 uno::Sequence< OUString > ScXMLImport_getSupportedServiceNames() throw()
 {
-    const OUString aServiceName( ScXMLImport_getImplementationName() );
-    return uno::Sequence< OUString > ( &aServiceName, 1 );
+    return { ScXMLImport_getImplementationName() };
 }
 
 uno::Reference< uno::XInterface > ScXMLImport_createInstance(
@@ -134,8 +133,7 @@ OUString ScXMLImport_Meta_getImplementationName() throw()
 
 uno::Sequence< OUString > ScXMLImport_Meta_getSupportedServiceNames() throw()
 {
-    const OUString aServiceName( ScXMLImport_Meta_getImplementationName() );
-    return uno::Sequence< OUString > ( &aServiceName, 1 );
+    return { ScXMLImport_Meta_getImplementationName() };
 }
 
 uno::Reference< uno::XInterface > ScXMLImport_Meta_createInstance(
@@ -152,8 +150,7 @@ OUString ScXMLImport_Styles_getImplementationName() throw()
 
 uno::Sequence< OUString > ScXMLImport_Styles_getSupportedServiceNames() throw()
 {
-    const OUString aServiceName( ScXMLImport_Styles_getImplementationName() );
-    return uno::Sequence< OUString > ( &aServiceName, 1 );
+    return { ScXMLImport_Styles_getImplementationName() };
 }
 
 uno::Reference< uno::XInterface > ScXMLImport_Styles_createInstance(
@@ -170,8 +167,7 @@ OUString ScXMLImport_Content_getImplementationName() throw()
 
 uno::Sequence< OUString > ScXMLImport_Content_getSupportedServiceNames() throw()
 {
-    const OUString aServiceName( ScXMLImport_Content_getImplementationName() );
-    return uno::Sequence< OUString > ( &aServiceName, 1 );
+    return { ScXMLImport_Content_getImplementationName() };
 }
 
 uno::Reference< uno::XInterface > ScXMLImport_Content_createInstance(
@@ -188,8 +184,7 @@ OUString ScXMLImport_Settings_getImplementationName() throw()
 
 uno::Sequence< OUString > ScXMLImport_Settings_getSupportedServiceNames() throw()
 {
-    const OUString aServiceName( ScXMLImport_Settings_getImplementationName() );
-    return uno::Sequence< OUString > ( &aServiceName, 1 );
+    return { ScXMLImport_Settings_getImplementationName() };
 }
 
 uno::Reference< uno::XInterface > ScXMLImport_Settings_createInstance(
diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx
index 47ef8a93af51..bb332e7939ab 100644
--- a/sd/source/core/stlfamily.cxx
+++ b/sd/source/core/stlfamily.cxx
@@ -175,9 +175,7 @@ sal_Bool SAL_CALL SdStyleFamily::supportsService( const OUString& ServiceName )
 
 Sequence< OUString > SAL_CALL SdStyleFamily::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/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 91cb60028dff..020d28a257b7 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -842,21 +842,16 @@ sal_Bool SAL_CALL SdStyleSheet::supportsService( const OUString& ServiceName )
 
 Sequence< OUString > SAL_CALL SdStyleSheet::getSupportedServiceNames()
 {
-    Sequence< OUString > aNameSequence( 10 );
-    OUString* pStrings = aNameSequence.getArray();
-
-    *pStrings++ = "com.sun.star.style.Style";
-    *pStrings++ = "com.sun.star.drawing.FillProperties";
-    *pStrings++ = "com.sun.star.drawing.LineProperties";
-    *pStrings++ = "com.sun.star.drawing.ShadowProperties";
-    *pStrings++ = "com.sun.star.drawing.ConnectorProperties";
-    *pStrings++ = "com.sun.star.drawing.MeasureProperties";
-    *pStrings++ = "com.sun.star.style.ParagraphProperties";
-    *pStrings++ = "com.sun.star.style.CharacterProperties";
-    *pStrings++ = "com.sun.star.drawing.TextProperties";
-    *pStrings++ = "com.sun.star.drawing.Text";
-
-    return aNameSequence;
+    return { "com.sun.star.style.Style",
+             "com.sun.star.drawing.FillProperties",
+             "com.sun.star.drawing.LineProperties",
+             "com.sun.star.drawing.ShadowProperties",
+             "com.sun.star.drawing.ConnectorProperties",
+             "com.sun.star.drawing.MeasureProperties",
+             "com.sun.star.style.ParagraphProperties",
+             "com.sun.star.style.CharacterProperties",
+             "com.sun.star.drawing.TextProperties",
+             "com.sun.star.drawing.Text" };
 }
 
 bool SdStyleSheet::SetName(const OUString& rNewName, bool bReindexNow)
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 1044e420983e..68011fc1c9ec 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -249,9 +249,7 @@ sal_Bool SAL_CALL SlideShow::supportsService( const OUString& ServiceName )
 
 Sequence< OUString > SAL_CALL SlideShow::getSupportedServiceNames(  )
 {
-    OUString aService( "com.sun.star.presentation.Presentation" );
-    Sequence< OUString > aSeq( &aService, 1 );
-    return aSeq;
+    return { "com.sun.star.presentation.Presentation" };
 }
 
 // XPropertySet
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index f5f5ddfc56d8..9877c41ca733 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -544,9 +544,7 @@ sal_Bool SAL_CALL SdUnoDrawView::supportsService( const OUString& ServiceName )
 
 Sequence< OUString > SAL_CALL SdUnoDrawView::getSupportedServiceNames(  )
 {
-    OUString aSN("com.sun.star.drawing.DrawingDocumentDrawView");
-    uno::Sequence< OUString > aSeq( &aSN, 1 );
-    return aSeq;
+    return { "com.sun.star.drawing.DrawingDocumentDrawView" };
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/unoidl/SdUnoOutlineView.cxx b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
index 0a5da1c00806..5fd7e56000cf 100644
--- a/sd/source/ui/unoidl/SdUnoOutlineView.cxx
+++ b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
@@ -150,9 +150,7 @@ sal_Bool SAL_CALL SdUnoOutlineView::supportsService( const OUString& ServiceName
 
 Sequence< OUString > SAL_CALL SdUnoOutlineView::getSupportedServiceNames(  )
 {
-    OUString aSN( "com.sun.star.presentation.OutlineView" );
-    uno::Sequence< OUString > aSeq( &aSN, 1 );
-    return aSeq;
+    return { "com.sun.star.presentation.OutlineView" };
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/unoidl/SdUnoSlideView.cxx b/sd/source/ui/unoidl/SdUnoSlideView.cxx
index df6750e38947..1a31540bf68e 100644
--- a/sd/source/ui/unoidl/SdUnoSlideView.cxx
+++ b/sd/source/ui/unoidl/SdUnoSlideView.cxx
@@ -164,9 +164,7 @@ sal_Bool SAL_CALL SdUnoSlideView::supportsService( const OUString& ServiceName )
 
 Sequence< OUString > SAL_CALL SdUnoSlideView::getSupportedServiceNames(  )
 {
-    OUString aSN( "com.sun.star.presentation.SlidesView" );
-    uno::Sequence< OUString > aSeq( &aSN, 1 );
-    return aSeq;
+    return { "com.sun.star.presentation.SlidesView" };
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 4b86d263c5b4..f1228da14f18 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -1394,18 +1394,8 @@ sal_Bool SAL_CALL DocumentSettings::supportsService( const OUString& ServiceName
 
 Sequence< OUString > SAL_CALL DocumentSettings::getSupportedServiceNames(  )
 {
-    Sequence< OUString > aSeq( 2 );
-    aSeq[0] = "com.sun.star.document.Settings" ;
-    if( mxModel->IsImpressDocument() )
-    {
-        aSeq[1] = "com.sun.star.presentation.DocumentSettings" ;
-    }
-    else
-    {
-        aSeq[1] = "com.sun.star.drawing.DocumentSettings" ;
-    }
-
-    return aSeq;
+    return {  "com.sun.star.document.Settings" ,
+              mxModel->IsImpressDocument()?OUString("com.sun.star.presentation.DocumentSettings"):OUString("com.sun.star.drawing.DocumentSettings") };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx
index d86deecd9b2f..24c0ac99d4cd 100644
--- a/sd/source/ui/unoidl/randomnode.cxx
+++ b/sd/source/ui/unoidl/randomnode.cxx
@@ -554,10 +554,7 @@ sal_Bool RandomAnimationNode::supportsService(const OUString& ServiceName)
 // XServiceInfo
 Sequence< OUString > RandomAnimationNode::getSupportedServiceNames()
 {
-    Sequence< OUString > aSeq( 2 );
-    aSeq[0] = "com.sun.star.animations.ParallelTimeContainer";
-    aSeq[1] = "com.sun.star.comp.sd.RandomAnimationNode";
-    return aSeq;
+    return { "com.sun.star.animations.ParallelTimeContainer", "com.sun.star.comp.sd.RandomAnimationNode" };
 }
 
 }
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index 6d17695de596..43cceb0dae39 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -73,9 +73,7 @@ sal_Bool SAL_CALL SdXCustomPresentation::supportsService( const OUString& Servic
 
 uno::Sequence< OUString > SAL_CALL SdXCustomPresentation::getSupportedServiceNames()
 {
-    OUString aSN( "com.sun.star.presentation.CustomPresentation" );
-    uno::Sequence< OUString > aSeq( &aSN, 1 );
-    return aSeq;
+    return { "com.sun.star.presentation.CustomPresentation" };
 }
 
 // XIndexContainer
@@ -284,9 +282,7 @@ sal_Bool SAL_CALL SdXCustomPresentationAccess::supportsService( const OUString&
 
 uno::Sequence< OUString > SAL_CALL SdXCustomPresentationAccess::getSupportedServiceNames()
 {
-    const OUString aNS( "com.sun.star.presentation.CustomPresentationAccess" );
-    uno::Sequence< OUString > aSeq( &aNS, 1 );
-    return aSeq;
+    return { "com.sun.star.presentation.CustomPresentationAccess" };
 }
 
 // XSingleServiceFactory
diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx
index f47914246fc0..b5a5d895e081 100644
--- a/sd/source/ui/unoidl/unodoc.cxx
+++ b/sd/source/ui/unoidl/unodoc.cxx
@@ -39,11 +39,7 @@ OUString SdDrawingDocument_getImplementationName()
 
 uno::Sequence< OUString > SdDrawingDocument_getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSeq( 2 );
-    aSeq[0] = "com.sun.star.drawing.DrawingDocument";
-    aSeq[1] = "com.sun.star.drawing.DrawingDocumentFactory";
-
-    return aSeq;
+    return { "com.sun.star.drawing.DrawingDocument", "com.sun.star.drawing.DrawingDocumentFactory" };
 }
 
 uno::Reference< uno::XInterface > SdDrawingDocument_createInstance(
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index c0749aa8cae9..df4259d6fc5c 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -105,9 +105,7 @@ sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName )
 
 uno::Sequence< OUString > SAL_CALL SdLayer::getSupportedServiceNames()
 {
-    OUString aServiceName("com.sun.star.drawing.Layer");
-    uno::Sequence< OUString > aSeq( &aServiceName, 1 );
-    return aSeq;
+    return { "com.sun.star.drawing.Layer" };
 }
 
 // beans::XPropertySet
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index d4a7a150aa1a..20bdfbd110e4 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1180,19 +1180,10 @@ uno::Sequence< OUString > SAL_CALL SdXImpressDocument::getSupportedServiceNames(
 {
     ::SolarMutexGuard aGuard;
 
-    uno::Sequence< OUString > aSeq( 4 );
-    OUString* pServices = aSeq.getArray();
-
-    *pServices++ = "com.sun.star.document.OfficeDocument";
-    *pServices++ = "com.sun.star.drawing.GenericDrawingDocument";
-    *pServices++ = "com.sun.star.drawing.DrawingDocumentFactory";
-
-    if( mbImpressDoc )
-        *pServices++ = "com.sun.star.presentation.PresentationDocument";
-    else
-        *pServices++ = "com.sun.star.drawing.DrawingDocument";
-
-    return aSeq;
+    return { "com.sun.star.document.OfficeDocument",
+             "com.sun.star.drawing.GenericDrawingDocument",
+             "com.sun.star.drawing.DrawingDocumentFactory",
+             mbImpressDoc?OUString("com.sun.star.presentation.PresentationDocument"):OUString("com.sun.star.drawing.DrawingDocument") };
 }
 
 // XPropertySet
@@ -3005,9 +2996,7 @@ sal_Bool SAL_CALL SdDrawPagesAccess::supportsService( const OUString& ServiceNam
 
 uno::Sequence< OUString > SAL_CALL SdDrawPagesAccess::getSupportedServiceNames(  )
 {
-    OUString aService( "com.sun.star.drawing.DrawPages" );
-    uno::Sequence< OUString > aSeq( &aService, 1 );
-    return aSeq;
+    return { "com.sun.star.drawing.DrawPages" };
 }
 
 // XComponent
@@ -3262,9 +3251,7 @@ sal_Bool SAL_CALL SdMasterPagesAccess::supportsService( const OUString& ServiceN
 
 uno::Sequence< OUString > SAL_CALL SdMasterPagesAccess::getSupportedServiceNames(  )
 {
-    OUString aService( "com.sun.star.drawing.MasterPages" );
-    uno::Sequence< OUString > aSeq( &aService, 1 );
-    return aSeq;
+    return { "com.sun.star.drawing.MasterPages" };
 }
 
 // class SdDocLinkTargets
@@ -3326,8 +3313,7 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames()
     SdDrawDocument* pDoc = mpModel->GetDoc();
     if( pDoc == nullptr )
     {
-        uno::Sequence< OUString > aSeq;
-        return aSeq;
+        return { };
     }
 
     if( pDoc->GetDocumentType() == DocumentType::Draw )
@@ -3440,9 +3426,7 @@ sal_Bool SAL_CALL SdDocLinkTargets::supportsService( const OUString& ServiceName
 
 uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getSupportedServiceNames()
 {
-    const OUString aSN( "com.sun.star.document.LinkTargets" );
-    uno::Sequence< OUString > aSeq( &aSN, 1 );
-    return aSeq;
+    return { "com.sun.star.document.LinkTargets" };
 }
 
 rtl::Reference< SdXImpressDocument > SdXImpressDocument::GetModel( SdDrawDocument const & rDocument )
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 5b5b7b429fea..58ba1631fd6d 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -179,13 +179,7 @@ sal_Bool SAL_CALL SdUnoPageBackground::supportsService( const OUString& ServiceN
 
 uno::Sequence< OUString > SAL_CALL SdUnoPageBackground::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aNameSequence( 2 );
-    OUString* pStrings = aNameSequence.getArray();
-
-    *pStrings++ = sUNO_Service_PageBackground;
-    *pStrings   = sUNO_Service_FillProperties;
-
-    return aNameSequence;
+    return { sUNO_Service_PageBackground, sUNO_Service_FillProperties };
 }
 
 // XPropertySet


More information about the Libreoffice-commits mailing list