[Libreoffice-commits] core.git: Branch 'feature/cib_contract136' - 115 commits - bin/distro-install-file-lists canvas/source config_host.mk.in configure.ac cppcanvas/source desktop/source desktop/unx download.lst extensions/Library_so_activex_x64.mk external/curl external/lcms2 external/libmwaw external/libwpd external/libxml2 external/libxslt external/mdnsresponder external/Module_external.mk external/msc-externals external/nss external/openssl external/poppler external/python3 external/python33 include/o3tl include/sfx2 instsetoo_native/inc_openoffice librelogo/source officecfg/Configuration_officecfg.mk officecfg/registry package/source postprocess/CustomTarget_registry.mk postprocess/CustomTarget_signing.mk postprocess/signing pyuno/source RepositoryExternal.mk Repository.mk RepositoryModule_host.mk sal/osl sax/source scp2/AutoInstall.mk scp2/InstallModule_python.mk scp2/InstallModule_windows.mk scp2/source scripting/source sdext/source setup_native/Library_inst_msu_msi.mk setup_native/Module _setup_native.mk setup_native/source sfx2/source shell/source solenv/bin solenv/gbuild solenv/gcc-wrappers svl/source sw/inc sw/qa sw/source vcl/source writerfilter/source xmlsecurity/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 23 13:27:03 UTC 2019


 Repository.mk                                                                      |    5 
 RepositoryExternal.mk                                                              |   10 
 RepositoryModule_host.mk                                                           |    1 
 bin/distro-install-file-lists                                                      |    3 
 canvas/source/directx/dx_canvasbitmap.cxx                                          |    3 
 config_host.mk.in                                                                  |    1 
 configure.ac                                                                       |  554 +--
 cppcanvas/source/mtfrenderer/emfplus.cxx                                           |  243 +
 desktop/source/app/app.cxx                                                         |    7 
 desktop/unx/source/pagein.c                                                        |    1 
 download.lst                                                                       |   39 
 extensions/Library_so_activex_x64.mk                                               |    4 
 external/Module_external.mk                                                        |    2 
 external/curl/CVE-2017-1000254.patch                                               |   50 
 external/curl/CVE-2018-1000120.patch                                               |   67 
 external/curl/CVE-2018-14618.patch                                                 |   66 
 external/curl/CVE-2018-16890.patch                                                 |   39 
 external/curl/CVE-2019-3822.patch                                                  |   35 
 external/curl/ExternalProject_curl.mk                                              |   14 
 external/curl/UnpackedTarball_curl.mk                                              |    6 
 external/curl/curl-msvc-disable-protocols.patch.1                                  |   24 
 external/lcms2/0001-Added-an-extra-check-to-MLU-bounds.patch.1                     |   25 
 external/lcms2/0017-Upgrade-Visual-studio-2017-15.8.patch.1                        |  172 +
 external/lcms2/ExternalPackage_lcms2.mk                                            |    2 
 external/lcms2/ExternalProject_lcms2.mk                                            |    1 
 external/lcms2/UnpackedTarball_lcms2.mk                                            |    6 
 external/lcms2/lcms2-2.4-windows.patch                                             |   32 
 external/lcms2/lcms2-config-guess.patch.0                                          | 1566 ----------
 external/lcms2/lcms2-vc2013-project.patch                                          |  490 ---
 external/lcms2/lcms2.patch                                                         |   20 
 external/lcms2/ubsan.patch.0                                                       |   22 
 external/libmwaw/0001-ofz-1037-resize-vector-correctly.patch.1                     |   25 
 external/libmwaw/UnpackedTarball_libmwaw.mk                                        |    1 
 external/libwpd/UnpackedTarball_libwpd.mk                                          |    1 
 external/libwpd/libwpd-tdf112269.patch.1                                           |   42 
 external/libxml2/0001-Fix-buffer-size-checks-in-xmlSnprintfElementContent.patch.1  |  116 
 external/libxml2/0001-Fix-handling-of-parameter-entity-references.patch.1          |  287 -
 external/libxml2/0001-Fix-type-confusion-in-xmlValidateOneNamespace.patch.1        |   43 
 external/libxml2/0001-Increase-buffer-space-for-port-in-HTTP-redirect-supp.patch.1 |   31 
 external/libxml2/0001-Prevent-unwanted-external-entity-reference.patch.1           |   35 
 external/libxml2/ExternalPackage_xml2.mk                                           |    2 
 external/libxml2/ExternalProject_xml2.mk                                           |    3 
 external/libxml2/UnpackedTarball_xml2.mk                                           |    6 
 external/libxml2/libxml2-android.patch                                             |   14 
 external/libxml2/libxml2-global-symbols.patch                                      |    4 
 external/libxml2/libxml2-icu.patch.0                                               |   15 
 external/libxml2/libxml2-vc10.patch                                                |    2 
 external/libxml2/ubsan.patch.0                                                     |   84 
 external/libxslt/UnpackedTarball_xslt.mk                                           |    1 
 external/libxslt/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch.1                  |  120 
 external/mdnsresponder/UnpackedTarball_mDNSResponder.mk                            |    5 
 external/mdnsresponder/mDNSResponder_Win32_SOCKET.patch.1                          |   85 
 external/mdnsresponder/mDNSResponder_Win32_buildfix.patch.1                        |   16 
 external/msc-externals/Module_msc-externals.mk                                     |    9 
 external/msc-externals/Package_ucrt.mk                                             |   21 
 external/nss/UnpackedTarball_nss.mk                                                |    4 
 external/nss/clang-cl.patch.0                                                      |   14 
 external/nss/nss-chromium-nss-static.patch                                         |  487 ---
 external/nss/nss-more-static.patch                                                 |   39 
 external/nss/nss.fix-freebl-add-lcc-support.patch.1                                |   11 
 external/nss/nss.patch                                                             |  123 
 external/nss/nss.vs2015.patch                                                      |   10 
 external/nss/nss.windowbuild.patch.0                                               |   55 
 external/openssl/ExternalProject_openssl.mk                                        |    2 
 external/openssl/UnpackedTarball_openssl.mk                                        |    1 
 external/openssl/openssllnx.patch                                                  |    2 
 external/openssl/opensslmingw.patch                                                |  123 
 external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1        |   27 
 external/poppler/ExternalProject_poppler.mk                                        |   51 
 external/poppler/Module_poppler.mk                                                 |    2 
 external/poppler/StaticLibrary_poppler.mk                                          |  140 
 external/poppler/UnpackedTarball_poppler.mk                                        |   20 
 external/poppler/poppler-0.46.0-std-max.patch.1                                    |   10 
 external/poppler/poppler-0.46.0-unused-private-field.patch.1                       |   11 
 external/poppler/poppler-c++11.patch.1                                             |   31 
 external/poppler/poppler-config.patch.1                                            |  484 +++
 external/poppler/poppler-libjpeg.patch.1                                           |   23 
 external/poppler/poppler-mac-fake.patch.1                                          |   13 
 external/poppler/poppler-notests.patch.1                                           |   11 
 external/poppler/poppler-snprintf.patch.1                                          |    2 
 external/poppler/poppler-vs2013.patch.1                                            |   11 
 external/poppler/ubsan.patch.0                                                     |   58 
 external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 |   59 
 external/python3/ExternalProject_python3.mk                                        |    2 
 external/python3/UnpackedTarball_python3.mk                                        |    2 
 external/python3/internal-zlib.patch.0                                             |   55 
 external/python3/python-3.5.7-c99.patch.1                                          |   62 
 external/python33/ExternalPackage_python3.mk                                       |  829 -----
 external/python33/ExternalProject_python3.mk                                       |  148 
 external/python33/GeneratedPackage_python3.mk                                      |   18 
 external/python33/Makefile                                                         |    7 
 external/python33/Module_python33.mk                                               |   24 
 external/python33/README                                                           |    1 
 external/python33/UnpackedTarball_python3.mk                                       |   61 
 external/python33/clang-cl.patch.0                                                 |   11 
 external/python33/i100492-freebsd.patch.1                                          |   80 
 external/python33/python-3.3.0-clang.patch.1                                       |   13 
 external/python33/python-3.3.0-darwin.patch.1                                      |   85 
 external/python33/python-3.3.0-gcc-4.8.patch.1                                     |   15 
 external/python33/python-3.3.0-i42553.patch.2                                      |   18 
 external/python33/python-3.3.0-msvc-disable.patch.1                                |   47 
 external/python33/python-3.3.0-msvc-x64.patch.1                                    |  289 -
 external/python33/python-3.3.0-msvc2012.patch.1                                    |   72 
 external/python33/python-3.3.0-pythreadstate.patch.1                               |   15 
 external/python33/python-3.3.0-ssl.patch.1                                         |  208 -
 external/python33/python-3.3.3-aix.patch.1                                         |  145 
 external/python33/python-3.3.3-disable-obmalloc.patch.0                            |   21 
 external/python33/python-3.3.3-elf-rpath.patch.1                                   |   13 
 external/python33/python-3.3.3-msvc2012-winxp.patch.1                              |  117 
 external/python33/python-3.3.3-py17797.patch.1                                     |   45 
 external/python33/python-3.3.5-darwin-gnu-xargs.patch.1                            |   12 
 external/python33/python-3.3.5-pyexpat-symbols.patch.1                             |   28 
 external/python33/python-3.3.5-vs2013.patch.1                                      |   14 
 external/python33/python-lsan.patch.0                                              |   19 
 external/python33/python-msvc-disable-sse2.patch.1                                 |   23 
 external/python33/python-vc2013.patch.1                                            | 1213 -------
 external/python33/ubsan.patch.0                                                    |   79 
 include/o3tl/make_unique.hxx                                                       |   19 
 include/o3tl/runtimetooustring.hxx                                                 |   48 
 include/sfx2/objsh.hxx                                                             |    2 
 instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt                 |    1 
 instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt                 |    2 
 instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt                 |    1 
 librelogo/source/LibreLogo/LibreLogo.py                                            |   51 
 officecfg/Configuration_officecfg.mk                                               |    3 
 officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu             |   14 
 package/source/zipapi/ZipFile.cxx                                                  |    1 
 postprocess/CustomTarget_registry.mk                                               |    6 
 postprocess/CustomTarget_signing.mk                                                |    1 
 postprocess/signing/no_signing.txt                                                 |    6 
 pyuno/source/module/pyuno_impl.hxx                                                 |    2 
 pyuno/source/module/pyuno_type.cxx                                                 |    2 
 pyuno/source/module/pyuno_util.cxx                                                 |    2 
 sal/osl/w32/file_dirvol.cxx                                                        |   16 
 sax/source/fastparser/fastparser.cxx                                               |    2 
 scp2/AutoInstall.mk                                                                |    1 
 scp2/InstallModule_python.mk                                                       |    6 
 scp2/InstallModule_windows.mk                                                      |    1 
 scp2/source/ooo/ucrt.scp                                                           |  154 
 scp2/source/ooo/vc_redist.scp                                                      |   12 
 scp2/source/winexplorerext/file_winexplorerext.scp                                 |   11 
 scp2/source/winexplorerext/module_winexplorerext.scp                               |    5 
 scripting/source/protocolhandler/scripthandler.cxx                                 |    9 
 scripting/source/pyprov/pythonscript.py                                            |   32 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx                              |   60 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx                              |   53 
 sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx                                   |    6 
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx                                 |    4 
 setup_native/Library_inst_msu_msi.mk                                               |   40 
 setup_native/Module_setup_native.mk                                                |    3 
 setup_native/source/packinfo/packinfo_office.txt                                   |   17 
 setup_native/source/win32/customactions/inst_msu/inst_msu.cxx                      |  543 +++
 setup_native/source/win32/customactions/inst_msu/inst_msu_msi.def                  |    5 
 sfx2/source/doc/objmisc.cxx                                                        |   52 
 sfx2/source/notify/eventsupplier.cxx                                               |   18 
 shell/source/unix/exec/shellexec.cxx                                               |   36 
 shell/source/win32/SysShExec.cxx                                                   |  119 
 solenv/bin/modules/installer.pm                                                    |   26 
 solenv/bin/modules/installer/globals.pm                                            |    1 
 solenv/bin/modules/installer/windows/directory.pm                                  |   62 
 solenv/bin/modules/installer/windows/idtglobal.pm                                  |   36 
 solenv/bin/modules/installer/windows/update.pm                                     |   28 
 solenv/bin/modules/installer/windows/upgrade.pm                                    |   12 
 solenv/gbuild/gbuild.mk                                                            |    2 
 solenv/gbuild/platform/com_MSC_defs.mk                                             |    6 
 solenv/gbuild/platform/windows.mk                                                  |   10 
 solenv/gcc-wrappers/wrapper.cxx                                                    |   20 
 svl/source/undo/undo.cxx                                                           |    9 
 sw/inc/unosett.hxx                                                                 |    2 
 sw/qa/extras/rtfexport/data/custom-doc-props.rtf                                   |   15 
 sw/qa/extras/rtfexport/rtfexport.cxx                                               |   15 
 sw/source/core/text/porfld.cxx                                                     |    4 
 sw/source/core/text/porfld.hxx                                                     |    1 
 sw/source/core/text/txtfld.cxx                                                     |   12 
 sw/source/core/unocore/unosett.cxx                                                 |   15 
 sw/source/filter/ww8/rtfexport.cxx                                                 |   67 
 sw/source/filter/ww8/rtfexport.hxx                                                 |    4 
 sw/source/uibase/config/StoredChapterNumbering.cxx                                 |    2 
 vcl/source/window/accessibility.cxx                                                |    3 
 vcl/source/window/window.cxx                                                       |   13 
 writerfilter/source/rtftok/rtfdispatchvalue.cxx                                    |   12 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                                     |   31 
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx                                   |   14 
 183 files changed, 3796 insertions(+), 8085 deletions(-)

