[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-0' - 13 commits - bin/distro-install-file-lists external/libgpg-error include/sfx2 officecfg/Configuration_officecfg.mk officecfg/registry oox/source postprocess/CustomTarget_registry.mk Repository.mk RepositoryModule_host.mk scp2/AutoInstall.mk scp2/InstallModule_python.mk sc/source sd/source setup_native/source sfx2/source solenv/bin sw/inc sw/source vcl/headless

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 6 09:36:58 UTC 2019


 Repository.mk                                                          |    4 
 RepositoryModule_host.mk                                               |    1 
 bin/distro-install-file-lists                                          |    3 
 external/libgpg-error/UnpackedTarball_libgpg-error.mk                  |    1 
 external/libgpg-error/libgpg-error_gawk5.patch                         |  114 ++++++++++
 external/libgpg-error/w32-build-fixes.patch                            |    2 
 include/sfx2/objsh.hxx                                                 |    2 
 officecfg/Configuration_officecfg.mk                                   |    3 
 officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu |   14 -
 oox/source/vml/vmlformatting.cxx                                       |    2 
 postprocess/CustomTarget_registry.mk                                   |    6 
 sc/source/ui/docshell/externalrefmgr.cxx                               |   53 +++-
 scp2/AutoInstall.mk                                                    |    1 
 scp2/InstallModule_python.mk                                           |    6 
 sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx   |    2 
 setup_native/source/packinfo/packinfo_office.txt                       |   17 -
 sfx2/source/doc/objmisc.cxx                                            |   33 ++
 sfx2/source/notify/eventsupplier.cxx                                   |   18 +
 solenv/bin/modules/installer/epmfile.pm                                |   12 -
 sw/inc/anchoredobject.hxx                                              |    1 
 sw/source/core/edit/edfcol.cxx                                         |    2 
 sw/source/core/inc/layouter.hxx                                        |    4 
 sw/source/core/layout/anchoredobject.cxx                               |    9 
 sw/source/core/layout/fly.cxx                                          |    2 
 sw/source/core/layout/layouter.cxx                                     |   15 +
 sw/source/core/layout/objstmpconsiderwrapinfl.cxx                      |   27 --
 sw/source/core/layout/objstmpconsiderwrapinfl.hxx                      |    1 
 sw/source/core/layout/ssfrm.cxx                                        |    5 
 sw/source/filter/ww8/ww8par.hxx                                        |    2 
 sw/source/filter/ww8/ww8par2.cxx                                       |   47 +++-
 vcl/headless/svpgdi.cxx                                                |   10 
 31 files changed, 302 insertions(+), 117 deletions(-)

New commits:
commit fe51efc58dc04746282aaf641b5e4bd240d20da5
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jul 31 12:30:26 2019 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:17:00 2019 +0200

    solenv installer: don't let RPM generate config(...) Requires
    
    Fedora 30's rpm 4.14.2.1 will generate this Requires:
    config(lodevbasis6.1-core) = 6.1.7.0.0-1
    
    ... but no corresponding Provides because that's disabled, so the
    package cannot be installed.
    
    The reason is that there is one %config file in the -core rpm:
    %attr(0644,root,root) %config(noreplace) "/opt/libreofficedev6.1/./share/psprint/psprint.conf"
    
    Old RPM from CentOS6 does not generate these config requires.
    
    Unfortunately there doesn't appear to be a way to disable this
    config(...) without disabling AutoReq, so do that, and invoke the shell
    script find-requires-x11.sh manually from epmfile.pm.
    
    Change-Id: I7fee0d9cd1b9e79f81bd4c611500e84736564881
    Reviewed-on: https://gerrit.libreoffice.org/76736
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit b1d555ed42a035e0489accc19903c1ed8897bcee)
    (cherry picked from commit fa58f27bb421b449134e79c03a4fb8762ab18679)

diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index eabab4cd05ae..d878de9b6a6b 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -1193,15 +1193,15 @@ sub set_autoprovreq_in_specfile
 {
     my ($changefile, $findrequires, $bindir) = @_;
 
-    my $autoreqprovline;
+    my $autoreqprovline = "AutoReqProv\: no\n";
 
     if ( $findrequires )
     {
-        $autoreqprovline = "AutoProv\: no\n%define _use_internal_dependency_generator 0\n%define __find_requires $bindir/$findrequires\n";
-    }
-    else
-    {
-        $autoreqprovline = "AutoReqProv\: no\n";
+        # don't let rpm invoke it, we never want to use AutoReq because
+        # rpm will generate Requires: config(packagename)
+        open (FINDREQUIRES, "echo | $bindir/$findrequires |");
+        while (<FINDREQUIRES>) { $autoreqprovline .= "Requires: $_\n"; }
+        close (FINDREQUIRES);
     }
 
     $autoreqprovline .= "%define _binary_filedigest_algorithm 1\n%define _binary_payload w9.gzdio\n";
commit 7d205ea105c9009a48f82b0732cf8f3a0a4167f6
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jul 29 12:28:26 2019 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:16:30 2019 +0200

    remove LibreLogo from build
    
    Change-Id: I62b45ea4890f5693e7d12f2b8c4ae43a9a03d16e
    (cherry picked from commit e9d6950387a6e41f8f7b7d91921a2686defe136b)

diff --git a/Repository.mk b/Repository.mk
index 92f24a886b98..e6d1a0437fbe 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -1048,10 +1048,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 3b530286114e..1f35ac0b34ae 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 378f55ce746b..c2904beaa573 100755
--- a/bin/distro-install-file-lists
+++ b/bin/distro-install-file-lists
@@ -141,14 +141,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
@@ -157,7 +155,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 ccaa35aea0a9..9078454350ef 100644
--- a/officecfg/Configuration_officecfg.mk
+++ b/officecfg/Configuration_officecfg.mk
@@ -72,7 +72,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 0f1b4a0b080b..58dc7d40aef4 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -858,20 +858,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 fb7a0502ec02..180b64f86e9e 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 7c9d6c4538bd..e198eaa5e3d0 100644
--- a/scp2/AutoInstall.mk
+++ b/scp2/AutoInstall.mk
@@ -39,7 +39,6 @@ $(eval $(call gb_AutoInstall_add_module,ooo_images,,,,PACKAGE_FILELIST))
 $(eval $(call gb_AutoInstall_add_module,ooobinarytable,LIBO_LIB_FILE_BINARYTABLE))
 $(eval $(call gb_AutoInstall_add_module,python,LIBO_LIB_FILE,LIBO_EXECUTABLE,,PACKAGE_FILELIST))
 $(eval $(call gb_AutoInstall_add_module,python_scriptprovider,,,,PACKAGE_FILELIST))
-$(eval $(call gb_AutoInstall_add_module,python_librelogo,,,,PACKAGE_FILELIST))
 $(eval $(call gb_AutoInstall_add_module,postgresqlsdbc,LIBO_LIB_FILE,,,PACKAGE_FILELIST))
 $(eval $(call gb_AutoInstall_add_module,pdfimport,LIBO_LIB_FILE,LIBO_EXECUTABLE,,PACKAGE_FILELIST))
 $(eval $(call gb_AutoInstall_add_module,quickstart,,LIBO_EXECUTABLE))
diff --git a/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk
index e38d58a9b821..fef10924a62f 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)
@@ -37,12 +36,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 f014aafdaa0b..b44267b7098f 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 = "2018 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 = "2018 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 b0bc53c6f3d241bd5f5d08ee982d4ba0921231f8
Author:     nd101 <Fong at nd.com.cn>
AuthorDate: Wed Jul 3 09:41:06 2019 +0800
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:14:50 2019 +0200

    Fix libgpg-error compilation error with gawk5
    
    This is an adaptation of upstream patch
    https://github.com/gpg/libgpg-error/commit/7865041c77f4f7005282f10f9b6666b19072fbdf
    plus a fix to Makefile.in
    
    Change-Id: I5bf946cf93e5849b8a3428064ab86f6255be97da
    Reviewed-on: https://gerrit.libreoffice.org/75022
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit af3b993ebea2f653fabba981d4c22b9aa779b32a)
    Reviewed-on: https://gerrit.libreoffice.org/75075
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 87215115618de0c12d287a300fc5fde993886089)
    Reviewed-on: https://gerrit.libreoffice.org/76308
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 8edc7023a14d26a7a6201f154b5c0e8edb47b1d9)

