[Libreoffice-commits] core.git: sw/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 18 09:28:58 UTC 2019


 sw/source/core/access/acccell.cxx            |    6 +-----
 sw/source/core/access/accdoc.cxx             |    6 +-----
 sw/source/core/access/accembedded.cxx        |    6 +-----
 sw/source/core/access/accfootnote.cxx        |   10 ++--------
 sw/source/core/access/accgraphic.cxx         |    6 +-----
 sw/source/core/access/accheaderfooter.cxx    |   10 ++--------
 sw/source/core/access/accpage.cxx            |    6 +-----
 sw/source/core/access/accpara.cxx            |    6 +-----
 sw/source/core/access/acctable.cxx           |    6 +-----
 sw/source/core/access/acctextframe.cxx       |    6 +-----
 sw/source/core/unocore/SwXTextDefaults.cxx   |   17 +++++++----------
 sw/source/core/unocore/unofield.cxx          |    6 +-----
 sw/source/core/unocore/unoframe.cxx          |    6 +-----
 sw/source/core/unocore/unosett.cxx           |    6 +-----
 sw/source/core/unocore/unosrch.cxx           |    6 +-----
 sw/source/ui/uno/swdetect.cxx                |    6 +-----
 sw/source/uibase/uno/SwXDocumentSettings.cxx |    6 +-----
 sw/source/uibase/uno/SwXFilterOptions.cxx    |    3 +--
 sw/source/uibase/uno/unoatxt.cxx             |    4 +---
 sw/source/uibase/uno/unomailmerge.cxx        |    6 +-----
 sw/source/uibase/uno/unomod.cxx              |    4 +---
 sw/source/uibase/uno/unotxdoc.cxx            |   17 +++++++----------
 sw/source/uibase/uno/unotxvw.cxx             |   23 ++++++++---------------
 23 files changed, 44 insertions(+), 134 deletions(-)

New commits:
commit b68f4ff85bc1d6e008facbc310ddbfb5d799b7a5
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Aug 18 10:17:45 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun Aug 18 11:28:03 2019 +0200

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

diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index d979723a4894..12762fa4a5d5 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -250,11 +250,7 @@ sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& sTestService
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.table.AccessibleCellView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.table.AccessibleCellView", sAccessibleServiceName };
 }
 
 void SwAccessibleCell::Dispose(bool bRecursive, bool bCanSkipInvisible)
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index 78b5c2757141..35b345d517f8 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -435,11 +435,7 @@ sal_Bool SAL_CALL SwAccessibleDocument::supportsService(const OUString& sTestSer
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = sServiceName;
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { sServiceName, sAccessibleServiceName };
 }
 
 // XInterface
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index dccad7083e86..eb63f192f02c 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -84,11 +84,7 @@ sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& sT
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.AccessibleTextEmbeddedObject";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.text.AccessibleTextEmbeddedObject", sAccessibleServiceName };
 }
 
 uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 14fb78525736..876e8c278364 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -101,14 +101,8 @@ sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& sTestSer
 
 Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    if( AccessibleRole::END_NOTE == GetRole() )
