Rebased ref, commits from common ancestor:
commit c81f8fe8d85c7c2c81a8496f4669f7ada4db1e3a
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Mon Nov 25 17:33:12 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:54 2019 +0100

    Release 5.4.9.0

diff --git a/configure.ac b/configure.ac
index f3450a5eed75..92264315cc2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([LibreOffice],[5.4.8.0.0+],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[5.4.9.0],[],[],[http://documentfoundation.org/])
 
 AC_PREREQ([2.59])
 
commit d3440285a4729e773a3eea666471e57d3a537bdc
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Fri Feb 15 11:31:04 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:54 2019 +0100

    tdf#123481 jurt: Avoid thread deadlocking
    
    Change-Id: I7b6454090aeb1046a814520166a5b8c39b716f6d
    Reviewed-on: https://gerrit.libreoffice.org/67861
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
    (cherry picked from commit ea3c25358e3136cf900bc4e7d1bd6387dcca7883)

diff --git a/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java 
b/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
index 0e7ecc41ba4d..588b8fe388f6 100644
--- a/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
+++ b/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
@@ -92,7 +92,9 @@ public final class AsynchronousFinalizer {
             done = true;
             queue.notify();
         }
-        thread.join();
+        // tdf#123481 Only join if we are not in our own thread, else we have 
a deadlock
+        if (Thread.currentThread() != thread)
+            thread.join();
     }
 
     /**
commit abe5a7af6a6f2aa80c5847ca38c781569ea1533c
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Mon Nov 25 17:27:50 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:54 2019 +0100

    .gitreview: Update default branch

diff --git a/.gitreview b/.gitreview
index 0f8e2875a6cc..8bb2a30d1a15 100644
--- a/.gitreview
+++ b/.gitreview
@@ -3,5 +3,4 @@ host=logerrit
 port=29418
 project=core
 defaultremote=logerrit
-defaultbranch=libreoffice-5-4
-
+defaultbranch=feature/cib_contract891c
commit f6cf08c4eb1ebf316ff62e74a2fa90e51a8b97c9
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Nov 25 12:34:28 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:54 2019 +0100

    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.st...@cib.de>
    (cherry picked from commit a6238c3fba80889f9090d997e2a4979b78b34ac7)
    
    Change-Id: I72e35c90fabb0a83f547a787dbaee774e35f9c08

diff --git a/download.lst b/download.lst
index f6e94fbcc512..f46a38121016 100644
--- a/download.lst
+++ b/download.lst
@@ -164,8 +164,8 @@ export MYTHES_SHA256SUM := 
1e81f395d8c851c3e4e75b568e20fa2fa549354e75ab397f9de4b
 export MYTHES_TARBALL := a8c2c5b8f09e7ede322d5c602ff6a4b6-mythes-1.2.4.tar.gz
 export NEON_SHA256SUM := 
00c626c0dc18d094ab374dbd9a354915bfe4776433289386ed489c2ec0845cdd
 export NEON_TARBALL := 231adebe5c2f78fded3e3df6e958878e-neon-0.30.1.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 7e1fbdaa2ff7..463451ecd924 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 7326c5a807d0..a2b7b65d68a6 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 3f76fc52436d..c1f994787ecb 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 2ee04c5c6f5dbbbbb22efef7915d3a3c23cc44ac
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Nov 25 18:16:48 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:54 2019 +0100

    l10ntools: try to fix WNT build failure in uimerge.cxx by ...
    
    ... moving libxslt includes first:
    
    C:\PROGRA~2\MICROS~2\Windows\v7.1A\include\winnt.h(519): warning C4005: 
'DECLARE_HANDLE': macro redefinition
    C:\LO\lode\dev\core\include\sal/main.h(87): note: see previous definition 
of 'DECLARE_HANDLE'
    C:\PROGRA~2\MICROS~2\Windows\v7.1A\include\windef.h(280): error C2371: 
'HINSTANCE': redefinition; different basic types
    C:\LO\lode\dev\core\include\sal/main.h(89): note: see declaration of 
'HINSTANCE'
    
    Change-Id: Ia9a89835c2d0b0c3dadde6258b5f3ea013541626

diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx
index dd334de13fa5..b85ac7c78915 100644
--- a/l10ntools/source/uimerge.cxx
+++ b/l10ntools/source/uimerge.cxx
@@ -7,17 +7,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <libexslt/exslt.h>
+#include <libxslt/transform.h>
+#include <libxslt/xslt.h>
+#include <libxslt/xsltutils.h>
+
 #include <sal/main.h>
 
 #include <osl/file.hxx>
 
 #include <rtl/strbuf.hxx>
 
-#include <libexslt/exslt.h>
-#include <libxslt/transform.h>
-#include <libxslt/xslt.h>
-#include <libxslt/xsltutils.h>
-
 #include <stdio.h>
 
 #include "common.hxx"
commit 09719b0dbc2a139decb2cc7a3f3612d24972e7f9
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Nov 20 13:11:59 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:53 2019 +0100

    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.st...@cib.de>
    (cherry picked from commit 28e52c49452320ac76489d0f93ca5692456e5331)
    Reviewed-on: https://gerrit.libreoffice.org/83336
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit f3b2d61376c6d7ae262f58406d89ef0caa8b0aaf)
    
    Change-Id: I72b3bf89b294ed3e24157c7e75fd58d4f68d9f35

diff --git a/download.lst b/download.lst
index ca44e2d2c3a7..f6e94fbcc512 100644
--- a/download.lst
+++ b/download.lst
@@ -191,8 +191,8 @@ export PIXMAN_SHA256SUM := 
21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export PNG_SHA256SUM := 
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
 export PNG_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 := 
c24a37c63a67f53bdd09c5f287b5cff8e8b98f857bf348c577d454d3f74db049
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 <aa...@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 17e921cb82d8..59a5a4ac94f0 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 df4f773e74c18453018562454b00f9bbbd0b1af9
Author:     Rasmus Thomsen <o...@cogitri.dev>
AuthorDate: Sat Oct 26 14:11:35 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:53 2019 +0100

    Fix build with poppler-0.82
    
    Reviewed-on: https://gerrit.libreoffice.org/81545
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 2eadd46ab81058087af95bdfc1fea28fcdb65998)
    Reviewed-on: https://gerrit.libreoffice.org/83363
    Reviewed-by: Rasmus Thomsen <o...@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 18a0f8e8e8ff..c23a8cff90bd 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -882,11 +882,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 )
@@ -1000,6 +1009,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)
@@ -1007,6 +1023,7 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
 #endif
                           int* maskColors, poppler_bool /*inlineImg*/ )
 {
+#endif
     if (m_bSkipImages)
         return;
     OutputBuffer aBuf; initBuf(aBuf);
@@ -1027,12 +1044,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 4b73e9a122e6..e6e35eab88ef 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)
         virtual void drawString(GfxState *state, const GooString *s) override;
 #else
@@ -250,12 +257,19 @@ namespace pdfi
                                    poppler_bool interpolate,
 #endif
                                    poppler_bool inlineImg) override;
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+        virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+                               int width, int height, GfxImageColorMap 
*colorMap,
+                               poppler_bool interpolate,
+                               const int* maskColors, poppler_bool inlineImg) 
override;
+#else
         virtual void drawImage(GfxState *state, Object *ref, Stream *str,
                                int width, int height, GfxImageColorMap 
*colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
                                poppler_bool interpolate,
 #endif
                                int *maskColors, poppler_bool inlineImg) 
override;
+#endif
         virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
                                      int width, int height,
                                      GfxImageColorMap *colorMap,
commit 78b30ef961001949d6cde7a6a579d1643818d0fd
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Nov 20 15:08:24 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:53 2019 +0100

    libxslt: upgrade to release 1.1.34
    
    Fixes CVE-2019-18197.
    
    Remove obsolete e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1.
    
    Reviewed-on: https://gerrit.libreoffice.org/83312
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit e9ea24cc004a8b9a5856f2f268bd40433c504db1)
    Reviewed-on: https://gerrit.libreoffice.org/83377
    (cherry picked from commit d19b32c779bfeb51ef9570c3de8ed1925ec44473)
    
    Change-Id: I95cf498e245083528f98bfef8cdd240bbe2211b9

diff --git a/download.lst b/download.lst
index 69a503cafcc8..ca44e2d2c3a7 100644
--- a/download.lst
+++ b/download.lst
@@ -142,8 +142,8 @@ export LIBXMLSEC_TARBALL := xmlsec1-1.2.24.tar.gz
 export LIBXML_SHA256SUM := 
aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
 export LIBXML_VERSION_MICRO := 10
 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
-export LIBXSLT_SHA256SUM := 
8e36605144409df979cab43d835002f63988f3dc94d5d3537c12796db90e38c8
-export LIBXSLT_VERSION_MICRO := 33
+export LIBXSLT_SHA256SUM := 
98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f
+export LIBXSLT_VERSION_MICRO := 34
 export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz
 export LPSOLVE_SHA256SUM := 
171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695
 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
diff --git a/external/libxslt/UnpackedTarball_xslt.mk 
b/external/libxslt/UnpackedTarball_xslt.mk
index ce16715d7817..3ba4f0d130a0 100644
--- a/external/libxslt/UnpackedTarball_xslt.mk
+++ b/external/libxslt/UnpackedTarball_xslt.mk
@@ -17,7 +17,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,xslt,\
        external/libxslt/libxslt-msvc.patch.2 \
        external/libxslt/libxslt-1.1.26-memdump.patch \
        external/libxslt/rpath.patch.0 \
