[Libreoffice-commits] core.git: Branch 'feature/cib_contract891' - 22 commits - bin/distro-install-file-lists external/boost external/harfbuzz include/basebmp include/formula include/sfx2 librelogo/source Makefile.fetch officecfg/Configuration_officecfg.mk officecfg/registry postprocess/CustomTarget_registry.mk RepositoryModule_host.mk scp2/InstallModule_python.mk scripting/source setup_native/source sfx2/source solenv/gbuild sw/qa vcl/source vcl/unx

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 30 20:56:49 UTC 2019


Rebased ref, commits from common ancestor:
commit ba62661ae812f48482f14db361d5c7c2196ed7f4
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Aug 28 17:37:20 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:03 2019 +0200

    Makefile.fetch: CentOS5 TLS is so obsolete it can't connect to dev-www
    
    We check the hash of the tarballs after download anyway.
    
    Change-Id: I0eddb6c8f1c36f8547af64767ff8e2bd8a72509d

diff --git a/Makefile.fetch b/Makefile.fetch
index a147e4a8c938..cd4e8d3f6336 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -11,7 +11,7 @@ fetch_LOGFILE := $(TARFILE_LOCATION)/fetch.log
 
 ifneq (,$(WGET))
 define fetch_Download__wget_command
-&& $(WGET) --progress=dot:mega -Q 0 -P "." -l 0 -nd -nH -N $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]
+&& $(WGET) --no-check-certificate --progress=dot:mega -Q 0 -P "." -l 0 -nd -nH -N $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]
 endef
 
 else
commit 9442f2cb7083274a7c87b9fc96cb1ef078dedfaa
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jul 29 12:28:26 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:03 2019 +0200

    remove LibreLogo from build
    
    (cherry picked from commit e9d6950387a6e41f8f7b7d91921a2686defe136b)
    (cherry picked from commit 7d205ea105c9009a48f82b0732cf8f3a0a4167f6)
    
    (cherry picked from commit c903537810c68e8b41bf74b0ed8b058b6c6dee5e)
    (cherry picked from commit a26a0fd2675103341ba42ce59f4275ba76b6c506)
    
    Change-Id: I62b45ea4890f5693e7d12f2b8c4ae43a9a03d16e

diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 4f90a704060a..0e591d2cfd50 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -68,7 +68,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
 	jurt \
 	jvmaccess \
 	jvmfwk \
-	librelogo \
 	lingucomponent \
 	linguistic \
 	lotuswordpro \
