[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0-29' - 21 commits - download.lst external/curl external/expat external/icu external/libabw external/libvisio external/libxml2 external/libxslt external/nss external/poppler forms/source sc/source sdext/source shell/source solenv/flatpak-manifest.in sw/inc sw/qa sw/source vcl/headless vcl/source writerfilter/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 23 20:44:05 UTC 2020


 download.lst                                                                       |   32 
 external/curl/zlib.patch.0                                                         |   10 
 external/expat/ExternalProject_expat.mk                                            |    2 
 external/expat/StaticLibrary_expat.mk                                              |    1 
 external/expat/StaticLibrary_expat_x64.mk                                          |    1 
 external/expat/UnpackedTarball_expat.mk                                            |    1 
 external/expat/expat-winapi.patch                                                  |   18 
 external/icu/ExternalProject_icu.mk                                                |    5 
 external/icu/UnpackedTarball_icu.mk                                                |    1 
 external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2                      |   37 
 external/libabw/UnpackedTarball_libabw.mk                                          |    4 
 external/libabw/libabw-msvc.patch.1                                                |   46 
 external/libvisio/0001-fix-debug-build.patch.1                                     |   40 
 external/libvisio/UnpackedTarball_libvisio.mk                                      |    1 
 external/libvisio/ubsan.patch                                                      |    4 
 external/libxml2/libxml2-android.patch                                             |    2 
 external/libxml2/libxml2-config.patch.1                                            |   46 
 external/libxslt/UnpackedTarball_libxslt.mk                                        |    2 
 external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1                  |  120 --
 external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1                  |   69 +
 external/libxslt/libxslt-config.patch.1                                            |   18 
 external/libxslt/libxslt-internal-symbols.patch.1                                  |    8 
 external/nss/UnpackedTarball_nss.mk                                                |    2 
 external/nss/clang-cl.patch.0                                                      |   16 
 external/nss/nss-chromium-nss-static.patch                                         |  487 ----------
 external/nss/nss-more-static.patch                                                 |   39 
 external/nss/nss.aix.patch                                                         |    2 
 external/nss/nss.patch                                                             |   27 
 external/nss/nss.vs2015.pdb.patch                                                  |    4 
 external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1        |   27 
 external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 |  169 +++
 external/poppler/StaticLibrary_poppler.mk                                          |    1 
 external/poppler/UnpackedTarball_poppler.mk                                        |    4 
 external/poppler/poppler-config.patch.1                                            |   19 
 forms/source/xforms/submission.cxx                                                 |    3 
 forms/source/xforms/submission/submission.hxx                                      |    6 
 sc/source/ui/docshell/docsh.cxx                                                    |   13 
 sc/source/ui/docshell/docsh4.cxx                                                   |   61 -
 sc/source/ui/docshell/externalrefmgr.cxx                                           |    9 
 sc/source/ui/inc/docsh.hxx                                                         |    2 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx                              |   25 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx                              |   14 
 shell/source/win32/SysShExec.cxx                                                   |    5 
 solenv/flatpak-manifest.in                                                         |   12 
 sw/inc/anchoredobject.hxx                                                          |    1 
 sw/qa/extras/ooxmlexport/data/tdf116194.docx                                       |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx                                         |    9 
 sw/source/core/inc/layouter.hxx                                                    |    4 
 sw/source/core/layout/anchoredobject.cxx                                           |    9 
 sw/source/core/layout/fly.cxx                                                      |    2 
 sw/source/core/layout/layouter.cxx                                                 |   15 
 sw/source/core/layout/objstmpconsiderwrapinfl.cxx                                  |   27 
 sw/source/core/layout/objstmpconsiderwrapinfl.hxx                                  |    1 
 sw/source/core/layout/ssfrm.cxx                                                    |    5 
 sw/source/filter/ww8/ww8par.hxx                                                    |    2 
 sw/source/filter/ww8/ww8par2.cxx                                                   |   47 
 vcl/headless/svpgdi.cxx                                                            |   10 
 vcl/source/gdi/CommonSalLayout.cxx                                                 |    8 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx                           |   37 
 writerfilter/source/dmapper/DomainMapperTableManager.hxx                           |    3 
 writerfilter/source/dmapper/TableData.hxx                                          |   11 
 writerfilter/source/dmapper/TableManager.cxx                                       |   20 
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx                              |    4 
 writerfilter/source/ooxml/model.xml                                                |    5 
 64 files changed, 652 insertions(+), 983 deletions(-)

New commits:
commit a47e7c93915396380fa1512d1cf6addb30b0e4cc
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Mon Dec 2 19:02:43 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:09:54 2020 +0200

    tdf#116194 DOCX import: fix missing tables with w:gridBefore
    
    Regression from the commit cf33af732ed0d3d553bb74636e3b14c55d44c153
    "handle w:gridBefore by faking cells (fdo#38414)"
    
    This patch replaces the previous fix with a better solution,
    fixing tdf#38414 on the proposed DomainMapper level. (Note:
    to reject the old fix completely, its follow-up commit w:gridAfter
    will be handled in a similar way.)
    
    Now the related regressions, tdf#111679, tdf#120512 and the complex
    forms of tdf#116194, tdf120256 and tdf#122608 are fixed, too.
    
    Reviewed-on: https://gerrit.libreoffice.org/84263
    Reviewed-by: László Németh <nemeth at numbertext.org>
    Tested-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit da1f71edfc72928b07a569b98e2766a8a7de9d2a)
    Reviewed-on: https://gerrit.libreoffice.org/84711
    Tested-by: Jenkins
    
    Change-Id: Id25f5fb4d9021c87ee8c82782b2038e6fb255673

diff --git a/sw/qa/extras/ooxmlexport/data/tdf116194.docx b/sw/qa/extras/ooxmlexport/data/tdf116194.docx
new file mode 100644
index 000000000000..feec3ee9870f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf116194.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 599cdf806cce..beb7c1fbde32 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -528,6 +528,15 @@ DECLARE_OOXMLEXPORT_TEST(testGridBefore, "gridbefore.docx")
     CPPUNIT_ASSERT( leftA3.toInt32() > leftB2.toInt32());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf116194, "tdf116194.docx")
+{
+    // The problem was that the importer lost consecutive tables with w:gridBefore
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl", 2);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx")
 {
     uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 50b7ea040b3f..1a0469060669 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -44,7 +44,7 @@ DomainMapperTableManager::DomainMapperTableManager() :
     m_nRow(0),
     m_nCell(),
     m_nGridSpan(1),
-    m_nGridBefore(0),
+    m_aGridBefore(),
     m_nGridAfter(0),
     m_nHeaderRepeat(0),
     m_nTableWidth(0),
@@ -364,7 +364,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
                 }
                 break;
             case NS_ooxml::LN_CT_TrPrBase_gridBefore:
-                m_nGridBefore = nIntValue;
+                m_aGridBefore.back( ) = nIntValue;
                 break;
             case NS_ooxml::LN_CT_TrPrBase_gridAfter:
                 m_nGridAfter = nIntValue;
@@ -404,6 +404,11 @@ std::shared_ptr< vector<sal_Int32> > DomainMapperTableManager::getCurrentGrid( )
     return m_aTableGrid.back( );
 }
 
+sal_uInt32 DomainMapperTableManager::getCurrentGridBefore( )
+{
+    return m_aGridBefore.back( );
+}
+
 bool DomainMapperTableManager::hasCurrentSpans() const
 {
     return !m_aGridSpans.empty();
@@ -466,6 +471,7 @@ void DomainMapperTableManager::startLevel( )
     m_aTmpPosition.push_back( pTmpPosition );
     m_aTmpTableProperties.push_back( pTmpProperties );
     m_nCell.push_back( 0 );
+    m_aGridBefore.push_back( 0 );
     m_nTableWidth = 0;
     m_nLayoutType = 0;
 
@@ -495,6 +501,7 @@ void DomainMapperTableManager::endLevel( )
         m_aCellWidths.back()->push_back(*oCurrentWidth);
 
     m_nCell.pop_back( );
+    m_aGridBefore.pop_back( );
     m_nTableWidth = 0;
     m_nLayoutType = 0;
 
@@ -550,6 +557,7 @@ void DomainMapperTableManager::endOfRowAction()
         IntVectorPtr pTmpGridSpans = m_aGridSpans.back();
         IntVectorPtr pTmpCellWidths = m_aCellWidths.back();
         sal_uInt32 nTmpCell = m_nCell.back();
+        sal_uInt32 nTmpGridBefore = m_aGridBefore.back();
 
         // endLevel and startLevel are taking care of the non finished row
         // to carry it over to the next table
@@ -562,10 +570,12 @@ void DomainMapperTableManager::endOfRowAction()
         m_aGridSpans.pop_back();
         m_aCellWidths.pop_back();
         m_nCell.pop_back();
+        m_aGridBefore.pop_back();
         m_aTableGrid.push_back(pTmpTableGrid);
         m_aGridSpans.push_back(pTmpGridSpans);
         m_aCellWidths.push_back(pTmpCellWidths);
         m_nCell.push_back(nTmpCell);
+        m_aGridBefore.push_back(nTmpGridBefore);
     }
 
     // Push the tmp position now that we compared it
@@ -608,10 +618,16 @@ void DomainMapperTableManager::endOfRowAction()
     }
 
     IntVectorPtr pCurrentSpans = getCurrentSpans( );
-    if( pCurrentSpans->size() < m_nCell.back( ) )
+
+    if( m_aGridBefore.back() > 0 )
+    {
+        //fill missing gridBefore elements with '1'
+        pCurrentSpans->insert( pCurrentSpans->begin( ), m_aGridBefore.back(), 1 );
+    }
+    if( pCurrentSpans->size() < m_aGridBefore.back() + m_nCell.back( ))
     {
         //fill missing elements with '1'
-        pCurrentSpans->insert( pCurrentSpans->end( ), m_nCell.back( ) - pCurrentSpans->size(), 1 );
+        pCurrentSpans->insert( pCurrentSpans->end( ), m_aGridBefore.back() + m_nCell.back( ) - pCurrentSpans->size(), 1 );
     }
 
 #ifdef DEBUG_WRITERFILTER
@@ -646,7 +662,7 @@ void DomainMapperTableManager::endOfRowAction()
     for (sal_Int32 i : (*pTableGrid.get()))
         nFullWidthRelative += i;
 
