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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 9 05:44:23 UTC 2021


 reportdesign/source/core/api/ReportDefinition.cxx         |   13 ++-----------
 reportdesign/source/core/api/Shape.cxx                    |    6 +-----
 reportdesign/source/ui/inspection/DataProviderHandler.cxx |    3 +--
 reportdesign/source/ui/inspection/GeometryHandler.cxx     |   14 ++++++++------
 4 files changed, 12 insertions(+), 24 deletions(-)

New commits:
commit bd536744ec947090819d59e0f0ec9f2c454aa428
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Jun 8 22:00:41 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Jun 9 07:43:32 2021 +0200

    Simplify Sequences initializations (reportdesign)
    
    Change-Id: I06f2675ee1270f04c6107761fbfc26a5570cc9c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116866
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 2fda942e438b..fd6bf1bb56c1 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1926,10 +1926,7 @@ void SAL_CALL OReportDefinition::setMimeType( const OUString& _mimetype )
 
 uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableMimeTypes(  )
 {
-    uno::Sequence< OUString > s_aList(2);
-    s_aList[0] = MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII;
-    s_aList[1] = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII;
-    return s_aList;
+    return { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII, MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII };
 }
 
 // css::XUnoTunnel
@@ -2649,13 +2646,7 @@ uno::Any SAL_CALL OReportDefinition::getTransferData( const datatransfer::DataFl
 
 uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransferDataFlavors(  )
 {
-    uno::Sequence< datatransfer::DataFlavor > aRet(1);
-
-    aRet[0] = datatransfer::DataFlavor( "image/png",
-        "PNG",
-        cppu::UnoType<uno::Sequence< sal_Int8 >>::get() );
-
-    return aRet;
+    return { { "image/png", "PNG", cppu::UnoType<uno::Sequence< sal_Int8 >>::get() } };
 }
 
 sal_Bool SAL_CALL OReportDefinition::isDataFlavorSupported( const datatransfer::DataFlavor& aFlavor )
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
index 8c37f99afda9..464d7ac46cbc 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -137,11 +137,7 @@ uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames(  )
     }
     else
     {
-        uno::Sequence< OUString > aServices(2);
-        aServices.getArray()[0] = SERVICE_SHAPE;
-        aServices.getArray()[1] = m_sServiceName;
-
-        return aServices;
+        return { SERVICE_SHAPE, m_sServiceName };
     }
 }
 
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index dd770ff9fd5b..ef1c58ada24f 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -226,8 +226,7 @@ void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
         OUString sStr;
         _aValue >>= sStr;
         xFormatted->setString(sStr);
-        uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1);
-        aArgs[0] = xFormatted;
+        uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs { xFormatted };
         xTitle->setText(aArgs);
     }
 }
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 512b6837be30..280e9060e67f 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1354,12 +1354,14 @@ uno::Sequence< OUString > SAL_CALL GeometryHandler::getActuatingProperties()
 {
     ::osl::MutexGuard aGuard( m_aMutex );
 
-    uno::Sequence< OUString > aSeq(5);
-    aSeq[0] = PROPERTY_BACKTRANSPARENT;
-    aSeq[1] = PROPERTY_CONTROLBACKGROUNDTRANSPARENT;
-    aSeq[2] = PROPERTY_FORMULALIST;
-    aSeq[3] = PROPERTY_TYPE;
-    aSeq[4] = PROPERTY_DATAFIELD;
+    uno::Sequence< OUString > aSeq
+    {
+        PROPERTY_BACKTRANSPARENT,
+        PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
+        PROPERTY_FORMULALIST,
+        PROPERTY_TYPE,
+        PROPERTY_DATAFIELD
+    };
 
     return ::comphelper::concatSequences(m_xFormComponentHandler->getActuatingProperties(),aSeq);
 }


More information about the Libreoffice-commits mailing list