diff --git a/bin/distro-install-file-lists b/bin/distro-install-file-lists
index 24cac1d76c22..7209989e6107 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 5f345b7fcf48..a28fd9041bb8 100644
--- a/officecfg/Configuration_officecfg.mk
+++ b/officecfg/Configuration_officecfg.mk
@@ -74,7 +74,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 \
@@ -113,7 +112,6 @@ $(eval $(call gb_Configuration_add_spool_modules,registry,officecfg/registry/dat
 	org/openoffice/Office/Embedding-reportbuilder.xcu \
 	org/openoffice/Office/Embedding-writer.xcu \
 	org/openoffice/Office/Recovery-gconflockdown.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 \
@@ -133,7 +131,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 4dcc178697de..5512f86e8fa6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -720,20 +720,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="UIName" oor:type="xs:string">
           <value xml:lang="en-US">Changes</value>
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 6f190da7af2a..537d0a227ff0 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -28,7 +28,6 @@ postprocess_XCDS := \
 	graphicfilter.xcd \
 	impress.xcd \
 	korea.xcd \
-	librelogo.xcd \
 	lingucomponent.xcd \
 	main.xcd \
 	math.xcd \
@@ -108,11 +107,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_korea := main
 postprocess_FILES_korea := \
 	$(postprocess_MOD)/org/openoffice/Office/Common-korea.xcu
diff --git a/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk
index 21bc3ef20f9b..e58528365d8e 100644
--- a/scp2/InstallModule_python.mk
+++ b/scp2/InstallModule_python.mk
@@ -44,13 +44,8 @@ endif
 
 $(eval $(call gb_InstallModule_add_scpfiles,scp2/python,\
     scp2/source/python/file_python \
-    scp2/source/python/file_python_librelogo \
     scp2/source/python/profileitem_python \
     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 005eaa49a25c..38f7dfbe5fd6 100644
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -270,6 +270,8 @@ module = "gid_Module_Pyuno"
 solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-pyuno"
 solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01, SUNWPython"
 packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-pyuno"
+linuxreplaces = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo"
+linuxincompat = "%BASISPACKAGEPREFIX%PRODUCTVERSION-librelogo"
 freebsdrequires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01"
 requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01 %PACKAGEVERSION %PACKAGEVERSION-%PACKAGEREVISION"
 copyright = "2012 The Document Foundation"
@@ -281,21 +283,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 = "2012 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-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")"
commit f3034f496918ed4d75c9b9129b7ace1173b0c48a
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Aug 26 10:18:09 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:02 2019 +0200

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 23d0050bbafb..0f428e8e0ad2 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1530,7 +1530,7 @@ bool SfxObjectShell::UnTrustedScript(const OUString& rScriptURL)
     do
     {
         OUString aToken = sScript.getToken(0, '/', nIndex);
-        if (aToken.startsWithIgnoreAsciiCase("LibreLogo"))
+        if (aToken.startsWithIgnoreAsciiCase("LibreLogo") || aToken.indexOf('~') != -1)
         {
             return true;
         }
commit 7711de6a3114cd4a7172e12392c4a9a841831ad1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Aug 19 11:27:15 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:02 2019 +0200

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

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index e531069e9898..2e633441c083 100755
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -235,7 +235,7 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
-            if xFileUri.isAbsolute():
+            if not xFileUri.hasRelativePath():
                 message = "pythonscript: an absolute uri is invalid '" + sFileUri+ "'"
                 log.debug( message )
                 raise RuntimeException( message )
commit 0b97c734e2f23c35a78944f1e45dbf442a89ca2e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 16 10:18:34 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:01 2019 +0200

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

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 5208a4d7c7d9..e531069e9898 100755
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -235,6 +235,11 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
+            if xFileUri.isAbsolute():
+                message = "pythonscript: an absolute uri is invalid '" + sFileUri+ "'"
+                log.debug( message )
+                raise RuntimeException( message )
+
             # absolute path to the .py file
             xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, True, RETAIN)
             sAbsScriptUri = xAbsScriptUri.getUriReference()
commit 8481219a2df812dd86c529d48611aa4230ad7acf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 12 20:32:54 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:01 2019 +0200

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

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 6e4c089b7555..5208a4d7c7d9 100755
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -222,7 +222,13 @@ class MyUriHelper:
             sStorageUri = sStorageUri.replace( "|", "/" )
 
             # path to the .py file, relative to the base
-            sFileUri = sStorageUri[0:sStorageUri.find("$")]
+            funcNameStart = sStorageUri.find("$")
+            if funcNameStart != -1:
+                sFileUri = sStorageUri[0:funcNameStart]
+                sFuncName = sStorageUri[funcNameStart+1:]
+            else:
+                sFileUri = sStorageUri
+
             xFileUri = self.m_uriRefFac.parse(sFileUri)
             if not xFileUri:
                 message = "pythonscript: invalid relative uri '" + sFileUri+ "'"
@@ -239,7 +245,9 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
-            ret = sBaseUri + sStorageUri
+            ret = sAbsScriptUri
+            if funcNameStart != -1:
+                ret = ret + "$" + sFuncName
             log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
             return ret
         except UnoException as e:
commit cddf06a914bae101877c81c23cb1452e74e49661
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 7 12:58:01 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:54:00 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)
    (cherry picked from commit 7db4545a37d9833d0e97b98d4904d2238d4e8985)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 8f6c1afd7dd7..23d0050bbafb 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1522,7 +1522,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 187c3d195bc96a6346484c1306a7c2d9786e8de3
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 6 13:29:22 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:59 2019 +0200

    Properly obtain location
    
    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)
    
    (cherry picked from commit b032ba86fe403ceddf77300cec1eefdbdfe1e129)
    
    Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8

diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index a613d9787f7d..2dd9c7084572 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>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -145,8 +146,12 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
     {
         try
         {
-            bool bIsDocumentScript = ( aURL.Complete.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "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 a07bc21e27fb..8f6c1afd7dd7 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1545,19 +1545,22 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
     OSL_TRACE( "in CallXScript" );
     ErrCode nErr = ERRCODE_NONE;
 
-    bool bIsDocumentScript = ( _rScriptURL.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "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 5e4c358334dcfce17209cc0f01af5948e34386d7
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Aug 3 16:37:48 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:59 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)
    (cherry picked from commit 102efaffd32f0deaf1868ca50c8aa06d83cc0353)

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index c43d892717d7..6e4c089b7555 100755
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -217,7 +217,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 283177e732245ff119fe81bca7e78bf019e44ef3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 13:25:31 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:58 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>
    (cherry picked from commit a99e6d6ae7537e701267cf0f2e79c30194189bfa)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a2db44260005..a07bc21e27fb 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>
@@ -1509,7 +1511,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 b86d2c4a114385c16a93f6aa0339570d8bc698ce
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 23 15:31:05 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:58 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>
    (cherry picked from commit 29d5fcb1bd034f99cb9153c99d58ab70d69980c5)

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 05aa6a7404a9..3c6658b44a03 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -402,6 +402,8 @@ public:
     */
     bool                        AdjustMacroMode( const OUString& rScriptType, bool _bSuppressUI = false );
 
+    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 9e5116521038..a2db44260005 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1506,16 +1506,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 ::com::sun::star::uno::Any* pCaller )
 {
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 67c2743b5847..1ba96ae88e69 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -219,18 +219,24 @@ static void Execute( uno::Any& aEventData, const document::DocumentEvent& aTrigg
         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 c8e7cbcf716097f45c7e9447de4263cb683abedb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 7 14:04:07 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:57 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)
    (cherry picked from commit 9b4d3561b4d8dd7e96695ffaabb805db1d4e25ab)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 4285fafe8f2a..9e5116521038 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1506,6 +1506,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 ::com::sun::star::uno::Any* pCaller )
 {
@@ -1518,6 +1528,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 1be871b9e6f8df0126a8a67bd6b98f9f7f36fd48
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Thu Jun 6 14:25:32 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:57 2019 +0200

    sanitize LibreLogo calls
    
    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)
    (cherry picked from commit a781c5e2733ce5c975721fc6d46ff72e8cda3956)
    
    Change-Id: Ie4d9858e5b4b3e55ab08416fb9338d2df34ee5e1

diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index d44ffa194a6d..dcbb37337454 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -67,6 +67,7 @@ __LineStyle_DOTTED__ = 2
 class __Doc__:
     def __init__(self, doc):
         self.doc = doc
+        self.secure = False
         try:
             self.drawpage = doc.DrawPage # Writer
         except:
@@ -381,10 +382,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:
                 __dispatcher__(".uno:Escape")
                 try:
commit e9e9a5870167a8371ff71752e125bfdab546e214
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Aug 28 11:20:35 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:56 2019 +0200

    boost: fix build with GCC9, implicit shared_ptr->bool
    
    Change-Id: I1e4c7a63d299f93a18f815f8af302fbe297d38eb

diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index 777a8c4417eb..35a8080c2b6c 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -47,6 +47,7 @@ boost_patches += boost.wshadow.patch
 boost_patches += boost.wdeprecated-register.patch.0
 boost_patches += boost.wuninitialized.patch
 boost_patches += boost.wdeprecated-auto_ptr.patch.0
+boost_patches += boost-shared_ptr-bool.patch.1
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
 
diff --git a/external/boost/boost-shared_ptr-bool.patch.1 b/external/boost/boost-shared_ptr-bool.patch.1
new file mode 100644
index 000000000000..556a8ed42c0d
--- /dev/null
+++ b/external/boost/boost-shared_ptr-bool.patch.1
@@ -0,0 +1,11 @@
+--- boost/boost/date_time/local_time/custom_time_zone.hpp.orig	2019-08-28 11:16:44.660857011 +0200
++++ boost/boost/date_time/local_time/custom_time_zone.hpp	2019-08-28 11:16:49.063758969 +0200
+@@ -64,7 +64,7 @@
+     //! True if zone uses daylight savings adjustments
+     virtual bool has_dst() const
+     {
+-      return (dst_calc_rules_); //if calc_rule is set the tz has dst
++      return (bool(dst_calc_rules_)); //if calc_rule is set the tz has dst
+     }
+     //! Local time that DST starts -- NADT if has_dst is false
+     virtual posix_time::ptime dst_local_start_time(gregorian::greg_year y) const
commit af2d6957ac5865a68721e7f31080564193eb2286
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Aug 27 18:55:12 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:55 2019 +0200

    backport ooxmlsdrexport.cxx part of...
    
    commit b2371492dfd5c8003f89ed8acf3dbc690d6af8d0
    Author:     Stephan Bergmann <sbergman at redhat.com>
    AuthorDate: Mon Mar 3 18:27:00 2014 +0100
    Commit:     Stephan Bergmann <sbergman at redhat.com>
    CommitDate: Mon Mar 3 18:36:55 2014 +0100
    
        Use cstdlib std::abs instead of stdlib.h abs
    
        ...because the latter lacks the abs(long) overload in some popular environme
    nts,
        cf. <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401> "stdlib.h does not
        provide abs(long) overload."
    
        Similarly, stdlib.h lacks the abs(float), abs(double), abs(long double)
        overloads compared to cmath there, whose use was apparently intended in
        sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx.  Rewrote that to use
        CPPUNIT_ASSERT_DOUBLES_EQUAL instead, which revealed that the comparisons ne
    ed
        rather large deltas of .1 resp. .2 (which the original code hid with an
        implicit conversion to integral type, thus using an effective delta of 1).
    
        Discovered with -Wabsolute-value ("absolute value function 'abs' given an
        argument of type 'long' but has parameter of type 'int' which may cause
        truncation of value") recently introduced on Clang trunk towards 3.5.
    
        Change-Id: I4c41575ffdccb2944498b662bd3a53fd510cb0c0
    
    Change-Id: I06ba8ebf89969bdc91d229a70ff62b644815ee8b

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b269a11f68da..3c73b1555f34 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1807,22 +1807,22 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx")
             if( aStyleCommandName.equals( "margin-left" ) )
             {
                 float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat();
-                CPPUNIT_ASSERT_EQUAL(0, abs(97.6 - fValue));
+                CPPUNIT_ASSERT_DOUBLES_EQUAL(97.6, fValue, 0.1);
             }
             else if( aStyleCommandName.equals( "margin-top" ) )
             {
                 float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat();
-                CPPUNIT_ASSERT_EQUAL(0, abs(165 - fValue));
+                CPPUNIT_ASSERT_DOUBLES_EQUAL(165.0, fValue, 0.2);
             }
             else if( aStyleCommandName.equals( "width" ) )
             {
                 float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat();
-                CPPUNIT_ASSERT_EQUAL(0, abs(283.4 - fValue));
+                CPPUNIT_ASSERT_DOUBLES_EQUAL(283.4, fValue, 0.1);
             }
             else if( aStyleCommandName.equals( "height" ) )
             {
                 float fValue = aStyleCommandValue.getToken( 0, 'p' ).toFloat();
-                CPPUNIT_ASSERT_EQUAL(0, abs(141.7 - fValue));
+                CPPUNIT_ASSERT_DOUBLES_EQUAL(141.7, fValue, 0.1);
             }
 
         } while( nextTokenPos != -1 );
commit c94f359bd6e22af7a0521415d25be14d85fc9feb
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jul 11 15:16:48 2018 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:54 2019 +0200

    basebmp: #ifdef some dead code
    
    libreoffice-4-1-6+backports/include/basebmp/packedpixeliterator.hxx:607:35: error: expression cannot be used as a function
             const int remainder( x(d.x) % num_intraword_positions );
    
    This was removed in:
    commit 1b4dff2c371d31c99f34324c3f6f31888bdc34d7 "loplugin:unusedmethods"
    
    Change-Id: I3bfc28da8f977633f0b4d808237235a5316338c4

diff --git a/include/basebmp/packedpixeliterator.hxx b/include/basebmp/packedpixeliterator.hxx
index e419a352f1a3..2cd487d4ae0a 100644
--- a/include/basebmp/packedpixeliterator.hxx
+++ b/include/basebmp/packedpixeliterator.hxx
@@ -602,6 +602,7 @@ public:
                 >> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
     }
 
+#if 0
     value_type get(difference_type const & d) const
     {
         const int remainder( x(d.x) % num_intraword_positions );
@@ -610,6 +611,7 @@ public:
                                           get_mask<value_type, bits_per_pixel, MsbFirst>(remainder))
                 >> get_shift<num_intraword_positions, bits_per_pixel, MsbFirst>(remainder));
     }