-       external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1 \
+       external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1 
b/external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1
deleted file mode 100644
index 260f35d1a35e..000000000000
--- a/external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1
+++ /dev/null
@@ -1,120 +0,0 @@
-From e03553605b45c88f0b4b2980adfbbb8f6fca2fd6 Mon Sep 17 00:00:00 2001
-From: Nick Wellnhofer <wellnho...@aevum.de>
-Date: Sun, 24 Mar 2019 09:51:39 +0100
-Subject: [PATCH] Fix security framework bypass
-
-xsltCheckRead and xsltCheckWrite return -1 in case of error but callers
-don't check for this condition and allow access. With a specially
-crafted URL, xsltCheckRead could be tricked into returning an error
-because of a supposedly invalid URL that would still be loaded
-succesfully later on.
-
-Fixes #12.
-
-Thanks to Felix Wilhelm for the report.
----
- libxslt/documents.c | 18 ++++++++++--------
- libxslt/imports.c   |  9 +++++----
- libxslt/transform.c |  9 +++++----
- libxslt/xslt.c      |  9 +++++----
- 4 files changed, 25 insertions(+), 20 deletions(-)
-
-diff --git a/libxslt/documents.c b/libxslt/documents.c
-index 3f3a7312..4aad11bb 100644
---- a/libxslt/documents.c
-+++ b/libxslt/documents.c
-@@ -296,10 +296,11 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const 
xmlChar *URI) {
-       int res;
- 
-       res = xsltCheckRead(ctxt->sec, ctxt, URI);
--      if (res == 0) {
--          xsltTransformError(ctxt, NULL, NULL,
--               "xsltLoadDocument: read rights for %s denied\n",
--                           URI);
-+      if (res <= 0) {
-+            if (res == 0)
-+                xsltTransformError(ctxt, NULL, NULL,
-+                     "xsltLoadDocument: read rights for %s denied\n",
-+                                 URI);
-           return(NULL);
-       }
-     }
-@@ -372,10 +373,11 @@ xsltLoadStyleDocument(xsltStylesheetPtr style, const 
xmlChar *URI) {
-       int res;
- 
-       res = xsltCheckRead(sec, NULL, URI);
--      if (res == 0) {
--          xsltTransformError(NULL, NULL, NULL,
--               "xsltLoadStyleDocument: read rights for %s denied\n",
--                           URI);
-+      if (res <= 0) {
-+            if (res == 0)
-+                xsltTransformError(NULL, NULL, NULL,
-+                     "xsltLoadStyleDocument: read rights for %s denied\n",
-+                                 URI);
-           return(NULL);
-       }
-     }
-diff --git a/libxslt/imports.c b/libxslt/imports.c
-index 874870cc..3783b247 100644
---- a/libxslt/imports.c
-+++ b/libxslt/imports.c
-@@ -130,10 +130,11 @@ xsltParseStylesheetImport(xsltStylesheetPtr style, 
xmlNodePtr cur) {
-       int secres;
- 
-       secres = xsltCheckRead(sec, NULL, URI);
--      if (secres == 0) {
--          xsltTransformError(NULL, NULL, NULL,
--               "xsl:import: read rights for %s denied\n",
--                           URI);
-+      if (secres <= 0) {
-+            if (secres == 0)
-+                xsltTransformError(NULL, NULL, NULL,
-+                     "xsl:import: read rights for %s denied\n",
-+                                 URI);
-           goto error;
-       }
-     }
-diff --git a/libxslt/transform.c b/libxslt/transform.c
-index 13793914..0636dbd0 100644
---- a/libxslt/transform.c
-+++ b/libxslt/transform.c
-@@ -3493,10 +3493,11 @@ xsltDocumentElem(xsltTransformContextPtr ctxt, 
xmlNodePtr node,
-      */
-     if (ctxt->sec != NULL) {
-       ret = xsltCheckWrite(ctxt->sec, ctxt, filename);
--      if (ret == 0) {
--          xsltTransformError(ctxt, NULL, inst,
--               "xsltDocumentElem: write rights for %s denied\n",
--                           filename);
-+      if (ret <= 0) {
-+            if (ret == 0)
-+                xsltTransformError(ctxt, NULL, inst,
-+                     "xsltDocumentElem: write rights for %s denied\n",
-+                                 filename);
-           xmlFree(URL);
-           xmlFree(filename);
-           return;
-diff --git a/libxslt/xslt.c b/libxslt/xslt.c
-index 780a5ad7..a234eb79 100644
---- a/libxslt/xslt.c
-+++ b/libxslt/xslt.c
-@@ -6763,10 +6763,11 @@ xsltParseStylesheetFile(const xmlChar* filename) {
-       int res;
- 
-       res = xsltCheckRead(sec, NULL, filename);
--      if (res == 0) {
--          xsltTransformError(NULL, NULL, NULL,
--               "xsltParseStylesheetFile: read rights for %s denied\n",
--                           filename);
-+      if (res <= 0) {
-+            if (res == 0)
-+                xsltTransformError(NULL, NULL, NULL,
-+                     "xsltParseStylesheetFile: read rights for %s denied\n",
-+                                 filename);
-           return(NULL);
-       }
-     }
--- 
-2.18.1
-
diff --git a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 
b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1
new file mode 100644
index 000000000000..f82c2e4f77ee
--- /dev/null
+++ b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1
@@ -0,0 +1,69 @@
+From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001
+From: Chun-wei Fan <fanchun...@src.gnome.org>
+Date: Tue, 12 Nov 2019 17:37:05 +0800
+Subject: [PATCH] win32: Add configuration for profiler
+
+Without this the generated xsltconfig.h will not be complete as there
+will be a configuration variable that is left in the header, breaking
+builds.
+
+This will allow one to enable or disable profiler support in Windows
+builds, and the default is to enable this.
+---
+ win32/configure.js | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/win32/configure.js b/win32/configure.js
+index 56694cce..12c99f30 100644
+--- a/win32/configure.js
++++ b/win32/configure.js
+@@ -47,6 +47,7 @@ var withIconv = true;
+ var withZlib = false;
+ var withCrypto = true;
+ var withModules = false;
++var withProfiler = true;
+ /* Win32 build options. */
+ var dirSep = "\\";
+ var compiler = "msvc";
+@@ -106,6 +107,7 @@ function usage()
+       txt += "  zlib:       Use zlib library (" + (withZlib? "yes" : "no") + 
")\n";
+       txt += "  crypto:     Enable Crypto support (" + (withCrypto? "yes" : 
"no") + ")\n";
+       txt += "  modules:    Enable Module support (" + (withModules? "yes" : 
"no") + ")\n";
++      txt += "  profiler:   Enable Profiler support (" + (withProfiler? "yes" 
: "no") + ")\n";
+       txt += "\nWin32 build options, default value given in parentheses:\n\n";
+       txt += "  compiler:   Compiler to be used [msvc|mingw] (" + compiler + 
")\n";
+       txt += "  cruntime:   C-runtime compiler option (only msvc) (" + 
cruntime + ")\n";
+@@ -192,6 +194,7 @@ function discoverVersion()
+       vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0"));
+       vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0"));
+       vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
++      vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0"));
+       vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
+       vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
+       vf.WriteLine("PREFIX=" + buildPrefix);
+@@ -240,6 +243,8 @@ function configureXslt()
+                       of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, 
withDebugger? "1" : "0"));
+               } else if (s.search(/\@WITH_MODULES\@/) != -1) {
+                       of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? 
"1" : "0"));
++              } else if (s.search(/\@WITH_PROFILER\@/) != -1) {
++                      of.WriteLine(s.replace(/\@WITH_PROFILER\@/, 
withProfiler? "1" : "0"));
+               } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) {
+                       
of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL"));
+               } else
+@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 
0); i++) {
+                       withCrypto = strToBool(arg.substring(opt.length + 1, 
arg.length));
+               else if (opt == "modules")
+                       withModules = strToBool(arg.substring(opt.length + 1, 
arg.length));
++              else if (opt == "profiler")
++                      withProfiler = strToBool(arg.substring(opt.length + 1, 
arg.length));
+               else if (opt == "compiler")
+                       compiler = arg.substring(opt.length + 1, arg.length);
+               else if (opt == "cruntime")
+@@ -477,6 +484,7 @@ txtOut += "         Use iconv: " + boolToStr(withIconv) + 
"\n";
+ txtOut += "         With zlib: " + boolToStr(withZlib) + "\n";
+ txtOut += "            Crypto: " + boolToStr(withCrypto) + "\n";
+ txtOut += "           Modules: " + boolToStr(withModules) + "\n";
++txtOut += "          Profiler: " + boolToStr(withProfiler) + "\n";
+ txtOut += "\n";
+ txtOut += "Win32 build configuration\n";
+ txtOut += "-------------------------\n";
diff --git a/external/libxslt/libxslt-config.patch.1 
b/external/libxslt/libxslt-config.patch.1
index dc33871398cc..6360d8cce512 100644
--- a/external/libxslt/libxslt-config.patch.1
+++ b/external/libxslt/libxslt-config.patch.1
@@ -23,13 +23,13 @@ Hack the xslt-config to return paths into WORKDIR.
  
  usage()
  {
-@@ -89,7 +95,8 @@
-     shift
- done
+@@ -92,7 +98,8 @@
+             libs="@XSLT_LIBDIR@ $libs"
+         fi
  
--the_libs="@XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@"
-+#the_libs="@XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@"
-+the_libs="-L${libdir} -lxslt -lm"
- if test "$includedir" != "/usr/include"; then
-     the_flags="$the_flags -I$includedir `@XML_CONFIG@ --cflags`"
- else
+-        libs="$libs @EXTRA_LIBS@"
++        #libs="$libs @EXTRA_LIBS@"
++        libs="-L${libdir}/libxslt/.libs -L${libdir}/libexslt/.libs -lxslt -lm"
+               ;;
+ 
+     *)
diff --git a/external/libxslt/libxslt-internal-symbols.patch.1 
b/external/libxslt/libxslt-internal-symbols.patch.1
index 7b13e1007c00..84a15154d729 100644
--- a/external/libxslt/libxslt-internal-symbols.patch.1
+++ b/external/libxslt/libxslt-internal-symbols.patch.1
@@ -1,13 +1,13 @@
 --- xslt/libxslt/libxslt.syms.orig     2017-09-05 16:25:50.504966267 +0200
 +++ xslt/libxslt/libxslt.syms  2017-09-05 16:41:00.256895709 +0200
 @@ -497,5 +497,10 @@
- # xsltInternals
-   xsltFlagRVTs;
-   xsltDecimalFormatGetByQName;
+ 
+ # pattern
+   xsltCompMatchClearCache;
 +
 +# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
 +    local:
 +  *;
 +
- } LIBXML2_1.1.27;
+ } LIBXML2_1.1.30;
  