-    if( pTableGrid->size() == ( m_nGridBefore + nGrids + m_nGridAfter ) && m_nCell.back( ) > 0 )
+    if( pTableGrid->size() == ( nGrids + m_nGridAfter ) && m_nCell.back( ) > 0 )
     {
         /*
          * If table width property set earlier is smaller than the current table width,
@@ -668,12 +684,12 @@ void DomainMapperTableManager::endOfRowAction()
                 pTablePropMap->setValue(TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::FIX);
             }
         }
-        uno::Sequence< text::TableColumnSeparator > aSeparators( m_nCell.back( ) - 1 );
+        uno::Sequence< text::TableColumnSeparator > aSeparators( m_aGridBefore.back() + m_nCell.back( ) - 1 );
         text::TableColumnSeparator* pSeparators = aSeparators.getArray();
         sal_Int16 nLastRelPos = 0;
-        sal_uInt32 nBorderGridIndex = m_nGridBefore;
+        sal_uInt32 nBorderGridIndex = 0;
 
-        size_t nWidthsBound =  m_nCell.back( ) - 1;
+        size_t nWidthsBound = m_aGridBefore.back() + m_nCell.back() - 1;
         if (nWidthsBound)
         {
             if (nFullWidthRelative == 0)
@@ -706,7 +722,7 @@ void DomainMapperTableManager::endOfRowAction()
     }
     else if ( pCellWidths->size() > 0 &&
                ( m_nLayoutType == NS_ooxml::LN_Value_doc_ST_TblLayout_fixed
-                 || pCellWidths->size() == ( m_nGridBefore + nGrids + m_nGridAfter ) )
+                 || pCellWidths->size() == ( nGrids + m_nGridAfter ) )
              )
     {
         // If we're here, then the number of cells does not equal to the amount
@@ -760,11 +776,12 @@ void DomainMapperTableManager::endOfRowAction()
 
     ++m_nRow;
     m_nCell.back( ) = 0;
+    m_aGridBefore.back( ) = 0;
     getCurrentGrid()->clear();
     pCurrentSpans->clear();
     pCellWidths->clear();
 
-    m_nGridBefore = m_nGridAfter = 0;
+    m_nGridAfter = 0;
     m_bRowSizeTypeInserted = false;
     m_bHasBtlrCell = false;
     m_bTableSizeTypeInserted = false;
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index f19eb467e12e..6d8abe7ed350 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -42,7 +42,7 @@ class DomainMapperTableManager : public TableManager
     sal_uInt32      m_nRow;
     ::std::vector< sal_uInt32 > m_nCell;
     sal_uInt32      m_nGridSpan;
-    sal_uInt32      m_nGridBefore; ///< number of grid columns in the parent table's table grid which must be skipped before the contents of this table row are added to the parent table
+    ::std::vector< sal_uInt32 > m_aGridBefore; ///< number of grid columns in the parent table's table grid which must be skipped before the contents of this table row are added to the parent table
     sal_uInt32      m_nGridAfter; ///< number of grid columns in the parent table's table grid which shall be left after the last cell in the table row
     sal_Int32       m_nHeaderRepeat; //counter of repeated headers - if == -1 then the repeating stops
     sal_Int32       m_nTableWidth; //might be set directly or has to be calculated from the column positions
@@ -98,6 +98,7 @@ public:
     bool hasCurrentSpans() const;
     IntVectorPtr getCurrentSpans( );
     IntVectorPtr getCurrentCellWidths( );
+    sal_uInt32 getCurrentGridBefore( );
 
     /// Turn the attributes collected so far in m_aTableLook into a property and clear the container.
     void finishTableLook();
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index cd17c007b3e3..33173ffcd41b 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -131,11 +131,18 @@ public:
        @param start     the start handle of the cell
        @param end       the end handle of the cell
        @param pProps    the properties of the cell
+       @param bAddBefore true: add an empty cell at beginning of the row for gridBefore
      */
-    void addCell(const css::uno::Reference<css::text::XTextRange>& start, TablePropertyMapPtr pProps)
+    void addCell(const css::uno::Reference<css::text::XTextRange>& start, TablePropertyMapPtr pProps, bool bAddBefore = false)
     {
         CellData::Pointer_t pCellData(new CellData(start, pProps));
-        mCells.push_back(pCellData);
+        if (bAddBefore)
+        {
+            mCells.insert(mCells.begin(), pCellData);
+            mCells[0]->setEnd(start);
+        }
+        else
+            mCells.push_back(pCellData);
     }
 
     void endCell(const css::uno::Reference<css::text::XTextRange>& end)
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index d9245678d5dc..f8789756d0a0 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -421,6 +421,26 @@ void TableManager::endRow()
 #ifdef DEBUG_WRITERFILTER
     TagLogger::getInstance().element("tablemanager.endRow");
 #endif
+    TableData::Pointer_t pTableData = mTableDataStack.top();
+
+    // Add borderless w:gridBefore cell(s) to the row
+    if (pTableData)
+    {
+        sal_uInt32 nGridBefore = mpTableDataHandler->getDomainMapperImpl().getTableManager().getCurrentGridBefore();
+        for (unsigned int i = 0; i < nGridBefore; ++i)
+        {
+            css::table::BorderLine2 aBorderLine;
+            aBorderLine.Color = 0;
+            aBorderLine.InnerLineWidth = 0;
+            aBorderLine.OuterLineWidth = 0;
+            TablePropertyMapPtr pCellProperties(new TablePropertyMap);
+            pCellProperties->Insert(PROP_TOP_BORDER, css::uno::makeAny(aBorderLine));
+            pCellProperties->Insert(PROP_LEFT_BORDER, css::uno::makeAny(aBorderLine));
+            pCellProperties->Insert(PROP_BOTTOM_BORDER, css::uno::makeAny(aBorderLine));
+            pCellProperties->Insert(PROP_RIGHT_BORDER, css::uno::makeAny(aBorderLine));
+            pTableData->getCurrentRow()->addCell(pTableData->getCurrentRow()->getCellStart(0), pCellProperties, /*bAddBefore=*/true);
+        }
+    }
 
     setRowEnd(true);
 }
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 44d2adace341..687d13d91c9a 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1488,6 +1488,10 @@ OOXMLValue::Pointer_t fakeNoBorder()
 // not insane enough to find out how to add cells in dmapper.
 void OOXMLFastContextHandlerTextTableRow::handleGridBefore( const OOXMLValue::Pointer_t& val )
 {
+    // start removing: disable for w:gridBefore
+    if (!mpGridAfter)
+        return;
+
     int count = val->getInt();
     for( int i = 0;
          i < count;
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 36328c035d75..0b55c895e9be 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -14425,7 +14425,7 @@
             <ref name="CT_DecimalNumber"/>
           </element>
           <element name="gridBefore">
-            <ref name="CT_TrPrBaseGridBefore"/>
+            <ref name="CT_DecimalNumber"/>
           </element>
           <element name="gridAfter">
             <ref name="CT_TrPrBaseGridAfter"/>
@@ -18381,6 +18381,7 @@
     <resource name="CT_TrPrBase" resource="Properties">
       <element name="cnfStyle" tokenid="ooxml:CT_TrPrBase_cnfStyle"/>
       <element name="divId" tokenid="ooxml:CT_TrPrBase_divId"/>
+      <element name="gridBefore" tokenid="ooxml:CT_TrPrBase_gridBefore"/>
       <element name="wBefore" tokenid="ooxml:CT_TrPrBase_wBefore"/>
       <element name="wAfter" tokenid="ooxml:CT_TrPrBase_wAfter"/>
       <element name="cantSplit" tokenid="ooxml:CT_TrPrBase_cantSplit"/>
@@ -18391,7 +18392,7 @@
       <element name="hidden" tokenid="ooxml:CT_TrPrBase_hidden"/>
     </resource>
     <resource name="CT_TrPrBaseGridBefore" resource="TextTableRow">
-      <attribute name="val" tokenid="ooxml:CT_TrPrBase_gridBefore" action="handleGridBefore"/>
+      <attribute name="val" tokenid="ooxml:CT_TrPrBase_gridBefore"/>
     </resource>
     <resource name="CT_TrPrBaseGridAfter" resource="TextTableRow">
       <attribute name="val" tokenid="ooxml:CT_TrPrBase_gridAfter" action="handleGridAfter"/>
commit 4fd3dd2c27b88f794e0cb0b92d2f87b12a1d1dca
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Nov 25 12:34:28 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    nss: upgrade to release 3.47.1
    
    Fixes CVE-2019-11745.
    
    Remove nss.fix-freebl-add-lcc-support.patch.1, fixed upstream.
    
    Reviewed-on: https://gerrit.libreoffice.org/83673
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit a6238c3fba80889f9090d997e2a4979b78b34ac7)
    
    Change-Id: I72e35c90fabb0a83f547a787dbaee774e35f9c08

diff --git a/download.lst b/download.lst
index fb2ddf7fc966..803b6de0e59b 100644
--- a/download.lst
+++ b/download.lst
@@ -195,8 +195,8 @@ export MYTHES_SHA256SUM := 1e81f395d8c851c3e4e75b568e20fa2fa549354e75ab397f9de4b
 export MYTHES_TARBALL := a8c2c5b8f09e7ede322d5c602ff6a4b6-mythes-1.2.4.tar.gz
 export NEON_SHA256SUM := db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca
 export NEON_TARBALL := neon-0.30.2.tar.gz
-export NSS_SHA256SUM := fae11751100510d26f16a245f0db9a5b3d638ab28ce0bccd50d4314f7e526ba1
-export NSS_TARBALL := nss-3.45-with-nspr-4.21.tar.gz
+export NSS_SHA256SUM := 07d4276168f59bb3038c7826dabb5fbfbab8336ddf65e4e6e43bce89ada78c64
+export NSS_TARBALL := nss-3.47.1-with-nspr-4.23.tar.gz
 export ODFGEN_SHA256SUM := 2c7b21892f84a4c67546f84611eccdad6259875c971e98ddb027da66ea0ac9c2
 export ODFGEN_VERSION_MICRO := 6
 export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 195e57197425..f1c025093216 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -22,7 +22,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
 		external/nss/nss.vs2015.patch) \
     external/nss/ubsan.patch.0 \
     external/nss/clang-cl.patch.0 \
-    external/nss/nss.fix-freebl-add-lcc-support.patch.1 \
     $(if $(filter IOS,$(OS)), \
         external/nss/nss-ios.patch) \
 	$(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
diff --git a/external/nss/clang-cl.patch.0 b/external/nss/clang-cl.patch.0
index 111ec934d147..1d615c2397d8 100644
--- a/external/nss/clang-cl.patch.0
+++ b/external/nss/clang-cl.patch.0
@@ -22,7 +22,7 @@
 +     defined(_M_ARM64)) && !defined __clang__
  # include <intrin.h>
  # pragma  intrinsic(_BitScanForward,_BitScanReverse)
-   __forceinline static int __prBitScanForward32(unsigned int val)
+ __forceinline static int __prBitScanForward32(unsigned int val)
 @@ -32,7 +32,7 @@
  # define pr_bitscan_ctz32(val)  __prBitScanForward32(val)
  # define pr_bitscan_clz32(val)  __prBitScanReverse32(val)
diff --git a/external/nss/nss.aix.patch b/external/nss/nss.aix.patch
index da9aacb10e84..4b0c6bfb3261 100644
--- a/external/nss/nss.aix.patch
+++ b/external/nss/nss.aix.patch
@@ -38,7 +38,7 @@ diff -ru a/nspr/pr/src/Makefile.in b/nspr/pr/src/Makefile.in
 --- a/a/nspr/pr/src/Makefile.in	2014-09-29 16:46:35.281395079 +0100
 +++ b/b/nspr/pr/src/Makefile.in	2014-09-29 16:50:33.909375948 +0100
 @@ -74,7 +74,6 @@
- endif
+ endif	# SunOS
  
  ifeq ($(OS_ARCH),AIX)
 -DSO_LDOPTS	+= -binitfini::_PR_Fini