New commits:
commit 9b23f50ac651486f3261c9ab50db8f8695688632
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 12 15:01:41 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

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

diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index a38e8cf1c52f..9c73fc696ce0 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
 		external/nss/nss.mingw.patch.3) \
     external/nss/ubsan.patch.0 \
     external/nss/clang-cl.patch.0 \
+    external/nss/nss.fix-freebl-add-lcc-support.patch.1 \
     $(if $(filter IOS,$(OS)), \
         external/nss/nss-ios.patch) \
 	$(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
diff --git a/external/nss/nss.fix-freebl-add-lcc-support.patch.1 b/external/nss/nss.fix-freebl-add-lcc-support.patch.1
new file mode 100644
index 000000000000..3e3c06327dde
--- /dev/null
+++ b/external/nss/nss.fix-freebl-add-lcc-support.patch.1
@@ -0,0 +1,11 @@
+--- b/nss/lib/freebl/Makefile
++++ a/nss/lib/freebl/Makefile
+@@ -495,7 +495,7 @@
+ ifdef USE_64
+ # no __int128 at least up to lcc 1.23 (pretending to be gcc5)
+ # NB: CC_NAME is not defined here
+-ifneq ($(shell $(CC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q'),lcc)
++ifneq ($(shell $(CC) -? 2>&1 >/dev/null </dev/null | sed -e 's/:.*//;1q'),lcc)
+     ifdef CC_IS_CLANG
+             HAVE_INT128_SUPPORT = 1
+             DEFINES += -DHAVE_INT128_SUPPORT
commit daf62d36998a4b1af5efcc1ba2bb742c6ceaf327
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jul 10 12:20:00 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

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

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

    expand pyuno path separators
    
    Change-Id: Ic97649ed6d4be595b308922c7bdc880cbb60b239
    Reviewed-on: https://gerrit.libreoffice.org/77102
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 75903a0298218f89a199a5ac151ee0166f4469d7)
    Reviewed-on: https://gerrit.libreoffice.org/77120
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 336a56c307e1..d9203abc5f9e 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1477,7 +1477,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 5e6e9c7b0d2c1d553e973983781439d413bbb344
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 13:25:31 2019 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    decode url escape codes and check each path segment
    
    Change-Id: Ie8f7cef912e8dacbc2a0bca73534a7a242a53ca1
    Reviewed-on: https://gerrit.libreoffice.org/76378
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 7942929685fafb0f9c82feb8da7279e5103c87f0)
    Reviewed-on: https://gerrit.libreoffice.org/76453
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index b3e7e510fdeb..336a56c307e1 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -54,6 +54,8 @@
 #include <com/sun/star/script/provider/XScriptProvider.hpp>
 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/uri/XVndSunStarScriptUrlReference.hpp>
 #include <com/sun/star/util/XModifiable.hpp>
 
 #include <toolkit/helper/vclunohelper.hxx>
@@ -1464,7 +1466,32 @@ namespace
 // don't allow LibreLogo to be used with our mouseover/etc dom-alike events
 bool SfxObjectShell::UnTrustedScript(const OUString& rScriptURL)
 {
-    return rScriptURL.startsWithIgnoreAsciiCase("vnd.sun.star.script:LibreLogo");
+    if (!rScriptURL.startsWith("vnd.sun.star.script:"))
+        return false;
+
+    // ensure URL Escape Codes are decoded
+    css::uno::Reference<css::uri::XUriReference> uri(
+        css::uri::UriReferenceFactory::create(comphelper::getProcessComponentContext())->parse(rScriptURL));
+    css::uno::Reference<css::uri::XVndSunStarScriptUrl> sfUri(uri, css::uno::UNO_QUERY);
+
+    if (!sfUri.is())
+        return false;
+
+    OUString sScript = sfUri->getName();
+
+    // check if any path portion matches LibreLogo and ban it if it does
+    sal_Int32 nIndex = 0;
+    do
+    {
+        OUString aToken = sScript.getToken(0, '/', nIndex);
+        if (aToken.startsWithIgnoreAsciiCase("LibreLogo"))
+        {
+            return true;
+        }
+    }
+    while (nIndex >= 0);
+
+    return false;
 }
 
 ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const OUString& _rScriptURL,
commit 695cb602b55cc0724cf3763f7eb845800f0812ee
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Aug 1 10:52:12 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    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.kaganski at collabora.com>
    (cherry picked from commit 2207269a84c7c9920af3385b837ce67978c720b4)
    Reviewed-on: https://gerrit.libreoffice.org/76848
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit dd2b7919058fc0e23a7117d39110d3ecaaad1fb2)
    Reviewed-on: https://gerrit.libreoffice.org/76881
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 72861eaf7cf9af3e7764b13d9e74edc5548806d2)
    Reviewed-on: https://gerrit.libreoffice.org/77095
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 44a6e047bdc6..88364ab3dc21 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -304,7 +304,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
commit 9766e5ae09930c54c84aabb99e1f75fd4d2a6576
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Aug 3 16:37:48 2019 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

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

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 9609b6d94640..6625b226f609 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -218,7 +218,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 886a0638246e5620ee2e8784253f0a804a447890
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 6 13:29:22 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    Properly obtain location
    
    Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8
    Reviewed-on: https://gerrit.libreoffice.org/77019
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit a9cde2557242a0c343d99533f3ee032599c66f42)
    Reviewed-on: https://gerrit.libreoffice.org/77023
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 28c6af3ddc283ca9c5712359a9abcb385c1575b4)
    Reviewed-on: https://gerrit.libreoffice.org/77097
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index 85573b51a5c3..e75897ef5894 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>
 