diff --git a/external/libgpg-error/UnpackedTarball_libgpg-error.mk b/external/libgpg-error/UnpackedTarball_libgpg-error.mk
index 822145c2f4ab..4dcef3f1465a 100644
--- a/external/libgpg-error/UnpackedTarball_libgpg-error.mk
+++ b/external/libgpg-error/UnpackedTarball_libgpg-error.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libgpg-error,$(LIBGPGERROR_TARBALL)
 $(eval $(call gb_UnpackedTarball_set_patchlevel,libgpg-error,0))
 
 $(eval $(call gb_UnpackedTarball_add_patches,libgpg-error, \
+	external/libgpg-error/libgpg-error_gawk5.patch \
 	$(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes.patch) \
 	$(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes-2.patch.1) \
 	$(if $(filter MSC,$(COM)),external/libgpg-error/w32-build-fixes-3.patch.1) \
diff --git a/external/libgpg-error/libgpg-error_gawk5.patch b/external/libgpg-error/libgpg-error_gawk5.patch
new file mode 100644
index 000000000000..3be76a4538a8
--- /dev/null
+++ b/external/libgpg-error/libgpg-error_gawk5.patch
@@ -0,0 +1,114 @@
+--- src/Makefile.am
++++ src/Makefile.am~
+@@ -266,7 +266,7 @@
+ 
+ errnos-sym.h: Makefile mkstrtable.awk errnos.in
+ 	$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+-		-v prefix=GPG_ERR_ -v namespace=errnos_ \
++		-v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
+ 		$(srcdir)/errnos.in >$@
+ 
+ 
+--- src/mkerrcodes.awk
++++ src/mkerrcodes.awk~
+@@ -81,7 +81,7 @@
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+--- src/mkerrcodes1.awk
++++ src/mkerrcodes1.awk~
+@@ -81,7 +81,7 @@
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+--- src/mkerrcodes2.awk
++++ src/mkerrcodes2.awk~
+@@ -91,7 +91,7 @@
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+--- src/mkerrnos.awk
++++ src/mkerrnos.awk~
+@@ -83,7 +83,7 @@
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+--- src/mkstrtable.awk
++++ src/mkstrtable.awk~
+@@ -77,7 +77,7 @@
+ #
+ # The variable prefix can be used to prepend a string to each message.
+ #
+-# The variable namespace can be used to prepend a string to each
++# The variable pkg_namespace can be used to prepend a string to each
+ # variable and macro name.
+ 
+ BEGIN {
+@@ -102,7 +102,7 @@
+       print "/* The purpose of this complex string table is to produce";
+       print "   optimal code with a minimum of relocations.  */";
+       print "";
+-      print "static const char " namespace "msgstr[] = ";
++      print "static const char " pkg_namespace "msgstr[] = ";
+       header = 0;
+     }
+   else
+@@ -110,7 +110,7 @@
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+@@ -150,7 +150,7 @@
+   else
+     print "  gettext_noop (\"" last_msgstr "\");";
+   print "";
+-  print "static const int " namespace "msgidx[] =";
++  print "static const int " pkg_namespace "msgidx[] =";
+   print "  {";
+   for (i = 0; i < coded_msgs; i++)
+     print "    " pos[i] ",";
+@@ -158,7 +158,7 @@
+   print "  };";
+   print "";
+   print "static GPG_ERR_INLINE int";
+-  print namespace "msgidxof (int code)";
++  print pkg_namespace "msgidxof (int code)";
+   print "{";
+   print "  return (0 ? 0";
+ 
+--- src/Makefile.in
++++ src/Makefile.in~
+@@ -1321,7 +1321,7 @@
+ 
+ errnos-sym.h: Makefile mkstrtable.awk errnos.in
+ 	$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+-		-v prefix=GPG_ERR_ -v namespace=errnos_ \
++		-v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
+ 		$(srcdir)/errnos.in >$@
+ 
+ mkheader: mkheader.c Makefile
+ 
diff --git a/external/libgpg-error/w32-build-fixes.patch b/external/libgpg-error/w32-build-fixes.patch
index e8a6b6145d46..96a62e32042c 100644
--- a/external/libgpg-error/w32-build-fixes.patch
+++ b/external/libgpg-error/w32-build-fixes.patch
@@ -136,7 +136,7 @@ diff -ru libgpg-error.orig/src/Makefile.in libgpg-error/src/Makefile.in
  
  errnos-sym.h: Makefile mkstrtable.awk errnos.in
 @@ -1325,7 +1325,7 @@
- 		-v prefix=GPG_ERR_ -v namespace=errnos_ \
+ 		-v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
  		$(srcdir)/errnos.in >$@
  
 -mkheader: mkheader.c Makefile
commit ba3fe4ffbc08036e9ae482efaead11ef92c060dc
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Jul 18 14:07:06 2019 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:14:20 2019 +0200

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

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index c87f952ff5cb..1ec78dd4740f 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -264,6 +264,8 @@ void SwFlyFrame::DestroyImpl()
 
     if( GetFormat() && !GetFormat()->GetDoc()->IsInDtor() )
     {
+        ClearTmpConsiderWrapInfluence(); // remove this from SwLayouter
+
         // OD 2004-01-19 #110582#
         Unchain();
 
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index ab584d14db31..43237173c224 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -512,7 +512,6 @@ void SwLayoutFrame::DestroyImpl()
                 const size_t nCnt = pFrame->GetDrawObjs()->size();
                 // #i28701#
                 SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[0];
-                pAnchoredObj->ClearTmpConsiderWrapInfluence();
                 if (SwFlyFrame* pFlyFrame = dynamic_cast<SwFlyFrame*>(pAnchoredObj))
                 {
                     SwFrame::DestroyFrame(pFlyFrame);
@@ -520,6 +519,7 @@ void SwLayoutFrame::DestroyImpl()
                 }
                 else
                 {
+                    pAnchoredObj->ClearTmpConsiderWrapInfluence();
                     SdrObject* pSdrObj = pAnchoredObj->DrawObj();
                     SwDrawContact* pContact =
                             static_cast<SwDrawContact*>(pSdrObj->GetUserCall());
commit 142a0329034ce941a63f909f35607d0914b8985e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 9 12:32:01 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:14:14 2019 +0200

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

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

    Postpone loading of all external references, including INDIRECT()
    
    ... which can be constructed with an arbitrary URI text string not
    an svExternal* token type, until link updates are allowed.
    
    Reviewed-on: https://gerrit.libreoffice.org/75422
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit b824b23860b2cf533d4f2428d4a750bd72576181)
    Reviewed-on: https://gerrit.libreoffice.org/76304
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
    Change-Id: I2ce4de415ff99ace04c083c36c1383d76a4ef40d
    (cherry picked from commit 31b1d2af8ce01804049168b7b0317d93d77a42d7)

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 47411568ea51..f4d9fb75ae1d 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -133,11 +133,12 @@ struct UpdateFormulaCell
 {
     void operator() (ScFormulaCell* pCell) const
     {
-        // Check to make sure the cell really contains ocExternalRef.
+        // Check to make sure the cell really contains svExternal*.
         // External names, external cell and range references all have a
-        // ocExternalRef token.
+        // token of svExternal*. Additionally check for INDIRECT() that can be
+        // called with any constructed URI string.
         ScTokenArray* pCode = pCell->GetCode();
-        if (!pCode->HasExternalRef())
+        if (!pCode->HasExternalRef() && !pCode->HasOpCode(ocIndirect))
             return;
 
         if (pCode->GetCodeError() != FormulaError::NONE)
@@ -1661,6 +1662,17 @@ static std::unique_ptr<ScTokenArray> lcl_fillEmptyMatrix(const ScRange& rRange)
     return pArray;
 }
 
+namespace {
+bool isLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+    SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+    if (!pDocShell)
+        return false;
+
+    return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+}
+
 ScExternalRefManager::ScExternalRefManager(ScDocument* pDoc) :
     mpDoc(pDoc),
     mbInReferenceMarking(false),
@@ -1950,8 +1962,19 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
     pSrcDoc = getSrcDocument(nFileId);
     if (!pSrcDoc)
     {
-        // Source document not reachable.  Throw a reference error.
-        pToken.reset(new FormulaErrorToken(FormulaError::NoRef));
+        // Source document not reachable.
+#if 0
+        if (!isLinkUpdateAllowedInDoc(*mpDoc))
+        {
+            // Indicate with specific error.
+            pToken.reset(new FormulaErrorToken(FormulaError::LinkFormulaNeedingCheck));
+        }
+        else
+#endif
+        {
+            // Throw a reference error.
+            pToken.reset(new FormulaErrorToken(FormulaError::NoRef));
+        }
         return pToken;
     }
 
@@ -2158,15 +2181,6 @@ void insertRefCellByIterator(
     }
 }
 
-bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
-{
-    SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
-    if (!pDocShell)
-        return false;
-
-    return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
-}
-
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell)
@@ -2377,8 +2391,8 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
     if (!pFileName)
         return nullptr;
 
-    // Do not load document until it was allowed
-    if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+    // Do not load document until it was allowed.
+    if (!isLinkUpdateAllowedInDoc(*mpDoc))
         return nullptr;
 
     ScDocument* pSrcDoc = nullptr;
@@ -2487,6 +2501,10 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
     if (!isFileLoadable(aFile))
         return nullptr;
 
+    // Do not load document until it was allowed.
+    if (!isLinkUpdateAllowedInDoc(*mpDoc))
+        return nullptr;
+
     OUString aOptions = pFileData->maFilterOptions;
     if ( !pFileData->maFilterName.isEmpty() )
         rFilter = pFileData->maFilterName;      // don't overwrite stored filter with guessed filter
@@ -2625,9 +2643,9 @@ void ScExternalRefManager::maybeLinkExternalFile( sal_uInt16 nFileId, bool bDefe
         aOptions = pFileData->maFilterOptions;
     }
 
-    // Filter detection may access external links; defer it until we are allowed
+    // Filter detection may access external links; defer it until we are allowed.
     if (!bDeferFilterDetection)
-        bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+        bDeferFilterDetection = !isLinkUpdateAllowedInDoc(*mpDoc);
 
     // If a filter was already set (for example, loading the cached table),
     // don't call GetFilterName which has to access the source file.
commit 73176974d613b01bdf5223b93cf2705d3fd8c155
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:10:53 2019 +0200

    Postpone filter detection until link update is allowed
    
    Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
    Reviewed-on: https://gerrit.libreoffice.org/75301
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
    Reviewed-on: https://gerrit.libreoffice.org/76303
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 43bf332aeede732557378e81765f29b704b17188)

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 480046766557..47411568ea51 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2158,6 +2158,15 @@ void insertRefCellByIterator(
     }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+    SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+    if (!pDocShell)
+        return false;
+
+    return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& rCell)
@@ -2369,13 +2378,8 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
         return nullptr;
 
     // Do not load document until it was allowed
