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@yahoo.fr>
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index d979723..12762fa 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 78b5c27..35b345d 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 dccad708..eb63f19 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 14fb785..876e8c2 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 01a6c1c..0599050 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 b20027d..90e954d 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 a3022f9..2ba612b 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 e6c0389..f8ad27d 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 c2bf545..681110f 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 b5732d1..eff9c3c 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 0403a2b..e7277a9 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 9f4c674..729bc6e 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 24bef22..2481e6d 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 44ff7e1..f58685c 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 43774ff..c324ab4 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 c99b2e6..f79d2c7 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 50bf389..3844ba0 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 bdc8f19..1d7f2d4 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 37ea804..4987717 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 df7d541..d5231fa 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 d1123e1..674a629 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 ca337d7..19d88c7 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 f268c5d..9bc4abc 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