@@ -146,8 +147,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 330c475efb8b..b3e7e510fdeb 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1473,19 +1473,22 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
     OSL_TRACE( "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 2ffba890afec41241189890a8c56f441abcb296d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 23 15:31:05 2019 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    expand LibreLogo check to global events
    
    Reviewed-on: https://gerrit.libreoffice.org/76189
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 4a66c7eda6ccde26a42c4e31725248c59940255d)
    
    Change-Id: I7f436983ba0eb4b76b02d08ee52626e54b103d5f
    (cherry picked from commit e5702eefdfe6d44a92fdfb3c6a3ff47fec83ee49)
    Reviewed-on: https://gerrit.libreoffice.org/76452
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 24b1d82862f9..83b5eb654618 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -409,6 +409,8 @@ public:
     */
     bool                        AdjustMacroMode();
 
+    static bool                 UnTrustedScript(const OUString& rScriptURL);
+
     SvKeyValueIterator*         GetHeaderAttributes();
     void                        ClearHeaderAttributesForSourceViewHack();
     void                        SetHeaderAttributesForSourceViewHack();
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 3016315cd17b..330c475efb8b 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1461,16 +1461,12 @@ namespace
     }
 }
 
-namespace {
-
 // don't allow LibreLogo to be used with our mouseover/etc dom-alike events
-bool UnTrustedScript(const OUString& rScriptURL)
+bool SfxObjectShell::UnTrustedScript(const OUString& rScriptURL)
 {
     return rScriptURL.startsWithIgnoreAsciiCase("vnd.sun.star.script:LibreLogo");
 }
 
-}
-
 ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const OUString& _rScriptURL,
     const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const css::uno::Any* pCaller )
 {
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index a2796becd1f8..63d9cb909345 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -213,18 +213,24 @@ void SfxEvents_Impl::Execute( uno::Any& aEventData, const document::DocumentEven
         else if (aType == "Service" ||
                   aType == "Script")
         {
-            if ( !aScript.isEmpty() )
+            bool bAllowed = false;
+            util::URL aURL;
+            if (!aScript.isEmpty())
             {
-                SfxViewFrame* pView = pDoc ?
-                    SfxViewFrame::GetFirst( pDoc ) :
-                    SfxViewFrame::Current();
-
                 uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
 
-                util::URL aURL;
                 aURL.Complete = aScript;
                 xTrans->parseStrict( aURL );
 
+                bAllowed = !SfxObjectShell::UnTrustedScript(aURL.Complete);
+            }
+
+            if (bAllowed)
+            {
+                SfxViewFrame* pView = pDoc ?
+                    SfxViewFrame::GetFirst( pDoc ) :
+                    SfxViewFrame::Current();
+
                 uno::Reference
                     < frame::XDispatchProvider > xProv;
 
commit ed0f8d83e024f4d8914ca7c588c1488ae1fa59b3
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jul 29 12:28:26 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    remove LibreLogo from build
    
     Conflicts:
            scp2/AutoInstall.mk
            setup_native/source/packinfo/packinfo_office.txt
            sw/Module_sw.mk
    
    Change-Id: I62b45ea4890f5693e7d12f2b8c4ae43a9a03d16e

diff --git a/Repository.mk b/Repository.mk
index 01ab27e12115..de328943a601 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -893,10 +893,6 @@ $(eval $(call gb_Helper_register_packages_for_install,python_scriptprovider, \
     scriptproviderforpython \
 ))
 
-$(eval $(call gb_Helper_register_packages_for_install,python_librelogo, \
-	librelogo \
-	librelogo_properties \
-))
 endif # DISABLE_PYTHON
 
 # External executables
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index d2f1d849b7fa..da121a6ddbbe 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -75,7 +75,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	jurt \
 	jvmaccess \
 	jvmfwk \
-	librelogo \
 	libreofficekit \
 	lingucomponent \
 	linguistic \
diff --git a/bin/distro-install-file-lists b/bin/distro-install-file-lists
index 2960f5fe0410..0bb77170d16b 100755
--- a/bin/distro-install-file-lists
+++ b/bin/distro-install-file-lists
@@ -142,14 +142,12 @@ if test "z$OOO_VENDOR" != "zDebian" ; then
             merge_flists gid_Module_Optional_Pymailmerge       $FILELISTSDIR/pyuno_list.txt
             merge_flists gid_Module_Pyuno                      $FILELISTSDIR/pyuno_list.txt
             merge_flists gid_Module_Script_Provider_For_Python $FILELISTSDIR/pyuno_list.txt
-            merge_flists gid_Module_Optional_Pyuno_LibreLogo   $FILELISTSDIR/pyuno_list.txt
             merge_flists gid_Module_Optional_Xsltfiltersamples $FILELISTSDIR/common_list.txt
         else
             merge_flists gid_Module_Optional_Grfflt            $FILELISTSDIR/common_list.txt
             merge_flists gid_Module_Optional_Headless          $FILELISTSDIR/common_list.txt
             merge_flists gid_Module_Optional_Pymailmerge       $FILELISTSDIR/mailmerge_list.txt
             merge_flists gid_Module_Pyuno                      $FILELISTSDIR/pyuno_list.txt
-            merge_flists gid_Module_Optional_Pyuno_LibreLogo   $FILELISTSDIR/pyuno_list.txt
             merge_flists gid_Module_Script_Provider_For_Python $FILELISTSDIR/pyuno_list.txt
             merge_flists gid_Module_Optional_Xsltfiltersamples $FILELISTSDIR/filters_list.txt
         fi
@@ -158,7 +156,6 @@ if test "z$OOO_VENDOR" != "zDebian" ; then
         merge_flists gid_Module_Optional_Headless          $FILELISTSDIR/common_list.txt
         merge_flists gid_Module_Optional_Pymailmerge       $FILELISTSDIR/common_list.txt
         merge_flists gid_Module_Pyuno                      $FILELISTSDIR/common_list.txt
-        merge_flists gid_Module_Optional_Pyuno_LibreLogo   $FILELISTSDIR/common_list.txt
         merge_flists gid_Module_Script_Provider_For_Python $FILELISTSDIR/common_list.txt
         merge_flists gid_Module_Optional_Xsltfiltersamples $FILELISTSDIR/common_list.txt
     fi
diff --git a/officecfg/Configuration_officecfg.mk b/officecfg/Configuration_officecfg.mk
index 1768f4e425a8..adf801fa6f64 100644
--- a/officecfg/Configuration_officecfg.mk
+++ b/officecfg/Configuration_officecfg.mk
@@ -73,7 +73,6 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat
 	org/openoffice/Office/Accelerators-macosx.xcu \
 	org/openoffice/Office/Accelerators-reportbuilder.xcu \
 	org/openoffice/Office/Accelerators-unxwnt.xcu \
-	org/openoffice/Office/Addons-librelogo.xcu \
 	org/openoffice/Office/Common-writer.xcu \
 	org/openoffice/Office/Common-calc.xcu \
 	org/openoffice/Office/Common-draw.xcu \
@@ -109,7 +108,6 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat
 	org/openoffice/Office/Embedding-base.xcu \
 	org/openoffice/Office/Embedding-reportbuilder.xcu \
 	org/openoffice/Office/Embedding-writer.xcu \
-	org/openoffice/Office/UI/WriterWindowState-librelogo.xcu \
 	org/openoffice/Office/UI/Controller-reportbuilder.xcu \
 	org/openoffice/TypeDetection/UISort-writer.xcu \
 	org/openoffice/TypeDetection/UISort-calc.xcu \
@@ -129,7 +127,6 @@ $(eval $(call gb_Configuration_add_spool_langpack,registry,officecfg/registry/da
 $(eval $(call gb_Configuration_add_localized_datas,registry,officecfg/registry/data,\
 	org/openoffice/Setup.xcu \
 	org/openoffice/Office/Accelerators.xcu \
-	org/openoffice/Office/Addons.xcu \
 	org/openoffice/Office/Common.xcu \
 	org/openoffice/Office/DataAccess.xcu \
 	org/openoffice/Office/PresentationMinimizer.xcu \
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index 57a59d2e12c7..803cae4abbf2 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -831,20 +831,6 @@
           <value>true</value>
         </prop>
       </node>
-      <node oor:name="private:resource/toolbar/addon_LibreLogo.OfficeToolBar" oor:op="replace" install:module="librelogo">
-        <prop oor:name="UIName" oor:type="xs:string">
-          <value xml:lang="en-US">Logo</value>
-        </prop>
-        <prop oor:name="Visible" oor:type="xs:boolean">
-          <value>false</value>
-        </prop>
-        <prop oor:name="Locked" oor:type="xs:boolean">
-          <value>false</value>
-        </prop>
-        <prop oor:name="HideFromToolbarMenu" oor:type="xs:boolean">
-          <value>false</value>
-        </prop>
-      </node>
       <node oor:name="private:resource/toolbar/changes" oor:op="replace">
         <prop oor:name="DockPos" oor:type="xs:string">
           <value>1,2</value>
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 6a9e2d19e457..119bd08befd9 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -27,7 +27,6 @@ postprocess_XCDS := \
 	draw.xcd \
 	graphicfilter.xcd \
 	impress.xcd \
-	librelogo.xcd \
 	lingucomponent.xcd \
 	main.xcd \
 	math.xcd \
@@ -110,11 +109,6 @@ postprocess_FILES_impress := \
 	$(postprocess_MOD)/org/openoffice/Office/ProtocolHandler-impress.xcu \
 	$(postprocess_MOD)/org/openoffice/Setup-impress.xcu
 
-postprocess_DEPS_librelogo := main writer
-postprocess_FILES_librelogo := \
-	$(postprocess_MOD)/org/openoffice/Office/Addons-librelogo.xcu \
-	$(postprocess_MOD)/org/openoffice/Office/UI/WriterWindowState-librelogo.xcu
-
 postprocess_DEPS_lingucomponent := main
 postprocess_FILES_lingucomponent := \
 	$(SRCDIR)/lingucomponent/config/Linguistic-lingucomponent-hyphenator.xcu \
diff --git a/scp2/AutoInstall.mk b/scp2/AutoInstall.mk
index 3f6de8c6f8da..0aea89f48b00 100644
--- a/scp2/AutoInstall.mk
+++ b/scp2/AutoInstall.mk
@@ -36,7 +36,6 @@ $(eval $(call gb_AutoInstall_add_module,ooo,LIBO_LIB_FILE,LIBO_EXECUTABLE,LIBO_J
 $(eval $(call gb_AutoInstall_add_module,ooobinarytable,LIBO_LIB_FILE_BINARYTABLE))
 $(eval $(call gb_AutoInstall_add_module,python,LIBO_LIB_FILE,LIBO_EXECUTABLE))
 $(eval $(call gb_AutoInstall_add_module,python_scriptprovider,))
-$(eval $(call gb_AutoInstall_add_module,python_librelogo,))
 $(eval $(call gb_AutoInstall_add_module,postgresqlsdbc,LIBO_LIB_FILE))
 $(eval $(call gb_AutoInstall_add_module,pdfimport,LIBO_LIB_FILE,LIBO_EXECUTABLE))
 $(eval $(call gb_AutoInstall_add_module,quickstart,,LIBO_EXECUTABLE))
diff --git a/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk
index 965781cc771e..c879713bd600 100644
--- a/scp2/InstallModule_python.mk
+++ b/scp2/InstallModule_python.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_InstallModule_InstallModule,scp2/python))
 $(eval $(call gb_InstallModule_use_auto_install_libs,scp2/python,\
 	python \
 	python_scriptprovider \
-	python_librelogo \
 ))
 
 ifeq ($(DISABLE_PYTHON),TRUE)
@@ -45,12 +44,7 @@ endif
 
 $(eval $(call gb_InstallModule_add_scpfiles,scp2/python,\
     scp2/source/python/file_python \
-    scp2/source/python/file_python_librelogo \
     scp2/source/python/module_python \
 ))
 
-$(eval $(call gb_InstallModule_add_localized_scpfiles,scp2/python,\
-    scp2/source/python/module_python_librelogo \
-))
-
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt
index 8c1eaf187796..c423661bd2d5 100644
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -266,6 +266,8 @@ module = "gid_Module_Pyuno"
 solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-pyuno"
 solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core, SUNWPython"
 packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-pyuno"
+linuxreplaces = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo"
+linuxincompat = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo"
 freebsdrequires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core"
 requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core %PACKAGEVERSION %PACKAGEVERSION-%PACKAGEREVISION"
 copyright = "2017 The Document Foundation"
@@ -277,21 +279,6 @@ packageversion = "%PACKAGEVERSION"
 End
 
 Start
-module = "gid_Module_Optional_Pyuno_LibreLogo"
-solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-librelogo"
-solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-pyuno,%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-writer,SUNWPython"
-packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo"
-freebsdrequires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-pyuno,%BASISPACKAGEPREFIX%PRODUCTVERSION-writer"
-requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-pyuno %PACKAGEVERSION %PACKAGEVERSION-%PACKAGEREVISION,%BASISPACKAGEPREFIX%PRODUCTVERSION-writer %PACKAGEVERSION %PACKAGEVERSION-%PACKAGEREVISION"
-copyright = "2017 The Document Foundation"
-solariscopyright = "solariscopyrightfile"
-vendor = "The Document Foundation"
-description = "LibreLogo toolbar for %PRODUCTNAME %PRODUCTVERSION Writer"
-destpath = "/opt"
-packageversion = "%PACKAGEVERSION"
-End
-
-Start
 module = "gid_Module_Script_Provider_For_Python"
 solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-python-script-provider"
 solarisrequires =  "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")"
commit 5f4dd13dea5f74eedcc0683120b430d575c7a3e2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jun 7 09:28:12 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    More uses of referer URL with SvxBrushItem
    
    Reviewed-on: https://gerrit.libreoffice.org/73643
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit b518882de8213ef71a8003f95fbdf7689069c06d)
    Conflicts:
            sw/source/core/text/porfld.cxx
            sw/source/core/unocore/unosett.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/73860
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit 87c418a98650ab6e4a62a0b4b72e02fee358dced)
    
    Change-Id: I04b524784df4ef453d8b1feec13b62f183a17e23

diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index dff4f1f8aee0..0aa6daefce36 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -208,7 +208,7 @@ public:
 
     static css::uno::Sequence<css::beans::PropertyValue> GetPropertiesForNumFormat(
             const SwNumFormat& rFormat, OUString const& rCharFormatName,
-            OUString const* pHeadingStyleName);
+            OUString const* pHeadingStyleName, OUString const & referer);
     static void SetPropertiesToNumFormat(
             SwNumFormat & aFormat,
             OUString & rCharStyleName,
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 8c489de68590..c3de3a25128e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -756,7 +756,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet,
 SwGrfNumPortion::SwGrfNumPortion(
         SwFrame*,
         const OUString& rGraphicFollowedBy,
-        const SvxBrushItem* pGrfBrush,
+        const SvxBrushItem* pGrfBrush, OUString const & referer,
         const SwFormatVertOrient* pGrfOrient, const Size& rGrfSize,
         const bool bLft, const bool bCntr, const sal_uInt16 nMinDst,
         const bool bLabelAlignmentPosAndSpaceModeActive ) :
@@ -770,7 +770,7 @@ SwGrfNumPortion::SwGrfNumPortion(
     if( pGrfBrush )
     {
         *pBrush = *pGrfBrush;
-        const Graphic* pGraph = pGrfBrush->GetGraphic();
+        const Graphic* pGraph = pGrfBrush->GetGraphic(referer);
         if( pGraph )
             SetAnimated( pGraph->IsAnimated() );
         else
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index cc5e350dbefa..a4f94d5147a1 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -172,6 +172,7 @@ public:
     SwGrfNumPortion( SwFrame *pFrame,
                      const OUString& rGraphicFollowedBy,
                      const SvxBrushItem* pGrfBrush,
+                     OUString const & referer,
                      const SwFormatVertOrient* pGrfOrient,
                      const Size& rGrfSize,
                      const bool bLeft,
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index d024e556ea43..26725e1cba3a 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -52,6 +52,7 @@
 #include "flddat.hxx"
 #include "fmtautofmt.hxx"
 #include <IDocumentSettingAccess.hxx>
+#include <sfx2/docfile.hxx>
 #include <svl/itemiter.hxx>
 
 static bool lcl_IsInBody( SwFrame *pFrame )
@@ -478,9 +479,18 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con
 
         if( SVX_NUM_BITMAP == rNumFormat.GetNumberingType() )
         {
+            OUString referer;
+            if (auto const sh1 = rInf.GetVsh()) {
+                if (auto const doc = sh1->GetDoc()) {
+                    auto const sh2 = doc->GetPersist();
+                    if (sh2 != nullptr && sh2->HasName()) {
+                        referer = sh2->GetMedium()->GetName();
+                    }
+                }
+            }
             pRet = new SwGrfNumPortion( const_cast<SwTextFrame*>(GetTextFrame()),
                                         pTextNd->GetLabelFollowedBy(),
-                                        rNumFormat.GetBrush(),
+                                        rNumFormat.GetBrush(), referer,
                                         rNumFormat.GetGraphicOrientation(),
                                         rNumFormat.GetGraphicSize(),
                                         bLeft, bCenter, nMinDist,
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 81fd65d30a05..afbee31d0340 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -54,6 +54,7 @@
 #include <vcl/font.hxx>
 #include <editeng/flstitem.hxx>
 #include <vcl/metric.hxx>
+#include <sfx2/docfile.hxx>
 #include <svtools/ctrltool.hxx>
 #include <osl/mutex.hxx>
 #include <vcl/svapp.hxx>
@@ -1341,13 +1342,21 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
         SwStyleNameMapper::FillProgName(sValue, aUString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true);
     }
 
-    return GetPropertiesForNumFormat(rFormat, CharStyleName, (pDocShell) ? & aUString : nullptr);
+    OUString referer;
+    if (pDoc != nullptr) {
+        auto const sh = pDoc->GetPersist();
+        if (sh != nullptr && sh->HasName()) {
+            referer = sh->GetMedium()->GetName();
+        }
+    }
+    return GetPropertiesForNumFormat(
+        rFormat, CharStyleName, (pDocShell) ? & aUString : nullptr, referer);
 
 }
 
 uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat(
         const SwNumFormat& rFormat, OUString const& rCharFormatName,
-        OUString const*const pHeadingStyleName)
+        OUString const*const pHeadingStyleName, OUString const & referer)
 {
     bool bChapterNum = pHeadingStyleName != nullptr;
 
@@ -1479,7 +1488,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat
             //graphicbitmap
             const Graphic* pGraphic = nullptr;
             if(pBrush )
-                pGraphic = pBrush->GetGraphic();
+                pGraphic = pBrush->GetGraphic(referer);
             if(pGraphic)
             {
                 uno::Reference<awt::XBitmap> xBmp = VCLUnoHelper::CreateBitmap( pGraphic->GetBitmapEx() );
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 75b49a22a085..793c13719c5f 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -135,7 +135,7 @@ public:
         OUString dummy; // pass in empty HeadingStyleName - can't import anyway
         uno::Sequence<beans::PropertyValue> const ret(
             SwXNumberingRules::GetPropertiesForNumFormat(
-                *pNumFormat, *pCharStyleName, &dummy));
+                *pNumFormat, *pCharStyleName, &dummy, ""));
         return uno::makeAny(ret);
     }
 
commit d39db7097da60c9ea55c5ddd6013be24a53c5a58
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 7 14:04:07 2019 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    explictly exclude LibreLogo from XScript usage
    
    Change-Id: I567647f0e2f8b82e4ef2995c673abe82f4564228
    Reviewed-on: https://gerrit.libreoffice.org/73659
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit cb0024e3668979dfdef44db5aa15ddfaf035e695)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 902e96ccea05..3016315cd17b 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1461,6 +1461,16 @@ namespace
     }
 }
 
+namespace {
+
+// don't allow LibreLogo to be used with our mouseover/etc dom-alike events
+bool UnTrustedScript(const OUString& rScriptURL)
+{
+    return rScriptURL.startsWithIgnoreAsciiCase("vnd.sun.star.script:LibreLogo");
+}
+
+}
+
 ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const OUString& _rScriptURL,
     const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const css::uno::Any* pCaller )
 {
@@ -1473,6 +1483,9 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
     if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( _rxScriptContext ) )
         return ERRCODE_IO_ACCESSDENIED;
 
+    if ( UnTrustedScript(_rScriptURL) )
+        return ERRCODE_IO_ACCESSDENIED;
+
     bool bCaughtException = false;
     Any aException;
     try
commit cdfde64510f4c484d4c291695aed2a5cb1bf5410
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Thu Jun 6 14:25:32 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:46 2019 +0200

    sanitize LibreLogo calls
    
    Change-Id: Ie4d9858e5b4b3e55ab08416fb9338d2df34ee5e1
    Reviewed-on: https://gerrit.libreoffice.org/73627
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 1b63fa32bbd4a5b89d2ee3a53b28de4250c8dad3)

diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index 7885ab9bb66d..2b9ef849ad13 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -76,6 +76,7 @@ __LineStyle_DOTTED__ = 2
 class __Doc__:
     def __init__(self, doc):
         self.doc = doc
+        self.secure = False
         try:
             self.drawpage = doc.DrawPage # Writer
         except:
@@ -409,10 +410,58 @@ class LogoProgram(threading.Thread):
         self.code = code
         threading.Thread.__init__(self)
 
+    def secure(self):
+        # 0 = secure
+        if _.secure:
+            return 0
+
+        # 1 = forms, fields or embedded objects are forbidden
+        if _.doc.DrawPage.Forms.getCount() > 0 or _.doc.getTextFields().createEnumeration().hasMoreElements() or _.doc.getEmbeddedObjects().getCount() > 0:
+            return 1
+
+        # 2 = hyperlinks with script events
+        nodes = _.doc.Text.createEnumeration()
+        while nodes.hasMoreElements():
+            node = nodes.nextElement()
+            if node.supportsService("com.sun.star.text.Paragraph"):
+                portions = node.createEnumeration()
+                while portions.hasMoreElements():
+                    portion = portions.nextElement()
+                    if portion.PropertySetInfo.hasPropertyByName("HyperLinkEvents"):
+                        events = portion.getPropertyValue("HyperLinkEvents")
+                        for event in events.getElementNames():
+                            attributes = events.getByName(event)
+                            for attribute in attributes:
+                                if attribute.Name == "EventType" and attribute.Value == "Script":
+                                    return 2
+
+        # 2 = images with script events
+        images = _.doc.DrawPage.createEnumeration()
+        while images.hasMoreElements():
+            image = images.nextElement()
+            try:
+                events = image.Events
+                for event in events.getElementNames():
+                    attributes = events.getByName(event)
+                    for attribute in attributes:
+                        if attribute.Name == "EventType" and attribute.Value == "Script":
+                            return 2
+            except:
+                pass
+
+        _.secure = True
+        return 0
+
     def run(self):
         global __thread__
         try:
-            exec(self.code)
+            # check document security
+            secid = self.secure()
+            if secid > 0:
+                parent = _.doc.CurrentController.Frame.ContainerWindow
+                MessageBox(parent, "Document objects with%s script events" % [" possible", ""][secid-1], "LibreLogo program can't start", "errorbox")
+            else:
+                exec(self.code)
             if _.origcursor[0] and _.origcursor[1]:
                 __dispatcher__(".uno:Escape")
                 try:
commit 4e7f243b04dddc8a8dcfa70b59d5680ed62097f6
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Thu Mar 9 18:42:09 2017 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    oops, forgot to commit that
    
    Change-Id: I7b0a08ca47996f80112f68daef3e2ba5e3be221b
    (cherry picked from commit 15d46079a5b6429dba0d501e7db218188294587a)

diff --git a/extensions/Library_so_activex_x64.mk b/extensions/Library_so_activex_x64.mk
index e1c4b9a8f9ba..64f644098a8f 100644
--- a/extensions/Library_so_activex_x64.mk
+++ b/extensions/Library_so_activex_x64.mk
@@ -52,7 +52,7 @@ $(eval $(call gb_Library_use_system_win32_libs,so_activex_x64,\
 $(eval $(call gb_Library_add_libs,so_activex_x64,\
 	$(if $(filter 140,$(VCVER)),\
 		$(ATL_LIB)/amd64/atls.lib, \
-		$(subst /x86,/x64,$(ATL_LIB)/amd64/atls.lib)) \
+		$(subst /x86,/x64,$(ATL_LIB)/atls.lib)) \
 ))
 
 # vim:set noet sw=4 ts=4:
commit a4aeece08b64670e440a70aa3973fd8bee404a8a
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Thu Mar 9 18:40:40 2017 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    extensions: fix MSVC 2017 build of Library_so_activex_x64
    
    Change-Id: Ia98c2ba085d6b7705b53dafd5368d69f0e0727c5
    (cherry picked from commit 869a249cebaf58d13812194297561fc361dd3a36)

diff --git a/extensions/Library_so_activex_x64.mk b/extensions/Library_so_activex_x64.mk
index d330ca8a3bf0..e1c4b9a8f9ba 100644
--- a/extensions/Library_so_activex_x64.mk
+++ b/extensions/Library_so_activex_x64.mk
@@ -50,7 +50,9 @@ $(eval $(call gb_Library_use_system_win32_libs,so_activex_x64,\
 ))
 
 $(eval $(call gb_Library_add_libs,so_activex_x64,\
-	$(ATL_LIB)/amd64/atls.lib \
+	$(if $(filter 140,$(VCVER)),\
+		$(ATL_LIB)/amd64/atls.lib, \
+		$(subst /x86,/x64,$(ATL_LIB)/amd64/atls.lib)) \
 ))
 
 # vim:set noet sw=4 ts=4:
commit 9de690503524fc4dd8e96db9df62b2315a3a4e01
Author:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Sat May 25 11:12:18 2019 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    Disable warning C4005 for Vista-compatible SDK 7.1A builds
    
    No point in pulling in all warning fixes from 5.4
    
    Change-Id: I926b2b41628d7059ec9187918ac9df9c1160dfe6

diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index ab6f27f6794e..91d2cdc4f218 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -152,6 +152,7 @@ gb_CFLAGS := \
 	-nologo \
 	-W4 \
 	-wd4091 \
+       -wd4005 \
 	$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \
 	-wd4127 \
 	$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \
@@ -194,6 +195,7 @@ gb_CXXFLAGS := \
 	-nologo \
 	-W4 \
 	-wd4091 \
+       -wd4005 \
 	$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \
 	-wd4127 \
 	$(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \
@@ -259,7 +261,6 @@ gb_PCHWARNINGS = \
 	-we4651 \
 	-we4652 \
 	-we4653 \
-	-we4005 \
 
 gb_STDLIBS := \
 	advapi32.lib \
commit ef37d229bbc2e79402186edf8ac7cf1db9a29982
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Tue May 30 17:00:42 2017 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    gbuild: stop defining _USING_V110_SDK71_
    
    Change-Id: Ic8eee967269b3666b15795f20ee62817dadfb0ff
    (cherry picked from commit 713ed7b338b467b176af7eb5e9a80559b8496e8e)

diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index cc73510bb451..ab6f27f6794e 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -54,7 +54,6 @@ gb_COMPILERDEFS := \
 	-D_MT \
 	-D_DLL \
 	-DCPPU_ENV=$(gb_CPPU_ENV) \
-	$(if $(findstring 140_70,$(VCVER)_$(WINDOWS_SDK_VERSION)),-D_USING_V110_SDK71_) \
 
 ifeq ($(CPUNAME),INTEL)
 gb_COMPILERDEFS += \
commit 1b9a84d2ad259ac2da6035db41b23a1a5ed38b0a
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Tue May 30 16:37:56 2017 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    gbuild: define _WIN32_WINNT = _WIN32_WINNT_WIN7 = 0x0601
    
    And rely on implicitly derived
    _WIN32_IE = _WIN32_IE_WIN7 = _WIN32_IE_IE80
    
    Change-Id: I94717e2ed66387bdc76f9047c02c0820d4adc1f9
    (cherry picked from commit 2829dabaf37e6d9c736430f3fb9bbfb786b078ad)

diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index ebd2a3c86a94..65a4f982320a 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -24,13 +24,11 @@ gb_Helper_LIBRARY_PATH_VAR := PATH
 gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
 # define _WIN32_WINNT and WINVER will be derived from it in sdkddkver.h
-# with a 7.1 SDK target Windows XP, with 8.x SDK target Windows Vista
-# currently _WIN32_IE is defined to a higher version than would be derived
-# in sdkddkver.h from _WIN32_WINNT=0x0502 but if _WIN32_WINNT >= 0x0600
-# the derived value is sufficient
+# current baseline is Windows 7 (NT 6.1)
+# for _WIN32_IE, if _WIN32_WINNT >= 0x0600 the derived value from
+# sdkddkver.h is sufficient
 gb_OSDEFS := \
-	-D_WIN32_WINNT=$(if $(filter 70,$(WINDOWS_SDK_VERSION)),0x0502,0x0600) \
-	-D_WIN32_IE=0x0700 \
+	-D_WIN32_WINNT=0x0601 \
 	-DWIN32 \
 	-DWNT \
 	-DNOMINMAX \
commit cb028a7425d1771f0f5bf4fbf06aecddeadea419
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Fri Jun 2 22:38:06 2017 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    scp2: package 64-bit MSVC runtimes for explorer extensions
    
    Not a backport because master is a bit too refactored now.
    
    Reviewed-on: https://gerrit.libreoffice.org/38365
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit ab4344c34ddf048adf9a3fad0dd1fa2970935550)
    
    Conflicts:
            scp2/source/winexplorerext/file_winexplorerext.scp
    
    Change-Id: I1eccb99252fb66dc1fcc9cb5af978c61717ff629

diff --git a/scp2/source/winexplorerext/file_winexplorerext.scp b/scp2/source/winexplorerext/file_winexplorerext.scp
index 7567896b4b9f..7ca1f9c6a63d 100644
--- a/scp2/source/winexplorerext/file_winexplorerext.scp
+++ b/scp2/source/winexplorerext/file_winexplorerext.scp
@@ -85,4 +85,15 @@ End
 
 #endif
 
+#if defined(WITH_VC140_REDIST) || defined(WITH_VC150_REDIST)
+
+File gid_File_X64_Redist
+    Styles = (FILELIST, USE_INTERNAL_RIGHTS, PACKED);
+    Dir = FILELIST_DIR;
+    Name = "msvc_dlls.filelist";
+    ComponentCondition = "VersionNT64";
+End
+
+#endif
+
 #endif
diff --git a/scp2/source/winexplorerext/module_winexplorerext.scp b/scp2/source/winexplorerext/module_winexplorerext.scp
index 440945e89096..b71153cd0052 100644
--- a/scp2/source/winexplorerext/module_winexplorerext.scp
+++ b/scp2/source/winexplorerext/module_winexplorerext.scp
@@ -49,9 +49,6 @@ Module gid_Module_Optional_Winexplorerext_x64
     Dirs = (gid_Dir_Shlxthdl);
     Files = (auto_winexplorerextwin64_ALL,
              auto_winexplorerextwin64nt6_ALL,
-             gid_File_Lib_Msvcp100,
-             gid_File_Lib_Msvcr100,
-             gid_File_Lib_Msvcp110,
-             gid_File_Lib_Msvcr110);
+             gid_File_X64_Redist);
 End
 #endif
commit 5597c0d019e0fdd5cb3717bfc3286591feed0032
Author:     David Ostrovsky <david at ostrovsky.org>
AuthorDate: Sat Jan 21 11:44:33 2017 +0100
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    tdf#105311 VC++ Runtime installed in wrong directory
    
    Starting from MSVC 14.0, the directory table layout of VC++ Runtime merge
    module changed. As consequence, all MSI produced with newer compilers,
    including MSVC 15.0 (aka VS 2017) are broken in term that the VC++
    Runtime DLLs are installed in the wrong directory, e.g.: C:\System64.
    
    According to the specification for merging merge module (msm), see:
    "Authoring Merge Module Directory Tables": [1], custom action 51 (set
    property) must be emitted for every directory name in the merge module
    directory table if the directory name is starting with the standard
    directory name.
    
    Quoting it here:
    
    "
    When a predefined directory is included in a merge module, the merge
    tool automatically adds a Custom Action Type 51 to the target database.
    The merge module author must ensure that a CustomAction table is also
    included. The CustomAction table may be empty, but this table is required
    to exist in the target database and ensures that the modified predefined
    directories are written to the correct locations. For example, when a
    system directory is included in a merge module, the merge module author
    must ensure that a Custom Action table exists.
    
    Note that the matching algorithm for the generation of these type 51
    custom actions only checks that the directory name begins with one of
    the predefined SystemFolder properties. It does not verify that the
    directory name exactly equals the directory property. Any directory
    beginning with one of these standard folder names gets a type 51 custom
    action, even if the rest of the name is not a GUID. Authors need to take
    care that this does not generate false positive matches, and unintended
    custom action generation, on derivative primary keys that begin with one
    of the SystemFolder properties."
    
    Rectify the problem by analyzing the directory table from the merge
    module, checking whether the directory name starts with the standard
    prefix name and if it is the case, emitting custom action 51 to set this
    variable to the standard directory name.
    
    Implementation details:
    
    We use the existing facility for emitting the custom action table events
    including referencing them in the corresponding sequence tables. Given
    that the specification above doesn't mention what sequence table should
    be referencing this emitted custom action, we reversed engineer this
    information from WiX toolkit. Merging the VC++ CRT module with WiX
    toolkit and investigating the resulting MSI with Orca MSI reader, reveals
    that these sequence tables were referencing from these sequence tables:
    
    * AdminExecuteSequence
    * AdminUISequence
    * AdvtExecuteSequence
    * InstallExecuteSequence
    * InstallUISequence
    
    Replicate this behaviour here as well. Note, though, that custom actions
    are generally not referenced in AdminUISequence and AdvtExecuteSequence
    tables in LibreOffice MSI building tool chain.
    
    Rendering of the custom action is achieved by programmatic emulation of
    custom action in SCP module. Consider this similar SCP module based
    action:
    
      Name = "MigrateInstallPath";
      Typ = "321";
      Source = "shlxtmsi.dll";
      Target = "MigrateInstallPath";
      Inbinarytable = 1;
      Assignment1 = ("InstallExecuteSequence", "", "CostInitialize");
      Assignment2 = ("InstallUISequence", "", "CostInitialize");
    
    We instantiate the following data structure to emit custom action
    System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1:
    
      Name = "System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1"
      Typ = "51"
      Source = "System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1"
      Target = "[System64Folder]"
      Styles = "NO_FILES"
      Assignment1 = ("AdminExecuteSequence", "", "CostInitialize")
      Assignment2 = ("InstallExecuteSequence", "", "CostInitialize")
      Assignment3 = ("InstallUISequence", "", "CostInitialize")
    
    [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa367787%28v=vs.85%29.aspx
    
    Change-Id: I2fbd37ff63298d99b2ba1b6afe6e875f56d8e378
    Reviewed-on: https://gerrit.libreoffice.org/33366
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: David Ostrovsky <david at ostrovsky.org>
    (cherry picked from commit 30473907a565764eb35a19051dc0d52704cf7bb7)

diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm
index 605aec25e663..eb6ec70aafb9 100644
--- a/solenv/bin/modules/installer.pm
+++ b/solenv/bin/modules/installer.pm
@@ -519,9 +519,15 @@ sub run {
                 if ( $installer::globals::updatedatabase )
                 {
                     ($uniquefilename, $revuniquefilename, $revshortfilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder, $allupdatecomponentorder, $shortdirname, $componentid, $componentidkeypath, $alloldproperties, $allupdatelastsequences, $allupdatediskids) = installer::windows::update::create_database_hashes($refdatabase);
-                    if ( $mergemodulesarrayref > -1 ) { installer::windows::update::readmergedatabase($mergemodulesarrayref, $languagestringref, $includepatharrayref); }
                 }
             }
+
+            # Always analyze the merge module.
+            # We need to investigate the directory table in merge module to emit
+            # custom action for directory names that start with standard prefix
+            if ( $mergemodulesarrayref > -1 ) {
+                installer::windows::update::readmergedatabase($mergemodulesarrayref, $languagestringref, $includepatharrayref);
+            }
         }
 
         ##############################################
@@ -1510,6 +1516,24 @@ sub run {
 
                 installer::windows::idtglobal::addcustomactions($languageidtdir, $windowscustomactionsarrayref, $filesinproductlanguageresolvedarrayref);
 
+                installer::logger::print_message( "... Analyze if custom action table must be patched with merge module directory names ...\n" );
+
+                my @customactions = ();
+                for my $e (keys %installer::globals::merge_directory_hash) {
+                    my $var;
+                    installer::logger::print_message( "... analyzing directory from merge module: $e\n");
+                    if (installer::windows::directory::has_standard_directory_prefix($e, \$var)) {
+                        installer::logger::print_message( "... emitting custom action to set the var $e to directory: $var\n");
+                        push(@customactions, installer::windows::idtglobal::emit_custom_action_for_standard_directory($e, $var));
+                    }
+                }
+
+                if (@customactions) {
+                    installer::logger::print_message( "... Patching custom action table with merge module directory names ...\n" );
+                    #print Dumper(@customactions);
+                    installer::windows::idtglobal::addcustomactions($languageidtdir, \@customactions, $filesinproductlanguageresolvedarrayref);
+                }
+
                 # Then the language specific msi database can be created
 
                 if ( $installer::globals::iswin || $installer::globals::packageformat eq 'msi' )
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index 5a7423aa48f8..c09b696c766c 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -159,6 +159,7 @@ BEGIN
     %merge_media_line = ();
     %merge_allfeature_hash = ();
     %merge_alldirectory_hash = ();
+    %merge_directory_hash = ();
     %copy_msm_files = ();
     $mergefeaturecollected = 0;
     $mergedirectoriescollected = 0;
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
index a1d677393334..b29fa13c045a 100644
--- a/solenv/bin/modules/installer/windows/directory.pm
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -29,6 +29,36 @@ use installer::windows::msiglobal;
 # Collecting all directory trees in global hash
 ##############################################################
 
+my @msistandarddirectorynames = qw(
+   AdminToolsFolder
+   AppDataFolder
+   CommonAppDataFolder
+   CommonFiles64Folder
+   CommonFilesFolder
+   DesktopFolder
+   FavoritesFolder
+   FontsFolder
+   LocalAppDataFolder
+   MyPicturesFolder
+   NetHoodFolder
+   PersonalFolder
+   PrintHoodFolder
+   ProgramFiles64Folder
+   ProgramFilesFolder
+   ProgramMenuFolder
+   RecentFolder
+   SendToFolder
+   StartMenuFolder
+   StartupFolder
+   System16Folder
+   System64Folder
+   SystemFolder
+   TempFolder
+   TemplateFolder
+   WindowsFolder
+   WindowsVolume
+);
+
 sub collectdirectorytrees
 {
     my ( $directoryref ) = @_;
@@ -569,4 +599,36 @@ sub create_directory_table
     }
 }
 
+################################################
+# Check if the string starts with another string
+################################################
+
+sub starts_with
+{
+    my ($first, $second) = @_;
+
+    return substr($first, 0, length($second)) eq $second;
+}
+
+###############################################
+# Check if the directory prefix is a standard
+# directory name. If it is the case, then the
+# standard directory name is returned in $var.
+###############################################
+
+sub has_standard_directory_prefix
+{
+    my ($dir, $var) = @_;
+
+    for my $d (@msistandarddirectorynames) {
+        if (starts_with($dir, $d) && $dir ne $d) {
+            installer::logger::print_message("... match found: [$d]\n");
+            ${$var} = $d;
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
 1;
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
index d9d2f9e2c238..2fa46fbbdb6a 100644
--- a/solenv/bin/modules/installer/windows/idtglobal.pm
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -1834,4 +1834,29 @@ sub setbidiattributes
     push(@installer::globals::logfileinfo, $infoline);
 }
 
+###############################################
+# Emit custom action 51 for setting standard
+# directory variable. Reference to a hash is
+# returned, represented the custom action.
+# This can be passed in to addcustomaction
+# method.
+###############################################
+
+sub emit_custom_action_for_standard_directory
+{
+    my ($dir, $var) = @_;
+    my %action = ();
+
+    $action{'Name'} = $dir;
+    $action{'Typ'} = "51";
+    $action{'Source'} = $dir;
+    $action{'Target'} = "[$var]";
+    $action{'Styles'} = "NO_FILE";
+    $action{'Assignment1'} = '("AdminExecuteSequence", "", "CostInitialize")';
+    $action{'Assignment2'} = '("InstallExecuteSequence", "", "CostInitialize")';
+    $action{'Assignment3'} = '("InstallUISequence", "", "CostInitialize")';
+
+    return \%action;
+}
+
 1;
diff --git a/solenv/bin/modules/installer/windows/update.pm b/solenv/bin/modules/installer/windows/update.pm
index 0edaaf2d8d91..45c47ed7ab0d 100644
--- a/solenv/bin/modules/installer/windows/update.pm
+++ b/solenv/bin/modules/installer/windows/update.pm
@@ -183,6 +183,9 @@ sub read_all_tables_from_msidatabase
         if ( ! -f $longonefilename ) { installer::exiter::exit_program("ERROR: Could not find idt file: $longonefilename!", "read_all_tables_from_msidatabase"); }
         my $filecontent = installer::files::read_file($longonefilename);
         my $idtcontent = analyze_idt_file($filecontent);
+        if ($onefilename eq "Directory.idt") {
+            collect_directories($filecontent);
+        }
         my $key = $onefilename;
         $key =~ s/\.idt\s*$//;
         $database{$key} = $idtcontent;
@@ -406,6 +409,31 @@ sub readdatabase
     return $database;
 }
 
+#########################################################################
+# Reading the file "Directory.idt".
+#########################################################################
+
+sub collect_directories
+{
+    my ($filecontent) = @_;
+
+    for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+    {
+        if ( $i <= 2 ) { next; }                        # ignoring first three lines
+        if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+        # Format: Directory Directory_Parent    DefaultDir
+        if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\s*$/ )
+        {
+            $installer::globals::merge_directory_hash{$1} = 1;
+        }
+        else
+        {
+            my $linecount = $i + 1;
+            installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "collect_directories");
+        }
+    }
+}
+
 #################################################################################
 # Files can be included in merge modules. This is also important for update.
 #################################################################################