-        pArray[0] = "com.sun.star.text.AccessibleEndnoteView";
-    else
-        pArray[0] = "com.sun.star.text.AccessibleFootnoteView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { (AccessibleRole::END_NOTE == GetRole())?OUString("com.sun.star.text.AccessibleEndnoteView"):OUString("com.sun.star.text.AccessibleFootnoteView"),
+             sAccessibleServiceName };
 }
 
 Sequence< sal_Int8 > SAL_CALL SwAccessibleFootnote::getImplementationId()
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index 01a6c1ca2338..0599050baf19 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -53,11 +53,7 @@ sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(const OUString& sTestServ
 
 Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.AccessibleTextGraphicObject";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.text.AccessibleTextGraphicObject", sAccessibleServiceName };
 }
 
 Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index b20027d2e5a0..90e954d994c7 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -85,14 +85,8 @@ sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService(const OUString& sTes
 
 Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    if( AccessibleRole::HEADER == GetRole() )
-        pArray[0] = "com.sun.star.text.AccessibleHeaderView";
-    else
-        pArray[0] = "com.sun.star.text.AccessibleFooterView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { (AccessibleRole::HEADER == GetRole())?OUString("com.sun.star.text.AccessibleHeaderView"):OUString("com.sun.star.text.AccessibleFooterView"),
+             sAccessibleServiceName };
 }
 
 Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index a3022f9e5d5c..2ba612b0e335 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -143,11 +143,7 @@ sal_Bool SwAccessiblePage::supportsService( const OUString& rServiceName)
 
 Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.AccessiblePageView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.text.AccessiblePageView", sAccessibleServiceName };
 }
 
 Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index e6c038924705..f8ad27d96077 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -890,11 +890,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::supportsService(
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = sServiceName;
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { sServiceName, sAccessibleServiceName };
 }
 
 static uno::Sequence< OUString > const & getAttributeNames()
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index c2bf54540ef3..681110f6e924 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1241,11 +1241,7 @@ sal_Bool SAL_CALL SwAccessibleTable::supportsService(
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.table.AccessibleTableView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.table.AccessibleTableView", sAccessibleServiceName };
 }
 
 void SwAccessibleTable::InvalidatePosOrSize( const SwRect& rOldBox )
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index b5732d1d2b72..eff9c3c1e782 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -274,11 +274,7 @@ sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService(const OUString& sTestSe
 
 uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.AccessibleTextFrameView";
-    pArray[1] = sAccessibleServiceName;
-    return aRet;
+    return { "com.sun.star.text.AccessibleTextFrameView", sAccessibleServiceName };
 }
 
 uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTextFrame::getImplementationId()
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index 0403a2b9cb58..e7277a9f2347 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -224,16 +224,13 @@ sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& rServiceName
 
 uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames(  )
 {
-    uno::Sequence< OUString > aRet(7);
-    OUString* pArr = aRet.getArray();
-    *pArr++ = "com.sun.star.text.Defaults";
-    *pArr++ = "com.sun.star.style.CharacterProperties";
-    *pArr++ = "com.sun.star.style.CharacterPropertiesAsian";
-    *pArr++ = "com.sun.star.style.CharacterPropertiesComplex";
-    *pArr++ = "com.sun.star.style.ParagraphProperties";
-    *pArr++ = "com.sun.star.style.ParagraphPropertiesAsian";
-    *pArr++ = "com.sun.star.style.ParagraphPropertiesComplex";
-    return aRet;
+    return { "com.sun.star.text.Defaults",
+             "com.sun.star.style.CharacterProperties",
+             "com.sun.star.style.CharacterPropertiesAsian",
+             "com.sun.star.style.CharacterPropertiesComplex",
+             "com.sun.star.style.ParagraphProperties",
+             "com.sun.star.style.ParagraphPropertiesAsian",
+             "com.sun.star.style.ParagraphPropertiesComplex" };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 9f4c674438dd..729bc6ecb1e3 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -532,11 +532,7 @@ sal_Bool SAL_CALL SwXFieldMaster::supportsService(const OUString& rServiceName)
 uno::Sequence< OUString > SAL_CALL
 SwXFieldMaster::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.TextFieldMaster";
-    pArray[1] = getServiceName(m_pImpl->m_nResTypeId);
-    return aRet;
+    return { "com.sun.star.text.TextFieldMaster", getServiceName(m_pImpl->m_nResTypeId) };
 }
 
 SwXFieldMaster::SwXFieldMaster(SwDoc *const pDoc, SwFieldIds const nResId)
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 24bef2288a44..2481e6d4b661 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1196,11 +1196,7 @@ sal_Bool SwXFrame::supportsService(const OUString& rServiceName)
 
 uno::Sequence< OUString > SwXFrame::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(3);
-    aRet[0] = "com.sun.star.text.BaseFrame";
-    aRet[1] = "com.sun.star.text.TextContent";
-    aRet[2] = "com.sun.star.document.LinkTarget";
-    return aRet;
+    return { "com.sun.star.text.BaseFrame", "com.sun.star.text.TextContent", "com.sun.star.document.LinkTarget" };
 }
 
 SwXFrame::SwXFrame(FlyCntType eSet, const ::SfxItemPropertySet* pSet, SwDoc *pDoc)
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 44ff7e1268d2..f58685cd2ba6 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -2264,11 +2264,7 @@ sal_Bool SwXChapterNumbering::supportsService(const OUString& rServiceName)
 
 Sequence< OUString > SwXChapterNumbering::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.ChapterNumbering";
-    pArray[1] = "com.sun.star.text.NumberingRules";
-    return aRet;
+    return { "com.sun.star.text.ChapterNumbering", "com.sun.star.text.NumberingRules" };
 }
 
 SwXChapterNumbering::SwXChapterNumbering(SwDocShell& rDocSh) :
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 43774ff58ba6..c324ab47d1b8 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -652,11 +652,7 @@ sal_Bool SwXTextSearch::supportsService(const OUString& rServiceName)
 
 uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.util.SearchDescriptor";