+#endif
 
     void set( value_type v ) const
     {
commit 47ade744a7b3475b2ab280ea7e8208e9a806aac5
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri May 16 21:49:23 2014 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:53 2019 +0200

    vcl: GTK: fix libstdc++ "irreflexive" assert
    
    /usr/include/c++/6.1.1/bits/stl_algo.h:4737:
    Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)).
    
    GdkRectangleCoincident is clearly not a less-than operator as required
    for std::sort.
    
    (cherry picked from commit e2b267b1906817cc45f0e4896bed58cff5b6b0f9)
    Reviewed-on: https://gerrit.libreoffice.org/26762
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 8851333f8aafe84ca9479faf24d9164035aff520)
    
    squashed dependency:
    fdo#78799 - ignore overlayed monitors with co-incident origin.
    This happens with certain fglrx drivers etc. where 'cloned' is not
    set but instead both monitors are placed over the top of each other
    (by XFCE) -> work around that.
    (cherry picked from commit 5eeea7c91d87ee8f0b8bc8c0144c04fb84310bbf)
    
    Change-Id: If2e65d420dc8cdf0707081361a40d4eaea28424e

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index 0a72054aeb9d..7284aa8e67d5 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -55,15 +55,25 @@ GtkSalSystem::GetDisplayXScreenCount()
 namespace
 {
 
-struct GdkRectangleEqual
+struct GdkRectangleCoincidentLess
 {
+    // fdo#78799 - detect and elide overlaying monitors of different sizes
+    bool operator()(GdkRectangle const& rLeft, GdkRectangle const& rRight)
+    {
+        return
+            rLeft.x < rRight.x
+            || rLeft.y < rRight.y
+            ;
+    }
+};
+struct GdkRectangleCoincident
+{
+    // fdo#78799 - detect and elide overlaying monitors of different sizes
     bool operator()(GdkRectangle const& rLeft, GdkRectangle const& rRight)
     {
         return
             rLeft.x == rRight.x
             && rLeft.y == rRight.y
-            && rLeft.width == rRight.width
-            && rLeft.height == rRight.height
             ;
     }
 };
@@ -95,10 +105,11 @@ GtkSalSystem::countScreenMonitors()
                 gdk_screen_get_monitor_geometry(pScreen, j, &aGeometry);
                 aGeometries.push_back(aGeometry);
             }