-    SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
-    if ( pDocShell )
-    {
-        const comphelper::EmbeddedObjectContainer& rContainer = pDocShell->GetEmbeddedObjectContainer();
-        if ( !rContainer.getUserAllowsLinkUpdate() )
-            return nullptr;
-    }
+    if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+        return nullptr;
 
     ScDocument* pSrcDoc = nullptr;
     ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));
@@ -2620,6 +2624,11 @@ void ScExternalRefManager::maybeLinkExternalFile( sal_uInt16 nFileId, bool bDefe
         aFilter = pFileData->maFilterName;
         aOptions = pFileData->maFilterOptions;
     }
+
+    // Filter detection may access external links; defer it until we are allowed
+    if (!bDeferFilterDetection)
+        bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
     // If a filter was already set (for example, loading the cached table),
     // don't call GetFilterName which has to access the source file.
     // If filter detection is deferred, the next successful loadSrcDocument()
commit 3098810911ccf76da1591d8f6cfceebfda13dcbd
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 13:25:31 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:10:42 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/76451
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit aab62f2b21c331ff8c31b7c856d5e59080b9d64a)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 667f3f789c66..a66eeefc1d45 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -41,6 +41,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>
@@ -1350,7 +1352,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 139d6207488d5e9ae7904f9ea07f058c531898ef
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 23 15:31:05 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 18:10:04 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
    Reviewed-on: https://gerrit.libreoffice.org/76305
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit b14742734481ae0a4731989a99db487d8ae1986a)

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index b514989055bc..35b3091e4669 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -397,6 +397,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 02d79c356e54..667f3f789c66 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1347,16 +1347,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 69076ad019d9..d190d48bddd3 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -209,18 +209,24 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum
         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 c170d0d512c1f2b1ae662ef15dc29b269cd72dae
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 27 19:45:34 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Aug 5 16:00:05 2019 +0200

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

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

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

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index b490121750db..90b9c07cd50c 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1150,6 +1150,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
     /** creates an image from the given rectangle, replacing all black pixels
      *  with nMaskColor and make all other full transparent */
     SourceHelper aSurface(rSalBitmap);