commit fb4973665c6a30e80b09c01bba706bb8149be863
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jul 3 08:33:34 2018 +0200
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    const fixes for python3-devel-3.7.0-1.fc29.x86_64
    
    Change-Id: Ia16a8b828e11ce36e9bb77ecf9e8a1179bd9b90c
    Reviewed-on: https://gerrit.libreoffice.org/56841
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 76a29148be63cb006a7e25e312dc93acc93e071f)

diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index 0452da7cef6f..4a12ad3136d2 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -80,7 +80,7 @@ inline PyObject* PyStr_FromString(const char *string)
     return PyUnicode_FromString(string);
 }
 
-inline char * PyStr_AsString(PyObject *object)
+inline char const * PyStr_AsString(PyObject *object)
 {
     return PyUnicode_AsUTF8(object);
 }
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index c2472e478029..f35ddf4ace6d 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -155,7 +155,7 @@ Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException )
     }
 
     OUString strTypeName( OUString::createFromAscii( PyStr_AsString( typeName.get() ) ) );
-    char *stringValue = PyStr_AsString( value.get() );
+    char const *stringValue = PyStr_AsString( value.get() );
 
     TypeDescription desc( strTypeName );
     if( desc.is() )
diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx
index ede4cd6f01c0..8e3d74287421 100644
--- a/pyuno/source/module/pyuno_util.cxx
+++ b/pyuno/source/module/pyuno_util.cxx
@@ -64,7 +64,7 @@ OUString pyString2ustring( PyObject *pystr )
 #else
 #if PY_MAJOR_VERSION >= 3
     Py_ssize_t size(0);