commit 2d7cc680c0ceade7ec45d632c1a59ad1026fb623
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Jan 14 15:52:00 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:53 2019 +0100

    libxslt: upgrade to release 1.1.33
    
    Change-Id: Ifc64dae74df341e107857e43223ead04b9c1061e
    Reviewed-on: https://gerrit.libreoffice.org/66309
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 3f720ac5ff65ddb2c0a06e48d0e2e9bec29f3a43)
    Reviewed-on: https://gerrit.libreoffice.org/66364
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit efe7b735104343e5e0182e1b004aca9c7b79a901)

diff --git a/download.lst b/download.lst
index a31c19985833..69a503cafcc8 100644
--- a/download.lst
+++ b/download.lst
@@ -142,8 +142,8 @@ export LIBXMLSEC_TARBALL := xmlsec1-1.2.24.tar.gz
 export LIBXML_SHA256SUM := 
aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
 export LIBXML_VERSION_MICRO := 10
 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
-export LIBXSLT_SHA256SUM := 
526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460
-export LIBXSLT_VERSION_MICRO := 32
+export LIBXSLT_SHA256SUM := 
8e36605144409df979cab43d835002f63988f3dc94d5d3537c12796db90e38c8
+export LIBXSLT_VERSION_MICRO := 33
 export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz
 export LPSOLVE_SHA256SUM := 
171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695
 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
commit 57912e6ea439ee897af53719ba06d1e49f2b2855
Author:     David Tardon <dtar...@redhat.com>
AuthorDate: Tue Nov 7 19:50:04 2017 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:53 2019 +0100

    upload libxslt 1.1.32
    
    Reviewed-on: https://gerrit.libreoffice.org/44422
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: David Tardon <dtar...@redhat.com>
    (cherry picked from commit c110dabbf0fcddf9da2e61d66ca093cf6e6c57a1)
    
    Change-Id: Idee2f18dccdf309027142137683ac86735f575cc

diff --git a/download.lst b/download.lst
index 5917a1660605..a31c19985833 100644
--- a/download.lst
+++ b/download.lst
@@ -142,8 +142,9 @@ export LIBXMLSEC_TARBALL := xmlsec1-1.2.24.tar.gz
 export LIBXML_SHA256SUM := 
aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
 export LIBXML_VERSION_MICRO := 10
 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
-export LIBXSLT_SHA256SUM := 
ba65236116de8326d83378b2bd929879fa185195bc530b9d1aba72107910b6b3
-export LIBXSLT_TARBALL := libxslt-1.1.30.tar.gz
+export LIBXSLT_SHA256SUM := 
526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460
+export LIBXSLT_VERSION_MICRO := 32
+export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz
 export LPSOLVE_SHA256SUM := 
171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695
 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
 export MARIADB_SHA256SUM := 
fd2f751dea049c1907735eb236aeace1d811d6a8218118b00bbaa9b84dc5cd60
diff --git a/external/libxslt/ExternalPackage_xslt.mk 
b/external/libxslt/ExternalPackage_xslt.mk
index 4354bd4b6191..f0fd5336297d 100644
--- a/external/libxslt/ExternalPackage_xslt.mk
+++ b/external/libxslt/ExternalPackage_xslt.mk
@@ -24,8 +24,8 @@ $(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.dll,wi
 $(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.dll,win32/bin.msvc/libexslt.dll))
 endif
 else # OS!=WNT
-$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.30))
-$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.18))
+$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.$(LIBXSLT_VERSION_MICRO)))
+$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.20))
 endif
 endif # DISABLE_DYNLOADING
 
diff --git a/external/libxslt/libxslt-msvc.patch.2 
b/external/libxslt/libxslt-msvc.patch.2
index 07e5dce578d8..1f538a5a7f88 100644
--- a/external/libxslt/libxslt-msvc.patch.2
+++ b/external/libxslt/libxslt-msvc.patch.2
@@ -1,7 +1,7 @@
 --- build/libxslt-1.1.26/win32/Makefile.msvc.old       2010-10-20 
01:02:55.359375000 +0200
 +++ build/libxslt-1.1.26/win32/Makefile.msvc   2010-10-20 01:03:05.187500000 
+0200
 @@ -54,6 +54,7 @@
- CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W3 $(CRUNTIME) /D 
"_REENTRANT"
+ CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /W3 /wd4244 /wd4267 $(CRUNTIME) /D 
"_REENTRANT"
  CFLAGS = $(CFLAGS) /I$(BASEDIR) /I$(XSLT_SRCDIR) /I$(INCPREFIX)
  CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
 +CFLAGS = $(CFLAGS) -arch:SSE $(SOLARINC) 
-I$(WORKDIR)\UnpackedTarball\xml2\include 
-I$(WORKDIR)/UnpackedTarball/icu/source/i18n 
-I$(WORKDIR)/UnpackedTarball/icu/source/common
commit 7551a672f5ceeecd37088a8f3f4e67bbc54ac5bc
Author:     Michael Stahl <mst...@redhat.com>
AuthorDate: Tue Sep 5 16:55:50 2017 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    libxslt: upgrade to release 1.1.30
    
    * drop most of libxslt-internal-symbols.patch, fixed upstream
    
    Reviewed-on: https://gerrit.libreoffice.org/41947
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit 1d7b3cbe1f08319eddf88aac04923ae44873f246)
    
    Change-Id: I59cf57a4d3139ad5fa0e5ce1a6cdaaa568ae3a40

diff --git a/download.lst b/download.lst
index f5e41e3c6dc4..5917a1660605 100644
--- a/download.lst
+++ b/download.lst
@@ -142,8 +142,8 @@ export LIBXMLSEC_TARBALL := xmlsec1-1.2.24.tar.gz
 export LIBXML_SHA256SUM := 
aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
 export LIBXML_VERSION_MICRO := 10
 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
-export LIBXSLT_SHA256SUM := 
b5976e3857837e7617b29f2249ebb5eeac34e249208d31f1fbf7a6ba7a4090ce
-export LIBXSLT_TARBALL := 
a129d3c44c022de3b9dcf6d6f288d72e-libxslt-1.1.29.tar.gz
+export LIBXSLT_SHA256SUM := 
ba65236116de8326d83378b2bd929879fa185195bc530b9d1aba72107910b6b3
+export LIBXSLT_TARBALL := libxslt-1.1.30.tar.gz
 export LPSOLVE_SHA256SUM := 
171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695
 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
 export MARIADB_SHA256SUM := 
fd2f751dea049c1907735eb236aeace1d811d6a8218118b00bbaa9b84dc5cd60
diff --git a/external/libxslt/ExternalPackage_xslt.mk 
b/external/libxslt/ExternalPackage_xslt.mk
index 41c79a3fe462..4354bd4b6191 100644
--- a/external/libxslt/ExternalPackage_xslt.mk
+++ b/external/libxslt/ExternalPackage_xslt.mk
@@ -24,8 +24,8 @@ $(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.dll,wi
 $(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.dll,win32/bin.msvc/libexslt.dll))
 endif
 else # OS!=WNT
-$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.29))
-$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.17))
+$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.30))
+$(eval $(call 
gb_ExternalPackage_add_file,xslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.18))
 endif
 endif # DISABLE_DYNLOADING
 