diff --git a/external/nss/nss.fix-freebl-add-lcc-support.patch.1 b/external/nss/nss.fix-freebl-add-lcc-support.patch.1
deleted file mode 100644
index 3e3c06327dde..000000000000
--- a/external/nss/nss.fix-freebl-add-lcc-support.patch.1
+++ /dev/null
@@ -1,11 +0,0 @@
---- b/nss/lib/freebl/Makefile
-+++ a/nss/lib/freebl/Makefile
-@@ -495,7 +495,7 @@
- ifdef USE_64
- # no __int128 at least up to lcc 1.23 (pretending to be gcc5)
- # NB: CC_NAME is not defined here
--ifneq ($(shell $(CC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q'),lcc)
-+ifneq ($(shell $(CC) -? 2>&1 >/dev/null </dev/null | sed -e 's/:.*//;1q'),lcc)
-     ifdef CC_IS_CLANG
-             HAVE_INT128_SUPPORT = 1
-             DEFINES += -DHAVE_INT128_SUPPORT
diff --git a/external/nss/nss.patch b/external/nss/nss.patch
index c367bce9097b..d9aaee5199bb 100644
--- a/external/nss/nss.patch
+++ b/external/nss/nss.patch
@@ -12,14 +12,14 @@
 --- a/nss.orig/nspr/pr/src/misc/prnetdb.c	2017-08-29 23:44:13.690045031 +0530
 +++ b/nss/nspr/pr/src/misc/prnetdb.c	2017-08-29 23:47:03.810814019 +0530
 @@ -438,7 +438,7 @@
- 	char *buf = *bufp;
- 	PRIntn buflen = *buflenp;
+     char *buf = *bufp;
+     PRIntn buflen = *buflenp;
  
--	if (align && ((long)buf & (align - 1))) {
-+	if (align && ((ptrdiff_t)buf & (align - 1))) {
- 		PRIntn skip = align - ((ptrdiff_t)buf & (align - 1));
- 		if (buflen < skip) {
- 			return 0;
+-    if (align && ((long)buf & (align - 1))) {
++    if (align && ((ptrdiff_t)buf & (align - 1))) {
+         PRIntn skip = align - ((ptrdiff_t)buf & (align - 1));
+         if (buflen < skip) {
+             return 0;
 --- a/a/nss/cmd/platlibs.mk	2017-08-29 23:44:13.554044416 +0530
 +++ b/b/nss/cmd/platlibs.mk	2017-08-29 23:46:09.638569150 +0530
 @@ -10,17 +10,22 @@
diff --git a/external/nss/nss.vs2015.pdb.patch b/external/nss/nss.vs2015.pdb.patch
index dc4f4638b476..c66940132cdd 100644
--- a/external/nss/nss.vs2015.pdb.patch
+++ b/external/nss/nss.vs2015.pdb.patch
@@ -18,5 +18,5 @@ diff -ru nss.orig/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk
 -	OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
 +	OPTIMIZER += -Zi -Fd./ -Od
  	NULLSTRING :=
- 	SPACE      := $(NULLSTRING) # end of the line
- 	USERNAME   := $(subst $(SPACE),_,$(USERNAME))
+ 	DEFINES    += -DDEBUG -UNDEBUG
+ 	DLLFLAGS   += -DEBUG -OUT:$@
commit 660974818f774e0b48a069879e3627dee40cef15
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Sun Jun 2 10:00:41 2019 +0800
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    tdf#107487 fix font fallback for non-BMP characters.
    
    Non-BMP characters use two sal_Unicodes. It is necessary
    to advnace with OUString::iterateCodePoints safely instead of
    nCharPos + 1.
    
    Change-Id: Iea1005f05421b1021a9b3ff611439357d4dcba9e
    Reviewed-on: https://gerrit.libreoffice.org/73326
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    (cherry picked from commit 16faad3657fad114aa984f92a14a5f212a2f8ff5)
    Reviewed-on: https://gerrit.libreoffice.org/80467
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 3a7969547742..88e97527ab5c 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -440,12 +440,14 @@ void CommonSalLayout::SetNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nCharPos,
     //mark all glyphs as missing so the whole thing is rendered with the same
     //font
     sal_Int32 nDone;
-    sal_Int32 nGraphemeStartPos =
-        mxBreak->previousCharacters(rArgs.mrStr, nCharPos + 1, aLocale,
-            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
     sal_Int32 nGraphemeEndPos =
         mxBreak->nextCharacters(rArgs.mrStr, nCharPos, aLocale,
             i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+    // Safely advance nCharPos in case it is a non-BMP character.
+    rArgs.mrStr.iterateCodePoints(&nCharPos);
+    sal_Int32 nGraphemeStartPos =
+        mxBreak->previousCharacters(rArgs.mrStr, nCharPos, aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
 
     rArgs.NeedFallback(nGraphemeStartPos, nGraphemeEndPos, bRightToLeft);
 }
commit 97a213b10b935d349715bcce3919b9ed7ee9d24a
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jul 18 14:07:06 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    sw: fix use after free on tdf117215-1.odt
    
    Move the fix from 6d0ea082889c89eb8b408779f2de08da7441ff54 to
    SwFlyFrame::DestroyImpl() so we unregister every SwFlyFrame.
    
    ==1550==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000383f56 at pc 0x7efcd70d5ab9 bp 0x7ffeb7ac7c40 sp 0x7ffeb7ac7c38
    WRITE of size 1 at 0x615000383f56 thread T0
        0 SwAnchoredObject::SetTmpConsiderWrapInfluence(bool) sw/source/core/layout/anchoredobject.cxx:743:32
        1 SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() sw/source/core/layout/objstmpconsiderwrapinfl.cxx:53:23
        2 SwLayouter::ClearObjsTmpConsiderWrapInfluence(SwDoc const&) sw/source/core/layout/layouter.cxx:387:84
        3 sw::DocumentLayoutManager::ClearSwLayouterEntries() sw/source/core/doc/DocumentLayoutManager.cxx:497:5
        4 sw::DocumentStateManager::SetModified() sw/source/core/doc/DocumentStateManager.cxx:45:39
        5 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) sw/source/core/doc/DocumentContentOperationsManager.cxx:3942:36
    
    0x615000383f56 is located 342 bytes inside of 504-byte region [0x615000383e00,0x615000383ff8)
    freed by thread T0 here:
        1 SwFlyAtContentFrame::~SwFlyAtContentFrame() sw/source/core/inc/flyfrms.hxx:159:7
        2 SwFrame::DestroyFrame(SwFrame*) sw/source/core/layout/ssfrm.cxx:389:9
        3 SwFrameFormat::DelFrames() sw/source/core/layout/atrfrm.cxx:2624:17
        4 SwUndoFlyBase::DelFly(SwDoc*) sw/source/core/undo/undobj1.cxx:161:19
        5 SwUndoDelLayFormat::SwUndoDelLayFormat(SwFrameFormat*) sw/source/core/undo/undobj1.cxx:403:5
        6 SwHistoryTextFlyCnt::SwHistoryTextFlyCnt(SwFrameFormat*) sw/source/core/undo/rolbck.cxx:538:20
        7 SwHistory::Add(SwFlyFrameFormat&, unsigned short&) sw/source/core/undo/rolbck.cxx:1083:50
        8 SwUndoSaveContent::DelContentIndex(SwPosition const&, SwPosition const&, DelContentType) sw/source/core/undo/undobj.cxx:1020:39
        9 SwUndoDelete::SwUndoDelete(SwPaM&, bool, bool) sw/source/core/undo/undel.cxx:229:9
        11 sw::DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM&) sw/source/core/doc/DocumentContentOperationsManager.cxx:3939:55
    
    Change-Id: Ia0c28c9d5792615cbb566e502374efd0f4056daf
    Reviewed-on: https://gerrit.libreoffice.org/75857
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit dea72ef111ee8a0b1b178f8cd48757514d5ca831)
    Reviewed-on: https://gerrit.libreoffice.org/75941
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 4b9324b93dcbd72c8c8949309d45790dd8f7d5fd)
    Reviewed-on: https://gerrit.libreoffice.org/76306
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 00c4ae49aa88319660b9201e8e5d8393953fa1ed)

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index acd348b096a5..e2a4605e8d65 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -270,6 +270,8 @@ void SwFlyFrame::DestroyImpl()
 
     if( GetFormat() && !GetFormat()->GetDoc()->IsInDtor() )
     {
+        ClearTmpConsiderWrapInfluence(); // remove this from SwLayouter
+
         // OD 2004-01-19 #110582#
         Unchain();
 
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index ab584d14db31..43237173c224 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -512,7 +512,6 @@ void SwLayoutFrame::DestroyImpl()
                 const size_t nCnt = pFrame->GetDrawObjs()->size();
                 // #i28701#
                 SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[0];
-                pAnchoredObj->ClearTmpConsiderWrapInfluence();
                 if (SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj))
                 {
                     SwFrame::DestroyFrame(pFlyFrame);
@@ -520,6 +519,7 @@ void SwLayoutFrame::DestroyImpl()
                 }
                 else
                 {
+                    pAnchoredObj->ClearTmpConsiderWrapInfluence();
                     SdrObject* pSdrObj = pAnchoredObj->DrawObj();
                     SwDrawContact* pContact =
                             static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
commit 9527d3e03d287c5f5aa5f9a2b6200d4061e2bbdd
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 9 12:32:01 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    forcepoint73 deleted SwAnchoredObject still referenced in TmpConsiderWrapInfl
    
    Reviewed-on: https://gerrit.libreoffice.org/58760
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 6d0ea082889c89eb8b408779f2de08da7441ff54)
    
    Change-Id: If255723834d049865fcf6fd0eac7768dfcbad2a1
    Reviewed-on: https://gerrit.libreoffice.org/58768
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit de765158b372d5f7bbb1b37c7d6be695ab6104ac)

diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 554fc6721902..ff8b59ca6ae7 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -467,6 +467,7 @@ class SW_DLLPUBLIC SwAnchoredObject
         // accessors to member <mbTmpConsiderWrapInfluence>
         void SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrapInfluence );
         bool IsTmpConsiderWrapInfluence() const { return mbTmpConsiderWrapInfluence;}
+        void ClearTmpConsiderWrapInfluence();
 
         /** method to determine, if the anchored object is overlapping with a
             previous column
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index bf72d5d4591e..a3979cf4670a 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -128,6 +128,10 @@ public:
     static void InsertObjForTmpConsiderWrapInfluence(
                                         const SwDoc& _rDoc,
                                         SwAnchoredObject& _rAnchoredObj );
+    static void RemoveObjForTmpConsiderWrapInfluence(
+                                        const SwDoc& _rDoc,
+                                        SwAnchoredObject& _rAnchoredObj );
+
     // --> #i65250#
     static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
                                    const SwFlowFrame& p_rFlowFrame,
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index a88d36eba220..3a5447f583ab 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -746,7 +746,14 @@ void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrap
     }
 }
 
-
+void SwAnchoredObject::ClearTmpConsiderWrapInfluence()
+{
+    mbTmpConsiderWrapInfluence = false;
+    mbClearedEnvironment = false;
+    SetClearedEnvironment( false );
+    SwLayouter::RemoveObjForTmpConsiderWrapInfluence( *(GetFrameFormat().GetDoc()),
+                                                      *this );
+}
 void SwAnchoredObject::SetTmpConsiderWrapInfluenceOfOtherObjs()
 {
     const SwSortedObjs* pObjs = GetAnchorFrame()->GetDrawObjs();
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 9ced7caa4747..10eba9979057 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -392,6 +392,7 @@ void SwLayouter::ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc )
         _rDoc.getIDocumentLayoutAccess().GetLayouter()->mpObjsTmpConsiderWrapInfl->Clear();
     }
 }
+
 void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
                                             const SwDoc& _rDoc,
                                             SwAnchoredObject& _rAnchoredObj )
@@ -410,6 +411,20 @@ void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
     _rDoc.getIDocumentLayoutAccess().GetLayouter()->mpObjsTmpConsiderWrapInfl->Insert( _rAnchoredObj );
 }
 
+void SwLayouter::RemoveObjForTmpConsiderWrapInfluence(
+                                            const SwDoc& _rDoc,
+                                            SwAnchoredObject& _rAnchoredObj )
+{
+    if ( !_rDoc.getIDocumentLayoutAccess().GetLayouter() )
+        return;
+
+    if ( !_rDoc.getIDocumentLayoutAccess().GetLayouter()->mpObjsTmpConsiderWrapInfl )
+        return;
+
+    _rDoc.getIDocumentLayoutAccess().GetLayouter()->mpObjsTmpConsiderWrapInfl->Remove( _rAnchoredObj );
+}
+
+
 void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTextFrame& rTextFrame )
 {
     if ( bCondition )
diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
index 01aa4d38a501..9c5a2240eeac 100644
--- a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
+++ b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx
@@ -31,23 +31,18 @@ SwObjsMarkedAsTmpConsiderWrapInfluence::~SwObjsMarkedAsTmpConsiderWrapInfluence(
 
 void SwObjsMarkedAsTmpConsiderWrapInfluence::Insert( SwAnchoredObject& _rAnchoredObj )
 {
+    auto it = std::find(maObjsTmpConsiderWrapInfl.begin(), maObjsTmpConsiderWrapInfl.end(), &_rAnchoredObj);
+    if (it != maObjsTmpConsiderWrapInfl.end())
+        return;
+    maObjsTmpConsiderWrapInfl.push_back( &_rAnchoredObj );
+}
 
-    bool bAlreadyInserted( false );
-    std::vector< SwAnchoredObject* >::const_iterator aIter = maObjsTmpConsiderWrapInfl.begin();
-    for ( ; aIter != maObjsTmpConsiderWrapInfl.end(); ++aIter )
-    {
-        const SwAnchoredObject* pAnchoredObj = *aIter;
-        if ( pAnchoredObj == &_rAnchoredObj )
-        {
-            bAlreadyInserted = true;
-            break;
-        }
-    }
-
-    if ( !bAlreadyInserted )
-    {
-        maObjsTmpConsiderWrapInfl.push_back( &_rAnchoredObj );
-    }
+void SwObjsMarkedAsTmpConsiderWrapInfluence::Remove( SwAnchoredObject& _rAnchoredObj )
+{
+    auto it = std::find(maObjsTmpConsiderWrapInfl.begin(), maObjsTmpConsiderWrapInfl.end(), &_rAnchoredObj);
+    if (it == maObjsTmpConsiderWrapInfl.end())
+        return;
+    maObjsTmpConsiderWrapInfl.erase(it);
 }
 
 void SwObjsMarkedAsTmpConsiderWrapInfluence::Clear()
diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.hxx b/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
index fcf495e72a50..28b6acf9de1c 100644
--- a/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
+++ b/sw/source/core/layout/objstmpconsiderwrapinfl.hxx
@@ -33,6 +33,7 @@ class SwObjsMarkedAsTmpConsiderWrapInfluence
         ~SwObjsMarkedAsTmpConsiderWrapInfluence();
 
         void Insert( SwAnchoredObject& _rAnchoredObj );
+        void Remove( SwAnchoredObject& _rAnchoredObj );
         void Clear();
 };
 
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 26b15e0e781f..ab584d14db31 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -512,9 +512,10 @@ void SwLayoutFrame::DestroyImpl()
                 const size_t nCnt = pFrame->GetDrawObjs()->size();
                 // #i28701#
                 SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[0];
-                if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) !=  nullptr )
+                pAnchoredObj->ClearTmpConsiderWrapInfluence();
+                if (SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj))
                 {
-                    SwFrame::DestroyFrame(static_cast<SwFlyFrame*>(pAnchoredObj));
+                    SwFrame::DestroyFrame(pFlyFrame);
                     assert(!pFrame->GetDrawObjs() || nCnt > pFrame->GetDrawObjs()->size());
                 }
                 else
commit 6efe932b458f59b775ea20aa198a3404c3311aa2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 27 19:45:34 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    ofz#11125 pass param len around
    
    Change-Id: I4b382271df21c58de0e102af6e0b07a88a1d9610
    Reviewed-on: https://gerrit.libreoffice.org/62448
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 6253b1a29c8c1bcd7fd9efb07ca1a12fb0fc1746)

diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index c0a4b44c4c93..b2db0fe83b44 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1033,7 +1033,7 @@ struct WW8TabBandDesc
     static void setcelldefaults(WW8_TCell *pCells, short nCells);
     void ReadDef(bool bVer67, const sal_uInt8* pS, short nLen);
     void ProcessDirection(const sal_uInt8* pParams);
-    void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC);
+    void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC, sal_uInt16 nParamsLen);
     void ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pParams, sal_uInt16 nParamsLen);
     void ProcessSprmTDxaCol(const sal_uInt8* pParamsTDxaCol);
     void ProcessSprmTDelete(const sal_uInt8* pParamsTDelete);
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 1ab43e948b90..2bb1a638bc2c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1360,11 +1360,17 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS, short nLen)
     }
 }
 
-void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC)
+void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSetBRC, sal_uInt16 nParamsLen)
 {
     if( !pParamsTSetBRC || !pTCs ) // set one or more cell border(s)
         return;
 
+    if (nParamsLen < 3)
+    {
+        SAL_WARN("sw.ww8", "table border property is too short");
+        return;
+    }
+
     sal_uInt8 nitcFirst= pParamsTSetBRC[0];// first col to be changed
     sal_uInt8 nitcLim  = pParamsTSetBRC[1];// (last col to be changed)+1
     sal_uInt8 nFlag    = *(pParamsTSetBRC+2);
@@ -1383,11 +1389,33 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSe
     WW8_TCell* pAktTC  = pTCs + nitcFirst;
     WW8_BRCVer9 brcVer9;
     if( nBrcVer == 6 )
+    {
+        if (nParamsLen < sizeof(WW8_BRCVer6) + 3)
+        {
+            SAL_WARN("sw.ww8", "table border property is too short");
+            return;
+        }
         brcVer9 = WW8_BRCVer9(WW8_BRC(*reinterpret_cast<WW8_BRCVer6 const *>(pParamsTSetBRC+3)));
+    }
     else if( nBrcVer == 8 )
+    {
+        static_assert(sizeof (WW8_BRC) == 4, "this has to match the msword size");
+        if (nParamsLen < sizeof(WW8_BRC) + 3)
+        {
+            SAL_WARN("sw.ww8", "table border property is too short");
+            return;
+        }
         brcVer9 = WW8_BRCVer9(*reinterpret_cast<WW8_BRC const *>(pParamsTSetBRC+3));
+    }
     else
+    {
+        if (nParamsLen < sizeof(WW8_BRCVer9) + 3)
+        {
+            SAL_WARN("sw.ww8", "table border property is too short");
+            return;
+        }
         brcVer9 = *reinterpret_cast<WW8_BRCVer9 const *>(pParamsTSetBRC+3);
+    }
 
     for( int i = nitcFirst; i < nitcLim; ++i, ++pAktTC )
     {
@@ -1400,7 +1428,6 @@ void WW8TabBandDesc::ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8* pParamsTSe
         if( bChangeRight )
             pAktTC->rgbrc[ WW8_RIGHT ] = brcVer9;
     }
-
 }
 
 void WW8TabBandDesc::ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pParams, sal_uInt16 nParamsLen)
@@ -1920,7 +1947,8 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
         sal_uInt16 nTableBordersLen = 0;
         const sal_uInt8* pTableBorders90 = nullptr;
         sal_uInt16 nTableBorders90Len = 0;
-        std::vector<const sal_uInt8*> aTSetBrcs, aTSetBrc90s;
+        // params, len
+        std::vector<std::pair<const sal_uInt8*, sal_uInt16>> aTSetBrcs, aTSetBrc90s;
         WW8_TablePos *pTabPos  = nullptr;
 
         // search end of a tab row
@@ -2023,10 +2051,10 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
                         }
                         break;
                     case sprmTSetBrc:
-                        aTSetBrcs.push_back(pParams); // process at end
+                        aTSetBrcs.emplace_back(pParams, nLen); // process at end
                         break;
                     case sprmTSetBrc90:
-                        aTSetBrc90s.push_back(pParams); // process at end
+                        aTSetBrc90s.emplace_back(pParams, nLen); // process at end
                         break;
                     case sprmTDxaCol:
                         pNewBand->ProcessSprmTDxaCol(pParams);
@@ -2074,11 +2102,10 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
             else if (pTableBorders)
                 pNewBand->ProcessSprmTTableBorders(bOldVer ? 6 : 8,
                     pTableBorders, nTableBordersLen);
-            std::vector<const sal_uInt8*>::const_iterator iter;
-            for (iter = aTSetBrcs.begin(); iter != aTSetBrcs.end(); ++iter)
-                pNewBand->ProcessSprmTSetBRC(bOldVer ? 6 : 8, *iter);
-            for (iter = aTSetBrc90s.begin(); iter != aTSetBrc90s.end(); ++iter)
-                pNewBand->ProcessSprmTSetBRC(9, *iter);
+            for (const auto& a : aTSetBrcs)
+                pNewBand->ProcessSprmTSetBRC(bOldVer ? 6 : 8, a.first, a.second);
+            for (const auto& a : aTSetBrc90s)
+                pNewBand->ProcessSprmTSetBRC(9, a.first, a.second);
         }
 
         if( nTabeDxaNew < SHRT_MAX )
commit 02dfcab214f0c1778007fc1e30d4c49066f7f7e9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 1 21:34:20 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    forcepoint#67 detect cairo surface creation failure
    
    if e.g. too large
    
    Reviewed-on: https://gerrit.libreoffice.org/58454
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 36bee88834f90818c5475b460c729186ef6c9229)
    
    Change-Id: I7de8748a5ed695c1b3ddc8c1358414f3acd68c94

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index a49080c18249..f7f6aa3ff557 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1269,6 +1269,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
     /** creates an image from the given rectangle, replacing all black pixels
      *  with nMaskColor and make all other full transparent */
     SourceHelper aSurface(rSalBitmap, true); // The mask is argb32
+    if (!aSurface.getSurface())
+    {
+        SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawMask case");
+        return;
+    }
     sal_Int32 nStride;
     unsigned char *mask_data = aSurface.getBits(nStride);
     for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
@@ -1586,6 +1591,11 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer)
                                         nFormat,
                                         pBuffer->mnWidth, pBuffer->mnHeight,
                                         pBuffer->mnScanlineSize);
+    if (cairo_surface_status(target) != CAIRO_STATUS_SUCCESS)
+    {
+        cairo_surface_destroy(target);
+        return nullptr;
+    }
     return target;
 }
 
commit 0b2a5f917a5201707e114ba7aae95c09ab51fabe
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 12 15:01:41 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    NSS fix lcc support patch
    
    This hangs the build process with current MSVC cl.exe. It even
    hangs when just calling "cl -? >/dev/null". Probably
    a cl.exe bug to detect redirection properly?
    
    This adds stdin redirection to /dev/null, like in configure.ac checks.
    
    Reviewed-on: https://gerrit.libreoffice.org/75495
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit b11ea5e9c37b19f0d60a4075146668954a7bf728)
    
    Change-Id: Ie03c3103ac68cd131dc280755621a8ce0417314f

diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index f1c025093216..195e57197425 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
 		external/nss/nss.vs2015.patch) \
     external/nss/ubsan.patch.0 \
     external/nss/clang-cl.patch.0 \
+    external/nss/nss.fix-freebl-add-lcc-support.patch.1 \
     $(if $(filter IOS,$(OS)), \
         external/nss/nss-ios.patch) \
 	$(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
diff --git a/external/nss/nss.fix-freebl-add-lcc-support.patch.1 b/external/nss/nss.fix-freebl-add-lcc-support.patch.1
new file mode 100644
index 000000000000..3e3c06327dde
--- /dev/null
+++ b/external/nss/nss.fix-freebl-add-lcc-support.patch.1
@@ -0,0 +1,11 @@
+--- b/nss/lib/freebl/Makefile
++++ a/nss/lib/freebl/Makefile
+@@ -495,7 +495,7 @@
+ ifdef USE_64
+ # no __int128 at least up to lcc 1.23 (pretending to be gcc5)
+ # NB: CC_NAME is not defined here
+-ifneq ($(shell $(CC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q'),lcc)
++ifneq ($(shell $(CC) -? 2>&1 >/dev/null </dev/null | sed -e 's/:.*//;1q'),lcc)
+     ifdef CC_IS_CLANG
+             HAVE_INT128_SUPPORT = 1
+             DEFINES += -DHAVE_INT128_SUPPORT
commit 88cbeae5fa815a70a511bfe9ff62b07a759c4910
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jul 10 12:20:00 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    nss: upgrade to release 3.45
    
    Fixes CVE-2019-11729 CVE-2019-11719 CVE-2019-11727, and the less
    important CVE-2018-12384 and CVE-2018-12404 from intermediate releases.
    
    Since NSS 3.44 it's possible to build as static libraries and for iOS;
    drop the nss-chromium-nss-static.patch and nss-more-static.patch and
    hope that it works.
    
    Drop one hunk from nss.patch that looks fixed upstream.
    
    Reviewed-on: https://gerrit.libreoffice.org/75344
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 6efc8a33f69bc7f4be45b7b81f67cd74c163b99e)
    
    Change-Id: I7f37ac36f7f8dfd49d0bfb4a6185ca49d4f618a3
    Reviewed-on: https://gerrit.libreoffice.org/75410
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/download.lst b/download.lst
index cbb5dea36aa7..fb2ddf7fc966 100644
--- a/download.lst
+++ b/download.lst
@@ -195,8 +195,8 @@ export MYTHES_SHA256SUM := 1e81f395d8c851c3e4e75b568e20fa2fa549354e75ab397f9de4b
 export MYTHES_TARBALL := a8c2c5b8f09e7ede322d5c602ff6a4b6-mythes-1.2.4.tar.gz
 export NEON_SHA256SUM := db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca
 export NEON_TARBALL := neon-0.30.2.tar.gz
-export NSS_SHA256SUM := f271ec73291fa3e4bd4b59109f8035cc3a192fc33886f40ed4f9ee4b31c746e9
-export NSS_TARBALL := nss-3.38-with-nspr-4.19.tar.gz
+export NSS_SHA256SUM := fae11751100510d26f16a245f0db9a5b3d638ab28ce0bccd50d4314f7e526ba1
+export NSS_TARBALL := nss-3.45-with-nspr-4.21.tar.gz
 export ODFGEN_SHA256SUM := 2c7b21892f84a4c67546f84611eccdad6259875c971e98ddb027da66ea0ac9c2
 export ODFGEN_VERSION_MICRO := 6
 export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 98cfe73ab4aa..f1c025093216 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -23,8 +23,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
     external/nss/ubsan.patch.0 \
     external/nss/clang-cl.patch.0 \
     $(if $(filter IOS,$(OS)), \
-        external/nss/nss-chromium-nss-static.patch \
-        external/nss/nss-more-static.patch \
         external/nss/nss-ios.patch) \
 	$(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
 		external/nss/nss.cygwin64.in32bit.patch) \
diff --git a/external/nss/clang-cl.patch.0 b/external/nss/clang-cl.patch.0
index 684cf74d3ca6..111ec934d147 100644
--- a/external/nss/clang-cl.patch.0
+++ b/external/nss/clang-cl.patch.0
@@ -15,11 +15,11 @@
 --- nspr/pr/include/prbit.h
 +++ nspr/pr/include/prbit.h
 @@ -14,7 +14,7 @@
- ** functions.
  */
  #if defined(_WIN32) && (_MSC_VER >= 1300) && \
--    (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM))
-+    (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)) && !defined __clang__
+     (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \
+-     defined(_M_ARM64))
++     defined(_M_ARM64)) && !defined __clang__
  # include <intrin.h>
  # pragma  intrinsic(_BitScanForward,_BitScanReverse)
    __forceinline static int __prBitScanForward32(unsigned int val)
@@ -29,15 +29,15 @@
  # define  PR_HAVE_BUILTIN_BITSCAN32
 -#elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \
 +#elif defined __GNUC__ && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \
-        (defined(__i386__) || defined(__x86_64__) || defined(__arm__))
+        (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
+         defined(__aarch64__))
  # define pr_bitscan_ctz32(val)  __builtin_ctz(val)
- # define pr_bitscan_clz32(val)  __builtin_clz(val)
 @@ -136,7 +136,7 @@
  */
  
  #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \
--    defined(_M_X64) || defined(_M_ARM))
-+    defined(_M_X64) || defined(_M_ARM)) && !defined __clang__
+-    defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64))
++    defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)) && !defined __clang__
  #include <stdlib.h>
  #pragma intrinsic(_rotl, _rotr)
  #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits)