-    char *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size));
+    char const *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size));
     ret = OUString(pUtf8, size, RTL_TEXTENCODING_UTF8);
 #else
     PyObject* pUtf8 = PyUnicode_AsUTF8String(pystr);
commit 76491baa306c775250b46d69950a45e3b8bd96a8
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Dec 17 00:23:24 2018 +0300
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    tdf#122134: use CurrentMajorVersionNumber to filter out Windows 10
    
    On Windows 8.1, the one that is problematic to tell from Windows 10
    (because the latter also exposes its version as 603 to the msiexec),
    the registry value doesn't exist at
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    but let's play safe and also check for "#6" value just in case.
    
    Reference:
    https://stackoverflow.com/questions/31072543/reliable-way-to-get-windows-version-from-registry
    
    Thanks to Mitchell <blazer64 at gmail.com> for the idea!
    
    Reviewed-on: https://gerrit.libreoffice.org/65231
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit d87fa557ff58c3b9f5c9079a1d7595e095694111)
    Reviewed-on: https://gerrit.libreoffice.org/65242
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 72f2fbc75dc254ea8e13527b592bd0b4fb946bab)
    
    Conflicts:
            instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
    
    Change-Id: Ic907c4d992a7cb1d12e392686c19cd6fd6da3c7c

diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
index 3968375a8815..4bc5b05f6d9a 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/AppSearc.idt
@@ -5,3 +5,4 @@ INSTALLLOCATION	installuser
 INSTALLLOCATION	installuser_
 INSTALLLOCATION	installmachine
 INSTALLLOCATION	installmachine_