diff --git a/external/libxslt/UnpackedTarball_xslt.mk 
b/external/libxslt/UnpackedTarball_xslt.mk
index 04ef80703e86..ce16715d7817 100644
--- a/external/libxslt/UnpackedTarball_xslt.mk
+++ b/external/libxslt/UnpackedTarball_xslt.mk
@@ -13,7 +13,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,xslt,$(LIBXSLT_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_add_patches,xslt,\
        external/libxslt/libxslt-config.patch.1 \
-       external/libxslt/libxslt-internal-symbols.patch \
+       external/libxslt/libxslt-internal-symbols.patch.1 \
        external/libxslt/libxslt-msvc.patch.2 \
        external/libxslt/libxslt-1.1.26-memdump.patch \
        external/libxslt/rpath.patch.0 \
diff --git a/external/libxslt/libxslt-internal-symbols.patch 
b/external/libxslt/libxslt-internal-symbols.patch
deleted file mode 100644
index 7023cb32354d..000000000000
--- a/external/libxslt/libxslt-internal-symbols.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- misc/libxslt-1.1.26/libxslt/libxslt.syms   Thu Sep 24 16:28:46 2009
-+++ misc/build/libxslt-1.1.26/libxslt/libxslt.syms     Thu Jul  8 12:22:14 2010
-@@ -107,7 +107,7 @@
-   xsltFreeCompMatchList;
-   xsltFreeTemplateHashes;
-   xsltGetTemplate;
--  xsltMatchPattern;
-+#NOT_IMPLEMENTED  xsltMatchPattern;
-   xsltTestCompMatchList;
- 
- # preproc
-@@ -406,7 +406,7 @@
-     global:
- 
- # xsltInternals
--  xsltConstNamespaceNameXSLT; # variable
-+#XSLT_REFACTORED_XSLT_NSCOMP  xsltConstNamespaceNameXSLT; # variable
-   xsltExtensionInstructionResultFinalize;
-   xsltExtensionInstructionResultRegister;
-   xsltInitCtxtKey;
-@@ -415,24 +415,24 @@
-   xsltInit;
- 
- # xsltInternals
--  xsltParseAnyXSLTElem;
--  xsltParseSequenceConstructor;
--  xsltPointerListAddSize;
--  xsltPointerListClear;
--  xsltPointerListCreate;
--  xsltPointerListFree;
-+#XSLT_REFACTORED  xsltParseAnyXSLTElem;
-+#XSLT_REFACTORED  xsltParseSequenceConstructor;
-+#XSLT_REFACTORED  xsltPointerListAddSize;
-+#XSLT_REFACTORED  xsltPointerListClear;
-+#XSLT_REFACTORED  xsltPointerListCreate;
-+#XSLT_REFACTORED  xsltPointerListFree;
-   xsltRegisterLocalRVT;
-   xsltReleaseRVT;
--  xsltRestoreDocumentNamespaces;
-+#XSLT_REFACTORED_XSLT_NSCOMP  xsltRestoreDocumentNamespaces;
- 
- # extensions
--  xsltStyleStylesheetLevelGetExtData;
-+#XSLT_REFACTORED  xsltStyleStylesheetLevelGetExtData;
- 
- # xsltInternals
- # xsltTransStorageAdd; removed in 1.1.28
- # xsltTransStorageRemove; removed in 1.1.28
-   xsltUninit;
--  xsltXSLTAttrMarker; # variable
-+#XSLT_REFACTORED  xsltXSLTAttrMarker; # variable
- } LIBXML2_1.1.9;
- 
- LIBXML2_1.1.20 {
-@@ -475,5 +475,9 @@
- 
- # xsltutils
-   xsltXPathCompileFlags;
-+
-+# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
-+    local:
-+  *;
- } LIBXML2_1.1.26;
- 
diff --git a/external/libxslt/libxslt-internal-symbols.patch.1 
b/external/libxslt/libxslt-internal-symbols.patch.1
new file mode 100644
index 000000000000..7b13e1007c00
--- /dev/null
+++ b/external/libxslt/libxslt-internal-symbols.patch.1
@@ -0,0 +1,13 @@
+--- xslt/libxslt/libxslt.syms.orig     2017-09-05 16:25:50.504966267 +0200
++++ xslt/libxslt/libxslt.syms  2017-09-05 16:41:00.256895709 +0200
+@@ -497,5 +497,10 @@
+ # xsltInternals
+   xsltFlagRVTs;
+   xsltDecimalFormatGetByQName;
++
++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local")
++    local:
++  *;
++
+ } LIBXML2_1.1.27;
+ 
commit 428259c2fdff8fc4004d0776da652d8fca46e823
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Nov 20 15:05:02 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    libxml2: upgrade to release 2.9.10
    
    ... which is, surprisingly enough, required to build the latest libxslt.
    
    Reviewed-on: https://gerrit.libreoffice.org/83311
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit d1bf39a78ed239d4493f0470ca937852265e79d6)
    Reviewed-on: https://gerrit.libreoffice.org/83347
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit e9dc4662d4ba3bde91407911f1bc1a7aa25fa0ce)
    
    Change-Id: Ifbb36ed61b8f68185f9c788f63a8edeb58899f94

diff --git a/download.lst b/download.lst
index 9143f3273cb1..f5e41e3c6dc4 100644
--- a/download.lst
+++ b/download.lst
@@ -139,8 +139,8 @@ export LIBTOMMATH_SHA256SUM := 
083daa92d8ee6f4af96a6143b12d7fc8fe1a547e14f862304
 export LIBTOMMATH_TARBALL := ltm-1.0.zip
 export LIBXMLSEC_SHA256SUM := 
99a8643f118bb1261a72162f83e2deba0f4f690893b4b90e1be4f708e8d481cc
 export LIBXMLSEC_TARBALL := xmlsec1-1.2.24.tar.gz
-export LIBXML_SHA256SUM := 
94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871
-export LIBXML_VERSION_MICRO := 9
+export LIBXML_SHA256SUM := 
aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
+export LIBXML_VERSION_MICRO := 10
 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
 export LIBXSLT_SHA256SUM := 
b5976e3857837e7617b29f2249ebb5eeac34e249208d31f1fbf7a6ba7a4090ce
 export LIBXSLT_TARBALL := 
a129d3c44c022de3b9dcf6d6f288d72e-libxslt-1.1.29.tar.gz
diff --git a/external/libxml2/libxml2-android.patch 
b/external/libxml2/libxml2-android.patch
index 714de61068fb..42af83274026 100644
--- a/external/libxml2/libxml2-android.patch
+++ b/external/libxml2/libxml2-android.patch
@@ -4,7 +4,7 @@
        $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
  check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-recursive
--all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
+-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
 +all-am: Makefile $(LTLIBRARIES) \
                config.h
  install-binPROGRAMS: install-libLTLIBRARIES
diff --git a/external/libxml2/libxml2-config.patch.1 
b/external/libxml2/libxml2-config.patch.1
index 7b2b7f604188..7ad61923ebee 100644
--- a/external/libxml2/libxml2-config.patch.1
+++ b/external/libxml2/libxml2-config.patch.1
@@ -25,45 +25,19 @@ Hack the xml2-config to return paths into WORKDIR.
        ;;
  
      --cflags)
--              echo @XML_INCLUDEDIR@ @XML_CFLAGS@
-+        echo -I${includedir}
-+#             echo @XML_INCLUDEDIR@ @XML_CFLAGS@
+-        cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
++        #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
++        cflags="-I${includedir}"
                ;;
  
      --libtool-libs)
-@@ -82,19 +88,24 @@
-               ;;
+@@ -91,7 +96,8 @@
+             libs="@XML_LIBDIR@ $libs"
+         fi
  
-     --libs)
--        if [ "`uname`" = "Linux" ]
--      then
--          if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = 
"-L/usr/lib64" ]
--          then
--              echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
--          else
--              echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
--          fi
--      else
--          echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ 
@WIN32_EXTRA_LIBADD@
--      fi
-+        echo -L${libdir} -lxml2 -lm
-+#        if [ "`uname`" = "Linux" ]
-+#     then
-+#         if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = 
"-L/usr/lib64" ]
-+#         then
-+#             echo @XML_LIBS@ @MODULE_PLATFORM_LIBS@
-+#         else
-+#             echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@
-+#         fi
-+#     else
-+#         echo @XML_LIBDIR@ @XML_LIBS@ @MODULE_PLATFORM_LIBS@ 
@WIN32_EXTRA_LIBADD@
-+#     fi
-               ;;
+-        libs="$libs @WIN32_EXTRA_LIBADD@"
++        #libs="$libs @WIN32_EXTRA_LIBADD@"
++        libs="-L${libdir} -lxml2 -lm"
+         ;;
  
-+    print) # ugly configure hack
-+        exit 0
-+        ;;
-+ 
      *)
-       usage
-       exit 1
commit 8b739043232a23850225bbe24c148c4ca42b4906
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Nov 18 18:45:46 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    python3: upgrade to release 3.5.9
    
    Fixes CVE-2019-9948 CVE-2019-9740 CVE-2019-10160 CVE-2019-16056
    and expat CVE-2019-15903.
    
    python-3.3.5-pyexpat-symbols.patch.1 fails to apply, and it's a
    mystery why --with-system-expat is used everywhere but on MacOSX,
    where 292af048ace2d4b455b2da3a22c784cb05db1d09 disabled it for no
    obvious reason, so try to remove the special case and get rid of the
    patch.
    
    Reviewed-on: https://gerrit.libreoffice.org/83117
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit b0930d56130fdddfe65e92b081a8afad77974076)
    Reviewed-on: https://gerrit.libreoffice.org/83189
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit 0d4b1f624349361e5bf11b58ccc9e0e295c0e4aa)
    
    Remove external/python3/python-3.5.7-c99.patch.1 - was apparently
    reverted upstream.
    
    Change-Id: I5ba4532eb6e7c2fb90daba95d132dcc7c9013d96

diff --git a/configure.ac b/configure.ac
index 1bef6421f028..f3450a5eed75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8273,7 +8273,7 @@ internal)
     SYSTEM_PYTHON=
     PYTHON_VERSION_MAJOR=3
     PYTHON_VERSION_MINOR=5
-    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
+    PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.9
     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
     fi
diff --git a/download.lst b/download.lst
index 302f213e8508..9143f3273cb1 100644
--- a/download.lst
+++ b/download.lst
@@ -194,8 +194,8 @@ export POPPLER_SHA256SUM := 
92e09fd3302567fd36146b36bb707db43ce436e8841219025a82
 export POPPLER_TARBALL := poppler-0.74.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