+    if (!aSurface.getSurface())
+    {
+        SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawMask case");
+        return;
+    }
     sal_Int32 nStride;
     unsigned char *mask_data = aSurface.getBits(nStride);
     for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
@@ -1399,6 +1404,11 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer)
                                         nFormat,
                                         pBuffer->mnWidth, pBuffer->mnHeight,
                                         pBuffer->mnScanlineSize);
+    if (cairo_surface_status(target) != CAIRO_STATUS_SUCCESS)
+    {
+        cairo_surface_destroy(target);
+        return nullptr;
+    }
     return target;
 }
 
commit b7463b99475b95751356be058a52d9f638407cdc
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Nov 6 12:01:34 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Wed Jul 31 18:15:41 2019 +0200

    tdf#121198: fix crash in SdrPage::GetPageNum()
    
    Regression from 9348b322a5c230dfcc2231661b73e480b130fcd9
    
    Change-Id: Ibf9d6b65f0dbcc3a751e3ac5f3dbc28d908d6c25
    Reviewed-on: https://gerrit.libreoffice.org/62952
    Tested-by: Jenkins
    (cherry picked from commit ebd24b39eee5ac72d33ad731e31469cf8f330631)
    Reviewed-on: https://gerrit.libreoffice.org/62965
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 86d6ef3371b425d8ec1347902c54597c2749cae7)