-            GdkRectangleEqual aCmp;
-            std::sort(aGeometries.begin(), aGeometries.end(), aCmp);
+            std::sort(aGeometries.begin(), aGeometries.end(),
+                    GdkRectangleCoincidentLess());
             const std::vector<GdkRectangle>::iterator aUniqueEnd(
-                    std::unique(aGeometries.begin(), aGeometries.end(), aCmp));
+                    std::unique(aGeometries.begin(), aGeometries.end(),
+                    GdkRectangleCoincident()));
             nMonitors = std::distance(aGeometries.begin(), aUniqueEnd);
         }
         maScreenMonitors.push_back(std::make_pair(pScreen, nMonitors));
commit 72dcc713f88854883eee09adce9b7516762c358e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 19 10:43:21 2016 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:53 2019 +0200

    -Werror=shift-negative-value (GCC 6)
    
    Change-Id: Ifc7b1d6675a8e8fb41dd47cc1282059c3790736f
    (cherry picked from commit 352f9fdff619b5a0a1414c29cfc47068165a599c)

diff --git a/include/basebmp/packedpixeliterator.hxx b/include/basebmp/packedpixeliterator.hxx
index 55cc1742d4c5..e419a352f1a3 100644
--- a/include/basebmp/packedpixeliterator.hxx
+++ b/include/basebmp/packedpixeliterator.hxx
@@ -79,7 +79,7 @@ public:
         num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
         /** Bit mask for one pixel (least significant bits)
          */