-export PYTHON_SHA256SUM := 
285892899bf4d5737fd08482aa6171c6b2564a45b9102dfacfb72826aebdc7dc
-export PYTHON_TARBALL := Python-3.5.7.tar.xz
+export PYTHON_SHA256SUM := 
c24a37c63a67f53bdd09c5f287b5cff8e8b98f857bf348c577d454d3f74db049
+export PYTHON_TARBALL := Python-3.5.9.tar.xz
 export RAPTOR_SHA256SUM := 
ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed
 export RAPTOR_TARBALL := a39f6c07ddb20d7dd2ff1f95fa21e2cd-raptor2-2.0.15.tar.gz
 export RASQAL_SHA256SUM := 
6924c9ac6570bd241a9669f83b467c728a322470bf34f4b2da4f69492ccfd97c
diff --git a/external/python3/ExternalProject_python3.mk 
b/external/python3/ExternalProject_python3.mk
index 997136504b14..8783c3eb3dcf 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -43,9 +43,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
 
 else
 
-# this was added in 2004, hopefully is obsolete now (and why only intel 
anyway)? $(if $(filter SOLARIS-INTEL,$(OS)$(CPUNAME)),--disable-ipv6)
-
-# --with-system-expat: this should find the one in the solver (or system)
+# --with-system-expat: this should find the one in the workdir (or system)
 
 # create a symlink "LO_lib" because the .so are in a directory with platform
 # specific name like build/lib.linux-x86_64-3.3
@@ -67,7 +65,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
                $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM)) \
                $(if $(ENABLE_VALGRIND),--with-valgrind) \
                --prefix=/python-inst \
-               $(if $(filter MACOSX,$(OS)),,--with-system-expat) \
+               --with-system-expat \
                $(if $(filter AIX,$(OS)), \
                        --disable-ipv6 --with-threads OPT="-g0 -fwrapv -O3 
-Wall", \
                        $(if $(gb_Module_CURRENTMODULE_DEBUG_ENABLED), \
diff --git a/external/python3/UnpackedTarball_python3.mk 
b/external/python3/UnpackedTarball_python3.mk
index 66a82955e440..ee99de1f5e0c 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -23,11 +23,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
        external/python3/python-3.5.4-msvc-disable.patch.1 \
        external/python3/python-3.3.0-pythreadstate.patch.1 \
        external/python3/python-3.3.0-clang.patch.1 \
-       external/python3/python-3.3.5-pyexpat-symbols.patch.1 \
        external/python3/ubsan.patch.0 \
        external/python3/python-3.5.tweak.strip.soabi.patch \
        
external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
 \
-       external/python3/python-3.5.7-c99.patch.1 \
 ))
 
 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/python-3.3.5-pyexpat-symbols.patch.1 
