filter/source/msfilter/escherex.cxx          |   18 ++++++++++++------
 filter/source/pdf/impdialog.cxx              |   15 ++++++++-------
 reportdesign/source/filter/xml/xmlExport.cxx |   17 +++++++++++------
 3 files changed, 31 insertions(+), 19 deletions(-)

New commits:
commit edf82470de0f7796992666a0c2b5c56dc66c94fd
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sat Oct 16 10:15:30 2021 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sat Oct 16 18:13:05 2021 +0200

    Simplify vector initialization in filter
    
    Change-Id: I78653b32a5418e44733e3d2740a9a7dd784f17ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123686
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index fecb2fa45291..5ab075d6050a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1907,14 +1907,20 @@ bool EscherPropertyContainer::CreatePolygonProperties(
 
     const sal_uInt16 nPolyCount(aPolyPolygon.Count());
     sal_uInt32 nTotalPoints(0);
-    std::vector< sal_uInt8 > aVertices(4, 0);
-    std::vector< sal_uInt8 > aSegments(4, 0);
 
-    aVertices.push_back(static_cast<sal_uInt8>(0xf0));
-    aVertices.push_back(static_cast<sal_uInt8>(0xff));
+    std::vector< sal_uInt8 > aVertices
+    {
+        0, 0, 0, 0,
+        static_cast<sal_uInt8>(0xf0),
+        static_cast<sal_uInt8>(0xff)
+    };
 
-    aSegments.push_back(static_cast<sal_uInt8>(2));
-    aSegments.push_back(static_cast<sal_uInt8>(0));
+    std::vector< sal_uInt8 > aSegments
+    {
+        0, 0, 0, 0,
+        static_cast<sal_uInt8>(2),
+        static_cast<sal_uInt8>(0)
+    };
 
     for(sal_uInt16 j(0); j < nPolyCount; ++j)
     {
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index e15d8a4c9bdd..c1a3c94d5a85 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -449,13 +449,14 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
     maConfigItem.WriteBool( "EnableCopyingOfContent", mbCanCopyOrExtract );
     maConfigItem.WriteBool( "EnableTextAccessForAccessibilityTools", 
mbCanExtractForAccessibility );
 
-    std::vector<beans::PropertyValue> aRet;
-
-    aRet.push_back(comphelper::makePropertyValue("Watermark", 
maWatermarkText));
-    aRet.push_back(comphelper::makePropertyValue("EncryptFile", mbEncrypt));
-    aRet.push_back(comphelper::makePropertyValue("PreparedPasswords", 
mxPreparedPasswords));
-    aRet.push_back(comphelper::makePropertyValue("RestrictPermissions", 
mbRestrictPermissions));
-    aRet.push_back(comphelper::makePropertyValue("PreparedPermissionPassword", 
maPreparedOwnerPassword));
+    std::vector<beans::PropertyValue> aRet
+    {
+        comphelper::makePropertyValue("Watermark", maWatermarkText),
+        comphelper::makePropertyValue("EncryptFile", mbEncrypt),
+        comphelper::makePropertyValue("PreparedPasswords", 
mxPreparedPasswords),
+        comphelper::makePropertyValue("RestrictPermissions", 
mbRestrictPermissions),
+        comphelper::makePropertyValue("PreparedPermissionPassword", 
maPreparedOwnerPassword)
+    };
     if( mbIsRangeChecked )
         aRet.push_back(comphelper::makePropertyValue("PageRange", 
msPageRange));
     else if( mbSelectionIsChecked )
commit ac10792ed4ca8d92f60c95ab4acd5b911e42cec7
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sat Oct 16 10:16:17 2021 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sat Oct 16 18:12:49 2021 +0200

    Simplify vector initialization in reportdesign
    
    Change-Id: Ic1927155b23f056fc1117b7726ab4b2eff8a6da3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123690
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/reportdesign/source/filter/xml/xmlExport.cxx 
b/reportdesign/source/filter/xml/xmlExport.cxx
index d9a673e81250..df89720fe7c5 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <memory>
+#include <o3tl/safeint.hxx>
 #include "xmlExport.hxx"
 #include "xmlAutoStyle.hxx"
 #include <xmloff/xmltoken.hxx>
@@ -497,15 +498,19 @@ void ORptExport::exportSectionAutoStyle(const 
Reference<XSection>& _xProp)
     const sal_Int32 nOffset = 
rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN);
     const sal_Int32 nCount  = _xProp->getCount();
 
-    ::std::vector<sal_Int32> aColumnPos;
+    ::std::vector<sal_Int32> aColumnPos
+    {
+        nOffset,
+        aSize.Width - 
rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN)
+    };
     aColumnPos.reserve(2*(nCount + 1));
-    aColumnPos.push_back(nOffset);
-    aColumnPos.push_back(aSize.Width - 
rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN));
 
-    ::std::vector<sal_Int32> aRowPos;
+    ::std::vector<sal_Int32> aRowPos
+    {
+        0,
+        o3tl::narrowing<sal_Int32>(_xProp->getHeight())
+    };
     aRowPos.reserve(2*(nCount + 1));
-    aRowPos.push_back(0);
-    aRowPos.push_back(_xProp->getHeight());
 
 
     ::std::vector<sal_Int32> aRowPosAutoGrow;

Reply via email to