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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 9 17:58:57 UTC 2021


 sd/source/filter/xml/sdxmlwrp.cxx          |   15 ++++++++++-----
 sd/source/ui/dlg/TemplateScanner.cxx       |   16 +++-------------
 sd/source/ui/presenter/PresenterCanvas.cxx |   15 +++++++++------
 3 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit fca7d50b17fae217bd34e9e6f5e3a8b0fda93833
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Jun 9 18:27:28 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Jun 9 19:57:46 2021 +0200

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

diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 4bd5b043e089..9a6e8d9a9afe 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -1007,11 +1007,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportFODP(SvStream &rStream)
     uno::Reference<io::XInputStream> xStream(new ::utl::OSeekableInputStreamWrapper(rStream));
     uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW);
 
-    css::uno::Sequence<OUString> aUserData(7);
-    aUserData[0] = "com.sun.star.comp.filter.OdfFlatXml";
-    aUserData[2] = "com.sun.star.comp.Impress.XMLOasisImporter";
-    aUserData[3] = "com.sun.star.comp.Impress.XMLOasisExporter";
-    aUserData[6] = "true";
+    css::uno::Sequence<OUString> aUserData
+    {
+        "com.sun.star.comp.filter.OdfFlatXml",
+        "",
+        "com.sun.star.comp.Impress.XMLOasisImporter",
+        "com.sun.star.comp.Impress.XMLOasisExporter",
+        "",
+        "",
+        "true"
+    };
     uno::Sequence<beans::PropertyValue> aAdaptorArgs(comphelper::InitPropertySequence(
     {
         { "UserData", uno::Any(aUserData) },
diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx
index 4afc801df5f2..5d302c26156f 100644
--- a/sd/source/ui/dlg/TemplateScanner.cxx
+++ b/sd/source/ui/dlg/TemplateScanner.cxx
@@ -141,15 +141,10 @@ TemplateScanner::State TemplateScanner::InitializeEntryScanning()
     {
         mxEntryEnvironment.clear();
 
+        //  Create a cursor to iterate over the templates in this folders.
         //  We are interested only in three properties: the entry's name,
         //  its URL, and its content type.
-        Sequence<OUString> aProps (3);
-        aProps[0] = TITLE;
-        aProps[1] = "TargetURL";
-        aProps[2] = "TypeDescription";
-
-        //  Create a cursor to iterate over the templates in this folders.
-        mxEntryResultSet.set( maFolderContent.createCursor(aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY));
+        mxEntryResultSet.set( maFolderContent.createCursor({ TITLE, "TargetURL", "TypeDescription" }, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY));
     }
     else
         eNextState = ERROR;
@@ -218,13 +213,8 @@ TemplateScanner::State TemplateScanner::InitializeFolderScanning()
         mxFolderEnvironment.clear();
         ::ucbhelper::Content aTemplateDir (mxTemplateRoot, mxFolderEnvironment, comphelper::getProcessComponentContext());
 
-        //  Define the list of properties we are interested in.
-        Sequence<OUString> aProps (2);
-        aProps[0] = TITLE;
-        aProps[1] = "TargetDirURL";
-
         //  Create a cursor to iterate over the template folders.
-        mxFolderResultSet.set( aTemplateDir.createCursor(aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY));
+        mxFolderResultSet.set( aTemplateDir.createCursor({ TITLE, "TargetDirURL" }, ::ucbhelper::INCLUDE_FOLDERS_ONLY));
         if (mxFolderResultSet.is())
             eNextState = GATHER_FOLDER_LIST;
     }
diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx
index f1f2271a1098..d657d6f37596 100644
--- a/sd/source/ui/presenter/PresenterCanvas.cxx
+++ b/sd/source/ui/presenter/PresenterCanvas.cxx
@@ -660,12 +660,15 @@ Reference<rendering::XPolyPolygon2D> PresenterCanvas::UpdateSpriteClip (
     else
     {
         // Create a new clip polygon from the window clip rectangle.
-        Sequence<Sequence<geometry::RealPoint2D> > aPoints (1);
-        aPoints[0] = Sequence<geometry::RealPoint2D>(4);
-        aPoints[0][0] = geometry::RealPoint2D(nMinX,nMinY);
-        aPoints[0][1] = geometry::RealPoint2D(nMaxX,nMinY);
-        aPoints[0][2] = geometry::RealPoint2D(nMaxX,nMaxY);
-        aPoints[0][3] = geometry::RealPoint2D(nMinX,nMaxY);
+        Sequence<Sequence<geometry::RealPoint2D> > aPoints
+        {
+            {
+                { nMinX,nMinY },
+                { nMaxX,nMinY },
+                { nMaxX,nMaxY },
+                { nMinX,nMaxY }
+            }
+        };
         Reference<rendering::XLinePolyPolygon2D> xLinePolygon(
             xDevice->createCompatibleLinePolyPolygon(aPoints));
         if (xLinePolygon.is())


More information about the Libreoffice-commits mailing list