diff --git a/external/nss/nss-chromium-nss-static.patch b/external/nss/nss-chromium-nss-static.patch
deleted file mode 100644
index 9d7a4e4352b1..000000000000
--- a/external/nss/nss-chromium-nss-static.patch
+++ /dev/null
@@ -1,487 +0,0 @@
-Based on http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/nss/patches/nss-static.patch
-
---- a/a/nss/lib/certhigh/certvfy.c    Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/certhigh/certvfy.c    Fri May 31 17:44:06 2013 -0700
-@@ -13,9 +13,11 @@
- #include "certdb.h"
- #include "certi.h"
- #include "cryptohi.h"
-+#ifndef NSS_DISABLE_LIBPKIX
- #include "pkix.h"
- /*#include "pkix_sample_modules.h" */
- #include "pkix_pl_cert.h"
-+#endif  /* NSS_DISABLE_LIBPKIX */
- 
- 
- #include "nsspki.h"
-@@ -24,6 +26,47 @@
- #include "pki3hack.h"
- #include "base.h"
- 
-+#ifdef NSS_DISABLE_LIBPKIX
-+SECStatus
-+cert_VerifyCertChainPkix(
-+    CERTCertificate *cert,
-+    PRBool           checkSig,
-+    SECCertUsage     requiredUsage,
-+    PRTime           time,
-+    void            *wincx,
-+    CERTVerifyLog   *log,
-+    PRBool          *pSigerror,
-+    PRBool          *pRevoked)
-+{
-+    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
-+    return SECFailure;
-+}
-+
-+SECStatus
-+CERT_SetUsePKIXForValidation(PRBool enable)
-+{
-+    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
-+    return SECFailure;
-+}
-+
-+PRBool
-+CERT_GetUsePKIXForValidation()
-+{
-+    return PR_FALSE;
-+}
-+
-+SECStatus CERT_PKIXVerifyCert(
-+    CERTCertificate *cert,
-+    SECCertificateUsage usages,
-+    CERTValInParam *paramsIn,
-+    CERTValOutParam *paramsOut,
-+    void *wincx)
-+{
-+    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
-+    return SECFailure;
-+}
-+#endif  /* NSS_DISABLE_LIBPKIX */
-+
- /*
-  * Check the validity times of a certificate
-  */
---- a/a/nss/lib/ckfw/nssck.api        Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/ckfw/nssck.api        Fri May 31 17:44:06 2013 -0700
-@@ -1752,7 +1752,7 @@
- }
- #endif /* DECLARE_STRICT_CRYPTOKI_NAMES */
- 
--static CK_RV CK_ENTRY
-+CK_RV CK_ENTRY
- __ADJOIN(MODULE_NAME,C_GetFunctionList)
- (
-   CK_FUNCTION_LIST_PTR_PTR ppFunctionList
-@@ -1830,7 +1830,7 @@
- __ADJOIN(MODULE_NAME,C_WaitForSlotEvent)
- };
- 
--static CK_RV CK_ENTRY
-+CK_RV CK_ENTRY
- __ADJOIN(MODULE_NAME,C_GetFunctionList)
- (
-   CK_FUNCTION_LIST_PTR_PTR ppFunctionList
-@@ -1840,6 +1840,8 @@
-   return CKR_OK;
- }
- 
-+#define NSS_STATIC
-+#ifndef NSS_STATIC
- /* This one is always present */
- CK_RV CK_ENTRY
- C_GetFunctionList
-@@ -1849,6 +1850,7 @@
- {
-   return __ADJOIN(MODULE_NAME,C_GetFunctionList)(ppFunctionList);
- }
-+#endif
- 
- #undef __ADJOIN
- 
---- a/a/nss/lib/freebl/rsa.c  Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/freebl/rsa.c  Fri May 31 17:44:06 2013 -0700
-@@ -1559,6 +1559,14 @@
-     RSA_Cleanup();
- }
- 
-+#define NSS_STATIC
-+#ifdef NSS_STATIC
-+void
-+BL_Unload(void)
-+{
-+}
-+#endif
-+
- PRBool bl_parentForkedAfterC_Initialize;
- 
- /*
---- a/a/nss/lib/freebl/shvfy.c        Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/freebl/shvfy.c        Fri May 31 17:44:06 2013 -0700
-@@ -273,9 +273,22 @@
-     return SECSuccess;
- }
- 
-+/*
-+ * Define PSEUDO_FIPS if you can't do FIPS software integrity test (e.g.,
-+ * if you're using NSS as static libraries), but want to conform to the
-+ * rest of the FIPS requirements.
-+ */
-+#define NSS_STATIC
-+#ifdef NSS_STATIC
-+#define PSEUDO_FIPS
-+#endif
-+
- PRBool
- BLAPI_SHVerify(const char *name, PRFuncPtr addr)
- {
-+#ifdef PSEUDO_FIPS
-+    return PR_TRUE;  /* a lie, hence *pseudo* FIPS */
-+#else
-     PRBool result = PR_FALSE; /* if anything goes wrong,
- 			       * the signature does not verify */
-     /* find our shared library name */
-@@ -291,11 +303,15 @@
-     }
- 
-     return result;
-+#endif  /* PSEUDO_FIPS */
- }
- 
- PRBool
- BLAPI_SHVerifyFile(const char *shName)
- {
-+#ifdef PSEUDO_FIPS
-+    return PR_TRUE;  /* a lie, hence *pseudo* FIPS */
-+#else
-     char *checkName = NULL;
-     PRFileDesc *checkFD = NULL;
-     PRFileDesc *shFD = NULL;
-@@ -492,6 +508,7 @@
-     }
- 
-     return result;
-+#endif  /* PSEUDO_FIPS */
- }
- 
- PRBool
---- a/a/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpcertstore.c    Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpcertstore.c    Fri May 31 17:44:06 2013 -0700
-@@ -201,7 +201,11 @@
- 
- typedef SECStatus (*pkix_DecodeCertsFunc)(char *certbuf, int certlen,
-                                           CERTImportCertificateFunc f, void *arg);
--
-+#define NSS_STATIC
-+#ifdef NSS_STATIC
-+extern SECStatus CERT_DecodeCertPackage(char* certbuf, int certlen,
-+                                        CERTImportCertificateFunc f, void* arg);
-+#endif
- 
- struct pkix_DecodeFuncStr {
-     pkix_DecodeCertsFunc func;          /* function pointer to the 
-@@ -223,6 +226,11 @@
-  */
- static PRStatus PR_CALLBACK pkix_getDecodeFunction(void)
- {
-+#ifdef NSS_STATIC
-+    pkix_decodeFunc.smimeLib = NULL;
-+    pkix_decodeFunc.func = CERT_DecodeCertPackage;
-+    return PR_SUCCESS;
-+#else
-     pkix_decodeFunc.smimeLib = 
- 		PR_LoadLibrary(SHLIB_PREFIX"smime3."SHLIB_SUFFIX);
-     if (pkix_decodeFunc.smimeLib == NULL) {
-@@ -235,7 +243,7 @@
- 	return PR_FAILURE;
-     }
-     return PR_SUCCESS;
--
-+#endif
- }
- 
- /*
---- a/a/nss/lib/nss/nssinit.c Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/nss/nssinit.c Fri May 31 17:44:06 2013 -0700
-@@ -20,9 +20,11 @@
- #include "secerr.h"
- #include "nssbase.h"
- #include "nssutil.h"
-+#ifndef NSS_DISABLE_LIBPKIX
- #include "pkixt.h"
- #include "pkix.h"
- #include "pkix_tools.h"
-+#endif  /* NSS_DISABLE_LIBPKIX */
- 
- #include "pki3hack.h"
- #include "certi.h"
-@@ -530,8 +532,10 @@
- 		 PRBool dontFinalizeModules)
- {
-     SECStatus rv = SECFailure;
-+#ifndef NSS_DISABLE_LIBPKIX
-     PKIX_UInt32 actualMinorVersion = 0;
-     PKIX_Error *pkixError = NULL;
-+#endif
-     PRBool isReallyInitted;
-     char *configStrings = NULL;
-     char *configName = NULL;
-@@ -685,6 +689,7 @@
- 	pk11sdr_Init();
- 	cert_CreateSubjectKeyIDHashTable();
- 
-+#ifndef NSS_DISABLE_LIBPKIX
- 	pkixError = PKIX_Initialize
- 	    (PKIX_FALSE, PKIX_MAJOR_VERSION, PKIX_MINOR_VERSION,
- 	    PKIX_MINOR_VERSION, &actualMinorVersion, &plContext);
-@@ -697,6 +702,7 @@
-                 CERT_SetUsePKIXForValidation(PR_TRUE);
-             }
-         }
-+#endif  /* NSS_DISABLE_LIBPKIX */
- 
- 
-     }
-@@ -1081,7 +1087,9 @@
-     cert_DestroyLocks();
-     ShutdownCRLCache();
-     OCSP_ShutdownGlobal();
-+#ifndef NSS_DISABLE_LIBPKIX
-     PKIX_Shutdown(plContext);
-+#endif
-     SECOID_Shutdown();
-     status = STAN_Shutdown();
-     cert_DestroySubjectKeyIDHashTable();
---- a/a/nss/lib/pk11wrap/pk11load.c   Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/pk11wrap/pk11load.c   Fri May 31 17:44:06 2013 -0700
-@@ -318,6 +318,13 @@
-     }
- }
- 
-+#define NSS_STATIC
-+#ifdef NSS_STATIC
-+extern CK_RV NSC_GetFunctionList(CK_FUNCTION_LIST_PTR *pFunctionList);
-+extern CK_RV FC_GetFunctionList(CK_FUNCTION_LIST_PTR *pFunctionList);
-+extern char **NSC_ModuleDBFunc(unsigned long function,char *parameters, void *args);
-+extern CK_RV builtinsC_GetFunctionList(CK_FUNCTION_LIST_PTR *pFunctionList);
-+#else
- static const char* my_shlib_name =
-     SHLIB_PREFIX"nss"SHLIB_VERSION"."SHLIB_SUFFIX;
- static const char* softoken_shlib_name =
-@@ -326,12 +332,14 @@
- static PRCallOnceType loadSoftokenOnce;
- static PRLibrary* softokenLib;
- static PRInt32 softokenLoadCount;
-+#endif  /* NSS_STATIC */
- 
- #include "prio.h"
- #include "prprf.h"
- #include <stdio.h>
- #include "prsystem.h"
- 
-+#ifndef NSS_STATIC
- /* This function must be run only once. */
- /*  determine if hybrid platform, then actually load the DSO. */
- static PRStatus
-@@ -348,6 +356,7 @@
-   }
-   return PR_FAILURE;
- }
-+#endif  /* !NSS_STATIC */
- 
- /*
-  * load a new module into our address space and initialize it.
-@@ -366,6 +375,16 @@
- 
-     /* intenal modules get loaded from their internal list */
-     if (mod->internal && (mod->dllName == NULL)) {
-+#ifdef NSS_STATIC
-+    if (mod->isFIPS) {
-+        entry = FC_GetFunctionList;
-+    } else {
-+        entry = NSC_GetFunctionList;
-+    }
-+    if (mod->isModuleDB) {
-+        mod->moduleDBFunc = NSC_ModuleDBFunc;
-+    }
-+#else
-     /*
-      * Loads softoken as a dynamic library,
-      * even though the rest of NSS assumes this as the "internal" module.
-@@ -391,6 +410,7 @@
-         mod->moduleDBFunc = (CK_C_GetFunctionList) 
-                     PR_FindSymbol(softokenLib, "NSC_ModuleDBFunc");
-     }
-+#endif
- 
-     if (mod->moduleDBOnly) {
-         mod->loaded = PR_TRUE;
-@@ -401,6 +421,15 @@
- 	if (mod->dllName == NULL) {
- 	    return SECFailure;
- 	}
-+#if defined(NSS_STATIC) && !defined(NSS_DISABLE_ROOT_CERTS)
-+       if (strstr(mod->dllName, "nssckbi") != NULL) {
-+           mod->library = NULL;
-+           PORT_Assert(!mod->moduleDBOnly);
-+           entry = builtinsC_GetFunctionList;
-+           PORT_Assert(!mod->isModuleDB);
-+           goto library_loaded;
-+       }
-+#endif
- 
- 	/* load the library. If this succeeds, then we have to remember to
- 	 * unload the library if anything goes wrong from here on out...
-@@ -423,6 +452,9 @@
- 	    mod->moduleDBFunc = (void *)
- 			PR_FindSymbol(library, "NSS_ReturnModuleSpecData");
- 	}
-+#if defined(NSS_STATIC) && !defined(NSS_DISABLE_ROOT_CERTS)
-+library_loaded:
-+#endif
- 	if (mod->moduleDBFunc == NULL) mod->isModuleDB = PR_FALSE;
- 	if (entry == NULL) {
- 	    if (mod->isModuleDB) {
-@@ -562,6 +594,7 @@
-      * if not, we should change this to SECFailure and move it above the
-      * mod->loaded = PR_FALSE; */
-     if (mod->internal && (mod->dllName == NULL)) {
-+#ifndef NSS_STATIC
-         if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) {
-           if (softokenLib) {
-               disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
-@@ -573,12 +606,18 @@
-           }
-           loadSoftokenOnce = pristineCallOnce;
-         }
-+#endif
- 	return SECSuccess;
-     }
- 
-     library = (PRLibrary *)mod->library;
-     /* paranoia */
-     if (library == NULL) {
-+#if defined(NSS_STATIC) && !defined(NSS_DISABLE_ROOT_CERTS)
-+       if (strstr(mod->dllName, "nssckbi") != NULL) {
-+           return SECSuccess;
-+       }
-+#endif
- 	return SECFailure;
-     }
- 
---- a/a/nss/lib/softoken/lgglue.c     Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/softoken/lgglue.c     Fri May 31 17:44:06 2013 -0700
-@@ -23,6 +23,8 @@
- static LGAddSecmodFunc legacy_glue_addSecmod = NULL;
- static LGShutdownFunc legacy_glue_shutdown = NULL;
- 
-+#define NSS_STATIC
-+#ifndef NSS_STATIC
- /*
-  * The following 3 functions duplicate the work done by bl_LoadLibrary.
-  * We should make bl_LoadLibrary a global and replace the call to
-@@ -160,6 +161,7 @@
- 
-     return lib;
- }
-+#endif  /* STATIC LIBRARIES */
- 
- /*
-  * stub files for legacy db's to be able to encrypt and decrypt
-@@ -272,6 +274,21 @@
- 	return SECSuccess;
-     }
- 
-+#ifdef NSS_STATIC
-+#ifdef NSS_DISABLE_DBM
-+    return SECFailure;
-+#else
-+    lib = (PRLibrary *) 0x8;
-+
-+    legacy_glue_open = legacy_Open;
-+    legacy_glue_readSecmod = legacy_ReadSecmodDB;
-+    legacy_glue_releaseSecmod = legacy_ReleaseSecmodDBData;
-+    legacy_glue_deleteSecmod = legacy_DeleteSecmodDB;
-+    legacy_glue_addSecmod = legacy_AddSecmodDB;
-+    legacy_glue_shutdown = legacy_Shutdown;
-+    setCryptFunction = legacy_SetCryptFunctions;
-+#endif
-+#else
-     lib = sftkdb_LoadLibrary(LEGACY_LIB_NAME);
-     if (lib == NULL) {
- 	return SECFailure;
-@@ -297,11 +314,14 @@
- 	PR_UnloadLibrary(lib);
- 	return SECFailure;
-     }
-+#endif  /* NSS_STATIC */
- 
-     /* verify the loaded library if we are in FIPS mode */
-     if (isFIPS) {
- 	if (!BLAPI_SHVerify(LEGACY_LIB_NAME,(PRFuncPtr)legacy_glue_open)) {
-+#ifndef NSS_STATIC
- 	    PR_UnloadLibrary(lib);
-+#endif
- 	    return SECFailure;
- 	}
-     	legacy_glue_libCheckSucceeded = PR_TRUE;
-@@ -418,10 +438,12 @@
- #endif
- 	crv = (*legacy_glue_shutdown)(parentForkedAfterC_Initialize);
-     }
-+#ifndef NSS_STATIC
-     disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
-     if (!disableUnload) {
-         PR_UnloadLibrary(legacy_glue_lib);
-     }
-+#endif
-     legacy_glue_lib = NULL;
-     legacy_glue_open = NULL;
-     legacy_glue_readSecmod = NULL;
---- a/a/nss/lib/softoken/lgglue.h     Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/softoken/lgglue.h     Fri May 31 17:44:06 2013 -0700
-@@ -38,6 +38,25 @@
- typedef void (*LGSetForkStateFunc)(PRBool);
- typedef void (*LGSetCryptFunc)(LGEncryptFunc, LGDecryptFunc);
- 
-+extern CK_RV legacy_Open(const char *dir, const char *certPrefix, 
-+               const char *keyPrefix, 
-+               int certVersion, int keyVersion, int flags, 
-+               SDB **certDB, SDB **keyDB);
-+extern char ** legacy_ReadSecmodDB(const char *appName, 
-+                       const char *filename, 
-+                       const char *dbname, char *params, PRBool rw);
-+extern SECStatus legacy_ReleaseSecmodDBData(const char *appName,
-+                       const char *filename, 
-+                       const char *dbname, char **params, PRBool rw);
-+extern SECStatus legacy_DeleteSecmodDB(const char *appName,
-+                       const char *filename, 
-+                       const char *dbname, char *params, PRBool rw);
-+extern SECStatus legacy_AddSecmodDB(const char *appName, 
-+                       const char *filename, 
-+                       const char *dbname, char *params, PRBool rw);
-+extern SECStatus legacy_Shutdown(PRBool forked);
-+extern void legacy_SetCryptFunctions(LGEncryptFunc, LGDecryptFunc);
-+
- /*
-  * Softoken Glue Functions
-  */
---- a/a/nss/lib/util/secport.h        Tue May 28 23:37:46 2013 +0200
-+++ a/a/nss/lib/util/secport.h        Fri May 31 17:44:06 2013 -0700
-@@ -210,6 +210,8 @@
- 
- extern int NSS_SecureMemcmp(const void *a, const void *b, size_t n);
- 
-+#define NSS_STATIC
-+#ifndef NSS_STATIC
- /*
-  * Load a shared library called "newShLibName" in the same directory as
-  * a shared library that is already loaded, called existingShLibName.
-@@ -244,6 +245,7 @@
- PORT_LoadLibraryFromOrigin(const char* existingShLibName,
-                  PRFuncPtr staticShLibFunc,
-                  const char *newShLibName);
-+#endif  /* NSS_STATIC */
- 
- SEC_END_PROTOS
- 
diff --git a/external/nss/nss-more-static.patch b/external/nss/nss-more-static.patch
deleted file mode 100644
index 26948f0be24c..000000000000
--- a/external/nss/nss-more-static.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/a/nss/lib/freebl/loader.c
-+++ a/a/nss/lib/freebl/loader.c
-@@ -114,6 +114,7 @@
- 
- #include "genload.c"
- 
-+extern FREEBLGetVectorFn FREEBL_GetVector;
- /* This function must be run only once. */
- /*  determine if hybrid platform, then actually load the DSO. */
- static PRStatus
-@@ -136,9 +136,9 @@
-         return PR_FAILURE;
-     }
- 
--    handle = loader_LoadLibrary(name);
--    if (handle) {
--        PRFuncPtr address = PR_FindFunctionSymbol(handle, "FREEBL_GetVector");
-+    handle = 0;
-+    {
-+        PRFuncPtr address = FREEBL_GetVector;
-         if (address) {
-             FREEBLGetVectorFn *getVector = (FREEBLGetVectorFn *)address;
-             const FREEBLVector *dsoVector = getVector();
-@@ -887,6 +887,7 @@
- void
- BL_Unload(void)
- {
-+#if 0
-     /* This function is not thread-safe, but doesn't need to be, because it is
-      * only called from functions that are also defined as not thread-safe,
-      * namely C_Finalize in softoken, and the SSL bypass shutdown callback called
-@@ -905,6 +905,7 @@
-     }
-     blLib = NULL;
-     loadFreeBLOnce = pristineCallOnce;
-+#endif
- }
- 
- /* ============== New for 3.003 =============================== */
diff --git a/external/nss/nss.patch b/external/nss/nss.patch
index 6219775c2d3c..c367bce9097b 100644
--- a/external/nss/nss.patch
+++ b/external/nss/nss.patch
@@ -153,16 +153,3 @@
  #! gmake
  #
  # This Source Code Form is subject to the terms of the Mozilla Public
-@@ -89,10 +91,10 @@
- NSPR_CONFIGURE_ENV = CC=gcc CXX=g++
- endif
- ifdef CC
--NSPR_CONFIGURE_ENV = CC=$(CC)
-+NSPR_CONFIGURE_ENV = CC="$(CC) "
- endif
- ifdef CCC
--NSPR_CONFIGURE_ENV += CXX=$(CCC)
-+NSPR_CONFIGURE_ENV += CXX="$(CCC) "
- endif
- # Remove -arch definitions. NSPR can't handle that.
- NSPR_CONFIGURE_ENV := $(filter-out -arch x86_64,$(NSPR_CONFIGURE_ENV))
commit f39c795182982eebf86c23173586b28d1004273d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed May 22 11:40:54 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    curl: upgrade to release 7.65.0
    
    Fixes CVE-2019-5435. It looks like this is not a problem on 32-bit
    Windows because fortunately we don't use /LARGEADDRESSAWARE flag
    to set IMAGE_FILE_LARGE_ADDRESS_AWARE... but on 32-bit Linux
    the user-space VM is 3GB so an exploit might be possible.
    
    Apparently there's no code in LO that uses the CURLU_URLENCODE flag.
    
    The other one, CVE-2019-5436, doesn't matter because we disable tftp.
    
    Change-Id: I0d4f087befa5a3c4fb21ec36761dad68932425d9
    Reviewed-on: https://gerrit.libreoffice.org/72732
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit edb01616ac176401650c35d938c75c6c5558a47e)

diff --git a/download.lst b/download.lst
index 5418d7f223b8..cbb5dea36aa7 100644
--- a/download.lst
+++ b/download.lst
@@ -29,8 +29,8 @@ export CPPUNIT_SHA256SUM := 3d569869d27b48860210c758c4f313082103a5e58219a7669b52
 export CPPUNIT_TARBALL := cppunit-1.14.0.tar.gz
 export CT2N_SHA256SUM := 71b238efd2734be9800af07566daea8d6685aeed28db5eb5fa0e6453f4d85de3
 export CT2N_TARBALL := 1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt
-export CURL_SHA256SUM := cb90d2eb74d4e358c1ed1489f8e3af96b50ea4374ad71f143fa4595e998d81b5
-export CURL_TARBALL := curl-7.64.0.tar.gz
+export CURL_SHA256SUM := 7766d263929404f693905b5e5222aa0f2bdf8c66ab4b8758f0c0820a42b966cd
+export CURL_TARBALL := curl-7.65.0.tar.xz
 export EBOOK_SHA256SUM := 7e8d8ff34f27831aca3bc6f9cc532c2f90d2057c778963b884ff3d1e34dfe1f9
 export EBOOK_TARBALL := libe-book-0.1.3.tar.xz
 export EPOXY_SHA256SUM := 1d8668b0a259c709899e1c4bab62d756d9002d546ce4f59c9665e2fc5f001a64
diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0
index b3e821039740..189e820d1afa 100644
--- a/external/curl/zlib.patch.0
+++ b/external/curl/zlib.patch.0
@@ -1,15 +1,5 @@
 --- configure
 +++ configure
-@@ -937,8 +937,8 @@
- ZLIB_LIBS
- HAVE_LIBZ_FALSE
- HAVE_LIBZ_TRUE
--HAVE_LIBZ
- PKGCONFIG
-+HAVE_LIBZ
- CURL_DISABLE_GOPHER
- CURL_DISABLE_SMTP
- CURL_DISABLE_SMB
 @@ -20709,7 +20709,6 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
commit 23d8321ad5817230e08fa42d70969c252c183c8b
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sat Aug 17 17:06:07 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    upload libvisio 0.1.7
    
    Change-Id: I4eb115c7c085b325370e9cd8f80e1b03f16f5033
    Reviewed-on: https://gerrit.libreoffice.org/77640
    Tested-by: Jenkins
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/77885
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/download.lst b/download.lst
index b83ebc3a0186..5418d7f223b8 100644
--- a/download.lst
+++ b/download.lst
@@ -250,8 +250,8 @@ export TWAIN_DSM_SHA256SUM := 82c818be771f242388457aa8c807e4b52aa84dc22b21c6c561
 export TWAIN_DSM_TARBALL := twaindsm_2.4.1.orig.tar.gz
 export UCPP_SHA256SUM := 983941d31ee8d366085cadf28db75eb1f5cb03ba1e5853b98f12f7f51c63b776
 export UCPP_TARBALL := 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
-export VISIO_SHA256SUM := fe1002d3671d53c09bc65e47ec948ec7b67e6fb112ed1cd10966e211a8bb50f9
-export VISIO_TARBALL := libvisio-0.1.6.tar.xz
+export VISIO_SHA256SUM := 8faf8df870cb27b09a787a1959d6c646faa44d0d8ab151883df408b7166bea4c
+export VISIO_TARBALL := libvisio-0.1.7.tar.xz
 export WPD_SHA256SUM := 323f68beaf4f35e5a4d7daffb4703d0566698280109210fa4eaa90dea27d6610
 export WPD_VERSION_MICRO := 2
 export WPD_TARBALL := libwpd-0.10.$(WPD_VERSION_MICRO).tar.xz
diff --git a/external/libvisio/0001-fix-debug-build.patch.1 b/external/libvisio/0001-fix-debug-build.patch.1
deleted file mode 100644
index 4146e6e8bfe7..000000000000
--- a/external/libvisio/0001-fix-debug-build.patch.1
+++ /dev/null
@@ -1,40 +0,0 @@
-From 15f3774513d0181ad90da382297c175cc3424462 Mon Sep 17 00:00:00 2001
-From: David Tardon <dtardon at redhat.com>
-Date: Sun, 22 Oct 2017 21:24:43 +0200
-Subject: [PATCH] fix debug build
-
-Change-Id: I860b6034e5d833900652aec8c3647eeae185e538
----
- src/lib/VDXParser.cpp  | 2 +-
- src/lib/VSDXParser.cpp | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/lib/VDXParser.cpp b/src/lib/VDXParser.cpp
-index f2f3154..0f07efd 100644
---- a/src/lib/VDXParser.cpp
-+++ b/src/lib/VDXParser.cpp
-@@ -916,7 +916,7 @@ xmlChar *libvisio::VDXParser::readStringData(xmlTextReaderPtr reader)
-     ret = xmlTextReaderRead(reader);
-     if (1 == ret && stringValue)
-     {
--      VSD_DEBUG_MSG(("VDXParser::readStringData stringValue %s\n", (const char *)stringValue));
-+      VSD_DEBUG_MSG(("VDXParser::readStringData stringValue %s\n", (const char *)stringValue.get()));
-       return stringValue.release();
-     }
-   }
-diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp
-index 488be3a..efd46b9 100644
---- a/src/lib/VSDXParser.cpp
-+++ b/src/lib/VSDXParser.cpp
-@@ -555,7 +555,7 @@ xmlChar *libvisio::VSDXParser::readStringData(xmlTextReaderPtr reader)
-   std::unique_ptr<xmlChar, void (*)(void *)> stringValue(xmlTextReaderGetAttribute(reader, BAD_CAST("V")), xmlFree);
-   if (stringValue)
-   {
--    VSD_DEBUG_MSG(("VSDXParser::readStringData stringValue %s\n", (const char *)stringValue));
-+    VSD_DEBUG_MSG(("VSDXParser::readStringData stringValue %s\n", (const char *)stringValue.get()));
-     return stringValue.release();
-   }
-   return nullptr;
--- 
-2.14.1
-
diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk
index 1ab8b392c4e8..eba43f3b7a6e 100644
--- a/external/libvisio/UnpackedTarball_libvisio.mk
+++ b/external/libvisio/UnpackedTarball_libvisio.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libvisio))
 
 $(eval $(call gb_UnpackedTarball_add_patches,libvisio, \
     external/libvisio/ubsan.patch \
-    external/libvisio/0001-fix-debug-build.patch.1 \
 ))
 
 ifeq ($(COM_IS_CLANG),TRUE)