-    pArray[1] = "com.sun.star.util.ReplaceDescriptor";
-    return aRet;
+    return { "com.sun.star.util.SearchDescriptor", "com.sun.star.util.ReplaceDescriptor" };
 }
 
 void SwXTextSearch::FillSearchOptions( i18nutil::SearchOptions2& rSearchOpt ) const
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index c99b2e6e369b..f79d2c719c62 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -148,11 +148,7 @@ sal_Bool SAL_CALL SwFilterDetect::supportsService( const OUString& sServiceName
 /* XServiceInfo */
 Sequence< OUString > SAL_CALL SwFilterDetect::getSupportedServiceNames()
 {
-    Sequence< OUString > seqServiceNames( 3 );
-    seqServiceNames.getArray() [0] = "com.sun.star.frame.ExtendedTypeDetection";
-    seqServiceNames.getArray() [1] = "com.sun.star.text.FormatDetector";
-    seqServiceNames.getArray() [2] = "com.sun.star.text.W4WFormatDetector";
-    return seqServiceNames ;
+    return { "com.sun.star.frame.ExtendedTypeDetection", "com.sun.star.text.FormatDetector", "com.sun.star.text.W4WFormatDetector" };
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 50bf389e702e..3844ba0969d4 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -1405,11 +1405,7 @@ sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceN
 
 Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames(  )
 {
-    Sequence< OUString > aSeq( 3 );
-    aSeq[0] = "com.sun.star.document.Settings";
-    aSeq[1] = "com.sun.star.text.DocumentSettings";
-    aSeq[2] = "com.sun.star.text.PrintSettings";
-    return aSeq;
+    return { "com.sun.star.document.Settings", "com.sun.star.text.DocumentSettings", "com.sun.star.text.PrintSettings" };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx
index bdc8f190dcb2..1d7f2d403acb 100644
--- a/sw/source/uibase/uno/SwXFilterOptions.cxx
+++ b/sw/source/uibase/uno/SwXFilterOptions.cxx
@@ -134,8 +134,7 @@ sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName )
 
 uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames()
 {
-    OUString sService("com.sun.star.ui.dialogs.FilterOptionsDialog");
-    return uno::Sequence< OUString> (&sService, 1);
+    return { "com.sun.star.ui.dialogs.FilterOptionsDialog" };
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 37ea804b9f59..4987717d9a25 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -207,9 +207,7 @@ sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName)
 
 uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames()
 {
-    OUString sService("com.sun.star.text.AutoTextContainer");
-    const uno::Sequence< OUString > aSeq( &sService, 1 );
-    return aSeq;
+    return { "com.sun.star.text.AutoTextContainer" };
 }
 
 namespace
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index df7d54194bbd..d5231fa826ce 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -1174,11 +1174,7 @@ sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
 
 uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aNames(2);
-    OUString *pName = aNames.getArray();
-    pName[0] = "com.sun.star.text.MailMerge";
-    pName[1] = "com.sun.star.sdb.DataAccessDescriptor";
-    return aNames;
+    return { "com.sun.star.text.MailMerge", "com.sun.star.sdb.DataAccessDescriptor" };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index d1123e1199f0..674a62907cd8 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -241,9 +241,7 @@ sal_Bool SwXModule::supportsService(const OUString& rServiceName)
 
 Sequence< OUString > SwXModule::getSupportedServiceNames()
 {
-    OUString sService( "com.sun.star.text.GlobalSettings");
-    const Sequence< OUString > aSeq( &sService, 1 );
-    return aSeq;
+    return { "com.sun.star.text.GlobalSettings" };
 }
 
 SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc)
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index ca337d79e4f7..19d88c7e018b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3924,16 +3924,13 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
 
 Sequence< OUString > SwXLinkTargetSupplier::getElementNames()
 {
-    Sequence< OUString > aRet(7);
-    OUString* pNames = aRet.getArray();
-    pNames[0] = sTables;
-    pNames[1] = sFrames  ;
-    pNames[2] = sGraphics;
-    pNames[3] = sOLEs   ;
-    pNames[4] = sSections;
-    pNames[5] = sOutlines;
-    pNames[6] = sBookmarks;
-    return aRet;
+    return { sTables,
+             sFrames,
+             sGraphics,
+             sOLEs,
+             sSections,
+             sOutlines,
+             sBookmarks };
 }
 
 sal_Bool SwXLinkTargetSupplier::hasByName(const OUString& rName)
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index f268c5d27299..9bc4abcfd985 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -847,11 +847,7 @@ sal_Bool SwXTextView::supportsService(const OUString& rServiceName)
 
 Sequence< OUString > SwXTextView::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(2);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.TextDocumentView";
-    pArray[1] = "com.sun.star.view.OfficeDocumentView";
-    return aRet;
+    return { "com.sun.star.text.TextDocumentView", "com.sun.star.view.OfficeDocumentView" };
 }
 
 SwXTextViewCursor::SwXTextViewCursor(SwView* pVw) :
@@ -1661,16 +1657,13 @@ sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName)
 
 Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet(7);
-    OUString* pArray = aRet.getArray();
-    pArray[0] = "com.sun.star.text.TextViewCursor";
-    pArray[1] = "com.sun.star.style.CharacterProperties";
-    pArray[2] = "com.sun.star.style.CharacterPropertiesAsian";
-    pArray[3] = "com.sun.star.style.CharacterPropertiesComplex";
-    pArray[4] = "com.sun.star.style.ParagraphProperties";
-    pArray[5] = "com.sun.star.style.ParagraphPropertiesAsian";
-    pArray[6] = "com.sun.star.style.ParagraphPropertiesComplex";
-    return aRet;
+    return { "com.sun.star.text.TextViewCursor",
+             "com.sun.star.style.CharacterProperties",
+             "com.sun.star.style.CharacterPropertiesAsian",
+             "com.sun.star.style.CharacterPropertiesComplex",
+             "com.sun.star.style.ParagraphProperties",
+             "com.sun.star.style.ParagraphPropertiesAsian",
+             "com.sun.star.style.ParagraphPropertiesComplex" };
 }
 
 namespace


More information about the Libreoffice-commits mailing list