+WINMAJORVER	WinMajorVer
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
index 44fb9f500387..b3eaa2342d9f 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
@@ -42,7 +42,7 @@ ProgressType3	installs
 Quickstarterlinkname	QUICKSTARTERLINKNAMETEMPLATE
 RebootYesNo	Yes
 ReinstallModeText	omus
-SecureCustomProperties	NEWPRODUCTS;OLDPRODUCTS;WIN81S14
+SecureCustomProperties	NEWPRODUCTS;OLDPRODUCTS;WIN81S14;WINMAJORVER
 SetupType	Typical
 SELECT_WORD	0
 SELECT_EXCEL	0
diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
index c082322086ad..7788815d3a6e 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/RegLocat.idt
@@ -5,3 +5,4 @@ installuser	1	Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]
 installuser_	1	Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]	INSTALLLOCATION	2
 installmachine	2	Software\LibreOffice\Layers\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]	INSTALLLOCATION	2
 installmachine_	2	Software\LibreOffice\Layers_\[DEFINEDPRODUCT]\[BRANDPACKAGEVERSION]	INSTALLLOCATION	2
+WinMajorVer	2	Software\Microsoft\Windows NT\CurrentVersion	CurrentMajorVersionNumber	2
diff --git a/scp2/source/ooo/ucrt.scp b/scp2/source/ooo/ucrt.scp
index ae2eb27a4dbe..a2d6965e2ecb 100644
--- a/scp2/source/ooo/ucrt.scp
+++ b/scp2/source/ooo/ucrt.scp
@@ -111,7 +111,7 @@ WindowsCustomAction gid_Customaction_check_win81x64_ucrt
 	Source = "InstMSUBinary";
 	Target = "Windows81-KB2999226-x64msu";
 	Inbinarytable = 0;