diff --git a/external/libvisio/ubsan.patch b/external/libvisio/ubsan.patch
index 7bba63fda7a1..c9ffbd98f4b6 100644
--- a/external/libvisio/ubsan.patch
+++ b/external/libvisio/ubsan.patch
@@ -4,8 +4,8 @@
      }
      if (U_SUCCESS(status) && conv)
      {
--      const char *src = (const char *)&characters[0];
-+      const char *src = (const char *)characters.data();
+-      const auto *src = (const char *)&characters[0];
++      const auto *src = (const char *)characters.data();
        const char *srcLimit = (const char *)src + characters.size();
        while (src < srcLimit)
        {
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 2d53be212354..eea0e611ba69 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -333,10 +333,10 @@
                     "dest-filename": "external/tarballs/ltm-1.0.zip"
                 },
                 {
-                    "url": "https://dev-www.libreoffice.org/src/libvisio-0.1.6.tar.xz",
-                    "sha256": "fe1002d3671d53c09bc65e47ec948ec7b67e6fb112ed1cd10966e211a8bb50f9",
+                    "url": "https://dev-www.libreoffice.org/src/libvisio-0.1.7.tar.xz",
+                    "sha256": "8faf8df870cb27b09a787a1959d6c646faa44d0d8ab151883df408b7166bea4c",
                     "type": "file",
-                    "dest-filename": "external/tarballs/libvisio-0.1.6.tar.xz"
+                    "dest-filename": "external/tarballs/libvisio-0.1.7.tar.xz"
                 },
                 {
                     "url": "https://dev-www.libreoffice.org/src/libwpd-0.10.2.tar.xz",
commit b27d146c40cdf85e4d6ed57cd96dfeb3e07193b8
Author:     David Tardon <dtardon at redhat.com>
AuthorDate: Sat Aug 17 16:46:47 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:16 2020 +0200

    upload libabw 0.1.3
    
    Change-Id: Ibb45a473f49a9ba8f9cf53593dead375ac8a1951
    Reviewed-on: https://gerrit.libreoffice.org/77639
    Tested-by: Jenkins
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/77884
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/download.lst b/download.lst
index fb8d42762b01..b83ebc3a0186 100644
--- a/download.lst
+++ b/download.lst
@@ -1,5 +1,5 @@
-export ABW_SHA256SUM := 0b72944d5af81dda0a5c5803ee84cbac4b81441a4d767aa57029adc6744c2485
-export ABW_TARBALL := libabw-0.1.2.tar.xz
+export ABW_SHA256SUM := e763a9dc21c3d2667402d66e202e3f8ef4db51b34b79ef41f56cacb86dcd6eed
+export ABW_TARBALL := libabw-0.1.3.tar.xz
 export APACHE_COMMONS_LOGGING_SHA256SUM := 49665da5a60d033e6dff40fe0a7f9173e886ae859ce6096c1afe34c48b677c81
 export APACHE_COMMONS_LOGGING_TARBALL := commons-logging-1.2-src.tar.gz
 export APR_SHA256SUM := 1af06e1720a58851d90694a984af18355b65bb0d047be03ec7d659c746d6dbdb
diff --git a/external/libabw/UnpackedTarball_libabw.mk b/external/libabw/UnpackedTarball_libabw.mk
index 27195d3a0ab3..7b9ba49e7e69 100644
--- a/external/libabw/UnpackedTarball_libabw.mk
+++ b/external/libabw/UnpackedTarball_libabw.mk
@@ -15,10 +15,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libabw,0))
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libabw))
 