b/external/python3/python-3.3.5-pyexpat-symbols.patch.1
deleted file mode 100644
index c04c78cf36e7..000000000000
--- a/external/python3/python-3.3.5-pyexpat-symbols.patch.1
+++ /dev/null
@@ -1,28 +0,0 @@
-HACK: Fix build breakage on MacOS:
-
-*** WARNING: renaming "pyexpat" since importing it failed: 
dlopen(build/lib.macosx-10.6-i386-3.3/pyexpat.so, 2): Symbol not found: 
_XML_ErrorString
-
-This reverts c242a8f30806 from the python hg repo:
-
-restore namespacing of pyexpat symbols (closes #19186)
-
-
-See http://bugs.python.org/issue19186#msg214069
-
-The recommendation to include Modules/inc at first broke the Linux build...
-
-So do it this way, as it was before. Needs some realignment later.
-
---- python3/Modules/expat/expat_external.h
-+++ python3/Modules/expat/expat_external.h
-@@ -7,10 +7,6 @@
-
- /* External API definitions */
-
--/* Namespace external symbols to allow multiple libexpat version to
--   co-exist. */
--#include "pyexpatns.h"
--
- #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
- #define XML_USE_MSC_EXTENSIONS 1
- #endif
diff --git a/external/python3/python-3.5.7-c99.patch.1 
b/external/python3/python-3.5.7-c99.patch.1
deleted file mode 100644
index 558166d9953f..000000000000
--- a/external/python3/python-3.5.7-c99.patch.1
+++ /dev/null
@@ -1,62 +0,0 @@
-remove C99 which isn't suppored by all compilers yet
-
---- python3/Modules/_pickle.c.orig     2019-04-03 16:34:01.380124314 +0200
-+++ python3/Modules/_pickle.c  2019-04-03 16:35:18.579005171 +0200
-@@ -674,9 +674,12 @@
-         PyErr_NoMemory();
-         return NULL;
-     }
--    for (size_t i = 0; i < self->mt_allocated; i++) {
-+    {
-+    size_t i;
-+    for (i = 0; i < self->mt_allocated; i++) {
-         Py_XINCREF(self->mt_table[i].me_key);
-     }
-+    }
-     memcpy(new->mt_table, self->mt_table,
-            sizeof(PyMemoEntry) * self->mt_allocated);
- 
-@@ -4204,7 +4207,9 @@
-         return NULL;
- 
-     memo = self->pickler->memo;
--    for (size_t i = 0; i < memo->mt_allocated; ++i) {
-+    {
-+    size_t i;
-+    for (i = 0; i < memo->mt_allocated; ++i) {
-         PyMemoEntry entry = memo->mt_table[i];
-         if (entry.me_key != NULL) {
-             int status;
-@@ -4225,6 +4230,7 @@
-                 goto error;
-         }
-     }
-+    }
-     return new_memo;
- 
-   error:
-@@ -6791,10 +6797,13 @@
-         if (new_memo == NULL)
-             return -1;
- 
--        for (size_t i = 0; i < new_memo_size; i++) {
-+        {
-+        size_t i;
-+        for (i = 0; i < new_memo_size; i++) {
-             Py_XINCREF(unpickler->memo[i]);
-             new_memo[i] = unpickler->memo[i];
-         }
-+        }
-     }
-     else if (PyDict_Check(obj)) {
-         Py_ssize_t i = 0;
-@@ -6839,7 +6848,8 @@
- 
-   error:
-     if (new_memo_size) {
--        for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
-+        size_t i;
-+        for (i = new_memo_size - 1; i != SIZE_MAX; i--) {
-             Py_XDECREF(new_memo[i]);
-         }
-         PyMem_FREE(new_memo);
commit 303ec44a5169e8bbbfd8098a98a0ff3197847400
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Fri Aug 16 15:36:15 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    Resolves: tdf#126928 allow link updates in an intermediate linked document
    
    ... if link updates are allowed in the current document and that
    intermediate document resides in a trusted location.
    
    This works with both, the "Always (from trusted locations)" and
    the "On request" settings under Tools -> Options -> Calc ->
    General. It can't work with documents residing in a non-trusted
    location as there is no way to allow updates on demand for a such
    loaded document (hidden via formulas).
    
    Reviewed-on: https://gerrit.libreoffice.org/77588
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 54bf84746a2a9a2e2aaf0df9e429b0cfd538f640)
    Reviewed-on: https://gerrit.libreoffice.org/77604
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 14825a8b7f00ee4c148f2583856e5102312cabbd)
    
    (cherry picked from commit f136b30fa3e991b780e4b1ed704d04256d0cfca0)
    
    Change-Id: Ie483f7743db7c6d5cf947dc16a9c3660855f3423
    (cherry picked from commit 86a3ea14d959f8a5409ea4883d9bf19e48046947)

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 69b399a0c355..4d06859b56ed 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -571,15 +571,22 @@ bool ScDocShell::Load( SfxMedium& rMedium )
     bool bRet = SfxObjectShell::Load(rMedium);
     if (bRet)
     {
-        comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-        rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
-
         if (GetMedium())
         {
             const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem<SfxUInt16Item>(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
             nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
         }
 
+        // GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
+        // been set first. Do not override an already forbidden LinkUpdate (the
+        // default is allow).
+        comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
+        if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
+        {
+            // For anything else than LM_ALWAYS we need user confirmation.
+            rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
+        }
+
         {
             //  prepare a valid document for XML filter
             //  (for ConvertFrom, InitNew is called before)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index da4ec0ac70e8..d8ca0bab3409 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -108,6 +108,41 @@ using namespace ::com::sun::star;
 #include <memory>
 #include <sfx2/notebookbar/SfxNotebookBar.hxx>
 
+ScLkUpdMode ScDocShell::GetLinkUpdateModeState() const
+{
+    const ScDocument& rDoc = GetDocument();
+
+    ScLkUpdMode nSet = rDoc.GetLinkMode();
+
+    if (nSet == LM_UNKNOWN)
+    {
+        ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
+        nSet = aAppOptions.GetLinkMode();
+    }
+
+    if (nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
+        nSet = LM_NEVER;
+    else if (nCanUpdate == css::document::UpdateDocMode::FULL_UPDATE)
+        nSet = LM_ALWAYS;
+
+    if (nSet == LM_ALWAYS
+            && !(SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks(
+                    GetMedium() == nullptr ? OUString() : 
GetMedium()->GetName())
+                || (IsDocShared()
+                    && 
SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks(
+                        GetSharedFileURL()))))
+    {
+        nSet = LM_ON_DEMAND;
+    }
+    if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE
+            && nSet == LM_ON_DEMAND)
+    {
+        nSet = LM_NEVER;
+    }
+
+    return nSet;
+}
+
 void ScDocShell::Execute( SfxRequest& rReq )
 {
     const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -409,33 +444,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
 
                 ScDocument& rDoc = GetDocument();
 
-                ScLkUpdMode nSet = rDoc.GetLinkMode();
-
                 sal_uInt16 nDlgRet=RET_NO;
-                if(nSet==LM_UNKNOWN)
-                {
-                    ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
-                    nSet=aAppOptions.GetLinkMode();
-                }
 
-                if (nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
-                    nSet = LM_NEVER;
-                else if (nCanUpdate == 
css::document::UpdateDocMode::FULL_UPDATE)
-                    nSet = LM_ALWAYS;
-
-                if (nSet == LM_ALWAYS
-                    && !(SvtSecurityOptions()
-                         .isTrustedLocationUriForUpdatingLinks(
-                             GetMedium() == nullptr
-                             ? OUString() : GetMedium()->GetName())))
-                {
-                    nSet = LM_ON_DEMAND;
-                }
-                if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE
-                    && nSet == LM_ON_DEMAND)
-                {
-                    nSet = LM_NEVER;
-                }
+                ScLkUpdMode nSet = GetLinkUpdateModeState();
 
                 if(nSet==LM_ON_DEMAND)
                 {
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 01209a55c3dc..f46872b740dd 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -56,6 +56,8 @@
 #include <columnspanset.hxx>
 #include <column.hxx>
 #include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/document/UpdateDocMode.hpp>
+#include <sal/log.hxx>
 
 #include <memory>
 #include <algorithm>
@@ -2533,6 +2535,11 @@ SfxObjectShellRef 
ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
 
     // If the current document is allowed to execute macros then the referenced
     // document may execute macros according to the security configuration.
+    // Similar for UpdateDocMode to update links, just that if we reach here
+    // the user already allowed updates and intermediate documents are expected
+    // to update as well. When loading the document ScDocShell::Load() will
+    // check through ScDocShell::GetLinkUpdateModeState() if its location is
+    // trusted.
     SfxObjectShell* pShell = mpDoc->GetDocumentShell();
     if (pShell)
     {
@@ -2544,6 +2551,8 @@ SfxObjectShellRef 
ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
                     static_cast<const SfxUInt16Item*>(pItem)->GetValue() != 
css::document::MacroExecMode::NEVER_EXECUTE)
                 pSet->Put( SfxUInt16Item( SID_MACROEXECMODE, 
css::document::MacroExecMode::USE_CONFIG));
         }
+
+        pSet->Put( SfxUInt16Item( SID_UPDATEDOCMODE, 
css::document::UpdateDocMode::FULL_UPDATE));
     }
 
     unique_ptr<SfxMedium> pMedium(new SfxMedium(aFile, StreamMode::STD_READ, 
pFilter, pSet));
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 43204614e26d..525dc34b14de 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -213,6 +213,7 @@ public:
 
     void    GetDocStat( ScDocStat& rDocStat );
 
+    const ScDocument& GetDocument() const { return aDocument; }
     ScDocument&     GetDocument()   { return aDocument; }
     ScDocFunc&      GetDocFunc()    { return *pDocFunc; }
 
@@ -291,6 +292,7 @@ public:
     virtual void    ReconnectDdeLink(SfxObjectShell& rServer) override;
     void            UpdateLinks() override;
     void            ReloadTabLinks();
+    ScLkUpdMode     GetLinkUpdateModeState() const;
 
     void            SetFormulaOptions( const ScFormulaOptions& rOpt, bool 
bForLoading = false );
     virtual void    CheckConfigOptions() override;
commit 74d7908ac8410a69e697fa114af33152021c065a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Sep 16 09:34:00 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    latest expat
    
    Reviewed-on: https://gerrit.libreoffice.org/78978
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 4436a29401beffd0893ecae70cd09c7a49f49f22)
    
    Change-Id: Ia98c9718ccd8e18b5f56851027bde944164f05c4

diff --git a/download.lst b/download.lst
index fb61c97ca3fe..302f213e8508 100644
--- a/download.lst
+++ b/download.lst
@@ -41,8 +41,8 @@ export EPM_TARBALL := 
3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
 export ETONYEK_SHA256SUM := 
032f53e8d7691e48a73ddbe74fa84c906ff6ff32a33e6ee2a935b6fdb6aecb78
 export ETONYEK_VERSION_MICRO := 6
 export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.bz2
-export EXPAT_SHA256SUM := 
d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
-export EXPAT_TARBALL := expat-2.2.5.tar.bz2
+export EXPAT_SHA256SUM := 
9a130948b05a82da34e4171d5f5ae5d321d9630277af02c8fa51e431f6475102
+export EXPAT_TARBALL := expat-2.2.8.tar.bz2
 export FIREBIRD_SHA256SUM := 
6994be3555e23226630c587444be19d309b25b0fcf1f87df3b4e3f88943e5860
 export FIREBIRD_TARBALL := Firebird-3.0.0.32483-0.tar.bz2
 export FONTCONFIG_SHA256SUM := 
b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3
diff --git a/external/expat/ExternalProject_expat.mk 
b/external/expat/ExternalProject_expat.mk
index 1a638eed14d6..87886eab1f7e 100644
--- a/external/expat/ExternalProject_expat.mk
+++ b/external/expat/ExternalProject_expat.mk
@@ -15,7 +15,7 @@ $(eval $(call gb_ExternalProject_register_targets,expat,\
 
 $(call gb_ExternalProject_get_state_target,expat,configure) :
        $(call gb_ExternalProject_run,configure,\
-               ./configure \
+               ./configure --without-docbook \
                        $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM) \
                        $(if $(filter INTEL 
ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
        ,,expat_configure.log)
diff --git a/external/expat/StaticLibrary_expat.mk 
b/external/expat/StaticLibrary_expat.mk
index 31d03d03102e..bdcc767e2905 100644
--- a/external/expat/StaticLibrary_expat.mk
+++ b/external/expat/StaticLibrary_expat.mk
@@ -48,7 +48,6 @@ $(eval $(call gb_StaticLibrary_add_cflags,expat,\
 ))
 
 $(eval $(call gb_StaticLibrary_add_generated_cobjects,expat,\
-       UnpackedTarball/expat/lib/loadlibrary \
        UnpackedTarball/expat/lib/xmlparse \
        UnpackedTarball/expat/lib/xmlrole \
        UnpackedTarball/expat/lib/xmltok \
diff --git a/external/expat/StaticLibrary_expat_x64.mk 
b/external/expat/StaticLibrary_expat_x64.mk
index 4f92d0fb284e..a38ba28c80dd 100644
--- a/external/expat/StaticLibrary_expat_x64.mk
+++ b/external/expat/StaticLibrary_expat_x64.mk
@@ -25,7 +25,6 @@ $(eval $(call gb_StaticLibrary_add_defs,expat_x64,\
 ))
 
 $(eval $(call gb_StaticLibrary_add_x64_generated_cobjects,expat_x64,\
-       UnpackedTarball/expat/lib/loadlibrary_x64 \
        UnpackedTarball/expat/lib/xmlparse_x64 \
        UnpackedTarball/expat/lib/xmltok_x64 \
        UnpackedTarball/expat/lib/xmlrole_x64 \
diff --git a/external/expat/UnpackedTarball_expat.mk 
b/external/expat/UnpackedTarball_expat.mk
index f90fc8552568..60e933d76090 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -24,7 +24,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,expat,\
 
 $(eval $(call gb_UnpackedTarball_set_post_action,expat,\
        $(if $(filter $(BUILD_X64),TRUE),         \
-         cp lib/loadlibrary.c lib/loadlibrary_x64.c && \
          cp lib/xmlparse.c lib/xmlparse_x64.c && \
          cp lib/xmltok.c lib/xmltok_x64.c     && \
          cp lib/xmlrole.c lib/xmlrole_x64.c) \
diff --git a/external/expat/expat-winapi.patch 
b/external/expat/expat-winapi.patch
index 3fe8a8a63e5a..b33c12b83b4c 100644
--- a/external/expat/expat-winapi.patch
+++ b/external/expat/expat-winapi.patch
@@ -1,13 +1,13 @@
 --- misc/expat-2.1.0/lib/expat_external.h      2009-11-16 08:53:17.375000000 
+0000
 +++ misc/build/expat-2.1.0/lib/expat_external.h        2009-11-16 
08:53:34.703125000 +0000
-@@ -7,10 +7,6 @@
+@@ -81,10 +81,6 @@
+ #  ifndef XML_BUILDING_EXPAT
+ /* using Expat from an application */
  
- /* External API definitions */
- 
--#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
--# define XML_USE_MSC_EXTENSIONS 1
--#endif
+-#    if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! 
defined(__CYGWIN__)
+-#      define XMLIMPORT __declspec(dllimport)
+-#    endif
 -
- /* Expat tries very hard to make the API boundary very specifically
-    defined.  There are two macros defined to control this boundary;
-    each of these can be defined before including this header to
+ #  endif
+ #endif /* not defined XML_STATIC */
+ 
commit 762c21e13e0410478fb4819a55aa7c820c145f27
Author:     David Tardon <dtar...@redhat.com>
AuthorDate: Wed Nov 8 19:01:59 2017 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:52 2019 +0100

    upload expat 2.2.5
    
    Reviewed-on: https://gerrit.libreoffice.org/44552
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: David Tardon <dtar...@redhat.com>
    (cherry picked from commit 34a7a9fd7649655256a85b5701d461af5ccc2016)
    
    Change-Id: Ic92002ec4f5edc48ca1bb3ac84836c4e6d19833c

diff --git a/download.lst b/download.lst
index 5af156056e0f..fb61c97ca3fe 100644
--- a/download.lst
+++ b/download.lst
@@ -41,8 +41,8 @@ export EPM_TARBALL := 
3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
 export ETONYEK_SHA256SUM := 
032f53e8d7691e48a73ddbe74fa84c906ff6ff32a33e6ee2a935b6fdb6aecb78
 export ETONYEK_VERSION_MICRO := 6
 export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.bz2
-export EXPAT_SHA256SUM := 
b31890fb02f85c002a67491923f89bda5028a880fd6c374f707193ad81aace5f
-export EXPAT_TARBALL := expat-2.2.3.tar.bz2
+export EXPAT_SHA256SUM := 
d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+export EXPAT_TARBALL := expat-2.2.5.tar.bz2
 export FIREBIRD_SHA256SUM := 
6994be3555e23226630c587444be19d309b25b0fcf1f87df3b4e3f88943e5860
 export FIREBIRD_TARBALL := Firebird-3.0.0.32483-0.tar.bz2
 export FONTCONFIG_SHA256SUM := 
b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3
diff --git a/external/expat/expat-winapi.patch 
b/external/expat/expat-winapi.patch
index 070dafc0cb0c..3fe8a8a63e5a 100644
--- a/external/expat/expat-winapi.patch
+++ b/external/expat/expat-winapi.patch
@@ -5,7 +5,7 @@
  /* External API definitions */
  
 -#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
--#define XML_USE_MSC_EXTENSIONS 1
+-# define XML_USE_MSC_EXTENSIONS 1
 -#endif
 -
  /* Expat tries very hard to make the API boundary very specifically
commit e5d7da1ae951089fb7d145f32e94f71a57d87768
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Aug 26 10:18:09 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    Improve check
    
    Change-Id: I8280a81eef2ced0ff0ace51ea9f094421abafe13
    Reviewed-on: https://gerrit.libreoffice.org/78108
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 761e6dd25782420bf06e4a2ff3205a79b6cbb136)
    Reviewed-on: https://gerrit.libreoffice.org/78129
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit ffad51e9e625a22f1efab3da7886baf4134b444f)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 3779150791fc..5c7beb7e4e2c 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1381,7 +1381,7 @@ bool SfxObjectShell::UnTrustedScript(const OUString& 
rScriptURL)
     do
     {
         OUString aToken = sScript.getToken(0, '/', nIndex);
-        if (aToken.startsWithIgnoreAsciiCase("LibreLogo"))
+        if (aToken.startsWithIgnoreAsciiCase("LibreLogo") || 
aToken.indexOf('~') != -1)
         {
             return true;
         }
commit f878380dbcbe1d9f92d464cd584908a83f78b9f6
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Aug 19 11:27:15 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    Improve check for absolute URI
    
    Change-Id: I4dee44832107f72f8f3fb68554428dc1e646c346
    Reviewed-on: https://gerrit.libreoffice.org/77706
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit c79efeb66f7951305d0334bc288aee1c571a8728)
    Reviewed-on: https://gerrit.libreoffice.org/77724
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 52f7aa318722bd17c77ee5c4fa8307936e7b53af)

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index a5ef31a4bf12..c46565949665 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -237,7 +237,7 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
-            if xFileUri.isAbsolute():
+            if not xFileUri.hasRelativePath():
                 message = "pythonscript: an absolute uri is invalid '" + 
sFileUri+ "'"
                 log.debug( message )
                 raise RuntimeException( message )
commit daaffb27c40b0d562ffa08b8384c4eeee39a8c82
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Aug 16 10:18:34 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    an absolute uri is invalid input
    
    Change-Id: I392be4282be8ed67e3451b28d2c9f22acd4c87fc
    Reviewed-on: https://gerrit.libreoffice.org/77564
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    Tested-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 3c076e54f736980e208f5c27ecf179aa90aea103)
    Reviewed-on: https://gerrit.libreoffice.org/77572
    Tested-by: Jenkins
    (cherry picked from commit 5445f7ffd09e891b220dabb19cd013bcf591fc08)

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index 316c5012cf31..a5ef31a4bf12 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -237,6 +237,11 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
+            if xFileUri.isAbsolute():
+                message = "pythonscript: an absolute uri is invalid '" + 
sFileUri+ "'"
+                log.debug( message )
+                raise RuntimeException( message )
+
             # absolute path to the .py file
             xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, 
True, RETAIN)
             sAbsScriptUri = xAbsScriptUri.getUriReference()
commit 2a7b1fb9183adc1791048523fd52de1a0e3e0cd0
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Aug 12 20:32:54 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    construct final url from parsed output
    
    Change-Id: Ifd733625a439685ad307603eb2b00bf463eb9ca9
    Reviewed-on: https://gerrit.libreoffice.org/77373
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 87959e5deea6d33cd35dbb3b8423056f9566710e)
    Reviewed-on: https://gerrit.libreoffice.org/77377
    (cherry picked from commit c03acb9b8a97254cfcf7c45ef920b93b7f1dd344)

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index 7fd0a47fc57a..316c5012cf31 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -224,7 +224,13 @@ class MyUriHelper:
             sStorageUri = sStorageUri.replace( "|", "/" )
 
             # path to the .py file, relative to the base
-            sFileUri = sStorageUri[0:sStorageUri.find("$")]
+            funcNameStart = sStorageUri.find("$")
+            if funcNameStart != -1:
+                sFileUri = sStorageUri[0:funcNameStart]
+                sFuncName = sStorageUri[funcNameStart+1:]
+            else:
+                sFileUri = sStorageUri
+
             xFileUri = self.m_uriRefFac.parse(sFileUri)
             if not xFileUri:
                 message = "pythonscript: invalid relative uri '" + sFileUri+ 
"'"
@@ -241,7 +247,9 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
-            ret = sBaseUri + sStorageUri
+            ret = sAbsScriptUri
+            if funcNameStart != -1:
+                ret = ret + "$" + sFuncName
             log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + 
ret )
             return ret
         except UnoException as e:
commit d35661c4d1699171690596d462f086c8183efafc
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Aug 7 12:58:01 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    expand pyuno path separators
    
    Change-Id: Ic97649ed6d4be595b308922c7bdc880cbb60b239
    Reviewed-on: https://gerrit.libreoffice.org/77102
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 75903a0298218f89a199a5ac151ee0166f4469d7)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 7c27ae0d5a9d..3779150791fc 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1373,7 +1373,8 @@ bool SfxObjectShell::UnTrustedScript(const OUString& 
rScriptURL)
     if (!sfUri.is())
         return false;
 
-    OUString sScript = sfUri->getName();
+    // pyuno encodes path separator as |
+    OUString sScript = sfUri->getName().replace('|', '/');
 
     // check if any path portion matches LibreLogo and ban it if it does
     sal_Int32 nIndex = 0;
commit 7ca1821a5add7d86d4023ce4a1f0b2dd874ce5dd
Author:     Juergen Funk <juergen.funk...@cib.de>
AuthorDate: Wed Sep 5 15:36:23 2018 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:51 2019 +0100

    Improve the Windows SDK 10 ProductVersion-Path
    
    At the moment the ProductVersion-Path has always the same format,
    with this patch, when the format the same, then no change is need for
    the next Version.
    
    Change-Id: I6a52fd20751ba139dd5ed6e3802f29c5e8f02975
    Reviewed-on: https://gerrit.libreoffice.org/60041
    Tested-by: Jenkins
    Reviewed-by: Juergen Funk (CIB) <juergen.funk...@cib.de>
    (cherry picked from commit dfb18a0557d5a897f443fd1f1d617365f6ae134a)

diff --git a/configure.ac b/configure.ac
index 19487e019ff5..1bef6421f028 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5193,16 +5193,17 @@ find_winsdk_version()
             reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft 
SDKs/Windows/v${1}/ProductVersion"
             if test -n "$regvalue"; then
                 winsdkbinsubdir="$regvalue".0
-            fi
-            winsdklibsubdir=$regvalue
-            if test "$regvalue" = "10.0.14393"; then
-                winsdklibsubdir="10.0.14393.0"
-            elif test "$regvalue" = "10.0.16299"; then
-                winsdklibsubdir="10.0.16299.0"
-            elif test "$regvalue" = "10.0.15063"; then
-                winsdklibsubdir="10.0.15063.0"
-            elif test "$regvalue" = "10.0.17134"; then
-                winsdklibsubdir="$regvalue.0"
+                winsdklibsubdir=$winsdkbinsubdir
+                tmppath="$winsdktest\\Include\\$winsdklibsubdir"
+                # test exist the SDK path
+                if test -d "$tmppath"; then
+                   # when path is convertable to a short path then path is okay
+                   if ! cygpath -d "$tmppath"; then
+                      AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see 
NtfsDisable8dot3NameCreation])
+                   fi
+                else
+                   AC_MSG_ERROR([The Windows SDK not found, check the 
installation])
+                fi
             fi
             return
         fi
commit 9475fda898c9750b1daff19a87ae5de192ae8c06
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu May 10 14:43:10 2018 +0300
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:50 2019 +0100

    Also for SDK 10.0.17134 the winsdklibsubdir needs to have a .0 tacked on
    
    Also remove questionable old "Hack needed at least by tml".
    
    Change-Id: I478358ea114cee2f8a181b98cb3433447b3ed560
    Reviewed-on: https://gerrit.libreoffice.org/54081
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    (cherry picked from commit fc00041df85fd508d1fc34658d4c9ceeb10084b1)

diff --git a/configure.ac b/configure.ac
index cce6cbb5f024..19487e019ff5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5201,12 +5201,8 @@ find_winsdk_version()
                 winsdklibsubdir="10.0.16299.0"
             elif test "$regvalue" = "10.0.15063"; then
                 winsdklibsubdir="10.0.15063.0"
-                dnl Hack needed at least by tml:
-                if test ! -f "${winsdktest}/Include/10.0.15063.0/um/sqlext.h" \
-                    -a -f "${winsdktest}/Include/10.0.14393.0/um/sqlext.h"
-                then
-                    winsdklibsubdir="10.0.14393.0"
-                fi
+            elif test "$regvalue" = "10.0.17134"; then
+                winsdklibsubdir="$regvalue.0"
             fi
             return
         fi
commit fc7786c5cbcc38d55ac85c81895fd907b90ff38e
Author:     Juergen Funk <juergen.funk...@cib.de>
AuthorDate: Mon Oct 16 13:56:51 2017 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:50 2019 +0100

    Intergate new Win-SDK 10.0.16299.0
    
    Change-Id: Ie0387fdb7fa5850d796d825e767119b90ae85d95
    Reviewed-on: https://gerrit.libreoffice.org/43422
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>
    (cherry picked from commit c7091668794e080fc8c5f2cff398e644a4cb1ea4)

diff --git a/configure.ac b/configure.ac
index b0ed14027b4b..cce6cbb5f024 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5197,6 +5197,8 @@ find_winsdk_version()
             winsdklibsubdir=$regvalue
             if test "$regvalue" = "10.0.14393"; then
                 winsdklibsubdir="10.0.14393.0"
+            elif test "$regvalue" = "10.0.16299"; then
+                winsdklibsubdir="10.0.16299.0"
             elif test "$regvalue" = "10.0.15063"; then
                 winsdklibsubdir="10.0.15063.0"
                 dnl Hack needed at least by tml:
commit b2b7646a2e2a89c2fe02d3afaed570aefa103402
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Aug 6 13:29:22 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:50 2019 +0100

    Properly obtain location
    
    Reviewed-on: https://gerrit.libreoffice.org/77019
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit a9cde2557242a0c343d99533f3ee032599c66f42)
    Reviewed-on: https://gerrit.libreoffice.org/77023
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 28c6af3ddc283ca9c5712359a9abcb385c1575b4)
    
    Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8

diff --git a/scripting/source/protocolhandler/scripthandler.cxx 
b/scripting/source/protocolhandler/scripthandler.cxx
index 50188ae52e74..78ac379e09d8 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -51,6 +51,7 @@
 #include "com/sun/star/uri/XUriReference.hpp"
 #include "com/sun/star/uri/UriReferenceFactory.hpp"
 #include "com/sun/star/uri/XVndSunStarScriptUrl.hpp"
+#include <com/sun/star/uri/XVndSunStarScriptUrlReference.hpp>
 
 #include <memory>
 
@@ -139,8 +140,12 @@ void SAL_CALL 
ScriptProtocolHandler::dispatchWithNotification(
     {
         try
         {
-            bool bIsDocumentScript = ( aURL.Complete.indexOf( "document" ) 
!=-1 );
-                // TODO: isn't this somewhat strange? This should be a test 
for a location=document parameter, shouldn't it?
+            css::uno::Reference<css::uri::XUriReferenceFactory> urifac(
+                css::uri::UriReferenceFactory::create(m_xContext));
+            css::uno::Reference<css::uri::XVndSunStarScriptUrlReference> uri(
+                urifac->parse(aURL.Complete), css::uno::UNO_QUERY_THROW);
+            auto const loc = uri->getParameter("location");
+            bool bIsDocumentScript = loc == "document";
 
             if ( bIsDocumentScript )
             {
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 2bb7b143a6bc..7c27ae0d5a9d 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1396,19 +1396,22 @@ ErrCode SfxObjectShell::CallXScript( const Reference< 
XInterface >& _rxScriptCon
     SAL_INFO("sfx", "in CallXScript" );
     ErrCode nErr = ERRCODE_NONE;
 
-    bool bIsDocumentScript = ( _rScriptURL.indexOf( "location=document" ) >= 0 
);
-        // TODO: we should parse the URL, and check whether there is a 
parameter with this name.
-        // Otherwise, we might find too much.
-    if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( 
_rxScriptContext ) )
-        return ERRCODE_IO_ACCESSDENIED;
-
-    if ( UnTrustedScript(_rScriptURL) )
-        return ERRCODE_IO_ACCESSDENIED;
-
     bool bCaughtException = false;
     Any aException;
     try
     {
+        css::uno::Reference<css::uri::XUriReferenceFactory> urifac(
+            
css::uri::UriReferenceFactory::create(comphelper::getProcessComponentContext()));
+        css::uno::Reference<css::uri::XVndSunStarScriptUrlReference> uri(
+            urifac->parse(_rScriptURL), css::uno::UNO_QUERY_THROW);
+        auto const loc = uri->getParameter("location");
+        bool bIsDocumentScript = loc == "document";
+        if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( 
_rxScriptContext ) )
+            return ERRCODE_IO_ACCESSDENIED;
+
+        if ( UnTrustedScript(_rScriptURL) )
+            return ERRCODE_IO_ACCESSDENIED;
+
         // obtain/create a script provider
         Reference< provider::XScriptProvider > xScriptProvider;
         Reference< provider::XScriptProviderSupplier > xSPS( _rxScriptContext, 
UNO_QUERY );
commit 8abb9ce4cc60e44718251017f9cfe3f994fdcdcc
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Sat Aug 3 16:37:48 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:50 2019 +0100

    keep name percent-encoded
    
    Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b
    Reviewed-on: https://gerrit.libreoffice.org/77006
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 315c51731384230194af26b86a976bf5d06c9dcc)

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index f5aa2173333a..7fd0a47fc57a 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -219,7 +219,9 @@ class MyUriHelper:
 
             # path to the .py file + "$functionname, arguments, etc
             xStorageUri = self.m_uriRefFac.parse(scriptURI)
-            sStorageUri = xStorageUri.getName().replace( "|", "/" );
+            # getName will apply url-decoding to the name, so encode back
+            sStorageUri = xStorageUri.getName().replace("%", "%25")
+            sStorageUri = sStorageUri.replace( "|", "/" )
 
             # path to the .py file, relative to the base
             sFileUri = sStorageUri[0:sStorageUri.find("$")]
commit 29ca5e6b0a772e784551516ddb718371bb477701
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 18 20:39:23 2018 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:50 2019 +0100

    keep pyuno script processing below base uri
    
    Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7
    Reviewed-on: https://gerrit.libreoffice.org/61969
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit b1c85cdb37a47998f8ab135fbc96f186334b171c)

diff --git a/scripting/source/pyprov/pythonscript.py 
b/scripting/source/pyprov/pythonscript.py
index 4803d0bebc23..f5aa2173333a 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -25,6 +25,7 @@ import imp
 import time
 import ast
 import platform
+from com.sun.star.uri.RelativeUriExcessParentSegments import RETAIN
 
 try:
     unicode
@@ -212,8 +213,33 @@ class MyUriHelper:
 
     def scriptURI2StorageUri( self, scriptURI ):
         try:
-            myUri = self.m_uriRefFac.parse(scriptURI)
-            ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" )
+            # base path to the python script location
+            sBaseUri = self.m_baseUri + "/"
+            xBaseUri = self.m_uriRefFac.parse(sBaseUri)
+
+            # path to the .py file + "$functionname, arguments, etc
+            xStorageUri = self.m_uriRefFac.parse(scriptURI)
+            sStorageUri = xStorageUri.getName().replace( "|", "/" );
+
+            # path to the .py file, relative to the base
+            sFileUri = sStorageUri[0:sStorageUri.find("$")]
+            xFileUri = self.m_uriRefFac.parse(sFileUri)
+            if not xFileUri:
+                message = "pythonscript: invalid relative uri '" + sFileUri+ 
"'"
+                log.debug( message )
+                raise RuntimeException( message )
+
+            # absolute path to the .py file
+            xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, 
True, RETAIN)
+            sAbsScriptUri = xAbsScriptUri.getUriReference()
+
+            # ensure py file is under the base path
+            if not sAbsScriptUri.startswith(sBaseUri):
+                message = "pythonscript: storage uri '" + sAbsScriptUri + "' 
not in base uri '" + self.m_baseUri + "'"
+                log.debug( message )
+                raise RuntimeException( message )
+
+            ret = sBaseUri + sStorageUri
             log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + 
ret )
             return ret
         except UnoException as e:
commit 91b6b30731d75dd6705b14ef73f01ef7e28b6094
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Fri Nov 29 07:51:49 2019 +0100

    tdf#126641: don't fail on file URLs with fragment
    
    This only fixes part that the URL refuses to open the target file.
    Honoring fragment isn't fixed here, since it's the system call to
    ShellExecuteExW that in this case internally converts the file URL
    into a system path, and strips the fragment from it.
    
    Regression from commit d59ec4cd1660410fa1b18c50d2d83b1417a82ddc.
    
    Change-Id: I6c9ed27e9a5bd7f2780dd3be96f816a6e825e043
    Reviewed-on: https://gerrit.libreoffice.org/76778
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4)
    Reviewed-on: https://gerrit.libreoffice.org/76848
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit dd2b7919058fc0e23a7117d39110d3ecaaad1fb2)
    Reviewed-on: https://gerrit.libreoffice.org/76881
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 72861eaf7cf9af3e7764b13d9e74edc5548806d2)

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 00e7b00ef6f1..6648d3f8d8a8 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -295,7 +295,9 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
         }
         if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
             OUString pathname;
-            auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, 
pathname);
+            uri->clearFragment(); // getSystemPathFromFileURL fails for URLs 
with fragment
+            auto const e1
+                = 
osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
             if (e1 != osl::FileBase::E_None) {
                 throw css::lang::IllegalArgumentException(
                     ("XSystemShellExecute.execute, getSystemPathFromFileURL <" 
+ aCommand

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to