-	Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And VersionNT64", "check_win8x64_ucrt");
+	Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And VersionNT64", "check_win8x64_ucrt");
 	Styles = "NO_FILE";
 End
 
@@ -147,7 +147,7 @@ WindowsCustomAction gid_Customaction_check_win81x32_ucrt
 	Source = "InstMSUBinary";
 	Target = "Windows81-KB2999226-x86msu";
 	Inbinarytable = 0;
-	Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And Not VersionNT64", "check_win8x32_ucrt");
+	Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And (Not WINMAJORVER Or WINMAJORVER = \"#6\") And Not VersionNT64", "check_win8x32_ucrt");
 	Styles = "NO_FILE";
 End
 
commit 9fe304b384b6207d0fbb1bd7d0959719f7cd91e4
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Apr 12 15:18:58 2018 +0300
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    tdf#108580 related: improve existing redist detection
    
    This uses VC Runtime upgrade code (checked using Upgrade table) to
    find installed redist, instead of checking registry keys that change
    between versions (while the runtime is still compatible, as with 2015
    and 2017).
    Also, it checks if UCRT is present. Now, if either VC Runtime or UCRT
    is absent, we try to install the redist. This would allow to install
    UCRT in scenarios when first install was attempted on a system not
    suitable for UCRT (like Win7 w/o SP1, or Win8.1 w/o April 2014 update
    rollup), where VC Runtime gets installed, but UCRT is still missing.
    We use the ucrtbase.dll version to check that; and as the expected
    version is 10.x, we take into account that Win10 lies about versions.
    
    Reviewed-on: https://gerrit.libreoffice.org/52794
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 1f8a3657216e44796cb94087450552aa977ebdae)
    
    Conflicts:
            instsetoo_native/inc_openoffice/windows/msi_templates/DrLocato.idt
    
    Change-Id: I864dfc09cf1bdc775501729fa2a27dc98295588c

