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

DuP-491 (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 1 16:32:27 UTC 2021


 sc/source/ui/Accessibility/AccessibleCell.cxx                |   11 +++--------
 sc/source/ui/Accessibility/AccessibleDocument.cxx            |    9 ++-------
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |   10 +++-------
 sc/source/ui/Accessibility/AccessiblePageHeader.cxx          |   10 +++-------
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx      |   10 +++-------
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx         |   10 +++-------
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx   |   10 +++-------
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx         |    9 ++-------
 sd/source/filter/html/HtmlOptionsDialog.cxx                  |    3 +--
 sd/source/ui/unoidl/unolayer.cxx                             |    5 ++---
 sd/source/ui/unoidl/unopage.cxx                              |    3 +--
 11 files changed, 26 insertions(+), 64 deletions(-)

New commits:
commit a58333410cdfb3a9e6ef82710534f2422a85aeea
Author:     DuP-491 <leolovelucia at gmail.com>
AuthorDate: Tue Dec 22 22:32:05 2020 +0530
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Fri Jan 1 17:31:48 2021 +0100

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

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 0ec73e1a95ad..0f6fd86a20ba 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -24,10 +24,10 @@
 
 #include <AccessibleCell.hxx>
 #include <scitems.hxx>
-
 #include <AccessibleText.hxx>
 #include <AccessibleDocument.hxx>
 #include <tabvwsh.hxx>
+#include <comphelper/sequence.hxx>
 #include <document.hxx>
 #include <attrib.hxx>
 #include <editsrc.hxx>
@@ -297,13 +297,8 @@ OUString SAL_CALL ScAccessibleCell::getImplementationName()
 uno::Sequence< OUString> SAL_CALL
     ScAccessibleCell::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.sheet.AccessibleCell";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.sheet.AccessibleCell" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
     //====  internal  =========================================================
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 1015063d1ce2..b39230314e2e 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1965,13 +1965,8 @@ OUString SAL_CALL
 uno::Sequence< OUString> SAL_CALL
     ScAccessibleDocument::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.AccessibleSpreadsheetDocumentView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.AccessibleSpreadsheetDocumentView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 568b4a2c59ee..8778e65c7aee 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -36,6 +36,7 @@
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <comphelper/sequence.hxx>
 
 #include <unotools/accessiblestatesethelper.hxx>
 #include <tools/gen.hxx>
@@ -1453,13 +1454,8 @@ OUString SAL_CALL ScAccessibleDocumentPagePreview::getImplementationName()
 
 uno::Sequence< OUString> SAL_CALL ScAccessibleDocumentPagePreview::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.AccessibleSpreadsheetPageView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.AccessibleSpreadsheetPageView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index 54df90578554..c836849a8be7 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -33,6 +33,7 @@
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <comphelper/sequence.hxx>
 
 #include <vcl/window.hxx>
 #include <svl/hint.hxx>
@@ -281,13 +282,8 @@ OUString SAL_CALL ScAccessiblePageHeader::getImplementationName()
 
 uno::Sequence<OUString> SAL_CALL ScAccessiblePageHeader::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.text.AccessibleHeaderFooterView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.text.AccessibleHeaderFooterView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //====  internal  =========================================================
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index dfc3159a89a3..f3e8e0c962f3 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <comphelper/sequence.hxx>
 #include <editeng/editobj.hxx>
 #include <svx/AccessibleTextHelper.hxx>
 #include <unotools/accessiblestatesethelper.hxx>
@@ -174,13 +175,8 @@ OUString SAL_CALL
 uno::Sequence< OUString> SAL_CALL
        ScAccessiblePageHeaderArea::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.sheet.AccessiblePageHeaderFooterAreasView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.sheet.AccessiblePageHeaderFooterAreasView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 6678f40cc7c3..e6d28dc83531 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -34,6 +34,7 @@
 #include <vcl/svapp.hxx>
 #include <toolkit/helper/convert.hxx>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <comphelper/sequence.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
@@ -177,13 +178,8 @@ OUString SAL_CALL ScAccessiblePreviewCell::getImplementationName()
 
 uno::Sequence<OUString> SAL_CALL ScAccessiblePreviewCell::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.table.AccessibleCellView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.table.AccessibleCellView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index ea6997331638..3f7c35c92826 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -30,6 +30,7 @@
 
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <comphelper/sequence.hxx>
 
 #include <vcl/window.hxx>
 #include <vcl/svapp.hxx>
@@ -258,13 +259,8 @@ OUString SAL_CALL ScAccessiblePreviewHeaderCell::getImplementationName()
 
 uno::Sequence<OUString> SAL_CALL ScAccessiblePreviewHeaderCell::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.table.AccessibleCellView";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.table.AccessibleCellView" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 44aa1edaa51c..553180e21e7a 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1268,13 +1268,8 @@ OUString SAL_CALL ScAccessibleSpreadsheet::getImplementationName()
 uno::Sequence< OUString> SAL_CALL
     ScAccessibleSpreadsheet::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSequence = ScAccessibleTableBase::getSupportedServiceNames();
-    sal_Int32 nOldSize(aSequence.getLength());
-    aSequence.realloc(nOldSize + 1);
-
-    aSequence[nOldSize] = "com.sun.star.AccessibleSpreadsheet";
-
-    return aSequence;
+    const css::uno::Sequence<OUString> vals { "com.sun.star.AccessibleSpreadsheet" };
+    return comphelper::concatSequences(ScAccessibleContextBase::getSupportedServiceNames(), vals);
 }
 
 //=====  XTypeProvider  =======================================================
diff --git a/sd/source/filter/html/HtmlOptionsDialog.cxx b/sd/source/filter/html/HtmlOptionsDialog.cxx
index 5db49c2af647..13e5cea52cca 100644
--- a/sd/source/filter/html/HtmlOptionsDialog.cxx
+++ b/sd/source/filter/html/HtmlOptionsDialog.cxx
@@ -117,8 +117,7 @@ sal_Bool SAL_CALL SdHtmlOptionsDialog::supportsService( const OUString& rService
 
 Sequence< OUString > SAL_CALL SdHtmlOptionsDialog::getSupportedServiceNames()
 {
-    Sequence< OUString > aRet { "com.sun.star.ui.dialog.FilterOptionsDialog" };
-    return aRet;
+  return { "com.sun.star.ui.dialog.FilterOptionsDialog" };
 }
 
 // XPropertyAccess
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index f042dc008543..18e92d383038 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -410,13 +410,12 @@ OUString SAL_CALL SdLayerManager::getImplementationName()
 
 sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName )
 {
-    return cppu::supportsService( this, ServiceName );
+ return cppu::supportsService( this, ServiceName );
 }
 
 uno::Sequence< OUString > SAL_CALL SdLayerManager::getSupportedServiceNames()
 {
-    uno::Sequence< OUString > aSeq { "com.sun.star.drawing.LayerManager" };
-    return aSeq;
+    return {"com.sun.star.drawing.LayerManager"};
 }
 
 // XLayerManager
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 4a4f09cd50e3..052460495200 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2009,8 +2009,7 @@ sal_Bool SAL_CALL SdPageLinkTargets::supportsService( const OUString& ServiceNam
 
 Sequence< OUString > SAL_CALL SdPageLinkTargets::getSupportedServiceNames()
 {
-    Sequence< OUString > aSeq { "com.sun.star.document.LinkTargets" };
-    return aSeq;
+  return { "com.sun.star.document.LinkTargets" };
 }
 
 // SdDrawPage


More information about the Libreoffice-commits mailing list