-        bit_mask=~(~0 << bits_per_pixel)
+        bit_mask=~(~0u << bits_per_pixel)
     };
 
 private:
@@ -249,7 +249,7 @@ public:
         num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
         /** Bit mask for one pixel (least significant bits)
          */
-        bit_mask=~(~0 << bits_per_pixel)
+        bit_mask=~(~0u << bits_per_pixel)
     };
 
 private:
@@ -502,7 +502,7 @@ public:
         num_intraword_positions=sizeof(value_type)*8/bits_per_pixel,
         /** Bit mask for one pixel (least significant bits)
          */
-        bit_mask=~(~0 << bits_per_pixel)
+        bit_mask=~(~0u << bits_per_pixel)
     };
 
     // TODO(F2): direction of iteration (ImageIterator can be made to
commit b7868c72c744e36b173fcf88919b3cc70916d1cf
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Thu Feb 18 14:06:35 2016 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:52 2019 +0200

    fdo#94009: harfbuzz: don't export symbols from VCL
    
    Should fix crashes due to symbol clashes in ELF global namespace
    where system's libharfbuzz.so.0 is loaded as well.
    
    (cherry picked from commit 549130ab5d9616f7eb5504db31546b386737ccb2)
    
    Change-Id: I35ffcbe4ac4de5a25cd8bf0cb9a8f0c11f4554c5

diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk
index f49553d4b6c8..1fbad2edfa35 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -30,6 +30,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) :
 			--with-cairo=no \
 			--with-glib=no \
 			$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+			$(if $(filter LINUX,$(OS)),CXXFLAGS="$(CXXFLAGS) -fvisibility=hidden") \
 		&& (cd $(EXTERNAL_WORKDIR)/src && $(MAKE)) \
 	)
 
commit 311a3ac25a4d25f08a7845b60dadfc790007ebd4
Author:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Thu Jul 5 01:33:23 2018 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:51 2019 +0200

    gcc7: disable -Wdeprecated for dynamic excpt specs
    
    gcc started to warn about c++11-deprecated dynamic exception
    specifications thusly:
    
    warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
    
    so disable this on the branch instead of a massive backport.
    
    See https://en.cppreference.com/w/cpp/language/except_spec for a
    discussion; this is still perfectly correct c++ code.
    
    Change-Id: Iffbb82e4da24fb96fab57f233b8ebe41fbc850fa
    Reviewed-on: https://gerrit.libreoffice.org/56981
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 52b85ab2adf74e82cb598d9273b1639b11c28270)

diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 1276e57502d6..048b75aa0da6 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -42,6 +42,7 @@ gb_CXXFLAGS := \
 	$(gb_CXXFLAGS_COMMON) \
 	-fPIC \
 	-Wshadow \
+	-Wno-deprecated \
 	-Woverloaded-virtual \
 
 ifeq ($(COM_GCC_IS_CLANG),)
commit 44f4fb9dc19f7131f625614fc96d0c8e99c6d85c
Author:     Michael Stahl <mstahl at redhat.com>
AuthorDate: Thu Mar 12 15:40:05 2015 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:50 2019 +0200

    formula: PVS-Studio V610 Undefined behavior shift negative signed int
    
    Change-Id: If6c054abfab6ba421a6924a65dac76782e6eaa0b
    (cherry picked from commit f1b5381ed70a21a6f460bcd6a8bedad10b9a5a02)

diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
index 1971c4fb4d97..b622f576eaba 100644
--- a/include/formula/grammar.hxx
+++ b/include/formula/grammar.hxx
@@ -54,7 +54,7 @@ public:
     // Room for 256 reference conventions.
     static const int kEnglishBit       = (1 << (kConventionShift + 8));
     // Mask off all non-language bits.