diff --git a/solenv/bin/modules/installer/windows/upgrade.pm b/solenv/bin/modules/installer/windows/upgrade.pm
index 54838212404c..9e0d7ea79fb7 100644
--- a/solenv/bin/modules/installer/windows/upgrade.pm
+++ b/solenv/bin/modules/installer/windows/upgrade.pm
@@ -45,6 +45,18 @@ sub create_upgrade_table
     $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTS" . "\n";
     push(@upgradetable, $newline);
 
+    # Detecting if VC Runtime is installed on system
+    $newline = "VCRUNTIME_UPGRADE_CODE" . "\t" . "14.0.24215" . "\t" . "15.0.0" . "\t" . "" . "\t" . "258" . "\t" . "" . "\t" . "VCRUNTIME_DETECTED";
+    if ( $installer::globals::cpuname eq 'X86_64' )
+    {
+        $newline =~ s/VCRUNTIME_UPGRADE_CODE/{36F68A90-239C-34DF-B58C-64B30153CE35}/;
+    }
+    else
+    {
+        $newline =~ s/VCRUNTIME_UPGRADE_CODE/{65E5BD06-6392-3027-8C26-853107D3CF1A}/;
+    }
+    push(@upgradetable, $newline);
+
     # Saving the file
 
     my $upgradetablename = $basedir . $installer::globals::separator . "Upgrade.idt";
commit 234641ca474a3868453f277e933fae43bbf85b8e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat Dec 8 23:35:37 2018 +0300
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    tdf#121987: Don't fail installation if failed to enable WU service
    
    Since commit 1882827320ed760de82211cf690b686f8d34ff74, an attempt to
    install UCRT will be performed regardless there is an evidence that it's
    present on the system, to workaround some cases where the existing UCRT
    is broken (tdf#115405, tdf#119910).
    
    But that made other errors to emerge: on systems where users disable WU
    service using some exotic ways, installer is unable to enable the
    service, and fails. [1][2] Examples of such hard-disables are using
    `sc delete` [3] and associating WU service with a guest account. Many
    such cases are reported for Windows 10, where installation of the UCRT
    is not required.
    
    So the solution (imperfect, but possibly the best possible here) is to
    allow installer to continue in case of failure enabling the service.
    This will automatically eliminate all problems related to Win10; and
    also for cases where users are advanced enough (the majority of such
    hard-disable cases should be those), it might be enough to add a
    relevant FAQ entry.
    
    [1] https://ask.libreoffice.org/en/question/172227/cannot-install-631/
    [2] https://ask.libreoffice.org/en/question/175571/installation-failed-unknown-error-win10x64/
    [3] https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-delete
    
    Change-Id: Ie85016eb6f0667f39412a3089fe1b1855cb1fc73
    Reviewed-on: https://gerrit.libreoffice.org/64825
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 53058090beede6a399e2f408f62c28a2921ff8ab)
    Reviewed-on: https://gerrit.libreoffice.org/64829
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
index b03d3cf3791c..fe948a97d595 100644
--- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
+++ b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
@@ -166,6 +166,16 @@ bool IsWow64Process()
 #endif
 }
 
+// An exception class to differentiate a non-fatal exception
+class nonfatal_exception : public std::exception
+{
+public:
+    nonfatal_exception(const std::exception& e)
+        : std::exception(e)
+    {
+    }
+};
+
 // Checks if Windows Update service is disabled, and if it is, enables it temporarily.
 class WUServiceEnabler
 {
@@ -195,27 +205,37 @@ public:
 private:
     static CloseServiceHandleGuard EnableWUService(MSIHANDLE hInstall)
     {
-        auto hSCM = Guard(OpenSCManagerW(nullptr, nullptr, SC_MANAGER_ALL_ACCESS));
-        if (!hSCM)
-            ThrowLastError("OpenSCManagerW");
-        WriteLog(hInstall, "Opened service control manager");
-
-        auto hService = Guard(OpenServiceW(hSCM.get(), L"wuauserv",
-                                           SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG
-                                               | SERVICE_QUERY_STATUS | SERVICE_STOP));
-        if (!hService)
-            ThrowLastError("OpenServiceW");
-        WriteLog(hInstall, "Obtained WU service handle");
-
-        if (ServiceStatus(hInstall, hService.get()) == SERVICE_RUNNING
-            || !EnsureServiceEnabled(hInstall, hService.get(), true))
+        try
         {
-            // No need to restore anything back, since we didn't change config
-            hService.reset();
-            WriteLog(hInstall, "Service configuration is unchanged");
-        }
+            auto hSCM = Guard(OpenSCManagerW(nullptr, nullptr, SC_MANAGER_ALL_ACCESS));
+            if (!hSCM)
+                ThrowLastError("OpenSCManagerW");
+            WriteLog(hInstall, "Opened service control manager");
+
+            auto hService = Guard(OpenServiceW(hSCM.get(), L"wuauserv",
+                                               SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG
+                                                   | SERVICE_QUERY_STATUS | SERVICE_STOP));
+            if (!hService)
+                ThrowLastError("OpenServiceW");
+            WriteLog(hInstall, "Obtained WU service handle");
+
+            if (ServiceStatus(hInstall, hService.get()) == SERVICE_RUNNING
+                || !EnsureServiceEnabled(hInstall, hService.get(), true))
+            {
+                // No need to restore anything back, since we didn't change config
+                hService.reset();
+                WriteLog(hInstall, "Service configuration is unchanged");
+            }
 
-        return hService;
+            return hService;
+        }
+        catch (const std::exception& e)
+        {
+            // Allow errors opening service to be logged, but not interrupt installation.
+            // They are likely to happen in situations where people hard-disable WU service,
+            // and for these cases, let people deal with install logs instead of failing.
+            throw nonfatal_exception(e);
+        }
     }
 
     // Returns if the service configuration was actually changed
@@ -476,6 +496,14 @@ extern "C" UINT __stdcall InstallMSU(MSIHANDLE hInstall)
                 ThrowWin32Error("Execution of wusa.exe", nExitCode);
         }
     }
+    catch (nonfatal_exception& e)
+    {
+        // An error that should not interrupt installation
+        WriteLog(hInstall, e.what());
+        WriteLog(hInstall, "Installation of MSU package failed, but installation of product will "
+                           "continue. You may need to install the required update manually");
+        return ERROR_SUCCESS;
+    }
     catch (std::exception& e)
     {
         WriteLog(hInstall, e.what());
commit 03231510ecc97bd176ae3b7e2cc9a0e336edb45c
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Sep 20 08:05:41 2018 +0300
Commit:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Fri Aug 23 12:40:45 2019 +0200

    tdf#115405, tdf#119910: don't check if UCRT is already installed
    
    There appears to be common situation that a system has *some* UCRT libraries
    in System32, that were installed improperly (presumably by some applications
    using simple copy).In these cases, our installer would detect the presence of
    ucrtbase.dll, and not try to install UCRT on the system.
    
    Unfortunately, it seems that oftentimes such improper UCRT installations miss
    some parts of UCRT, which leads to LibreOffice failing to start with messages
    like "The program can't start because api-ms-win-crt-string-l1-1-0.dll is
    missing from your computer. Try reinstalling the program to fix this problem."
    (the missing component varies).
    
    This patch removes the check for UCRT presence. Installer will try to install
    UCRT on applicable systems unconditionally. Since the proper outcomes in case
    of already present UCRT are either WU_S_ALREADY_INSTALLED or WU_E_NOT_APPLICABLE
    and both are treated as success in inst_msu action (see InstallMSU in
    setup_native/source/win32/customactions/inst_msu/inst_msu.cxx), this should
    only make this part more robust, and not bring new problems (yes, I know that
    actually there will be new problems, as usual).
    
    Reviewed-on: https://gerrit.libreoffice.org/60789
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 1882827320ed760de82211cf690b686f8d34ff74)
    Reviewed-on: https://gerrit.libreoffice.org/61444
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    
    Change-Id: I22a3d357014d31a8e492ff8a15bcb477eeb79735

diff --git a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
index f51e12ed0d60..44fb9f500387 100644
--- a/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt
+++ b/instsetoo_native/inc_openoffice/windows/msi_templates/Property.idt

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list