-$(eval $(call gb_UnpackedTarball_add_patches,libabw, \
-    external/libabw/libabw-msvc.patch.1 \
-))
-
 ifeq ($(COM_IS_CLANG),TRUE)
 ifneq ($(filter -fsanitize=%,$(CC)),)
 $(eval $(call gb_UnpackedTarball_add_patches,libabw, \
diff --git a/external/libabw/libabw-msvc.patch.1 b/external/libabw/libabw-msvc.patch.1
deleted file mode 100644
index d14b122f9575..000000000000
--- a/external/libabw/libabw-msvc.patch.1
+++ /dev/null
@@ -1,46 +0,0 @@
-From 49f6461d4751d3b16e32ab8f9c93a3856b33be49 Mon Sep 17 00:00:00 2001
-From: Miklos Vajna <vmiklos at collabora.co.uk>
-Date: Wed, 2 Aug 2017 14:53:36 +0200
-Subject: [PATCH] m4: MSVC defines __cplusplus as 199711L still
-
-See e.g.
-<https://stackoverflow.com/questions/37503029/cplusplus-is-equal-to-199711-in-msvc-does-it-support-c11>,
-on MSVC we can't depend on the value of __cplusplus, since that one is a
-too low value, even if everything else works fine.
----
- m4/ax_cxx_compile_stdcxx.m4 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff -Naur a/configure b/configure
---- a/configure	2017-08-02 14:50:09.000000000 +0200
-+++ b/configure	2017-08-02 14:50:57.000000000 +0200
-@@ -16001,7 +16001,7 @@
- 
- #error "This is not a C++ compiler"
- 
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
- 
- #error "This is not a C++11 compiler"
- 
-@@ -16314,7 +16314,7 @@
- 
- #error "This is not a C++ compiler"
- 
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
- 
- #error "This is not a C++11 compiler"
- 
-@@ -16636,7 +16636,7 @@
- 
- #error "This is not a C++ compiler"
- 
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
- 
- #error "This is not a C++11 compiler"
- 
--- 
-2.12.3
-
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 369bef4c1233..2d53be212354 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -237,10 +237,10 @@
                     "dest-filename": "external/tarballs/libgpg-error-1.27.tar.bz2"
                 },
                 {
-                    "url": "https://dev-www.libreoffice.org/src/libabw-0.1.2.tar.xz",
-                    "sha256": "0b72944d5af81dda0a5c5803ee84cbac4b81441a4d767aa57029adc6744c2485",
+                    "url": "https://dev-www.libreoffice.org/src/libabw-0.1.3.tar.xz",
+                    "sha256": "e763a9dc21c3d2667402d66e202e3f8ef4db51b34b79ef41f56cacb86dcd6eed",
                     "type": "file",
-                    "dest-filename": "external/tarballs/libabw-0.1.2.tar.xz"
+                    "dest-filename": "external/tarballs/libabw-0.1.3.tar.xz"
                 },
                 {
                     "url": "https://dev-www.libreoffice.org/src/libcdr-0.1.4.tar.xz",
commit 2aca7fa0d6dad1060a8f010a5135cc61e49c0a18
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Mar 24 10:48:04 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:15 2020 +0200

    icu: add patch to fix CVE-2020-10531
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90971
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 002d1152dc418f7d624409e76cd9d4ac0b42c7f8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90975
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 63b573faf984875cda7a879e696ea75fae81df57)
    
    Change-Id: I0aca4af1bd79f28bf1c920a4d05e80948106aaac

diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index 1a9c5ff90602..6f99976871ad 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -13,7 +13,10 @@ $(eval $(call gb_ExternalProject_register_targets,icu,\
 	build \
 ))
 
-icu_CPPFLAGS:="-DHAVE_GCC_ATOMICS=$(if $(filter TRUE,$(GCC_HAVE_BUILTIN_ATOMIC)),1,0)"
+# -I to find o3tl headers
+icu_CPPFLAGS:=" \
+	-DHAVE_GCC_ATOMICS=$(if $(filter TRUE,$(GCC_HAVE_BUILTIN_ATOMIC)),1,0) \
+	-I$(SRCDIR)/include"
 
 ifeq ($(OS),WNT)
 
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 499650976a55..ef195a13686c 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
 	$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
 	external/icu/icu4c-khmerbreakengine.patch.1 \
 	external/icu/icu4c-59-werror-shadow.patch.1 \
+	external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2 \
 ))
 
 $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2 b/external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2
new file mode 100644
index 000000000000..d3b34db670c5
--- /dev/null
+++ b/external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2
@@ -0,0 +1,37 @@
+From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang at chromium.org>
+Date: Sat, 1 Feb 2020 02:39:04 +0000
+Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
+
+See #971
+---
+ icu4c/source/common/unistr.cpp          |  6 ++-
+ icu4c/source/test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++
+ icu4c/source/test/intltest/ustrtest.h   |  1 +
+ 3 files changed, 68 insertions(+), 1 deletion(-)
+
+diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp
+index 901bb3358ba..077b4d6ef20 100644
+--- a/icu4c/source/common/unistr.cpp
++++ b/icu4c/source/common/unistr.cpp
+@@ -31,6 +31,7 @@
+ #include "ustr_imp.h"
+ #include "umutex.h"
+ #include "uassert.h"
++#include <o3tl/safeint.hxx>
+ 
+ #if 0
+ 
+@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
+   }
+ 
+   int32_t oldLength = length();
+-  int32_t newLength = oldLength + srcLength;
++  int32_t newLength;
++  if (o3tl::checked_add(oldLength, srcLength, newLength)) {
++    setToBogus();
++    return *this;
++  }
+   // optimize append() onto a large-enough, owned string
+   if((newLength <= getCapacity() && isBufferWritable()) ||
+       cloneArrayIfNeeded(newLength, getGrowCapacity(newLength))) {
commit 1c707ce8efcb8dd435da3faff11775ee7cf81203
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 15 17:16:02 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:15 2020 +0200

    Remove a fragment from a file URL early on
    
    ...as ShellExecuteExW would ignore it anyway
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86868
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 14b36a16b225bf7c988f118d499a7287c47cd83e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86877
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 51da0d22ff42b20ab38130b7874651ef136ecceb)
    
    Change-Id: I969db094bb7d2ea230ac8c36eb23d71a90fbe466

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 33554bd5608f..9ee49fd5db56 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -306,6 +306,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
             static_cast< XSystemShellExecute* >( this ),
             3 );
 
+    OUString preprocessed_command(aCommand);
     if ((nFlags & URIS_ONLY) != 0)
     {
         css::uno::Reference< css::uri::XUriReference > uri(
@@ -319,6 +320,9 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
                 static_cast< cppu::OWeakObject * >(this), 0);
         }
         if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