-    static const int kFlagMask         = ~((~int(0)) << kConventionShift);
+    static const int kFlagMask         = ~((~unsigned(0)) << kConventionShift);
 
     /** Values encoding the formula language plus address reference convention
         plus English parsing/formatting
commit 091d159c3a2d3432ec8bae4d7fe38ab3d0c7bec9
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jul 8 09:49:50 2014 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Aug 30 22:53:50 2019 +0200

    Fix some round() confusion
    
    Why insist on using the same name as a standard function? Causes
    confusion with VS2013 at least, "ambiguous call to overloaded
    function."
    
    Sure, this might be caused by a bug in the compiler (or its
    headers). Or maybe vagueness in the language definition? Who cares, I
    still claim that intentionally writing an own function called round()
    is asking for problems. So rename it to round_to_long().
    
    (And then the return value of calls to this function, which is of type
    'long', is assigned in a couple of places to variables of type 'int',
    fun... Intentional, knowing there will be no overflow, or a bug
    waiting to happen?)
    
    (cherry picked from commit ba27300d419786ca6fa8a7df950d01f472de3314)
    
    Change-Id: If15d44f10f9f05de1c7c79492baf158eee770b8b

diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 499458eb307f..25016b8e6ac7 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -40,6 +40,8 @@
 #include <deque>
 
 // Platform
+#include <config_global.h>
+
 #include <svsys.h>
 
 #include <salgdi.hxx>
@@ -87,7 +89,7 @@ static FILE * grLog()
 
 namespace
 {
-    inline long round(const float n) {
+    inline long round_to_long(const float n) {
         return long(n + (n < 0 ? -0.5 : 0.5));
     }
 
@@ -224,7 +226,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
         }
 
         int baseGlyph = mvGlyphs.size();
-        int scaledGlyphPos = round(gr_slot_origin_X(baseSlot) * fScaling) + mnWidth + nDxOffset;
+        int scaledGlyphPos = round_to_long(gr_slot_origin_X(baseSlot) * fScaling) + mnWidth + nDxOffset;
         if (mvChar2Glyph[firstChar - mnMinCharPos] == -1 || mvGlyphs[mvChar2Glyph[firstChar - mnMinCharPos]].maLinearPos.X() < scaledGlyphPos)
         {
             mvChar2Glyph[firstChar - mnMinCharPos] = mvGlyphs.size();
@@ -238,8 +240,8 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
         if (nextBoundary > fMaxX && (nextChar < mnMinCharPos || nextChar >= mnEndCharPos || !isWhite(pStr[nextChar]) || fMaxX <= 0.0f))
             fMaxX = nextBoundary;
     }
-    long nXOffset = round(fMinX * fScaling);
-    long nXEnd = round(fMaxX * fScaling);
+    long nXOffset = round_to_long(fMinX * fScaling);
+    long nXEnd = round_to_long(fMaxX * fScaling);
     int nCharRequested = minimum<int>(lastCharPos, mnEndCharPos) - mnMinCharPos;
     int firstCharOffset = maximum<int>(mnSegCharOffset, mnMinCharPos) - mnMinCharPos;
     // fill up non-base char dx with cluster widths from previous base glyph
@@ -312,8 +314,8 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
 
     long glyphId = gr_slot_gid(gi);
     long deltaOffset = 0;
-    int scaledGlyphPos = round(gr_slot_origin_X(gi) * scaling) + mnWidth + rDXOffset;
-    int glyphWidth = round((nextGlyphOrigin - gOrigin) * scaling);
+    int scaledGlyphPos = round_to_long(gr_slot_origin_X(gi) * scaling) + mnWidth + rDXOffset;
+    int glyphWidth = round_to_long((nextGlyphOrigin - gOrigin) * scaling);
     if (!bIsBase)
     {
         mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
@@ -358,11 +360,11 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
     nGlyphFlags |= (bRtl)? GlyphItem::IS_RTL_GLYPH : 0;
     GlyphItem aGlyphItem(mvGlyphs.size(),
         glyphId,
-        Point(scaledGlyphPos, round((-gr_slot_origin_Y(gi) * scaling))),
+        Point(scaledGlyphPos, round_to_long((-gr_slot_origin_Y(gi) * scaling))),
         nGlyphFlags,
         glyphWidth);
     if (glyphId != static_cast<long>(GF_DROPPED))
-        aGlyphItem.mnOrigWidth = round(gr_slot_advance_X(gi, mpFace, mpFont) * scaling);
+        aGlyphItem.mnOrigWidth = round_to_long(gr_slot_advance_X(gi, mpFace, mpFont) * scaling);
     mvGlyphs.push_back(aGlyphItem);
 
     // update the offset if this glyph was dropped


More information about the Libreoffice-commits mailing list