diff --git a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
index 323dbe948fe9..9dfd02d700b8 100644
--- a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
@@ -220,7 +220,7 @@ bool InsertionIndicatorHandler::IsInsertionTrivial (
     // to check that the insertion position is not directly in front or
     // directly behind the selection and thus moving the selection there
     // would not change the model.
-    return nInsertionIndex >= nFirstIndex && nInsertionIndex < nLastIndex;
+    return nInsertionIndex >= nFirstIndex && nInsertionIndex <= (nLastIndex+1);
 }
 
 bool InsertionIndicatorHandler::IsInsertionTrivial (const sal_Int8 nDndAction)
commit 2602a36d913bb94672903588078f744a2aae9c50
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Aug 16 14:32:19 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Wed Jul 31 18:11:53 2019 +0200

    tdf#118385 Avoid crash on loading document
    
    Reviewed-on: https://gerrit.libreoffice.org/59173
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    (cherry picked from commit 308fbd8cdf9ce0fc3921b6c4c58707609b486fb9)
    Reviewed-on: https://gerrit.libreoffice.org/59247
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 67ac2e8adc708480aa4e28a81cec464938e43c86)
    
    Change-Id: Ifb18fee79667a5d0284407e84877b0d4d89536d9

diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 5861ed88bbe3..5bc4a8b238b9 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -961,7 +961,7 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen
     {
         OUString sText = moString.get();
         double fRatio = 0;
-        VclPtr<VirtualDevice> pDevice = VclPtr<VirtualDevice>::Create();
+        ScopedVclPtrInstance<VirtualDevice> pDevice;
         vcl::Font aFont = pDevice->GetFont();
         aFont.SetFamilyName(sFont);
         aFont.SetFontSize(Size(0, 96));
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 1ec98d87bb0f..bf12303ba2c7 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1481,7 +1481,7 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark,
     // Calc the ratio.
     double fRatio = 0;
 
-    VclPtr<VirtualDevice> pDevice = VclPtr<VirtualDevice>::Create();
+    ScopedVclPtrInstance<VirtualDevice> pDevice;
     vcl::Font aFont = pDevice->GetFont();
     aFont.SetFamilyName(sFont);
     aFont.SetFontSize(Size(0, 96));


More information about the Libreoffice-commits mailing list