+            // ShellExecuteExW appears to ignore the fragment of a file URL anyway, so remove it:
+            uri->clearFragment();
+            preprocessed_command = uri->getUriReference();
             OUString pathname;
             auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, pathname);
             if (e1 != osl::FileBase::E_None) {
@@ -422,7 +426,6 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
         and names no existing file (remember the jump mark
         sign '#' is a valid file name character we remove
         the jump mark, else ShellExecuteEx fails */
-    OUString preprocessed_command(aCommand);
     if (is_system_path(preprocessed_command))
     {
         if (has_jump_mark(preprocessed_command) && !is_existing_file(preprocessed_command))
commit cd0d034110f5622131db8e2195da0939c8ef148f
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Nov 20 13:11:59 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:15 2020 +0200

    poppler: upgrade to release 0.82.0
    
    fixes CVE-2019-9903 CVE-2019-9631 CVE-2019-9545 CVE-2019-9543
    CVE-2019-14494 CVE-2019-12293 CVE-2019-11026 CVE-2019-10873
    CVE-2019-10872 CVE-2019-10871 CVE-2019-10018
    
    remove obsolete 0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1
    
    Reviewed-on: https://gerrit.libreoffice.org/83308
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 28e52c49452320ac76489d0f93ca5692456e5331)
    Reviewed-on: https://gerrit.libreoffice.org/83336
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit f3b2d61376c6d7ae262f58406d89ef0caa8b0aaf)
    
    Change-Id: I72b3bf89b294ed3e24157c7e75fd58d4f68d9f35

diff --git a/download.lst b/download.lst
index bf61e2ff6bf6..fb8d42762b01 100644
--- a/download.lst
+++ b/download.lst
@@ -220,8 +220,8 @@ export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export LIBPNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
 export LIBPNG_TARBALL := libpng-1.6.37.tar.xz
-export POPPLER_SHA256SUM := 92e09fd3302567fd36146b36bb707db43ce436e8841219025a82ea9fb0076b2f
-export POPPLER_TARBALL := poppler-0.74.0.tar.xz
+export POPPLER_SHA256SUM := 234f8e573ea57fb6a008e7c1e56bfae1af5d1adf0e65f47555e1ae103874e4df
+export POPPLER_TARBALL := poppler-0.82.0.tar.xz
 export POSTGRESQL_SHA256SUM := db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 export PYTHON_SHA256SUM := 063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009
diff --git a/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1 b/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1
deleted file mode 100644
index b459a0a0bef7..000000000000
--- a/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1
+++ /dev/null
@@ -1,27 +0,0 @@
-From f4136a6353162db249f63ddb0f20611622ab61b4 Mon Sep 17 00:00:00 2001
-From: Albert Astals Cid <aacid at kde.org>
-Date: Wed, 27 Feb 2019 19:43:22 +0100
-Subject: [PATCH] ImageStream::getLine: fix crash on broken files
-
-Fixes #728
----
- poppler/Stream.cc | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/poppler/Stream.cc b/poppler/Stream.cc
-index 33537b0e..a41435ab 100644
---- a/poppler/Stream.cc
-+++ b/poppler/Stream.cc
-@@ -496,6 +496,9 @@ unsigned char *ImageStream::getLine() {
-   }
-  
-   int readChars = str->doGetChars(inputLineSize, inputLine);
-+  if (unlikely(readChars == -1)) {
-+      readChars = 0;
-+  }
-   for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF;
-   if (nBits == 1) {
-     unsigned char *p = inputLine;
--- 
-2.20.1
-
diff --git a/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 b/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1
new file mode 100644
index 000000000000..26fdc10dec50
--- /dev/null
+++ b/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1
@@ -0,0 +1,169 @@
+Revert "Make the mul tables be calculated at compile time with constexpr"
+
+This reverts commit e0ef346c0f669140076c4cf443f07ea0770996da.
+---
+ poppler/Decrypt.cc | 134 ++++++++++++---------------------------------
+ 1 file changed, 35 insertions(+), 99 deletions(-)
+
+diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
+index 57945778..f5062929 100644
+--- a/poppler/Decrypt.cc
++++ b/poppler/Decrypt.cc
+@@ -763,119 +763,55 @@ static inline void invShiftRows(unsigned char *state) {
+ }
+ 
+ // {02} \cdot s
+-struct Mul02Table
+-{
+-  constexpr Mul02Table() : values()
+-  {
+-    for(int s = 0; s < 256; s++) {
+-      values[s] = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-    }
+-  }
+-
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+-  unsigned char values[256];
+-};
+-
+-static constexpr Mul02Table mul02;
++static inline unsigned char mul02(unsigned char s) {
++  return (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++}
+ 
+ // {03} \cdot s
+-struct Mul03Table
+-{
+-  constexpr Mul03Table() : values()
+-  {
+-    for(int s=0; s<256; s++) {
+-      const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-      values[s] = s ^ s2;
+-    }
+-  }
+-
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+-  unsigned char values[256];
+-};
+-
+-static constexpr Mul03Table mul03;
++static inline unsigned char mul03(unsigned char s) {
++  unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++  return s ^ s2;
++}
+ 
+ // {09} \cdot s
+-struct Mul09Table
+-{
+-  constexpr Mul09Table() : values()
+-  {
+-    for(int s=0; s<256; s++) {
+-      const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-      const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+-      const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+-      values[s] = s ^ s8;
+-    }
+-  }
+-
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+-  unsigned char values[256];
+-};
++static inline unsigned char mul09(unsigned char s) {
++  unsigned char s2, s4, s8;
+ 
+-static constexpr Mul09Table mul09;
++  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++  return s ^ s8;
++}
+ 
+ // {0b} \cdot s
+-struct Mul0bTable
+-{
+-  constexpr Mul0bTable() : values()
+-  {
+-    for(int s=0; s<256; s++) {
+-      const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-      const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+-      const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+-      values[s] = s ^ s2 ^ s8;
+-    }
+-  }
+-
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
++static inline unsigned char mul0b(unsigned char s) {
++  unsigned char s2, s4, s8;
+ 
+-  unsigned char values[256];
+-};
+-
+-static constexpr Mul0bTable mul0b;
++  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++  return s ^ s2 ^ s8;
++}
+ 
+ // {0d} \cdot s
+-struct Mul0dTable
+-{
+-  constexpr Mul0dTable() : values()
+-  {
+-    for(int s=0; s<256; s++) {
+-      const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-      const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+-      const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+-      values[s] = s ^ s4 ^ s8;
+-    }
+-  }
++static inline unsigned char mul0d(unsigned char s) {
++  unsigned char s2, s4, s8;
+ 
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+-  unsigned char values[256];
+-};
+-
+-static constexpr Mul0dTable mul0d;
++  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++  return s ^ s4 ^ s8;
++}
+ 
+ // {0e} \cdot s
+-struct Mul0eTable
+-{
+-  constexpr Mul0eTable() : values()
+-  {
+-    for(int s=0; s<256; s++) {
+-      const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+-      const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+-      const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+-      values[s] = s2 ^ s4 ^ s8;
+-    }
+-  }
+-
+-  constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
++static inline unsigned char mul0e(unsigned char s) {
++  unsigned char s2, s4, s8;
+ 
+-  unsigned char values[256];
+-};
+-
+-static constexpr Mul0eTable mul0e;
++  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++  return s2 ^ s4 ^ s8;
++}
+ 
+ static inline void mixColumns(unsigned char *state) {
+   int c;
+-- 
+2.21.0
+
diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk
index aa5ed693eb22..ae03836f2ba6 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -55,7 +55,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
 	UnpackedTarball/poppler/goo/gfile \
 	UnpackedTarball/poppler/goo/GooTimer \
 	UnpackedTarball/poppler/goo/GooString \
-	UnpackedTarball/poppler/goo/FixedPoint \
 	UnpackedTarball/poppler/goo/NetPBMWriter \
 	UnpackedTarball/poppler/goo/PNGWriter \
 	UnpackedTarball/poppler/goo/TiffWriter \
diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk
index 151fa5d0444f..76fd33236e5d 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -14,7 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler
 $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
 	external/poppler/poppler-config.patch.1 \
 	external/poppler/poppler-c++11.patch.1 \
-	external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1 \
+	external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 \
 ))
 
 # std::make_unique is only available in C++14
@@ -23,7 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
 # be happy with std::make_unique so just skip it
 ifneq ($(OS_FOR_BUILD),MACOSX)
 $(eval $(call gb_UnpackedTarball_set_post_action,poppler,\
-	env -i PATH="$(PATH)" $(FIND) . -name '*.cc' -exec sed -i -e 's/std::make_unique/o3tl::make_unique/' {} \\; \
+	env -i PATH="$(if $(filter WNT,$(OS)),/usr/bin,$(PATH))" $(FIND) . -name '*.cc' -exec sed -i -e 's/std::make_unique/o3tl::make_unique/' {} \\; \
 ))
 endif
 
diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1
index 1c68806276f7..cb74cd66fb5e 100644
--- a/external/poppler/poppler-config.patch.1
+++ b/external/poppler/poppler-config.patch.1
@@ -195,7 +195,7 @@ index 0fbd336a..451213f8 100644
 +#define PACKAGE_NAME "poppler"
 +
 +/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "poppler 0.74.0"
++#define PACKAGE_STRING "poppler 0.82.0"
 +
 +/* Define to the one symbol short name of this package. */
 +#define PACKAGE_TARNAME "poppler"
@@ -204,7 +204,7 @@ index 0fbd336a..451213f8 100644
 +#define PACKAGE_URL ""
 +
 +/* Define to the version of this package. */
-+#define PACKAGE_VERSION "0.74.0"
++#define PACKAGE_VERSION "0.82.0"
 +
 +/* Poppler data dir */
 +#define POPPLER_DATADIR "/usr/local/share/poppler"
@@ -228,7 +228,7 @@ index 0fbd336a..451213f8 100644
 +/* #undef USE_FLOAT */
 +
 +/* Version number of package */
-+#define VERSION "0.74.0"
++#define VERSION "0.82.0"
 +
 +#if defined(__APPLE__)
 +#elif defined (_WIN32)
@@ -268,7 +268,7 @@ new file mode 100644
 index 0fbd336a..451213f8 100644
 --- /dev/null
 +++ b/poppler/poppler-config.h
-@@ -0,0 +1,168 @@
+@@ -0,0 +1,173 @@
 +//================================================= -*- mode: c++ -*- ====
 +//
 +// poppler-config.h
@@ -304,7 +304,7 @@ index 0fbd336a..451213f8 100644
 +
 +/* Defines the poppler version. */
 +#ifndef POPPLER_VERSION
-+#define POPPLER_VERSION "0.74.0"
++#define POPPLER_VERSION "0.82.0"
 +#endif
 +
 +/* Enable multithreading support. */
@@ -396,6 +396,11 @@ index 0fbd336a..451213f8 100644
 +/* #undef USE_CMS */
 +#endif
 +
++/* Use header-only classes from Boost in the Splash backend */
++#ifndef USE_BOOST_HEADERS
++/* #undef USE_BOOST_HEADERS */
++#endif
++
 +// Also, there are preprocessor symbols in the header files
 +// that are used but never defined when building poppler using configure
 +// or cmake: DISABLE_OUTLINE, DEBUG_MEM,
@@ -466,9 +471,9 @@ index 0fbd336a..451213f8 100644
 +
 +#include "poppler-global.h"
 +
-+#define POPPLER_VERSION "0.74.0"
++#define POPPLER_VERSION "0.82.0"
 +#define POPPLER_VERSION_MAJOR 0
-+#define POPPLER_VERSION_MINOR 74
++#define POPPLER_VERSION_MINOR 82
 +#define POPPLER_VERSION_MICRO 0
 +
 +namespace poppler
commit 1702443688a0bc219aed9afaf21e9101f2f48179
Author:     Rasmus Thomsen <oss at cogitri.dev>
AuthorDate: Sat Oct 26 14:11:35 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 23 16:08:15 2020 +0200

    Fix build with poppler-0.82
    
    Reviewed-on: https://gerrit.libreoffice.org/81545
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 2eadd46ab81058087af95bdfc1fea28fcdb65998)
    Reviewed-on: https://gerrit.libreoffice.org/83363
    Reviewed-by: Rasmus Thomsen <oss at cogitri.dev>
    (cherry picked from commit 928a372775a0758aa76eb10e568d5c106a8586eb)
    
    Change-Id: I3b6b3faea7986f3e5a6ae4790580d03bc9c955fc

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index cd6a5b65e30a..ed9ea6cc5440 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -877,11 +877,20 @@ void PDFOutDev::eoClip(GfxState *state)
     local offset of character (zero for horizontal writing mode). not
     taken into account for output pos updates. Used for vertical writing.
  */
+
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+void PDFOutDev::drawChar(GfxState *state, double x, double y,
+                         double dx, double dy,
+                         double originX, double originY,
+                         CharCode, int /*nBytes*/, const Unicode *u, int uLen)
+{
+#else
 void PDFOutDev::drawChar(GfxState *state, double x, double y,
                          double dx, double dy,
                          double originX, double originY,
                          CharCode, int /*nBytes*/, Unicode *u, int uLen)
 {
+#endif
     assert(state);
 
     if( u == nullptr )
@@ -995,6 +1004,13 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
     writeBinaryBuffer(aBuf);
 }
 
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
+                          int width, int height, GfxImageColorMap* colorMap,
+                          poppler_bool /*interpolate*/,
+                          const int* maskColors, poppler_bool /*inlineImg*/ )
+{
+#else
 void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
                           int width, int height, GfxImageColorMap* colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
@@ -1002,6 +1018,7 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
 #endif
                           int* maskColors, poppler_bool /*inlineImg*/ )
 {
+#endif
     if (m_bSkipImages)
         return;
     OutputBuffer aBuf; initBuf(aBuf);
@@ -1022,12 +1039,20 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
         {
             GfxRGB aMinRGB;
             colorMap->getColorSpace()->getRGB(
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+                reinterpret_cast<const GfxColor*>(maskColors),
+#else
                 reinterpret_cast<GfxColor*>(maskColors),
+#endif
                 &aMinRGB );
 
             GfxRGB aMaxRGB;
             colorMap->getColorSpace()->getRGB(
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+                reinterpret_cast<const GfxColor*>(maskColors)+gfxColorMaxComps,
+#else
                 reinterpret_cast<GfxColor*>(maskColors)+gfxColorMaxComps,
+#endif
                 &aMaxRGB );
 
             aMaskBuf.push_back( colToByte(aMinRGB.r) );
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index ced1a653a494..ccf5b8fa9535 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -232,10 +232,17 @@ namespace pdfi
         virtual void eoClip(GfxState *state) override;
 
         //----- text drawing
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+        virtual void drawChar(GfxState *state, double x, double y,
+                              double dx, double dy,
+                              double originX, double originY,
+                              CharCode code, int nBytes, const Unicode *u, int uLen) override;
+#else
         virtual void drawChar(GfxState *state, double x, double y,
                               double dx, double dy,
                               double originX, double originY,
                               CharCode code, int nBytes, Unicode *u, int uLen) override;
+#endif
 #if POPPLER_CHECK_VERSION(0, 64, 0)

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list