commit 8add7f2715aa860606c264168d602850130c5fe7
Author: CentOS Sources
Date: Tue May 7 03:47:06 2019 -0400
import libreoffice-6.0.6.1-13.el8
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3ab4eac
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+SOURCES/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
+SOURCES/185d60944ea767075d27247c3162b3bc-unowinreg.dll
+SOURCES/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+SOURCES/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+SOURCES/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+SOURCES/gpgkey-C2839ECAD9408FBE9531C3E9F434A1EFAFEEAEA3.gpg.asc
+SOURCES/libreoffice-6.0.6.1.tar.xz
+SOURCES/libreoffice-base-symbolic.svg
+SOURCES/libreoffice-calc-symbolic.svg
+SOURCES/libreoffice-draw-symbolic.svg
+SOURCES/libreoffice-help-6.0.6.1.tar.xz
+SOURCES/libreoffice-impress-symbolic.svg
+SOURCES/libreoffice-main-symbolic.svg
+SOURCES/libreoffice-math-symbolic.svg
+SOURCES/libreoffice-translations-6.0.6.1.tar.xz
+SOURCES/libreoffice-writer-symbolic.svg
diff --git a/.libreoffice.metadata b/.libreoffice.metadata
new file mode 100644
index 0000000..9999e10
--- /dev/null
+++ b/.libreoffice.metadata
@@ -0,0 +1,16 @@
+7168b0f40aa5c72267899601c116d2348d2f56ec SOURCES/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
+0619ed3a89644bef318df67db12045b2b590585b SOURCES/185d60944ea767075d27247c3162b3bc-unowinreg.dll
+1acea86fd399ed7817879d36370d3d1f8b109050 SOURCES/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+8a90669029e107b61953b90ba11545fef586c2ca SOURCES/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+2d49e11b0b711970f494294dc3698f05eb294853 SOURCES/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+7b5fd93d787fbc6d9c2d4025d543730ee8dc4559 SOURCES/gpgkey-C2839ECAD9408FBE9531C3E9F434A1EFAFEEAEA3.gpg.asc
+7a10bc2e3d39a2b61a507eae30c8b505dcd4f553 SOURCES/libreoffice-6.0.6.1.tar.xz
+54fc749ba924f9ca4e0391caaf579ab344302038 SOURCES/libreoffice-base-symbolic.svg
+9de544172d736d59589767000c1f657034a5d53d SOURCES/libreoffice-calc-symbolic.svg
+0f6dc4726da0920869354fbe4b2924f9ac569b4a SOURCES/libreoffice-draw-symbolic.svg
+d453fdf82bf65f79bfbf70986720436ba4d9ed51 SOURCES/libreoffice-help-6.0.6.1.tar.xz
+8c74dd667c660cc643c4d715dd50491ba92146d5 SOURCES/libreoffice-impress-symbolic.svg
+c77acd04a7647b09745f9424ab0f65d52dfcd397 SOURCES/libreoffice-main-symbolic.svg
+3857a55644148eb25ed1a594bd00d1262761fb39 SOURCES/libreoffice-math-symbolic.svg
+9dbf1c8f3b373a3ec15e989f86c1a34a7d7aa761 SOURCES/libreoffice-translations-6.0.6.1.tar.xz
+d4f0674ad46a832120db956cc01a27fdc2060458 SOURCES/libreoffice-writer-symbolic.svg
diff --git a/SOURCES/0001-Adapt-to-Python-3.patch b/SOURCES/0001-Adapt-to-Python-3.patch
new file mode 100644
index 0000000..c563af1
--- /dev/null
+++ b/SOURCES/0001-Adapt-to-Python-3.patch
@@ -0,0 +1,23 @@
+From 6deba9b85bc9d5eb4f297ea305bcddfbad0060e1 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann
+Date: Tue, 3 Jul 2018 09:30:37 +0200
+Subject: [PATCH] Adapt to Python 3
+
+Change-Id: I7c44c23810a79242ec5ddf52a316b4bba7d838ce
+---
+ solenv/bin/pack_images.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/solenv/bin/pack_images.py b/solenv/bin/pack_images.py
+index 0f493c8f3035..b66ea34e731c 100755
+--- a/solenv/bin/pack_images.py
++++ b/solenv/bin/pack_images.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+ #
+--
+2.17.1
+
diff --git a/SOURCES/0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch b/SOURCES/0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch
new file mode 100644
index 0000000..fb453d1
--- /dev/null
+++ b/SOURCES/0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch
@@ -0,0 +1,67 @@
+From 811575c105b0a2bc597afda2f84a087199447ae5 Mon Sep 17 00:00:00 2001
+Message-Id: <811575c105b0a2bc597afda2f84a087199447ae5.1531842164.git.erack@redhat.com>
+From: Stephan Bergmann
+Date: Wed, 18 Apr 2018 16:35:55 +0200
+Subject: [PATCH] Keep the still relevant part of
+ external/icu/icu4c-ubsan.patch.1
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+...which f247f08e370626bbb427acd8f4a400fd875350a3 "Upgrade to ICU 61.1" had
+removed completely, in error.
+
+Change-Id: I7239011561851333cac58e54e4e7d590b8529dbc
+---
+ external/icu/UnpackedTarball_icu.mk | 1 +
+ external/icu/icu4c-ubsan.patch.1 | 14 ++++++++++++++
+ 2 files changed, 15 insertions(+)
+ create mode 100644 external/icu/icu4c-ubsan.patch.1
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-Keep-the-still-relevant-part-of-external-icu-icu4c-u.patch"
+
+diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
+index b81cdaab6242..c789e6eb8d84 100644
+--- a/external/icu/UnpackedTarball_icu.mk
++++ b/external/icu/UnpackedTarball_icu.mk
+@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
+ external/icu/icu4c-solarisgcc.patch.1 \
+ external/icu/icu4c-mkdir.patch.1 \
+ external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \
++ external/icu/icu4c-ubsan.patch.1 \
+ external/icu/icu4c-icu11100.patch.1 \
+ external/icu/icu4c-scriptrun.patch.1 \
+ external/icu/icu4c-rtti.patch.1 \
+diff --git a/external/icu/icu4c-ubsan.patch.1 b/external/icu/icu4c-ubsan.patch.1
+new file mode 100644
+index 000000000000..ea9f13fd85cd
+--- /dev/null
++++ b/external/icu/icu4c-ubsan.patch.1
+@@ -0,0 +1,14 @@
++diff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h
++--- icu.org/source/common/ubidiimp.h 2017-02-03 19:57:23.000000000 +0100
+++++ icu/source/common/ubidiimp.h 2017-04-21 22:46:25.374651159 +0200
++@@ -198,8 +198,8 @@
++ /* in a Run, logicalStart will get this bit set if the run level is odd */
++ #define INDEX_ODD_BIT (1UL<<31)
++
++-#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))
++-#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31))
+++#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))
+++#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31))
++ #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT)
++
++ #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT)
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-Related-rhbz-1618703-Properly-handle-failure-decodin.patch b/SOURCES/0001-Related-rhbz-1618703-Properly-handle-failure-decodin.patch
new file mode 100644
index 0000000..1b45161
--- /dev/null
+++ b/SOURCES/0001-Related-rhbz-1618703-Properly-handle-failure-decodin.patch
@@ -0,0 +1,94 @@
+From 03ab9306c70df34d7824f700d5635e8b458e6d6d Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann
+Date: Thu, 23 Aug 2018 16:45:34 +0200
+Subject: [PATCH 1/5] Related rhbz#1618703: Properly handle failure decoding
+ master password
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+...when e.g. FIPS mode makes PasswordContainer::DecodePasswords fail by throwing
+an exception which needs to be caught in PasswordContainerHelper::addRecord (in
+uui/source/passwordcontainer.cxx, but which only catches NoMasterException, not
+generic RuntimeException)
+
+Change-Id: I877bb5126e79ac2c90b11ef6d31bf81a2927f409
+Reviewed-on: https://gerrit.libreoffice.org/59511
+Tested-by: Jenkins
+Reviewed-by: Stephan Bergmann
+(cherry picked from commit e17987f4bd54fec7e0d94bdefdb94809255b3436)
+Reviewed-on: https://gerrit.libreoffice.org/59568
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+(cherry picked from commit 24b3d08018b6350d5e60615eb375b337ab1b4f75)
+---
+ svl/source/passwordcontainer/passwordcontainer.cxx | 11 ++++++-----
+ svl/source/passwordcontainer/passwordcontainer.hxx | 2 +-
+ 2 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
+index c2e8b7100028..6d4bb02427ac 100644
+--- a/svl/source/passwordcontainer/passwordcontainer.cxx
++++ b/svl/source/passwordcontainer/passwordcontainer.cxx
+@@ -417,7 +417,7 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& )
+ }
+ }
+
+-std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aMasterPasswd )
++std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aMasterPasswd, css::task::PasswordRequestMode mode )
+ {
+ if( !aMasterPasswd.isEmpty() )
+ {
+@@ -463,7 +463,8 @@ std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLin
+
+ // problems with decoding
+ OSL_FAIL( "Problem with decoding" );
+- throw RuntimeException("Can't decode!" );
++ throw css::task::NoMasterException(
++ "Can't decode!", css::uno::Reference(), mode);
+ }
+
+ OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPasswd )
+@@ -586,7 +587,7 @@ UserRecord PasswordContainer::CopyToUserRecord( const NamePassRecord& aRecord, b
+ {
+ try
+ {
+- ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ) );
++ ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER );
+ aPasswords.insert( aPasswords.end(), aDecodedPasswords.begin(), aDecodedPasswords.end() );
+ }
+ catch( NoMasterException& )
+@@ -848,7 +849,7 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac
+ }
+ else
+ {
+- std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass ) );
++ std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass, aRMode ) );
+ if( aRM.empty() || aPass != aRM[0] )
+ {
+ bAskAgain = true;
+@@ -1005,7 +1006,7 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere
+ {
+ sal_Int32 oldLen = aUsers.getLength();
+ aUsers.realloc( oldLen + 1 );
+- aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ) ) ) );
++ aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ) ) );
+ }
+
+ if( aUsers.getLength() )
+diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx
+index 67ad63e72722..a1190549eb77 100644
+--- a/svl/source/passwordcontainer/passwordcontainer.hxx
++++ b/svl/source/passwordcontainer/passwordcontainer.hxx
+@@ -268,7 +268,7 @@ css::task::UrlRecord find(
+ const css::uno::Reference< css::task::XInteractionHandler >& Handler );
+
+ /// @throws css::uno::RuntimeException
+- static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aMasterPassword );
++ static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aMasterPassword, css::task::PasswordRequestMode mode );
+
+ /// @throws css::uno::RuntimeException
+ static OUString EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPassword );
+--
+2.17.1
+
diff --git a/SOURCES/0001-Related-tdf-105998-except-cut-and-paste-as-bitmap-in.patch b/SOURCES/0001-Related-tdf-105998-except-cut-and-paste-as-bitmap-in.patch
new file mode 100644
index 0000000..1d09956
--- /dev/null
+++ b/SOURCES/0001-Related-tdf-105998-except-cut-and-paste-as-bitmap-in.patch
@@ -0,0 +1,74 @@
+From 15cdcd0346b7aa98d4697edec8aeea9c810efa62 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Tue, 5 Dec 2017 17:13:28 +0000
+Subject: [PATCH] Related: tdf#105998 except cut and paste as bitmap instead of
+ export
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Take a drawing rectangle in draw and cut and paste as bitmap to writer. The
+hairline border along the very right/bottom edge of the bitmap appear missing.
+
+fallback to default handlers which can distort the hairline to be visible
+
+Change-Id: Iedb580f65879628839c83e41092745ae7c11267c
+Reviewed-on: https://gerrit.libreoffice.org/45902
+Tested-by: Jenkins
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+---
+ .../source/processor2d/vclpixelprocessor2d.cxx | 25 +++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+index 9c21c83ee..5c5c0bb 100644
+--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
++++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+@@ -41,6 +41,7 @@
+ #include "helperwrongspellrenderer.hxx"
+ #include
+ #include
++#include
+ #include
+ #include
+ #include
+@@ -210,10 +211,6 @@ namespace drawinglayer
+ maBColorModifierStack.getModifiedColor(
+ rSource.getLineAttribute().getColor()));
+
+- mpOutputDevice->SetFillColor();
+- mpOutputDevice->SetLineColor(Color(aLineColor));
+- aHairLinePolyPolygon.transform(maCurrentTransformation);
+-
+ double fLineWidth(rSource.getLineAttribute().getWidth());
+
+ if(basegfx::fTools::more(fLineWidth, 0.0))
+@@ -234,6 +231,24 @@ namespace drawinglayer
+ fLineWidth = 0.0;
+ }
+
++ //Related: tdf#105998 cut and paste as bitmap of shape from draw to
++ //writer. If we are a hairline along the very right/bottom edge of
++ //the canvas then fallback to defaults which can distort the
++ //hairline inside the paintable area
++ if (fLineWidth == 0.0)
++ {
++ Size aSize = mpOutputDevice->GetOutputSize();
++ basegfx::B2DRange aRange = aHairLinePolyPolygon.getB2DRange();
++ basegfx::B2DRange aOutputRange = aRange;
++ aOutputRange.transform(maCurrentTransformation);
++ if (std::round(aOutputRange.getMaxX()) == aSize.Width() || std::round(aOutputRange.getMaxY()) == aSize.Height())
++ return false;
++ }
++
++ mpOutputDevice->SetFillColor();
++ mpOutputDevice->SetLineColor(Color(aLineColor));
++ aHairLinePolyPolygon.transform(maCurrentTransformation);
++
+ bool bHasPoints(false);
+ bool bTryWorked(false);
+
+--
+2.9.5
+
diff --git a/SOURCES/0001-Related-tdf-106100-recover-mangled-svg-in-presentati.patch b/SOURCES/0001-Related-tdf-106100-recover-mangled-svg-in-presentati.patch
new file mode 100644
index 0000000..518896e
--- /dev/null
+++ b/SOURCES/0001-Related-tdf-106100-recover-mangled-svg-in-presentati.patch
@@ -0,0 +1,67 @@
+From a74837a0e7c7259e4396aa5f05cf1384e256db35 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Mon, 20 Feb 2017 16:04:58 +0000
+Subject: [PATCH] Related: tdf#106100 recover mangled svg in presentations
+
+Change-Id: I77b452aa69a8341aa30e1e93d0d5ee8160533095
+---
+ svgio/Module_svgio.mk | 4 ----
+ svgio/source/svgreader/svgsvgnode.cxx | 27 +++------------------------
+ 2 files changed, 3 insertions(+), 28 deletions(-)
+
+diff --git a/svgio/Module_svgio.mk b/svgio/Module_svgio.mk
+index 29ef97d..8b827fc 100644
+--- a/svgio/Module_svgio.mk
++++ b/svgio/Module_svgio.mk
+@@ -22,8 +22,4 @@ $(eval $(call gb_Module_add_targets,svgio,\
+ Library_svgio \
+ ))
+
+-$(eval $(call gb_Module_add_check_targets,svgio,\
+- CppunitTest_svgio \
+-))
+-
+ # vim: set noet ts=4 sw=4:
+diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx
+index 7800666..087c621 100644
+--- a/svgio/source/svgreader/svgsvgnode.cxx
++++ b/svgio/source/svgreader/svgsvgnode.cxx
+@@ -522,32 +522,11 @@ namespace svgio
+ }
+ else
+ {
+- // There exists no parent to resolve relative width or height.
+- // Use child size as fallback and expand to aspect ratio given
+- // by the viewBox. No mapping.
+- // We get viewport >= content, therefore no clipping.
+- bNeedsMapping = false;
+- const basegfx::B2DRange aChildRange(
+- aSequence.getB2DRange(
+- drawinglayer::geometry::ViewInformation2D()));
+- const double fChildWidth(aChildRange.getWidth());
+- const double fChildHeight(aChildRange.getHeight());
+- const double fLeft(aChildRange.getMinX());
+- const double fTop(aChildRange.getMinY());
+- if ( fChildWidth / fViewBoxWidth > fChildHeight / fViewBoxHeight )
+- { // expand y
+- fW = fChildWidth;
+- fH = fChildWidth / fViewBoxRatio;
+- }
+- else
+- { // expand x
+- fH = fChildHeight;
+- fW = fChildHeight * fViewBoxRatio;
+- }
+- aSvgCanvasRange = basegfx::B2DRange(fLeft, fTop, fLeft + fW, fTop + fH);
++ fW = fViewBoxWidth;
++ fH = fViewBoxHeight;
++ aSvgCanvasRange = basegfx::B2DRange(0.0, 0.0, fW, fH);
+ }
+
+-
+ if (bNeedsMapping)
+ {
+ // create mapping
+--
+2.9.3
+
diff --git a/SOURCES/0001-Resolves-rhbz-1432468-disable-opencl-by-default.patch b/SOURCES/0001-Resolves-rhbz-1432468-disable-opencl-by-default.patch
new file mode 100644
index 0000000..d17e9c0
--- /dev/null
+++ b/SOURCES/0001-Resolves-rhbz-1432468-disable-opencl-by-default.patch
@@ -0,0 +1,26 @@
+From b54cfe9d3d22fdd40f7015bd343df8620c983779 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Mon, 27 Mar 2017 11:47:01 +0100
+Subject: [PATCH] Resolves: rhbz#1432468 disable opencl by default
+
+Change-Id: Ie037fcabdd219f195425979dd721501fb5527573
+---
+ officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+index 946bd32..284d694 100644
+--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
++++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+@@ -5670,7 +5670,7 @@
+ Determines whether OpenCL can be used, when available, to speed up
+ some operations.
+
+- true
++ false
+
+
+
+--
+2.9.3
+
diff --git a/SOURCES/0001-Resolves-rhbz-1647507-try-inputted-password-as-both-.patch b/SOURCES/0001-Resolves-rhbz-1647507-try-inputted-password-as-both-.patch
new file mode 100644
index 0000000..f542832
--- /dev/null
+++ b/SOURCES/0001-Resolves-rhbz-1647507-try-inputted-password-as-both-.patch
@@ -0,0 +1,40 @@
+From f648553dfc356b3c5e6dd77ea96039a9977f00d6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Thu, 8 Nov 2018 10:58:00 +0000
+Subject: [PATCH] Resolves: rhbz#1647507 try inputted password as both user and
+ owner password
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Change-Id: Ibe1fae39d3153238e85400c9645766c260c9290d
+Reviewed-on: https://gerrit.libreoffice.org/63080
+Tested-by: Jenkins
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+(cherry picked from commit e3ca8385fed93e61efb8200149e06b822a84a47e)
+---
+ sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index 16db05afe870..b536a710e832 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -101,9 +101,11 @@ int main(int argc, char **argv)
+ : (ownerPassword[0] != '\001'
+ ? new GooString(ownerPassword)
+ : nullptr ) );
+- GooString* pUserPasswordStr( userPassword[0] != '\001'
++ GooString* pUserPasswordStr( aPwBuf[0] != 0
++ ? new GooString( aPwBuf )
++ : (userPassword[0] != '\001'
+ ? new GooString(userPassword)
+- : nullptr );
++ : nullptr ) );
+ if( outputFile[0] != '\001' )
+ g_binary_out = fopen(outputFile,"wb");
+
+--
+2.17.1
+
diff --git a/SOURCES/0001-Upgrade-to-ICU-61.1.patch b/SOURCES/0001-Upgrade-to-ICU-61.1.patch
new file mode 100644
index 0000000..ed64bec
--- /dev/null
+++ b/SOURCES/0001-Upgrade-to-ICU-61.1.patch
@@ -0,0 +1,675 @@
+From f247f08e370626bbb427acd8f4a400fd875350a3 Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Eike Rathke
+Date: Tue, 17 Apr 2018 20:13:52 +0200
+Subject: [PATCH] Upgrade to ICU 61.1
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+Change-Id: I89c1c3d13d85decc72576744de2a16d20471d29d
+Reviewed-on: https://gerrit.libreoffice.org/53064
+Tested-by: Jenkins
+Reviewed-by: Eike Rathke
+---
+ configure.ac | 4 +-
+ download.lst | 8 +-
+ external/icu/UnpackedTarball_icu.mk | 3 +-
+ ...patch.1 => icu4c-61-werror-shadow.patch.1} | 30 ++-
+ external/icu/icu4c-khmerbreakengine.patch.1 | 246 +++++++++---------
+ external/icu/icu4c-ubsan.patch.1 | 91 -------
+ 6 files changed, 147 insertions(+), 235 deletions(-)
+ rename external/icu/{icu4c-59-werror-shadow.patch.1 => icu4c-61-werror-shadow.patch.1} (50%)
+ delete mode 100644 external/icu/icu4c-ubsan.patch.1
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-Upgrade-to-ICU-61.1.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-Upgrade-to-ICU-61.1.patch"
+
+diff --git a/configure.ac b/configure.ac
+index bdc374699cb9..458f9f3c2735 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9001,8 +9001,8 @@ SYSTEM_GENBRK=
+ SYSTEM_GENCCODE=
+ SYSTEM_GENCMN=
+
+-ICU_MAJOR=60
+-ICU_MINOR=2
++ICU_MAJOR=61
++ICU_MINOR=1
+ ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
+ ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
+ ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
+diff --git a/download.lst b/download.lst
+index 0a1fa65396d1..76f067bff4d7 100644
+--- a/download.lst
++++ b/download.lst
+@@ -102,10 +102,10 @@ export HUNSPELL_SHA256SUM := 3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce
+ export HUNSPELL_TARBALL := hunspell-1.6.2.tar.gz
+ export HYPHEN_SHA256SUM := 304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705
+ export HYPHEN_TARBALL := 5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
+-export ICU_SHA256SUM := f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418
+-export ICU_TARBALL := icu4c-60_2-src.tgz
+-export ICU_DATA_SHA256SUM := 68f42ad0c9e0a5a5af8eba0577ba100833912288bad6e4d1f42ff480bbcfd4a9
+-export ICU_DATA_TARBALL := icu4c-60_2-data.zip
++export ICU_SHA256SUM := d007f89ae8a2543a53525c74359b65b36412fa84b3349f1400be6dcf409fafef
++export ICU_TARBALL := icu4c-61_1-src.tgz
++export ICU_DATA_SHA256SUM := d149ed0985b5a6e16a9d8ed66f105dd58fd334c276779f74241cfa656ed2830a
++export ICU_DATA_TARBALL := icu4c-61_1-data.zip
+ export JFREEREPORT_FLOW_ENGINE_SHA256SUM := 233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
+ export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
+ export JFREEREPORT_FLUTE_SHA256SUM := 1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
+diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
+index a4d0b16ecb36..b81cdaab6242 100644
+--- a/external/icu/UnpackedTarball_icu.mk
++++ b/external/icu/UnpackedTarball_icu.mk
+@@ -27,15 +27,14 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
+ external/icu/icu4c-solarisgcc.patch.1 \
+ external/icu/icu4c-mkdir.patch.1 \
+ external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch.1 \
+- external/icu/icu4c-ubsan.patch.1 \
+ external/icu/icu4c-icu11100.patch.1 \
+ external/icu/icu4c-scriptrun.patch.1 \
+ external/icu/icu4c-rtti.patch.1 \
+ external/icu/icu4c-clang-cl.patch.1 \
+ $(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
+ external/icu/icu4c-khmerbreakengine.patch.1 \
+- external/icu/icu4c-59-werror-shadow.patch.1 \
+ external/icu/ofz4860.patch.2 \
++ external/icu/icu4c-61-werror-shadow.patch.1 \
+ ))
+
+ $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
+diff --git a/external/icu/icu4c-59-werror-shadow.patch.1 b/external/icu/icu4c-61-werror-shadow.patch.1
+similarity index 50%
+rename from external/icu/icu4c-59-werror-shadow.patch.1
+rename to external/icu/icu4c-61-werror-shadow.patch.1
+index fb88244aff13..b00f76317eff 100644
+--- a/external/icu/icu4c-59-werror-shadow.patch.1
++++ b/external/icu/icu4c-61-werror-shadow.patch.1
+@@ -1,33 +1,35 @@
++# https://ssl.icu-project.org/trac/ticket/13709
++# Werror=shadow fails for unistr.h
+ diff -ur icu.org/source/common/unicode/unistr.h icu/source/common/unicode/unistr.h
+---- icu.org/source/common/unicode/unistr.h 2017-03-29 06:44:37.000000000 +0200
+-+++ icu/source/common/unicode/unistr.h 2017-04-24 11:59:51.782076511 +0200
+-@@ -3080,11 +3080,11 @@
++--- icu.org/source/common/unicode/unistr.h 2018-03-26 15:38:29.000000000 +0200
+++++ icu/source/common/unicode/unistr.h 2018-04-18 10:44:16.321188314 +0200
++@@ -3053,11 +3053,11 @@
+ * uint16_t * constructor.
+ * Delegates to UnicodeString(const char16_t *, int32_t).
+ * @param text UTF-16 string
+ - * @param length string length
+-+ * @param length_ string length
+- * @draft ICU 59
+++ * @param textLength string length
++ * @stable ICU 59
+ */
+ - UnicodeString(const uint16_t *text, int32_t length) :
+ - UnicodeString(ConstChar16Ptr(text), length) {}
+-+ UnicodeString(const uint16_t *text, int32_t length_) :
+-+ UnicodeString(ConstChar16Ptr(text), length_) {}
+++ UnicodeString(const uint16_t *text, int32_t textLength) :
+++ UnicodeString(ConstChar16Ptr(text), textLength) {}
+ #endif
+
+- /*
+-@@ -3097,11 +3097,11 @@
++ #if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
++@@ -3066,11 +3066,11 @@
+ * (Only defined if U_SIZEOF_WCHAR_T==2.)
+ * Delegates to UnicodeString(const char16_t *, int32_t).
+ * @param text NUL-terminated UTF-16 string
+ - * @param length string length
+-+ * @param length_ string length
+- * @draft ICU 59
+++ * @param textLength string length
++ * @stable ICU 59
+ */
+ - UnicodeString(const wchar_t *text, int32_t length) :
+ - UnicodeString(ConstChar16Ptr(text), length) {}
+-+ UnicodeString(const wchar_t *text, int32_t length_) :
+-+ UnicodeString(ConstChar16Ptr(text), length_) {}
+++ UnicodeString(const wchar_t *text, int32_t textLength) :
+++ UnicodeString(ConstChar16Ptr(text), textLength) {}
+ #endif
+
+- /*
++ /**
+diff --git a/external/icu/icu4c-khmerbreakengine.patch.1 b/external/icu/icu4c-khmerbreakengine.patch.1
+index 6b45b3743611..9f134dd961b1 100644
+--- a/external/icu/icu4c-khmerbreakengine.patch.1
++++ b/external/icu/icu4c-khmerbreakengine.patch.1
+@@ -1,16 +1,18 @@
+ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+---- icu.org/source/common/dictbe.cpp 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/dictbe.cpp 2017-04-21 23:14:23.845894374 +0200
+-@@ -29,8 +29,17 @@
++--- icu.org/source/common/dictbe.cpp 2018-03-26 15:38:30.000000000 +0200
+++++ icu/source/common/dictbe.cpp 2018-04-17 17:55:38.620944919 +0200
++@@ -29,7 +29,19 @@
+ ******************************************************************
+ */
+
+--DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes) {
+-+DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes) :
+-+ clusterLimit(3)
+-+{
++-DictionaryBreakEngine::DictionaryBreakEngine() {
+++DictionaryBreakEngine::DictionaryBreakEngine()
+++ : fTypes(0), clusterLimit(0) {
+++}
+++
+++DictionaryBreakEngine::DictionaryBreakEngine(uint32_t breakTypes)
+++ : fTypes(breakTypes), clusterLimit(3) {
+ + UErrorCode status = U_ZERO_ERROR;
+- fTypes = breakTypes;
+ + fViramaSet.applyPattern(UNICODE_STRING_SIMPLE("[[:ccc=VR:]]"), status);
+ +
+ + // note Skip Sets contain fIgnoreSet characters too.
+@@ -20,16 +22,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ }
+
+ DictionaryBreakEngine::~DictionaryBreakEngine() {
+-@@ -92,7 +101,7 @@
+- result = divideUpDictionaryRange(text, rangeStart, rangeEnd, foundBreaks);
+- utext_setNativeIndex(text, current);
+- }
+--
+-+
+- return result;
+- }
+-
+-@@ -103,6 +112,169 @@
++@@ -76,6 +88,169 @@
+ fSet.compact();
+ }
+
+@@ -199,7 +192,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ /*
+ ******************************************************************
+ * PossibleWord
+-@@ -130,35 +302,35 @@
++@@ -103,35 +278,35 @@
+ public:
+ PossibleWord() : count(0), prefix(0), offset(-1), mark(0), current(0) {};
+ ~PossibleWord() {};
+@@ -244,7 +237,7 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ // Dictionary leaves text after longest prefix, not longest word. Back up.
+ if (count <= 0) {
+ utext_setNativeIndex(text, start);
+-@@ -830,51 +1002,28 @@
++@@ -803,51 +978,28 @@
+ * KhmerBreakEngine
+ */
+
+@@ -265,7 +258,8 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ -static const int32_t KHMER_MIN_WORD_SPAN = KHMER_MIN_WORD * 2;
+ -
+ KhmerBreakEngine::KhmerBreakEngine(DictionaryMatcher *adoptDictionary, UErrorCode &status)
+- : DictionaryBreakEngine((1 << UBRK_WORD) | (1 << UBRK_LINE)),
++- : DictionaryBreakEngine(),
+++ : DictionaryBreakEngine((1 << UBRK_WORD) | (1 << UBRK_LINE)),
+ fDictionary(adoptDictionary)
+ {
+ - fKhmerWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]]"), status);
+@@ -301,13 +295,13 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ - fEndWordSet.compact();
+ - fBeginWordSet.compact();
+ -// fSuffixSet.compact();
+-+ fIgnoreSet.compact();
+-+ fBaseSet.compact();
+-+ fPuncSet.compact();
+++ fIgnoreSet.compact();
+++ fBaseSet.compact();
+++ fPuncSet.compact();
+ }
+
+ KhmerBreakEngine::~KhmerBreakEngine() {
+-@@ -886,180 +1035,204 @@
++@@ -859,180 +1011,204 @@
+ int32_t rangeStart,
+ int32_t rangeEnd,
+ UVector32 &foundBreaks ) const {
+@@ -350,17 +344,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ + foundBreaks.push(rangeEnd, status);
+ + return foundBreaks.size() - wordsFound;
+ + }
+-+
+-+ scanStart = rangeStart;
+-+ scanWJ(text, scanStart, rangeEnd, before, after);
+-+ if (startZwsp || initAfter >= before) {
+-+ after = initAfter;
+-+ before = 0;
+-+ }
+-+ if (!endZwsp && after > finalBefore && after < rangeEnd)
+-+ endZwsp = true;
+-+ if (endZwsp && before > finalBefore)
+-+ before = finalBefore;
+
+ - while (U_SUCCESS(status) && (current = (int32_t)utext_getNativeIndex(text)) < rangeEnd) {
+ - cuWordLength = 0;
+@@ -375,7 +358,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ - cpWordLength = words[wordsFound % KHMER_LOOKAHEAD].markedCPLength();
+ - wordsFound += 1;
+ - }
+--
+++ scanStart = rangeStart;
+++ scanWJ(text, scanStart, rangeEnd, before, after);
+++ if (startZwsp || initAfter >= before) {
+++ after = initAfter;
+++ before = 0;
+++ }
+++ if (!endZwsp && after > finalBefore && after < rangeEnd)
+++ endZwsp = true;
+++ if (endZwsp && before > finalBefore)
+++ before = finalBefore;
++
+ - // If there was more than one, see which one can take us forward the most words
+ - else if (candidates > 1) {
+ - // If we're already at the end of the range, we're done
+@@ -390,22 +383,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ - words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
+ - wordsMatched = 2;
+ - }
+--
+-- // If we're already at the end of the range, we're done
+-- if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
+-- goto foundBest;
+-- }
+--
+-- // See if any of the possible second words is followed by a third word
+-- do {
+-- // If we find a third word, stop right away
+-- if (words[(wordsFound + 2) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd)) {
+-- words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
+-- goto foundBest;
+-- }
+-- }
+-- while (words[(wordsFound + 1) % KHMER_LOOKAHEAD].backUp(text));
+-- }
+ + utext_setNativeIndex(text, rangeStart);
+ + int32_t numCodePts = rangeEnd - rangeStart;
+ + // bestSnlp[i] is the snlp of the best segmentation of the first i
+@@ -415,7 +392,11 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ + for(int32_t i = 1; i <= numCodePts; i++) {
+ + bestSnlp.addElement(kuint32max, status);
+ + }
+-+
++
++- // If we're already at the end of the range, we're done
++- if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
++- goto foundBest;
++- }
+ + // prev[i] is the index of the last code point in the previous word in
+ + // the best segmentation of the first i characters. Note negative implies
+ + // that the code point is part of an unknown word.
+@@ -423,7 +404,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ + for(int32_t i = 0; i <= numCodePts; i++) {
+ + prev.addElement(kuint32max, status);
+ + }
+-+
++
++- // See if any of the possible second words is followed by a third word
++- do {
++- // If we find a third word, stop right away
++- if (words[(wordsFound + 2) % KHMER_LOOKAHEAD].candidates(text, fDictionary, rangeEnd)) {
++- words[wordsFound % KHMER_LOOKAHEAD].markCurrent();
++- goto foundBest;
++- }
++- }
++- while (words[(wordsFound + 1) % KHMER_LOOKAHEAD].backUp(text));
++- }
+ + const int32_t maxWordSize = 20;
+ + UVector32 values(maxWordSize, status);
+ + values.setSize(maxWordSize);
+@@ -528,27 +519,17 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ - if (cuWordLength <= 0) {
+ - wordsFound += 1;
+ - }
+--
+-- // Update the length with the passed-over characters
+-- cuWordLength += chars;
+-- }
+-- else {
+-- // Back up to where we were for next iteration
+-- utext_setNativeIndex(text, current+cuWordLength);
+ + } while (fMarkSet.contains(c) || fIgnoreSet.contains(c));
+ + values.setElementAt(BADSNLP, count);
+ + lengths.setElementAt(utext_getNativeIndex(text) - currix, count++);
+ + } else {
+ + values.setElementAt(BADSNLP, count);
+ + lengths.setElementAt(1, count++);
+- }
+- }
+++ }
+++ }
+
+-- // Never stop before a combining mark.
+-- int32_t currPos;
+-- while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
+-- utext_next32(text);
+-- cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
++- // Update the length with the passed-over characters
++- cuWordLength += chars;
+ + for (int32_t j = 0; j < count; j++) {
+ + uint32_t v = values.elementAti(j);
+ + int32_t newSnlp = bestSnlp.elementAti(i) + v;
+@@ -559,7 +540,10 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ + ++ln;
+ + utext_next32(text);
+ + c = utext_current32(text);
+-+ }
++ }
++- else {
++- // Back up to where we were for next iteration
++- utext_setNativeIndex(text, current+cuWordLength);
+ + int32_t ln_j_i = ln + i; // yes really i!
+ + if (newSnlp < bestSnlp.elementAti(ln_j_i)) {
+ + if (v == BADSNLP) {
+@@ -572,9 +556,38 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ + else
+ + prev.setElementAt(i, ln_j_i);
+ + bestSnlp.setElementAt(newSnlp, ln_j_i);
+-+ }
++ }
+ }
+ -
++- // Never stop before a combining mark.
++- int32_t currPos;
++- while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
++- utext_next32(text);
++- cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
+++ }
+++ // Start pushing the optimal offset index into t_boundary (t for tentative).
+++ // prev[numCodePts] is guaranteed to be meaningful.
+++ // We'll first push in the reverse order, i.e.,
+++ // t_boundary[0] = numCodePts, and afterwards do a swap.
+++ UVector32 t_boundary(numCodePts+1, status);
+++
+++ int32_t numBreaks = 0;
+++ // No segmentation found, set boundary to end of range
+++ while (numCodePts >= 0 && (uint32_t)bestSnlp.elementAti(numCodePts) == kuint32max) {
+++ --numCodePts;
+++ }
+++ if (numCodePts < 0) {
+++ t_boundary.addElement(numCodePts, status);
+++ numBreaks++;
+++ } else {
+++ for (int32_t i = numCodePts; (uint32_t)i != kuint32max; i = prev.elementAti(i)) {
+++ if (i < 0) i = -i;
+++ t_boundary.addElement(i, status);
+++ numBreaks++;
++ }
+++ U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0);
+++ }
++
+ - // Look ahead for possible suffixes if a dictionary word does not follow.
+ - // We do this in code rather than using a rule so that the heuristic
+ - // resynch continues to function. For example, one of the suffix characters
+@@ -616,30 +629,6 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+ - // Did we find a word on this iteration? If so, push it on the break stack
+ - if (cuWordLength > 0) {
+ - foundBreaks.push((current+cuWordLength), status);
+-+ }
+-+ // Start pushing the optimal offset index into t_boundary (t for tentative).
+-+ // prev[numCodePts] is guaranteed to be meaningful.
+-+ // We'll first push in the reverse order, i.e.,
+-+ // t_boundary[0] = numCodePts, and afterwards do a swap.
+-+ UVector32 t_boundary(numCodePts+1, status);
+-+
+-+ int32_t numBreaks = 0;
+-+ // No segmentation found, set boundary to end of range
+-+ while (numCodePts >= 0 && (uint32_t)bestSnlp.elementAti(numCodePts) == kuint32max) {
+-+ --numCodePts;
+-+ }
+-+ if (numCodePts < 0) {
+-+ t_boundary.addElement(numCodePts, status);
+-+ numBreaks++;
+-+ } else {
+-+ for (int32_t i = numCodePts; (uint32_t)i != kuint32max; i = prev.elementAti(i)) {
+-+ if (i < 0) i = -i;
+-+ t_boundary.addElement(i, status);
+-+ numBreaks++;
+-+ }
+-+ U_ASSERT(prev.elementAti(t_boundary.elementAti(numBreaks - 1)) == 0);
+-+ }
+-+
+ + // Now that we're done, convert positions in t_boundary[] (indices in
+ + // the normalized input string) back to indices in the original input UText
+ + // while reversing t_boundary and pushing values to foundBreaks.
+@@ -669,38 +658,35 @@ diff -ur icu.org/source/common/dictbe.cpp icu/source/common/dictbe.cpp
+
+ #if !UCONFIG_NO_NORMALIZATION
+ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
+---- icu.org/source/common/dictbe.h 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/dictbe.h 2017-04-21 23:14:23.845894374 +0200
+-@@ -34,6 +34,15 @@
++--- icu.org/source/common/dictbe.h 2018-03-26 15:38:30.000000000 +0200
+++++ icu/source/common/dictbe.h 2018-04-17 14:55:33.307639865 +0200
++@@ -34,7 +34,8 @@
++ * threads without synchronization.
+ */
+ class DictionaryBreakEngine : public LanguageBreakEngine {
+- private:
+-+
+-+ /**
+-+ * Default constructor.
+-+ *
+-+ */
+-+ DictionaryBreakEngine();
+-+
++- private:
+ + protected:
+ +
+ /**
+ * The set of characters handled by this engine
+ * @internal
+-@@ -48,11 +57,63 @@
++@@ -42,14 +43,84 @@
+
+- uint32_t fTypes;
++ UnicodeSet fSet;
+
+ + const int32_t WJ = 0x2060;
+ + const int32_t ZWSP = 0x200B;
+ +
+- /**
+-- * Default constructor.
+-- *
+++ /**
+++ * The break types it was constructed with
+++ * @internal
+++ */
+++ uint32_t fTypes;
+++
+++ /**
+ + * A Unicode set of all viramas
+ + * @internal
+- */
+-- DictionaryBreakEngine();
+++ */
+ + UnicodeSet fViramaSet;
+ +
+ + /**
+@@ -751,10 +737,26 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
+ + bool scanAfterEnd(UText *text, int32_t rangeEnd, int32_t& end, bool &doBreak) const;
+ + void scanBackClusters(UText *text, int32_t textStart, int32_t& start) const;
+ + void scanFwdClusters(UText *text, int32_t textEnd, int32_t& end) const;
+-
+++
+ public:
+
+-@@ -83,7 +144,7 @@
++ /**
++- * Constructor
+++ * Default constructor.
+++ *
++ */
++ DictionaryBreakEngine();
++
++ /**
+++ * Constructor with break types.
+++ */
+++ explicit DictionaryBreakEngine(uint32_t breakTypes);
+++
+++ /**
++ * Virtual destructor.
++ */
++ virtual ~DictionaryBreakEngine();
++@@ -68,7 +139,7 @@
+ * Find any breaks within a run in the supplied text.
+ *
+ * @param text A UText representing the text. The iterator is left at
+@@ -763,7 +765,7 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
+ * that starts from the first character in the range.
+ * @param startPos The start of the run within the supplied text.
+ * @param endPos The end of the run within the supplied text.
+-@@ -245,118 +306,120 @@
++@@ -218,118 +289,120 @@
+
+ };
+
+@@ -997,8 +999,8 @@ diff -ur icu.org/source/common/dictbe.h icu/source/common/dictbe.h
+
+ /*******************************************************************
+ diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionarydata.cpp
+---- icu.org/source/common/dictionarydata.cpp 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/dictionarydata.cpp 2017-04-21 23:14:23.846894372 +0200
++--- icu.org/source/common/dictionarydata.cpp 2018-03-26 15:38:30.000000000 +0200
+++++ icu/source/common/dictionarydata.cpp 2018-04-17 14:04:50.775567214 +0200
+ @@ -44,7 +44,7 @@
+
+ int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t limit,
+@@ -1046,8 +1048,8 @@ diff -ur icu.org/source/common/dictionarydata.cpp icu/source/common/dictionaryda
+ if (values != NULL) {
+ values[wordCount] = bt.getValue();
+ diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata.h
+---- icu.org/source/common/dictionarydata.h 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/dictionarydata.h 2017-04-21 23:14:23.846894372 +0200
++--- icu.org/source/common/dictionarydata.h 2018-03-26 15:38:30.000000000 +0200
+++++ icu/source/common/dictionarydata.h 2018-04-17 14:04:50.775567214 +0200
+ @@ -21,6 +21,7 @@
+ #include "unicode/utext.h"
+ #include "unicode/udata.h"
+@@ -1084,8 +1086,8 @@ diff -ur icu.org/source/common/dictionarydata.h icu/source/common/dictionarydata
+ private:
+ UChar32 transform(UChar32 c) const;
+ diff -ur icu.org/source/data/Makefile.in icu/source/data/Makefile.in
+---- icu.org/source/data/Makefile.in 2017-04-21 23:13:03.248087545 +0200
+-+++ icu/source/data/Makefile.in 2017-04-21 23:14:23.846894372 +0200
++--- icu.org/source/data/Makefile.in 2018-04-17 12:28:37.098707466 +0200
+++++ icu/source/data/Makefile.in 2018-04-17 14:04:50.775567214 +0200
+ @@ -183,7 +183,7 @@
+ endif
+ endif
+diff --git a/external/icu/icu4c-ubsan.patch.1 b/external/icu/icu4c-ubsan.patch.1
+deleted file mode 100644
+index 9f6aa3fbc9f8..000000000000
+--- a/external/icu/icu4c-ubsan.patch.1
++++ /dev/null
+@@ -1,91 +0,0 @@
+-diff -ur icu.org/source/common/rbbidata.h icu/source/common/rbbidata.h
+---- icu.org/source/common/rbbidata.h 2017-02-03 19:57:23.000000000 +0100
+-+++ icu/source/common/rbbidata.h 2017-04-21 22:46:25.371651160 +0200
+-@@ -115,7 +115,7 @@
+- /* StatusTable of the set of matching */
+- /* tags (rule status values) */
+- int16_t fReserved;
+-- uint16_t fNextState[2]; /* Next State, indexed by char category. */
+-+ uint16_t fNextState[1]; /* Next State, indexed by char category. */
+- /* This array does not have two elements */
+- /* Array Size is actually fData->fHeader->fCatCount */
+- /* CAUTION: see RBBITableBuilder::getTableSize() */
+-@@ -128,7 +128,7 @@
+- uint32_t fRowLen; /* Length of a state table row, in bytes. */
+- uint32_t fFlags; /* Option Flags for this state table */
+- uint32_t fReserved; /* reserved */
+-- char fTableData[4]; /* First RBBIStateTableRow begins here. */
+-+ char fTableData[1]; /* First RBBIStateTableRow begins here. */
+- /* (making it char[] simplifies ugly address */
+- /* arithmetic for indexing variable length rows.) */
+- };
+-diff -ur icu.org/source/common/rbbitblb.cpp icu/source/common/rbbitblb.cpp
+---- icu.org/source/common/rbbitblb.cpp 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/rbbitblb.cpp 2017-04-21 22:46:25.373651159 +0200
+-@@ -1095,15 +1095,15 @@
+- return 0;
+- }
+-
+-- size = sizeof(RBBIStateTable) - 4; // The header, with no rows to the table.
+-+ size = offsetof(RBBIStateTable, fTableData); // The header, with no rows to the table.
+-
+- numRows = fDStates->size();
+- numCols = fRB->fSetBuilder->getNumCharCategories();
+-
+-- // Note The declaration of RBBIStateTableRow is for a table of two columns.
+-- // Therefore we subtract two from numCols when determining
+-+ // Note The declaration of RBBIStateTableRow is for a table of one columns.
+-+ // Therefore we subtract one from numCols when determining
+- // how much storage to add to a row for the total columns.
+-- rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2);
+-+ rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1);
+- size += numRows * rowSize;
+- return size;
+- }
+-@@ -1133,7 +1133,7 @@
+- }
+-
+- table->fRowLen = sizeof(RBBIStateTableRow) +
+-- sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2);
+-+ sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1);
+- table->fNumStates = fDStates->size();
+- table->fFlags = 0;
+- if (fRB->fLookAheadHardBreak) {
+-diff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h
+---- icu.org/source/common/ubidiimp.h 2017-02-03 19:57:23.000000000 +0100
+-+++ icu/source/common/ubidiimp.h 2017-04-21 22:46:25.374651159 +0200
+-@@ -198,8 +198,8 @@
+- /* in a Run, logicalStart will get this bit set if the run level is odd */
+- #define INDEX_ODD_BIT (1UL<<31)
+-
+--#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))
+--#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31))
+-+#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))
+-+#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31))
+- #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT)
+-
+- #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT)
+-diff -ur icu.org/source/common/ucmndata.cpp icu/source/common/ucmndata.cpp
+---- icu.org/source/common/ucmndata.cpp 2017-03-08 16:34:47.000000000 +0100
+-+++ icu/source/common/ucmndata.cpp 2017-04-21 22:46:25.376651159 +0200
+-@@ -77,7 +77,7 @@
+- typedef struct {
+- uint32_t count;
+- uint32_t reserved;
+-- PointerTOCEntry entry[2]; /* Actual size is from count. */
+-+ PointerTOCEntry entry[1]; /* Actual size is from count. */
+- } PointerTOC;
+-
+-
+-diff -ur icu.org/source/common/ucmndata.h icu/source/common/ucmndata.h
+---- icu.org/source/common/ucmndata.h 2017-01-20 01:20:31.000000000 +0100
+-+++ icu/source/common/ucmndata.h 2017-04-21 22:46:25.377651159 +0200
+-@@ -52,7 +52,7 @@
+-
+- typedef struct {
+- uint32_t count;
+-- UDataOffsetTOCEntry entry[2]; /* Actual size of array is from count. */
+-+ UDataOffsetTOCEntry entry[1]; /* Actual size of array is from count. */
+- } UDataOffsetTOC;
+-
+- /**
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-Upgrade-to-ICU-62.1.patch b/SOURCES/0001-Upgrade-to-ICU-62.1.patch
new file mode 100644
index 0000000..cfbb5d0
--- /dev/null
+++ b/SOURCES/0001-Upgrade-to-ICU-62.1.patch
@@ -0,0 +1,236 @@
+From 86dfa34c6d83b70923d462fecad316dafd9a1fc4 Mon Sep 17 00:00:00 2001
+Message-Id: <86dfa34c6d83b70923d462fecad316dafd9a1fc4.1531839924.git.erack@redhat.com>
+From: Eike Rathke
+Date: Mon, 16 Jul 2018 15:20:32 +0200
+Subject: [PATCH] Upgrade to ICU 62.1
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+Change-Id: I9426e77aa85cfe068df59db47b8ac50b59cd4eb3
+Reviewed-on: https://gerrit.libreoffice.org/57500
+Reviewed-by: Eike Rathke
+Tested-by: Jenkins
+---
+ configure.ac | 2 +-
+ download.lst | 8 +++----
+ external/icu/UnpackedTarball_icu.mk | 1 -
+ external/icu/icu4c-mkdir.patch.1 | 6 ++---
+ external/icu/ofz4860.patch.2 | 25 ---------------------
+ i18nutil/source/utility/unicode.cxx | 23 +++++++++++++++++++
+ include/svx/strings.hrc | 11 +++++++++
+ svx/source/dialog/charmap.cxx | 35 +++++++++++++++++++++++++++++
+ 8 files changed, 77 insertions(+), 34 deletions(-)
+ delete mode 100644 external/icu/ofz4860.patch.2
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-Upgrade-to-ICU-62.1.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-Upgrade-to-ICU-62.1.patch"
+
+diff --git a/configure.ac b/configure.ac
+index 23b3fd4953c9..2fd11a9b3d19 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -9066,7 +9066,7 @@ SYSTEM_GENBRK=
+ SYSTEM_GENCCODE=
+ SYSTEM_GENCMN=
+
+-ICU_MAJOR=61
++ICU_MAJOR=62
+ ICU_MINOR=1
+ ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
+ ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
+diff --git a/download.lst b/download.lst
+index dd3519b74a8d..0d4e974ed105 100644
+--- a/download.lst
++++ b/download.lst
+@@ -102,10 +102,10 @@ export HUNSPELL_SHA256SUM := 3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce
+ export HUNSPELL_TARBALL := hunspell-1.6.2.tar.gz
+ export HYPHEN_SHA256SUM := 304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705
+ export HYPHEN_TARBALL := 5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz
+-export ICU_SHA256SUM := d007f89ae8a2543a53525c74359b65b36412fa84b3349f1400be6dcf409fafef
+-export ICU_TARBALL := icu4c-61_1-src.tgz
+-export ICU_DATA_SHA256SUM := d149ed0985b5a6e16a9d8ed66f105dd58fd334c276779f74241cfa656ed2830a
+-export ICU_DATA_TARBALL := icu4c-61_1-data.zip
++export ICU_SHA256SUM := 3dd9868d666350dda66a6e305eecde9d479fb70b30d5b55d78a1deffb97d5aa3
++export ICU_TARBALL := icu4c-62_1-src.tgz
++export ICU_DATA_SHA256SUM := 93bcaf58cfa9223972da79cb8e0f94819ace4995db6041b84f4d9bd810246d1d
++export ICU_DATA_TARBALL := icu4c-62_1-data.zip
+ export JFREEREPORT_FLOW_ENGINE_SHA256SUM := 233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
+ export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
+ export JFREEREPORT_FLUTE_SHA256SUM := 1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
+diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
+index c789e6eb8d84..6800c1fb5ea8 100644
+--- a/external/icu/UnpackedTarball_icu.mk
++++ b/external/icu/UnpackedTarball_icu.mk
+@@ -34,7 +34,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
+ external/icu/icu4c-clang-cl.patch.1 \
+ $(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
+ external/icu/icu4c-khmerbreakengine.patch.1 \
+- external/icu/ofz4860.patch.2 \
+ external/icu/icu4c-61-werror-shadow.patch.1 \
+ ))
+
+diff --git a/external/icu/icu4c-mkdir.patch.1 b/external/icu/icu4c-mkdir.patch.1
+index 3234f151b677..7de4cf51174c 100644
+--- a/external/icu/icu4c-mkdir.patch.1
++++ b/external/icu/icu4c-mkdir.patch.1
+@@ -1,10 +1,10 @@
+ diff -ur icu.org/source/data/Makefile.in icu/source/data/Makefile.in
+---- icu.org/source/data/Makefile.in 2016-06-15 20:58:17.000000000 +0200
+-+++ icu/source/data/Makefile.in 2017-04-21 22:29:00.747158002 +0200
++--- icu.org/source/data/Makefile.in 2018-06-21 11:39:15.000000000 +0200
+++++ icu/source/data/Makefile.in 2018-07-16 13:18:26.928109541 +0200
+ @@ -367,6 +367,7 @@
+ ifeq ($(PKGDATA_MODE),dll)
+ SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
+- $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
++ $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc | build-dir
+ + mkdir -p $(OUTTMPDIR)
+ ifeq ($(MSYS_RC_MODE),1)
+ rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $<
+diff --git a/external/icu/ofz4860.patch.2 b/external/icu/ofz4860.patch.2
+deleted file mode 100644
+index 14114d52878b..000000000000
+--- a/external/icu/ofz4860.patch.2
++++ /dev/null
+@@ -1,25 +0,0 @@
+-From 529ba01ee606940ca273b187be8ce9ba31cf2d90 Mon Sep 17 00:00:00 2001
+-From: David Tardon
+-Date: Fri, 19 Jan 2018 10:41:02 +0100
+-Subject: [PATCH] ofz#4860 fix past-the-end read from array
+-
+----
+- icu4c/source/common/locmap.cpp | 2 +-
+- 1 file changed, 1 insertion(+), 1 deletion(-)
+-
+-diff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp
+-index cbb2b810a..6d62d8310 100644
+---- a/icu4c/source/common/locmap.cpp
+-+++ b/icu4c/source/common/locmap.cpp
+-@@ -1015,7 +1015,7 @@ static const char*
+- getPosixID(const ILcidPosixMap *this_0, uint32_t hostID)
+- {
+- uint32_t i;
+-- for (i = 0; i <= this_0->numRegions; i++)
+-+ for (i = 0; i < this_0->numRegions; i++)
+- {
+- if (this_0->regionMaps[i].hostID == hostID)
+- {
+---
+-2.14.3
+-
+diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
+index 6d90b15ca42e..876750d6119d 100644
+--- a/i18nutil/source/utility/unicode.cxx
++++ b/i18nutil/source/utility/unicode.cxx
+@@ -726,6 +726,29 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
+ case USCRIPT_ZANABAZAR_SQUARE:
+ sRet = "mn-Zanb"; // abugida to write Mongolian
+ break;
++#endif
++#if (U_ICU_VERSION_MAJOR_NUM >= 62)
++ case USCRIPT_DOGRA:
++ sRet = "dgo"; // Dogri proper
++ break;
++ case USCRIPT_GUNJALA_GONDI:
++ sRet = "wsg"; // Adilabad Gondi
++ break;
++ case USCRIPT_MAKASAR:
++ sRet = "mak";
++ break;
++ case USCRIPT_MEDEFAIDRIN:
++ sRet = "mis-Medf"; // Uncoded with script
++ break;
++ case USCRIPT_HANIFI_ROHINGYA:
++ sRet = "rhg";
++ break;
++ case USCRIPT_SOGDIAN:
++ sRet = "sog";
++ break;
++ case USCRIPT_OLD_SOGDIAN:
++ sRet = "sog";
++ break;
+ #endif
+ }
+ return sRet;
+# Slightly adapted to rawhide/F29 libreoffice-6-0-6
+diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
+index 86c2215ac1c4..18fd984a1bd8 100644
+--- a/include/svx/strings.hrc
++++ b/include/svx/strings.hrc
+@@ -1656,6 +1656,17 @@
+ #define RID_SUBSETSTR_SOYOMBO NC_("RID_SUBSETMAP", "Soyombo")
+ #define RID_SUBSETSTR_SYRIAC_SUPPLEMENT NC_("RID_SUBSETMAP", "Syriac Supplement")
+ #define RID_SUBSETSTR_ZANABAZAR_SQUARE NC_("RID_SUBSETMAP", "Zanabazar Square")
++#define RID_SUBSETSTR_CHESS_SYMBOLS NC_("RID_SUBSETMAP", "Chess Symbols")
++#define RID_SUBSETSTR_DOGRA NC_("RID_SUBSETMAP", "Dogra")
++#define RID_SUBSETSTR_GEORGIAN_EXTENDED NC_("RID_SUBSETMAP", "Georgian Extended")
++#define RID_SUBSETSTR_GUNJALA_GONDI NC_("RID_SUBSETMAP", "Gunjala Gondi")
++#define RID_SUBSETSTR_HANIFI_ROHINGYA NC_("RID_SUBSETMAP", "Hanifi Rohingya")
++#define RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS NC_("RID_SUBSETMAP", "Indic Siyaq Numbers")
++#define RID_SUBSETSTR_MAKASAR NC_("RID_SUBSETMAP", "Makasar")
++#define RID_SUBSETSTR_MAYAN_NUMERALS NC_("RID_SUBSETMAP", "Mayan Numerals")
++#define RID_SUBSETSTR_MEDEFAIDRIN NC_("RID_SUBSETMAP", "Medefaidrin")
++#define RID_SUBSETSTR_OLD_SOGDIAN NC_("RID_SUBSETMAP", "Old Sogdian")
++#define RID_SUBSETSTR_SOGDIAN NC_("RID_SUBSETMAP", "Sogdian")
+
+ #endif
+
+diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
+index 3bf3a01d520f..fcaa955541df 100644
+--- a/svx/source/dialog/charmap.cxx
++++ b/svx/source/dialog/charmap.cxx
+@@ -1744,6 +1744,41 @@ void SubsetMap::InitList()
+ aAllSubsets.emplace_back( 0x11A00, 0x11A4F, SvxResId(RID_SUBSETSTR_ZANABAZAR_SQUARE) );
+ break;
+ #endif
++#if (U_ICU_VERSION_MAJOR_NUM >= 62)
++ case UBLOCK_CHESS_SYMBOLS:
++ aAllSubsets.emplace_back( 0x1FA00, 0x1FA6F, SvxResId(RID_SUBSETSTR_CHESS_SYMBOLS) );
++ break;
++ case UBLOCK_DOGRA:
++ aAllSubsets.emplace_back( 0x11800, 0x1184F, SvxResId(RID_SUBSETSTR_DOGRA) );
++ break;
++ case UBLOCK_GEORGIAN_EXTENDED:
++ aAllSubsets.emplace_back( 0x1C90, 0x1CBF, SvxResId(RID_SUBSETSTR_GEORGIAN_EXTENDED) );
++ break;
++ case UBLOCK_GUNJALA_GONDI:
++ aAllSubsets.emplace_back( 0x11D60, 0x11DAF, SvxResId(RID_SUBSETSTR_GUNJALA_GONDI) );
++ break;
++ case UBLOCK_HANIFI_ROHINGYA:
++ aAllSubsets.emplace_back( 0x10D00, 0x10D3F, SvxResId(RID_SUBSETSTR_HANIFI_ROHINGYA) );
++ break;
++ case UBLOCK_INDIC_SIYAQ_NUMBERS:
++ aAllSubsets.emplace_back( 0x1EC70, 0x1ECBF, SvxResId(RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS) );
++ break;
++ case UBLOCK_MAKASAR:
++ aAllSubsets.emplace_back( 0x11EE0, 0x11EFF, SvxResId(RID_SUBSETSTR_MAKASAR) );
++ break;
++ case UBLOCK_MAYAN_NUMERALS:
++ aAllSubsets.emplace_back( 0x1D2E0, 0x1D2FF, SvxResId(RID_SUBSETSTR_MAYAN_NUMERALS) );
++ break;
++ case UBLOCK_MEDEFAIDRIN:
++ aAllSubsets.emplace_back( 0x16E40, 0x16E9F, SvxResId(RID_SUBSETSTR_MEDEFAIDRIN) );
++ break;
++ case UBLOCK_OLD_SOGDIAN:
++ aAllSubsets.emplace_back( 0x10F00, 0x10F2F, SvxResId(RID_SUBSETSTR_OLD_SOGDIAN) );
++ break;
++ case UBLOCK_SOGDIAN:
++ aAllSubsets.emplace_back( 0x10F30, 0x10F6F, SvxResId(RID_SUBSETSTR_SOGDIAN) );
++ break;
++#endif
+
+ }
+
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch b/SOURCES/0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch
new file mode 100644
index 0000000..2e33f8e
--- /dev/null
+++ b/SOURCES/0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch
@@ -0,0 +1,43 @@
+From 1d3de59ac2d12e42e12c9642bd252236a80b096b Mon Sep 17 00:00:00 2001
+Message-Id: <1d3de59ac2d12e42e12c9642bd252236a80b096b.1531842210.git.erack@redhat.com>
+From: Eike Rathke
+Date: Tue, 17 Jul 2018 17:37:55 +0200
+Subject: [PATCH] Use $(ICU_MAJOR) instead of hard coded (Upgrade to ICU 62.1)
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+Change-Id: Ifea7072922388b2c0b7631fb809b23e2a5524a3c
+---
+ ios/CustomTarget_iOS_setup.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-Use-ICU_MAJOR-instead-of-hard-coded-Upgrade-to-ICU-6.patch"
+
+# Slightly adapted to rawhide/F29 libreoffice-6-0-6
+diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
+index a0d1a18823ab..718bb8b90d46 100644
+--- a/ios/CustomTarget_iOS_setup.mk
++++ b/ios/CustomTarget_iOS_setup.mk
+@@ -32,7 +32,7 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS_setup.mk
+ > $(IOSGEN)/native-code.h
+
+ # generate resource files used to start/run LibreOffice
+- cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt61l.dat $(IOSRES)/icudt61l.dat
++ cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt$(ICU_MAJOR)l.dat $(IOSRES)/icudt$(ICU_MAJOR)l.dat
+ cp $(INSTDIR)/program/types.rdb $(IOSRES)/udkapi.rdb
+ cp $(INSTDIR)/program/types/offapi.rdb $(IOSRES)
+ cp $(INSTDIR)/program/types/oovbaapi.rdb $(IOSRES)
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-We-use-ICU-61-now.patch b/SOURCES/0001-We-use-ICU-61-now.patch
new file mode 100644
index 0000000..1b3f5de
--- /dev/null
+++ b/SOURCES/0001-We-use-ICU-61-now.patch
@@ -0,0 +1,43 @@
+From b9dde4a74cba5a771cbc85880d518f6717d19216 Mon Sep 17 00:00:00 2001
+Message-Id:
+From: Tor Lillqvist
+Date: Thu, 7 Jun 2018 21:51:14 +0300
+Subject: [PATCH] We use ICU 61 now
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+Change-Id: I7faf23de08db680599658206faaf3028888563f6
+---
+ ios/CustomTarget_iOS_setup.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-We-use-ICU-61-now.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-We-use-ICU-61-now.patch"
+
+# Slightly adapted to rawhide/F29 libreoffice-6-0-6
+diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
+index a9f98850c6d8..a0d1a18823ab 100644
+--- a/ios/CustomTarget_iOS_setup.mk
++++ b/ios/CustomTarget_iOS_setup.mk
+@@ -32,7 +32,7 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk $(SRCDIR)/ios/CustomTarget_iOS_setup.mk
+ > $(IOSGEN)/native-code.h
+
+ # generate resource files used to start/run LibreOffice
+- cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt60l.dat $(IOSRES)/icudt60l.dat
++ cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt61l.dat $(IOSRES)/icudt61l.dat
+ cp $(INSTDIR)/program/types.rdb $(IOSRES)/udkapi.rdb
+ cp $(INSTDIR)/program/types/offapi.rdb $(IOSRES)
+ cp $(INSTDIR)/program/types/oovbaapi.rdb $(IOSRES)
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-cov-scan-help-warnings.patch b/SOURCES/0001-cov-scan-help-warnings.patch
new file mode 100644
index 0000000..cd6b21f
--- /dev/null
+++ b/SOURCES/0001-cov-scan-help-warnings.patch
@@ -0,0 +1,25 @@
+From fa5f426359bbe1b6a9c521130bf7bbee2e60f69f Mon Sep 17 00:00:00 2001
+From: rpmbuild
+Date: Wed, 18 Jul 2018 15:31:31 +0100
+Subject: [PATCH] foo
+
+---
+ helpcontent2/to-wiki/wikiconv2.py | 2 --
+ 5 files changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py
+index 93f72eb..55ff72f 100755
+--- a/helpcontent2/to-wiki/wikiconv2.py
++++ b/helpcontent2/to-wiki/wikiconv2.py
+@@ -1071,8 +1071,6 @@ class Item(ElementBase):
+ sys.stderr.write('Unhandled item type. Possibly type has been localized.\n')
+ finally:
+ raise UnhandledItemType
+- return replace_text(self.text)
+-
+
+ class Paragraph(ElementBase):
+ def __init__(self, attrs, parent):
+--
+2.14.4
+
diff --git a/SOURCES/0001-cov-scan-warnings.patch b/SOURCES/0001-cov-scan-warnings.patch
new file mode 100644
index 0000000..11afe49
--- /dev/null
+++ b/SOURCES/0001-cov-scan-warnings.patch
@@ -0,0 +1,2547 @@
+From b2549a70cb5d27f9c869451650c289ca831af97d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Thu, 26 Jul 2018 13:08:01 +0100
+Subject: [PATCH] cov scan warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Change-Id: If27bcfe85c5f2502ac1adb4ed4850ee42447516a
+
+coverity#705646 Resource leak
+
+Reviewed-on: https://gerrit.libreoffice.org/54139
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+(cherry picked from commit 1a3deaa7f7ff1d7e6ab5f5d551bcbc8c00d84052)
+
+Change-Id: I709b16f720cf97c05207cfb22d0c0ea15622367a
+
+Related: rhbz#1602589 silence error[memleak]: Memory leak: newValue
+
+Change-Id: I2d04c75aa9b5e1d91e06992fdb99899657ecf96d
+
+Related: rhbz#1602589 double_free, convert to std::vector
+
+Change-Id: I5fa19422d7ee61e7aad74eae86d843072e94016c
+
+Related: rhbz#1602589 silence coverity leaked_storage
+
+Change-Id: Iae694be40b32cc3821d326bb362e6091dba19a35
+
+Related: rhbz#1602589 silence coverity use_after_free
+
+Change-Id: If5345b6515c45bee2742d1293cd181ab46e8e61b
+
+Related: rhbz#1602589 silence coverity copy_paste_error
+
+Change-Id: Idca4bfaaa9f127eae87ae879e2131aed747ce4b3
+
+Related: rhbz#1602589 add comments to coverity annotations
+
+Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7
+
+Related: rhbz#1602589 silence leaked_storage
+
+Change-Id: Ib489ebf55d3a18d2af6f34b3f6128231d6d7758c
+
+InsertNewTable always returns true
+
+Change-Id: I28b2cd46bf40011f5f813784bd5c182f18ee103f
+
+pDPObject can never be null
+
+Change-Id: Ie98da9b53e952c2fb1f8f91e4b9489060114c366
+
+ScDPObject is only needed in endFastElement
+
+Change-Id: I8e1a7897777111c225e42ebcf81e67face6b29b9
+
+Related: rhbz#1602589 silence leaked_storage
+
+Change-Id: I21cc4af40429fa3ef4284d6c0ea592b05bf36620
+
+bodge it
+
+Change-Id: Ie9e4e3173a91f5380a98d629c8a67d2ebb9c6c14
+
+Related: rhbz#1602589 rework to avoid bogus cppcheck double free warning
+
+Change-Id: Ie673de68f39b903536c2287b8989fe6afcc9fd66
+
+SHELLCHECK_WARNING, VERBOSE is unused
+
+gengal.sh was originally based on unopkg.sh
+which had this --verbose switch...
+
+commit 164027e48899faaee284242eaca04b8aa5545319
+Date: Fri Apr 5 16:39:24 2013 +0100
+
+ gengal: re-base on original tool.
+
+ new wrapper based on unopkg.sh.
+ work re-based on original SUSE implementation.
+
+and unopkg.sh later had VERBOSE removed...
+
+commit 1fc195f7e830619d56cc4c56043b154bc3a72b02
+Author: Stephan Bergmann
+Date: Thu Oct 17 15:34:53 2013 +0200
+
+ Simplify code (VERBOSE was unused)
+
+but gengal.sh retained its unused VERBOSE variable
+
+Change-Id: I56aa830aef829c7727550fcaf7aed5058fffdc78
+---
+ bridges/source/cpp_uno/shared/bridge.cxx | 2 +-
+ bridges/source/jni_uno/jni_bridge.cxx | 4 +-
+ bridges/source/jni_uno/jni_info.cxx | 6 +-
+ comphelper/source/misc/threadpool.cxx | 2 +-
+ cppu/source/typelib/static_types.cxx | 2 +-
+ cppu/source/typelib/typelib.cxx | 9 +-
+ extensions/source/scanner/sanedlg.cxx | 2 +-
+ filter/source/svg/presentation_engine.js | 8 +-
+ .../accelerators/acceleratorconfiguration.cxx | 4 +-
+ idlc/source/parser.y | 2 +-
+ include/LibreOfficeKit/LibreOfficeKitInit.h | 4 +-
+ include/vcl/bitmap.hxx | 14 +-
+ pyuno/source/module/pyuno_dlopenwrapper.c | 1 +
+ registry/source/reflwrit.cxx | 8 +-
+ registry/source/regimpl.cxx | 124 ++++++---------
+ sal/osl/unx/file.cxx | 4 +-
+ sal/osl/unx/pipe.cxx | 9 +-
+ sal/osl/unx/profile.cxx | 1 +
+ sal/osl/w32/file.cxx | 4 +-
+ sal/rtl/alloc_arena.cxx | 2 +-
+ sal/rtl/alloc_cache.cxx | 6 +-
+ sc/inc/dpobject.hxx | 2 +-
+ sc/qa/unit/ucalc_pivottable.cxx | 142 +++++++-----------
+ sc/source/core/data/dpobject.cxx | 3 +-
+ sc/source/core/tool/chgtrack.cxx | 20 ++-
+ sc/source/core/tool/compiler.cxx | 1 +
+ sc/source/filter/xml/xmldpimp.cxx | 19 +--
+ sc/source/filter/xml/xmldpimp.hxx | 3 +-
+ sc/source/ui/docshell/dbdocfun.cxx | 4 +-
+ sc/source/ui/undo/undodat.cxx | 6 +-
+ sc/source/ui/view/viewdata.cxx | 2 +
+ .../ui/animations/CustomAnimationPane.cxx | 2 +
+ sd/source/ui/unoidl/unosrch.cxx | 71 +++------
+ sfx2/source/control/itemdel.cxx | 2 +-
+ solenv/bin/pack_images.py | 2 +-
+ soltools/cpp/_unix.c | 1 +
+ soltools/mkdepend/parse.c | 1 +
+ svtools/source/svhtml/htmlout.cxx | 2 +-
+ svx/source/gengal/gengal.sh | 2 -
+ sw/source/core/text/itrform2.cxx | 2 +
+ sw/source/ui/index/cnttab.cxx | 9 +-
+ unoidl/source/legacyprovider.cxx | 32 ++--
+ unotest/source/cpp/officeconnection.cxx | 2 +-
+ vcl/source/bitmap/BitmapScaleConvolution.cxx | 62 ++++----
+ vcl/source/gdi/bitmap3.cxx | 10 +-
+ vcl/source/gdi/bitmap4.cxx | 53 +++----
+ vcl/source/gdi/pdfwriter_impl.cxx | 1 +
+ vcl/unx/generic/plugadapt/salplug.cxx | 1 +
+ .../sun/star/wizards/agenda/TopicsControl.py | 6 +-
+ .../star/wizards/document/OfficeDocument.py | 1 -
+ 50 files changed, 306 insertions(+), 376 deletions(-)
+
+diff --git a/bridges/source/cpp_uno/shared/bridge.cxx b/bridges/source/cpp_uno/shared/bridge.cxx
+index 556350022e48..186d89aa1956 100644
+--- a/bridges/source/cpp_uno/shared/bridge.cxx
++++ b/bridges/source/cpp_uno/shared/bridge.cxx
+@@ -144,7 +144,7 @@ uno_Mapping * Bridge::createMapping(
+ bool bExportCpp2Uno)
+ {
+ Bridge * bridge = new Bridge(pCppEnv, pUnoEnv, bExportCpp2Uno);
+- //coverity[leaked_storage]
++ // coverity[leaked_storage] - on purpose
+ return bExportCpp2Uno ? &bridge->aCpp2Uno : &bridge->aUno2Cpp;
+ }
+
+diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
+index 3859b148c541..15daa8e28603 100644
+--- a/bridges/source/jni_uno/jni_bridge.cxx
++++ b/bridges/source/jni_uno/jni_bridge.cxx
+@@ -551,7 +551,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
+ uno_registerMapping(
+ &mapping, Bridge_free,
+ pFrom, &pTo->pExtEnv->aBase, nullptr );
+- // coverity[leaked_storage]
++ // coverity[leaked_storage] - on purpose
+ }
+ else if ( from_env_typename == UNO_LB_UNO && to_env_typename == UNO_LB_JAVA )
+ {
+@@ -561,7 +561,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
+ uno_registerMapping(
+ &mapping, Bridge_free,
+ &pFrom->pExtEnv->aBase, pTo, nullptr );
+- // coverity[leaked_storage]
++ // coverity[leaked_storage] - on purpose
+ }
+ }
+ catch (const BridgeRuntimeError & err)
+diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx
+index 82b773d6d58c..1542eebbf4e6 100644
+--- a/bridges/source/jni_uno/jni_info.cxx
++++ b/bridges/source/jni_uno/jni_info.cxx
+@@ -103,7 +103,7 @@ JNI_interface_type_info::JNI_interface_type_info(
+ typelib_InterfaceTypeDescription * td =
+ reinterpret_cast< typelib_InterfaceTypeDescription * >(
+ m_td.get() );
+- // coverity [ctor_dtor_leak]
++ // coverity[ctor_dtor_leak] - on purpose
+ m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ];
+ sal_Int32 nMethodIndex = 0;
+ typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
+@@ -288,7 +288,7 @@ JNI_compound_type_info::JNI_compound_type_info(
+ td->aBase.pWeakRef,
+ jni_info->m_RuntimeException_type.getTypeLibType() ))
+ {
+- // coverity [ctor_dtor_leak]
++ // coverity[ctor_dtor_leak] - on purpose
+ m_fields = new jfieldID[ 2 ];
+ m_fields[ 0 ] = nullptr; // special Throwable.getMessage()
+ // field Context
+@@ -860,7 +860,7 @@ JNI_info::JNI_info(
+ {
+ css::uno::TypeDescription XInterface_td(
+ cppu::UnoType::get());
+- // coverity [ctor_dtor_leak]
++ // coverity[ctor_dtor_leak] - on purpose
+ m_XInterface_type_info =
+ new JNI_interface_type_info( jni, XInterface_td.get() );
+ }
+diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx
+index 23e363213206..d8e984fe58d5 100644
+--- a/comphelper/source/misc/threadpool.cxx
++++ b/comphelper/source/misc/threadpool.cxx
+@@ -153,7 +153,7 @@ void ThreadPool::shutdownLocked(std::unique_lock& aGuard)
+ }
+ assert( maTasks.empty() );
+
+- // coverity[missing_lock]
++ // coverity[missing_lock] - on purpose
+ mbTerminate = true;
+
+ maTasksChanged.notify_all();
+diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
+index 3fb0bf6ab62a..f432b766a84a 100644
+--- a/cppu/source/typelib/static_types.cxx
++++ b/cppu/source/typelib/static_types.cxx
+@@ -439,7 +439,7 @@ void SAL_CALL typelib_static_interface_type_init(
+ typelib_TypeDescriptionReference * pBaseType )
+ SAL_THROW_EXTERN_C()
+ {
+- // coverity[callee_ptr_arith]
++ // coverity[callee_ptr_arith] - not a bug
+ typelib_static_mi_interface_type_init(
+ ppRef, pTypeName, pBaseType == nullptr ? 0 : 1, &pBaseType);
+ }
+diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
+index 4ef5aaf18ac7..8d0c8e5647de 100644
+--- a/cppu/source/typelib/typelib.cxx
++++ b/cppu/source/typelib/typelib.cxx
+@@ -564,6 +564,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ osl_atomic_increment( &Init::get().nIndirectTypeDescriptionCount );
+ #endif
+ pTmp->pType = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -581,6 +582,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->aBase.ppTypeRefs = nullptr;
+ pTmp->aBase.ppMemberNames = nullptr;
+ pTmp->pParameterizedTypes = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -597,6 +599,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->pMemberOffsets = nullptr;
+ pTmp->ppTypeRefs = nullptr;
+ pTmp->ppMemberNames = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -611,6 +614,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->nEnumValues = 0;
+ pTmp->ppEnumNames = nullptr;
+ pTmp->pEnumValues = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -632,6 +636,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->pMapMemberIndexToFunctionIndex= nullptr;
+ pTmp->nBaseTypes = 0;
+ pTmp->ppBaseTypes = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -652,6 +657,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->pInterface = nullptr;
+ pTmp->pBaseRef = nullptr;
+ pTmp->nIndex = 0;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -672,6 +678,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
+ pTmp->ppGetExceptions = nullptr;
+ pTmp->nSetExceptions = 0;
+ pTmp->ppSetExceptions = nullptr;
++ // coverity[leaked_storage] - this is on purpose
+ }
+ break;
+
+@@ -892,7 +899,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterface(
+ typelib_TypeDescriptionReference ** ppMembers )
+ SAL_THROW_EXTERN_C()
+ {
+- // coverity[callee_ptr_arith]
++ // coverity[callee_ptr_arith] - not a bug
+ typelib_typedescription_newMIInterface(
+ ppRet, pTypeName, 0, 0, 0, 0, 0, pBaseInterface == nullptr ? 0 : 1,
+ &pBaseInterface, nMembers, ppMembers);
+diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
+index e515a763af39..d4b4bf9d3156 100644
+--- a/extensions/source/scanner/sanedlg.cxx
++++ b/extensions/source/scanner/sanedlg.cxx
+@@ -495,7 +495,6 @@ void SaneDlg::InitFields()
+ pField->SetMax( (long)pDouble[ nValue-1 ] );
+ else
+ pField->SetMax( (long)pDouble[ 1 ] );
+- delete [] pDouble;
+ }
+ switch( i ) {
+ case 0: aMinTopLeft.X() = pField->GetMin();break;
+@@ -513,6 +512,7 @@ void SaneDlg::InitFields()
+ case 3: aMaxBottomRight.Y() = (int)fValue;break;
+ }
+ }
++ delete [] pDouble;
+ pField->Enable();
+ }
+ else
+diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
+index 7dbe377697dd..f4b9db25e4e0 100644
+--- a/filter/source/svg/presentation_engine.js
++++ b/filter/source/svg/presentation_engine.js
+@@ -7987,7 +7987,7 @@ AnimationBaseNode3.prototype.info = function( bVerbose )
+ sInfo += '; keyTimes: ' + this.getKeyTimes().join( ',' );
+
+ // values
+- if( this.getKeyTimes().length )
++ if( this.getValues().length )
+ sInfo += '; values: ' + this.getValues().join( ',' );
+
+ // formula
+@@ -12170,7 +12170,6 @@ SlideTransition.prototype.createSlideTransition = function( aLeavingSlide, aEnte
+
+ case PUSHWIPE_TRANSITION:
+ {
+- var bCombined = false;
+ var aDirection = null;
+ switch( this.eTransitionSubType )
+ {
+@@ -12192,10 +12191,7 @@ SlideTransition.prototype.createSlideTransition = function( aLeavingSlide, aEnte
+ aDirection = { x: -1.0, y: 0.0 };
+ break;
+ }
+- if( bCombined )
+- return null;
+- else
+- return new MovingSlideChange( aLeavingSlide, aEnteringSlide, aDirection, aDirection );
++ return new MovingSlideChange( aLeavingSlide, aEnteringSlide, aDirection, aDirection );
+ }
+
+ case SLIDEWIPE_TRANSITION:
+diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
+index ecc33938ab75..6a5a120331c1 100644
+--- a/framework/source/accelerators/acceleratorconfiguration.cxx
++++ b/framework/source/accelerators/acceleratorconfiguration.cxx
+@@ -1125,7 +1125,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred)
+
+ // take over all changes into the original container
+ SolarMutexGuard g;
+- // coverity[check_after_deref]
++ // coverity[check_after_deref] - confusing but correct
+ if (m_pPrimaryWriteCache)
+ {
+ m_aPrimaryReadCache.takeOver(*m_pPrimaryWriteCache);
+@@ -1164,7 +1164,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred)
+
+ // take over all changes into the original container
+ SolarMutexGuard g;
+- // coverity[check_after_deref]
++ // coverity[check_after_deref] - confusing but correct
+ if (m_pSecondaryWriteCache)
+ {
+ m_aSecondaryReadCache.takeOver(*m_pSecondaryWriteCache);
+diff --git a/idlc/source/parser.y b/idlc/source/parser.y
+index 1e873853b46e..592a082d58f8 100644
+--- a/idlc/source/parser.y
++++ b/idlc/source/parser.y
+@@ -2136,7 +2136,7 @@ at_least_one_scoped_name :
+ } else
+ {
+ std::list< OString >* pScopedNames = new std::list< OString >;
+- // coverity [copy_paste_error]
++ // coverity[copy_paste_error] - this is not a cut and paste
+ pScopedNames->push_back(*$1);
+ $$ = pScopedNames;
+ }
+diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
+index a0c111a9e0e2..71f4f2e68b04 100644
+--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
++++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
+@@ -280,13 +280,13 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p
+ }
+ free( imp_lib );
+ // dlhandle is "leaked"
+- // coverity[leaked_storage]
++ // coverity[leaked_storage] - on purpose
+ return pSym( install_path );
+ }
+
+ free( imp_lib );
+ // dlhandle is "leaked"
+- // coverity[leaked_storage]
++ // coverity[leaked_storage] - on purpose
+ return pSym2( install_path, user_profile_url );
+ }
+
+diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
+index 66a056448b53..d38aabac32f3 100644
+--- a/include/vcl/bitmap.hxx
++++ b/include/vcl/bitmap.hxx
+@@ -667,9 +667,9 @@ public:
+ Bitmap& aNewBitmap,
+ BitmapReadAccess const * pReadAcc,
+ int aNumberOfContributions,
+- const double* pWeights,
+- int const * pPixels,
+- const int* pCount );
++ const std::vector& rWeights,
++ const std::vector& rPixels,
++ const std::vector& rCounts );
+
+ SAL_DLLPRIVATE bool ImplMakeMono( sal_uInt8 cThreshold );
+ SAL_DLLPRIVATE bool ImplMakeGreyscales( sal_uInt16 nGreyscales );
+@@ -704,10 +704,10 @@ public:
+ SAL_DLLPRIVATE static void ImplBlurContributions(
+ const int aSize,
+ const int aNumberOfContributions,
+- const double* pBlurVector,
+- double*& pWeights,
+- int*& pPixels,
+- int*& pCount );
++ const std::vector& rBlurVector,
++ std::vector& pWeights,
++ std::vector& rPixels,
++ std::vector& rCounts );
+
+ public:
+
+diff --git a/pyuno/source/module/pyuno_dlopenwrapper.c b/pyuno/source/module/pyuno_dlopenwrapper.c
+index 5654cb0f8f0a..44e711653e35 100644
+--- a/pyuno/source/module/pyuno_dlopenwrapper.c
++++ b/pyuno/source/module/pyuno_dlopenwrapper.c
+@@ -72,6 +72,7 @@ static void * load(void const * address, char const * symbol) {
+ dlclose(h);
+ abort();
+ }
++ // coverity[leaked_storage] - this is on purpose
+ return func;
+ }
+
+diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
+index 45c5ae474a2c..7f82f9cd5172 100644
+--- a/registry/source/reflwrit.cxx
++++ b/registry/source/reflwrit.cxx
+@@ -376,11 +376,11 @@ void FieldEntry::setData(const OString& name,
+ RTValueType constValueType,
+ RTConstValueUnion constValue)
+ {
+- sal_Unicode * newValue = nullptr;
++ std::unique_ptr newValue;
+ if (constValueType == RT_TYPE_STRING && constValue.aString != nullptr) {
+ sal_Int32 n = rtl_ustr_getLength(constValue.aString) + 1;
+- newValue = new sal_Unicode[n];
+- memcpy(newValue, constValue.aString, n * sizeof (sal_Unicode));
++ newValue.reset(new sal_Unicode[n]);
++ memcpy(newValue.get(), constValue.aString, n * sizeof (sal_Unicode));
+ }
+
+ m_name = name;
+@@ -406,7 +406,7 @@ void FieldEntry::setData(const OString& name,
+ m_constValue.aString = NULL_WSTRING;
+ else
+ {
+- m_constValue.aString = newValue;
++ m_constValue.aString = newValue.release();
+ }
+ }
+ else
+diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
+index 6dec181933ea..260c7e9d2a7e 100644
+--- a/registry/source/regimpl.cxx
++++ b/registry/source/regimpl.cxx
+@@ -21,6 +21,7 @@
+ #include "regimpl.hxx"
+
+ #include
++#include
+ #include
+ #include
+
+@@ -323,8 +324,7 @@ void dumpType(typereg::Reader const & reader, OString const & indent) {
+ printf(
+ "%s parameter count: %u\n", indent.getStr(),
+ static_cast< unsigned int >(reader.getMethodParameterCount(i)));
+- // coverity[tainted_data] cid#1215304 unhelpfully warns about an
+- // untrusted loop bound here:
++ // coverity[tainted_data] - cid#1215304 unhelpfully warns about untrusted loop bound
+ for (sal_uInt16 j = 0; j < reader.getMethodParameterCount(i); ++j)
+ {
+ printf(
+@@ -365,8 +365,7 @@ void dumpType(typereg::Reader const & reader, OString const & indent) {
+ printf(
+ "%s exception count: %u\n", indent.getStr(),
+ static_cast< unsigned int >(reader.getMethodExceptionCount(i)));
+- // coverity[tainted_data] cid#1215304 unhelpfully warns about an
+- // untrusted loop bound here:
++ // coverity[tainted_data] - cid#1215304 unhelpfully warns about untrusted loop bound
+ for (sal_uInt16 j = 0; j < reader.getMethodExceptionCount(i); ++j)
+ {
+ printf(
+@@ -903,7 +902,6 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
+ bool bReport)
+ {
+ OStoreStream rValue;
+- sal_uInt8* pBuffer;
+ RegValueType valueType;
+ sal_uInt32 valueSize;
+ sal_uInt32 nSize;
+@@ -937,37 +935,32 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
+ return RegError::VALUE_NOT_EXISTS;
+ }
+
+- pBuffer = static_cast(rtl_allocateMemory(VALUE_HEADERSIZE));
++ std::vector aBuffer(VALUE_HEADERSIZE);
+
+ sal_uInt32 rwBytes;
+- if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes))
++ if (rValue.readAt(0, aBuffer.data(), VALUE_HEADERSIZE, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ if (rwBytes != VALUE_HEADERSIZE)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+ RegError _ret = RegError::NO_ERROR;
+- sal_uInt8 type = *pBuffer;
+- valueType = (RegValueType)type;
+- readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
+- rtl_freeMemory(pBuffer);
++ sal_uInt8 type = aBuffer[0];
++ valueType = static_cast(type);
++ readUINT32(aBuffer.data() + VALUE_TYPEOFFSET, valueSize);
+
+ nSize = VALUE_HEADERSIZE + valueSize;
+- pBuffer = static_cast(rtl_allocateMemory(nSize));
++ aBuffer.resize(nSize);
+
+- if (rValue.readAt(0, pBuffer, nSize, rwBytes))
++ if (rValue.readAt(0, aBuffer.data(), nSize, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ if (rwBytes != nSize)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+@@ -978,19 +971,17 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
+ if (valueType == RegValueType::BINARY)
+ {
+ _ret = checkBlop(
+- rValue, sTargetPath, valueSize, pBuffer+VALUE_HEADEROFFSET,
++ rValue, sTargetPath, valueSize, aBuffer.data() + VALUE_HEADEROFFSET,
+ bReport);
+ if (_ret != RegError::NO_ERROR)
+ {
+ if (_ret == RegError::MERGE_ERROR ||
+ (_ret == RegError::MERGE_CONFLICT && bWarnings))
+ {
+- rtl_freeMemory(pBuffer);
+ return _ret;
+ }
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+ return _ret;
+ }
+ }
+@@ -998,23 +989,19 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
+
+ if (rValue.create(rTargetFile, sTargetPath, valueName, storeAccessMode::Create))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+- if (rValue.writeAt(0, pBuffer, nSize, rwBytes))
++ if (rValue.writeAt(0, aBuffer.data(), nSize, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+ if (rwBytes != nSize)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ pTargetKey->setModified();
+
+- rtl_freeMemory(pBuffer);
+ return _ret;
+ }
+
+@@ -1031,33 +1018,30 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
+ return RegError::INVALID_VALUE;
+ }
+
+- sal_uInt8* pBuffer = static_cast(rtl_allocateMemory(VALUE_HEADERSIZE));
++ std::vector aBuffer(VALUE_HEADERSIZE);
+ RegValueType valueType;
+ sal_uInt32 valueSize;
+ sal_uInt32 rwBytes;
+ OString targetPath(OUStringToOString(sTargetPath, RTL_TEXTENCODING_UTF8));
+
+- if (!rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes) &&
++ if (!rValue.readAt(0, aBuffer.data(), VALUE_HEADERSIZE, rwBytes) &&
+ (rwBytes == VALUE_HEADERSIZE))
+ {
+- sal_uInt8 type = *pBuffer;
+- valueType = (RegValueType)type;
+- readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
+- rtl_freeMemory(pBuffer);
++ sal_uInt8 type = aBuffer[0];
++ valueType = static_cast(type);
++ readUINT32(aBuffer.data() + VALUE_TYPEOFFSET, valueSize);
+
+ if (valueType == RegValueType::BINARY)
+ {
+- pBuffer = static_cast(rtl_allocateMemory(valueSize));
+- if (!rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, rwBytes) &&
++ aBuffer.resize(valueSize);
++ if (!rValue.readAt(VALUE_HEADEROFFSET, aBuffer.data(), valueSize, rwBytes) &&
+ (rwBytes == valueSize))
+ {
+- RegistryTypeReader reader2(pBuffer, valueSize);
++ RegistryTypeReader reader2(aBuffer.data(), valueSize);
+
+ if ((reader.getTypeClass() != reader2.getTypeClass())
+ || reader2.getTypeClass() == RT_TYPE_INVALID)
+ {
+- rtl_freeMemory(pBuffer);
+-
+ if (bReport)
+ {
+ fprintf(stdout, "ERROR: values of blop from key \"%s\" has different types.\n",
+@@ -1073,22 +1057,17 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
+ {
+ mergeModuleValue(rValue, reader, reader2);
+
+- rtl_freeMemory(pBuffer);
+ return RegError::NO_ERROR;
+ } else
+ if (reader2.getFieldCount() > 0)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::NO_ERROR;
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::MERGE_CONFLICT;
+ }
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+-
+ if (bReport)
+ {
+ fprintf(stderr, "WARNING: value of key \"%s\" already exists.\n",
+@@ -1098,7 +1077,6 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
+ }
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+ if (bReport)
+ {
+ fprintf(stderr, "ERROR: values of key \"%s\" contains bad data.\n",
+@@ -1108,7 +1086,6 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
+ }
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+ if (bReport)
+ {
+ fprintf(stderr, "ERROR: values of key \"%s\" has different types.\n",
+@@ -1118,7 +1095,6 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
+ }
+ } else
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ }
+@@ -1189,27 +1165,23 @@ RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue,
+ const sal_uInt8* pBlop = writer.getBlop();
+ sal_uInt32 aBlopSize = writer.getBlopSize();
+
+- sal_uInt8 type = (sal_uInt8)RegValueType::BINARY;
+- sal_uInt8* pBuffer = static_cast(rtl_allocateMemory(VALUE_HEADERSIZE + aBlopSize));
++ sal_uInt8 type = sal_uInt8(RegValueType::BINARY);
++ std::vector aBuffer(VALUE_HEADERSIZE + aBlopSize);
+
+- memcpy(pBuffer, &type, 1);
+- writeUINT32(pBuffer+VALUE_TYPEOFFSET, aBlopSize);
+- memcpy(pBuffer+VALUE_HEADEROFFSET, pBlop, aBlopSize);
++ memcpy(aBuffer.data(), &type, 1);
++ writeUINT32(aBuffer.data() + VALUE_TYPEOFFSET, aBlopSize);
++ memcpy(aBuffer.data() + VALUE_HEADEROFFSET, pBlop, aBlopSize);
+
+ sal_uInt32 rwBytes;
+- if (rTargetValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+aBlopSize, rwBytes))
++ if (rTargetValue.writeAt(0, aBuffer.data(), VALUE_HEADERSIZE+aBlopSize, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+ if (rwBytes != VALUE_HEADERSIZE+aBlopSize)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+-
+- rtl_freeMemory(pBuffer);
+ }
+ return RegError::NO_ERROR;
+ }
+@@ -1325,7 +1297,6 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const
+ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_Int16 nSpc) const
+ {
+ OStoreStream rValue;
+- sal_uInt8* pBuffer;
+ sal_uInt32 valueSize;
+ RegValueType valueType;
+ OUString sFullPath(sPath);
+@@ -1348,33 +1319,29 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ return RegError::VALUE_NOT_EXISTS;
+ }
+
+- pBuffer = static_cast(rtl_allocateMemory(VALUE_HEADERSIZE));
++ std::vector aBuffer(VALUE_HEADERSIZE);
+
+ sal_uInt32 rwBytes;
+- if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes))
++ if (rValue.readAt(0, aBuffer.data(), VALUE_HEADERSIZE, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ if (rwBytes != (VALUE_HEADERSIZE))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+- sal_uInt8 type = *pBuffer;
+- valueType = (RegValueType)type;
+- readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
++ sal_uInt8 type = aBuffer[0];
++ valueType = static_cast(type);
++ readUINT32(aBuffer.data() + VALUE_TYPEOFFSET, valueSize);
+
+- pBuffer = static_cast(rtl_allocateMemory(valueSize));
+- if (rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, rwBytes))
++ aBuffer.resize(valueSize);
++ if (rValue.readAt(VALUE_HEADEROFFSET, aBuffer.data(), valueSize, rwBytes))
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+ if (rwBytes != valueSize)
+ {
+- rtl_freeMemory(pBuffer);
+ return RegError::INVALID_VALUE;
+ }
+
+@@ -1393,14 +1360,14 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ fprintf(stdout, "%s Data = ", indent);
+
+ sal_Int32 value;
+- readINT32(pBuffer, value);
++ readINT32(aBuffer.data(), value);
+ fprintf(stdout, "%ld\n", sal::static_int_cast< long >(value));
+ }
+ break;
+ case RegValueType::STRING:
+ {
+ sal_Char* value = static_cast(rtl_allocateMemory(valueSize));
+- readUtf8(pBuffer, value, valueSize);
++ readUtf8(aBuffer.data(), value, valueSize);
+ fprintf(stdout, "%sValue: Type = RegValueType::STRING\n", indent);
+ fprintf(
+ stdout, "%s Size = %lu\n", indent,
+@@ -1419,7 +1386,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ fprintf(stdout, "%s Data = ", indent);
+
+ std::unique_ptr value(new sal_Unicode[size]);
+- readString(pBuffer, value.get(), size);
++ readString(aBuffer.data(), value.get(), size);
+
+ OString uStr = OUStringToOString(value.get(), RTL_TEXTENCODING_UTF8);
+ fprintf(stdout, "L\"%s\"\n", uStr.getStr());
+@@ -1433,7 +1400,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ sal::static_int_cast< unsigned long >(valueSize));
+ fprintf(stdout, "%s Data = ", indent);
+ dumpType(
+- typereg::Reader(pBuffer, valueSize),
++ typereg::Reader(aBuffer.data(), valueSize),
+ sIndent + " ");
+ }
+ break;
+@@ -1442,7 +1409,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ sal_uInt32 offset = 4; // initial 4 bytes for the size of the array
+ sal_uInt32 len = 0;
+
+- readUINT32(pBuffer, len);
++ readUINT32(aBuffer.data(), len);
+
+ fprintf(stdout, "%sValue: Type = RegValueType::LONGLIST\n", indent);
+ fprintf(
+@@ -1456,7 +1423,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ sal_Int32 longValue;
+ for (sal_uInt32 i=0; i < len; i++)
+ {
+- readINT32(pBuffer+offset, longValue);
++ readINT32(aBuffer.data() + offset, longValue);
+
+ if (offset > 4)
+ fprintf(stdout, "%s ", indent);
+@@ -1475,7 +1442,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ sal_uInt32 sLen = 0;
+ sal_uInt32 len = 0;
+
+- readUINT32(pBuffer, len);
++ readUINT32(aBuffer.data(), len);
+
+ fprintf(stdout, "%sValue: Type = RegValueType::STRINGLIST\n", indent);
+ fprintf(
+@@ -1488,12 +1455,12 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+
+ for (sal_uInt32 i=0; i < len; i++)
+ {
+- readUINT32(pBuffer+offset, sLen);
++ readUINT32(aBuffer.data() + offset, sLen);
+
+ offset += 4; // 4 bytes (sal_uInt32) for the string size
+
+ sal_Char *pValue = static_cast(rtl_allocateMemory(sLen));
+- readUtf8(pBuffer+offset, pValue, sLen);
++ readUtf8(aBuffer.data() + offset, pValue, sLen);
+
+ if (offset > 8)
+ fprintf(stdout, "%s ", indent);
+@@ -1512,7 +1479,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ sal_uInt32 sLen = 0;
+ sal_uInt32 len = 0;
+
+- readUINT32(pBuffer, len);
++ readUINT32(aBuffer.data(), len);
+
+ fprintf(stdout, "%sValue: Type = RegValueType::UNICODELIST\n", indent);
+ fprintf(
+@@ -1526,12 +1493,12 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+ OString uStr;
+ for (sal_uInt32 i=0; i < len; i++)
+ {
+- readUINT32(pBuffer+offset, sLen);
++ readUINT32(aBuffer.data() + offset, sLen);
+
+ offset += 4; // 4 bytes (sal_uInt32) for the string size
+
+ sal_Unicode *pValue = static_cast(rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)));
+- readString(pBuffer+offset, pValue, sLen);
++ readString(aBuffer.data() + offset, pValue, sLen);
+
+ if (offset > 8)
+ fprintf(stdout, "%s ", indent);
+@@ -1552,7 +1519,6 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
+
+ fprintf(stdout, "\n");
+
+- rtl_freeMemory(pBuffer);
+ return RegError::NO_ERROR;
+ }
+
+diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
+index de36b3d26a9c..d2b59dfb2851 100644
+--- a/sal/osl/unx/file.cxx
++++ b/sal/osl/unx/file.cxx
+@@ -1148,10 +1148,10 @@ const off_t MAX_OFF_T = std::numeric_limits< off_t >::max();
+
+ namespace {
+
+-//coverity[result_independent_of_operands]
++// coverity[result_independent_of_operands] - crossplatform requirement
+ template bool exceedsMaxOffT(T n) { return n > MAX_OFF_T; }
+
+-//coverity[result_independent_of_operands]
++// coverity[result_independent_of_operands] - crossplatform requirement
+ template bool exceedsMinOffT(T n)
+ { return n < std::numeric_limits::min(); }
+
+diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
+index e577e89608ba..aae01fd36439 100644
+--- a/sal/osl/unx/pipe.cxx
++++ b/sal/osl/unx/pipe.cxx
+@@ -287,10 +287,11 @@ oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions
+ if (listen(pPipe->m_Socket, 5) < 0)
+ {
+ SAL_WARN("sal.osl.pipe", "listen() failed: " << strerror(errno));
+- // coverity[toctou] cid#1255391 warns about unlink(name) after
+- // stat(name, &status) above, but the intervening call to bind makes
+- // those two clearly unrelated, as it would fail if name existed at
+- // that point in time:
++ // cid#1255391 warns about unlink(name) after stat(name, &status)
++ // above, but the intervening call to bind makes those two clearly
++ // unrelated, as it would fail if name existed at that point in
++ // time:
++ // coverity[toctou] - this is bogus
+ unlink(name); /* remove filesystem entry */
+ close(pPipe->m_Socket);
+ destroyPipeImpl(pPipe);
+diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
+index a3d029e94da2..0671a80d264d 100644
+--- a/sal/osl/unx/profile.cxx
++++ b/sal/osl/unx/profile.cxx
+@@ -181,6 +181,7 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o
+ if (pProfile->m_pFile == nullptr)
+ closeFileImpl(pFile,pProfile->m_Flags);
+
++ // coverity[leaked_storage] - pFile is not leaked
+ return pProfile;
+ }
+
+diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
+index 7c0b6674c23f..106e160f894e 100644
+--- a/sal/osl/w32/file.cxx
++++ b/sal/osl/w32/file.cxx
+@@ -776,7 +776,7 @@ oslFileError SAL_CALL osl_closeFile(oslFileHandle Handle)
+
+ namespace {
+
+-//coverity[result_independent_of_operands]
++// coverity[result_independent_of_operands] - crossplatform requirement
+ template bool exceedsMaxSIZE_T(T n)
+ { return n > std::numeric_limits< SIZE_T >::max(); }
+
+@@ -930,7 +930,7 @@ LONGLONG const g_limit_longlong = std::numeric_limits< LONGLONG >::max();
+
+ namespace {
+
+-//coverity[result_independent_of_operands]
++// coverity[result_independent_of_operands] - crossplatform requirement
+ template bool exceedsMaxLONGLONG(T n)
+ { return n > g_limit_longlong; }
+
+diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
+index 373de6d51ad9..4967fac93293 100644
+--- a/sal/rtl/alloc_arena.cxx
++++ b/sal/rtl/alloc_arena.cxx
+@@ -258,7 +258,7 @@ void rtl_arena_hash_rescale(
+ rtl_arena_segment_type * next = curr->m_fnext;
+ rtl_arena_segment_type ** head;
+
+- // coverity[negative_shift]
++ // coverity[negative_shift] - bogus
+ head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]);
+ curr->m_fnext = (*head);
+ (*head) = curr;
+diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
+index 091a5bf774ee..6ffc506e2a6e 100644
+--- a/sal/rtl/alloc_cache.cxx
++++ b/sal/rtl/alloc_cache.cxx
+@@ -829,7 +829,7 @@ void rtl_cache_deactivate(rtl_cache_type * cache)
+ /* cleanup cpu layer */
+ if ((mag = cache->m_cpu_curr))
+ {
+- // coverity[missing_lock]
++ // coverity[missing_lock] - locking is fine
+ cache->m_cpu_curr = nullptr;
+ rtl_cache_magazine_clear (cache, mag);
+ rtl_cache_free (mag_cache, mag);
+@@ -837,7 +837,7 @@ void rtl_cache_deactivate(rtl_cache_type * cache)
+
+ if ((mag = cache->m_cpu_prev))
+ {
+- // coverity[missing_lock]
++ // coverity[missing_lock] - locking is fine
+ cache->m_cpu_prev = nullptr;
+ rtl_cache_magazine_clear (cache, mag);
+ rtl_cache_free (mag_cache, mag);
+@@ -1279,7 +1279,7 @@ static void rtl_cache_depot_wsupdate(
+ RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
+ }
+ }
+- // coverity[missing_unlock]
++ // coverity[missing_unlock] - locking is fine
+ }
+
+ /**
+diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
+index 39299c79ab26..814ad49e86c3 100644
+--- a/sc/inc/dpobject.hxx
++++ b/sc/inc/dpobject.hxx
+@@ -391,7 +391,7 @@ public:
+ OUString CreateNewName() const;
+
+ void FreeTable(const ScDPObject* pDPObj);
+- SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj);
++ SC_DLLPUBLIC void InsertNewTable(ScDPObject* pDPObj);
+ SC_DLLPUBLIC bool HasTable(const ScDPObject* pDPObj) const;
+
+ SC_DLLPUBLIC SheetCaches& GetSheetCaches();
+diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx
+index 404de5d06c14..dbf991387fef 100644
+--- a/sc/qa/unit/ucalc_pivottable.cxx
++++ b/sc/qa/unit/ucalc_pivottable.cxx
+@@ -221,8 +221,7 @@ void Test::testPivotTable()
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -247,7 +246,7 @@ void Test::testPivotTable()
+ { "Total Result", "50", "57", "23", "130" }
+ };
+
+- bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be only one data cache.", size_t(1), pDPs->GetSheetCaches().size());
+@@ -285,7 +284,7 @@ void Test::testPivotTable()
+ { "Total Result", "50", "57", "23", "130" }
+ };
+
+- bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (from old cache)");
++ bool bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (from old cache)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -322,7 +321,7 @@ void Test::testPivotTable()
+ { "Total Result", "300", "700", "1100", "2100" }
+ };
+
+- bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (refreshed)");
++ bool bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (refreshed)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -351,8 +350,7 @@ void Test::testPivotTable()
+
+ pDPObj = createDPFromRange(
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
+- bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -402,8 +400,7 @@ void Test::testPivotTableLabels()
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -418,7 +415,7 @@ void Test::testPivotTableLabels()
+ { "Total Result", "30", "20", "45", "95" }
+ };
+
+- bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -458,8 +455,7 @@ void Test::testPivotTableDateLabels()
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -476,7 +472,7 @@ void Test::testPivotTableDateLabels()
+ { "Total Result", "30", "20", "45", "95" }
+ };
+
+- bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<5>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -541,8 +537,7 @@ void Test::testPivotTableFilters()
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, true);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -559,7 +554,7 @@ void Test::testPivotTableFilters()
+ { "Sum - Val2", "80" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (unfiltered)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (unfiltered)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -593,7 +588,7 @@ void Test::testPivotTableFilters()
+ { "Sum - Val2", "40" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by page)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by page)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -622,7 +617,7 @@ void Test::testPivotTableFilters()
+ { "Sum - Val2", "20" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by query)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by query)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -645,7 +640,7 @@ void Test::testPivotTableFilters()
+ { "Sum - Val2", "40" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by page)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output (filtered by page)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -701,8 +696,7 @@ void Test::testPivotTableNamedSource()
+ CPPUNIT_ASSERT_MESSAGE("Failed to create a new pivot table object.", pDPObj);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -977,9 +971,7 @@ void Test::testPivotTableDuplicateDataFields()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -997,7 +989,7 @@ void Test::testPivotTableDuplicateDataFields()
+ { "Total Count - Value", nullptr, "10" },
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1021,7 +1013,7 @@ void Test::testPivotTableDuplicateDataFields()
+ { "Total Result", "411", "10" }
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1070,9 +1062,7 @@ void Test::testPivotTableNormalGrouping()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1092,7 +1082,7 @@ void Test::testPivotTableNormalGrouping()
+ { "Total Result", "28" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Initial output without grouping");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Initial output without grouping");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1140,7 +1130,7 @@ void Test::testPivotTableNormalGrouping()
+ { "Total Result", nullptr, "28" }
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "A, B, C grouped by Group1.");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "A, B, C grouped by Group1.");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1177,7 +1167,7 @@ void Test::testPivotTableNormalGrouping()
+ { "Total Result", nullptr, "28" }
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "D, E, F grouped by Group2.");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "D, E, F grouped by Group2.");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1232,9 +1222,7 @@ void Test::testPivotTableNumberGrouping()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1272,7 +1260,7 @@ void Test::testPivotTableNumberGrouping()
+ { "Total Result", "1389" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Order grouped by numbers");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Order grouped by numbers");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1317,9 +1305,7 @@ void Test::testPivotTableDateGrouping()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1389,7 +1375,7 @@ void Test::testPivotTableDateGrouping()
+ { "Total Result", nullptr, nullptr, "36" },
+ };
+
+- bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "Years, quarters and months date groups.");
++ bool bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "Years, quarters and months date groups.");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1417,7 +1403,7 @@ void Test::testPivotTableDateGrouping()
+ { "Total Result", nullptr, nullptr, "10" },
+ };
+
+- bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "Year 2012 data now hidden");
++ bool bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "Year 2012 data now hidden");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1446,7 +1432,7 @@ void Test::testPivotTableDateGrouping()
+ { "Total Result", "36" }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Remove all date grouping.");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Remove all date grouping.");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1490,9 +1476,7 @@ void Test::testPivotTableEmptyRows()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1511,7 +1495,7 @@ void Test::testPivotTableEmptyRows()
+ { "Total Result", "10" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Include empty rows");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Include empty rows");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1533,7 +1517,7 @@ void Test::testPivotTableEmptyRows()
+ { "Total Result", "10" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1559,7 +1543,7 @@ void Test::testPivotTableEmptyRows()
+ { "Total Result", "10" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Ignore empty rows");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1617,9 +1601,7 @@ void Test::testPivotTableTextNumber()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1637,7 +1619,7 @@ void Test::testPivotTableTextNumber()
+ { "Total Result", "10" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Text number field members");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Text number field members");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1662,7 +1644,7 @@ void Test::testPivotTableTextNumber()
+ { "4", nullptr }
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Text number field members");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Text number field members");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1701,9 +1683,7 @@ void Test::testPivotTableCaseInsensitiveStrings()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1718,7 +1698,7 @@ void Test::testPivotTableCaseInsensitiveStrings()
+ { "Total Result", "3" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Case insensitive strings");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Case insensitive strings");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1792,9 +1772,7 @@ void Test::testPivotTableNumStability()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1864,9 +1842,7 @@ void Test::testPivotTableFieldReference()
+ m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -1884,7 +1860,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", "15" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (none)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (none)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1911,7 +1887,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", nullptr },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (difference from)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (difference from)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1931,7 +1907,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", nullptr },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% of)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% of)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1951,7 +1927,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", nullptr },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% difference from)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% difference from)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1971,7 +1947,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", nullptr },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (Running total)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (Running total)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -1991,7 +1967,7 @@ void Test::testPivotTableFieldReference()
+ { "Total Result", "100.00%" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% of column)");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Field reference (% of column)");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -2105,9 +2081,7 @@ void Test::testFuncGETPIVOTDATA()
+ }
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -2122,7 +2096,7 @@ void Test::testFuncGETPIVOTDATA()
+ { "Total Result", "21" },
+ };
+
+- bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Pivot table created for GETPIVOTDATA");
++ bool bSuccess = checkDPTableOutput<2>(m_pDoc, aOutRange, aOutputCheck, "Pivot table created for GETPIVOTDATA");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -2168,8 +2142,7 @@ void Test::testFuncGETPIVOTDATA()
+ pDPObj = createDPFromRange(m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+ }
+
+- bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("InsertNewTable failed", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ aOutRange = refresh(pDPObj);
+
+ {
+@@ -2184,7 +2157,7 @@ void Test::testFuncGETPIVOTDATA()
+ { "Total Count - Value", nullptr, "6" },
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "Pivot table refreshed");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "Pivot table refreshed");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -2264,9 +2237,7 @@ void Test::testFuncGETPIVOTDATALeafAccess()
+ pDPObj = createDPFromRange(m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+-
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new pivot table object into document.", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -2283,7 +2254,7 @@ void Test::testFuncGETPIVOTDATALeafAccess()
+ { "Total Result", nullptr, "10" },
+ };
+
+- bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "Pivot table refreshed");
++ bool bSuccess = checkDPTableOutput<3>(m_pDoc, aOutRange, aOutputCheck, "Pivot table refreshed");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -2361,8 +2332,7 @@ void Test::testPivotTableRepeatItemLabels()
+ m_pDoc, ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0), aFields, nFieldCount, false);
+
+ ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new datapilot object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.",
+ size_t(1), pDPs->GetCount());
+ pDPObj->SetName(pDPs->CreateNewName());
+@@ -2388,7 +2358,7 @@ void Test::testPivotTableRepeatItemLabels()
+ { "Total Result", nullptr, nullptr, "220" }
+ };
+
+- bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
++ bool bSuccess = checkDPTableOutput<4>(m_pDoc, aOutRange, aOutputCheck, "DataPilot table output");
+ CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
+ }
+
+@@ -2442,15 +2412,13 @@ void Test::testPivotTableDPCollection()
+
+ // Add 2 DP objects
+ ScDPObject* pDPObj = createDPFromRange(m_pDoc, aDataRange , aFields, nFieldCount, false);
+- bool bSuccess = pDPs->InsertNewTable(pDPObj);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new DP object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj);
+ pDPObj->SetName("DP1"); // set custom name
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be only one data pilot table.", size_t(1), pDPs->GetCount());
+
+ ScDPObject* pDPObj2 = createDPFromRange(m_pDoc, aDataRange, aFields, nFieldCount, false);
+- bSuccess = pDPs->InsertNewTable(pDPObj2);
+- CPPUNIT_ASSERT_MESSAGE("failed to insert a new DP object into document", bSuccess);
++ pDPs->InsertNewTable(pDPObj2);
+ pDPObj2->SetName("DP2"); // set custom name
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("there should be two DP tables", size_t(2), pDPs->GetCount());
+diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
+index f86a608b156e..1cc9cf20f2ec 100644
+--- a/sc/source/core/data/dpobject.cxx
++++ b/sc/source/core/data/dpobject.cxx
+@@ -3797,7 +3797,7 @@ void ScDPCollection::FreeTable(const ScDPObject* pDPObject)
+ maTables.erase(std::remove_if(maTables.begin(), maTables.end(), funcRemoveCondition), maTables.end());
+ }
+
+-bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
++void ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
+ {
+ const ScRange& rOutRange = pDPObj->GetOutRange();
+ const ScAddress& s = rOutRange.aStart;
+@@ -3805,7 +3805,6 @@ bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj)
+ mpDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), ScMF::DpTable);
+
+ maTables.push_back(std::unique_ptr(pDPObj));
+- return true;
+ }
+
+ bool ScDPCollection::HasTable(const ScDPObject* pDPObj) const
+diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
+index 67fe8aee6c41..1e461fed1ff4 100644
+--- a/sc/source/core/tool/chgtrack.cxx
++++ b/sc/source/core/tool/chgtrack.cxx
+@@ -339,8 +339,11 @@ bool ScChangeAction::IsDeletedIn( const ScChangeAction* p ) const
+ void ScChangeAction::RemoveAllDeletedIn()
+ {
+ //TODO: Not from TopContent, but really this one
+- while ( pLinkDeletedIn )
+- delete pLinkDeletedIn; // Moves up by itself
++ while (pLinkDeletedIn)
++ {
++ // coverity[use_after_free] - Moves up by itself
++ delete pLinkDeletedIn;
++ }
+ }
+
+ bool ScChangeAction::IsDeletedInDelType( ScChangeActionType eDelType ) const
+@@ -399,8 +402,11 @@ void ScChangeAction::SetDeletedIn( ScChangeAction* p )
+
+ void ScChangeAction::RemoveAllDependent()
+ {
+- while ( pLinkDependent )
+- delete pLinkDependent; // Moves up by itself
++ while (pLinkDependent)
++ {
++ // coverity[use_after_free] - Moves up by itself
++ delete pLinkDependent;
++ }
+ }
+
+ DateTime ScChangeAction::GetDateTime() const
+@@ -828,8 +834,11 @@ ScChangeActionDel::ScChangeActionDel(
+ ScChangeActionDel::~ScChangeActionDel()
+ {
+ DeleteCellEntries();
+- while ( pLinkMove )
++ while (pLinkMove)
++ {
++ // coverity[use_after_free] - Moves up by itself
+ delete pLinkMove;
++ }
+ }
+
+ void ScChangeActionDel::AddContent( ScChangeActionContent* pContent )
+@@ -1054,6 +1063,7 @@ void ScChangeActionDel::UndoCutOffMoves()
+ { // Restore cut off Moves; delete Entries/Links
+ while ( pLinkMove )
+ {
++ // coverity[deref_arg] - the call on delete pLinkMove at the block end Moves a new entry into pLinkMode by itself
+ ScChangeActionMove* pMove = pLinkMove->GetMove();
+ short nFrom = pLinkMove->GetCutOffFrom();
+ short nTo = pLinkMove->GetCutOffTo();
+diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
+index 9e9edb77dc7a..58e3bbb69976 100644
+--- a/sc/source/core/tool/compiler.cxx
++++ b/sc/source/core/tool/compiler.cxx
+@@ -5697,6 +5697,7 @@ bool ScCompiler::HandleTableRef()
+ default:
+ ; // nothing
+ }
++ // coverity[copy_paste_error] - this is correct, aStart in both aDBRange uses
+ if (aColRange.aStart.Row() != aDBRange.aStart.Row() || aColRange.aEnd.Row() != aDBRange.aStart.Row())
+ aRange = ScRange( ScAddress::INITIALIZE_INVALID);
+ else
+diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
+index c6d3581ca7a3..27c8804f8961 100644
+--- a/sc/source/filter/xml/xmldpimp.cxx
++++ b/sc/source/filter/xml/xmldpimp.cxx
+@@ -96,7 +96,7 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
+ const rtl::Reference& rAttrList ) :
+ ScXMLImportContext( rImport ),
+ pDoc(GetScImport().GetDocument()),
+- pDPObject(nullptr),
++ pDPSave(new ScDPSaveData()),
+ pDPDimSaveData(nullptr),
+ sDataPilotTableName(),
+ sApplicationData(),
+@@ -194,9 +194,6 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
+ }
+ }
+ }
+-
+- pDPObject = new ScDPObject(pDoc);
+- pDPSave.reset(new ScDPSaveData());
+ }
+
+ ScXMLDataPilotTableContext::~ScXMLDataPilotTableContext()
+@@ -322,7 +319,7 @@ ScDPOutputGeometry::FieldType toFieldType(sheet::DataPilotFieldOrientation nOrie
+
+ }
+
+-void ScXMLDataPilotTableContext::SetButtons()
++void ScXMLDataPilotTableContext::SetButtons(ScDPObject* pDPObject)
+ {
+ ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter);
+ aGeometry.setColumnFieldCount(mnColFieldCount);
+@@ -390,8 +387,7 @@ void ScXMLDataPilotTableContext::SetButtons()
+ }
+ }
+
+- if ( pDPObject )
+- pDPObject->RefreshAfterLoad();
++ pDPObject->RefreshAfterLoad();
+ }
+
+ void ScXMLDataPilotTableContext::SetSelectedPage( const OUString& rDimName, const OUString& rSelected )
+@@ -455,6 +451,7 @@ void SAL_CALL ScXMLDataPilotTableContext::endFastElement( sal_Int32 /*nElement*/
+ if (!bTargetRangeAddress)
+ return;
+
++ ScDPObject* pDPObject(new ScDPObject(pDoc));
+ pDPObject->SetName(sDataPilotTableName);
+ pDPObject->SetTag(sApplicationData);
+ pDPObject->SetOutRange(aTargetRangeAddress);
+@@ -540,13 +537,9 @@ void SAL_CALL ScXMLDataPilotTableContext::endFastElement( sal_Int32 /*nElement*/
+ if ( pDPCollection->GetByName(pDPObject->GetName()) )
+ pDPObject->SetName( OUString() ); // ignore the invalid name, create a new name in AfterXMLLoading
+
+- if (!pDPCollection->InsertNewTable(pDPObject))
+- {
+- OSL_FAIL("cannot insert DPObject");
+- DELETEZ( pDPObject );
+- }
++ pDPCollection->InsertNewTable(pDPObject);
+
+- SetButtons();
++ SetButtons(pDPObject);
+ }
+
+ void ScXMLDataPilotTableContext::SetGrandTotal(
+diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx
+index 9cc139e0f08f..3c9ff0911ce8 100644
+--- a/sc/source/filter/xml/xmldpimp.hxx
++++ b/sc/source/filter/xml/xmldpimp.hxx
+@@ -71,7 +71,6 @@ class ScXMLDataPilotTableContext : public ScXMLImportContext
+ GrandTotalItem();
+ };
+ ScDocument* pDoc;
+- ScDPObject* pDPObject;
+ std::unique_ptr pDPSave;
+ std::unique_ptr pDPDimSaveData;
+ GrandTotalItem maRowGrandTotal;
+@@ -139,7 +138,7 @@ public:
+ void AddDimension(ScDPSaveDimension* pDim);
+ void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim);
+ void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim);
+- void SetButtons();
++ void SetButtons(ScDPObject* pDPObject);
+ void SetSelectedPage( const OUString& rDimName, const OUString& rSelected );
+ };
+
+diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
+index d518ff17c03a..ed6fa69b0d08 100644
+--- a/sc/source/ui/docshell/dbdocfun.cxx
++++ b/sc/source/ui/docshell/dbdocfun.cxx
+@@ -1431,9 +1431,7 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
+ }
+ }
+
+- if (!rDoc.GetDPCollection()->InsertNewTable(pDestObj.release()))
+- // Insertion into collection failed.
+- return false;
++ rDoc.GetDPCollection()->InsertNewTable(pDestObj.release());
+
+ rDestObj.ReloadGroupTableData();
+ rDestObj.SyncAllDimensionMembers();
+diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
+index b7a745a87d98..c84d38cc8c80 100644
+--- a/sc/source/ui/undo/undodat.cxx
++++ b/sc/source/ui/undo/undodat.cxx
+@@ -1442,11 +1442,7 @@ void ScUndoDataPilot::Undo()
+ // re-insert deleted object
+
+ ScDPObject* pDestObj = new ScDPObject(*xOldDPObject);
+- if ( !rDoc.GetDPCollection()->InsertNewTable(pDestObj) )
+- {
+- OSL_FAIL("cannot insert DPObject");
+- DELETEZ( pDestObj );
+- }
++ rDoc.GetDPCollection()->InsertNewTable(pDestObj);
+ }
+
+ if (xNewUndoDoc)
+diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
+index e28704470b4e..8564c988336e 100644
+--- a/sc/source/ui/view/viewdata.cxx
++++ b/sc/source/ui/view/viewdata.cxx
+@@ -176,6 +176,7 @@ ScPositionHelper::getNearestByIndex(index_type nIndex) const
+ }
+
+ auto posLB = std::prev(posUB);
++ // coverity[copy_paste_error] - posUB is correct
+ if (posUB == mData.end())
+ {
+ return *posLB;
+@@ -206,6 +207,7 @@ ScPositionHelper::getNearestByPosition(long nPos) const
+ }
+
+ auto posLB = std::prev(posUB);
++ // coverity[copy_paste_error] - posUB is correct
+ if (posUB == mData.end())
+ {
+ return *posLB;
+diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
+index c00aedf6c607..14bc19266ed2 100644
+--- a/sd/source/ui/animations/CustomAnimationPane.cxx
++++ b/sd/source/ui/animations/CustomAnimationPane.cxx
+@@ -2312,6 +2312,7 @@ void CustomAnimationPane::moveSelection( bool bUp )
+ CustomAnimationEffectPtr pEffect = (*aIter++);
+
+ EffectSequence::iterator aUpEffectPos( pSequence->find( pEffect ) );
++ // coverity[copy_paste_error] - this is correct, checking if it exists
+ if( aUpEffectPos != rEffectSequence.end() )
+ {
+ EffectSequence::iterator aInsertPos( rEffectSequence.erase( aUpEffectPos ) );
+@@ -2342,6 +2343,7 @@ void CustomAnimationPane::moveSelection( bool bUp )
+ CustomAnimationEffectPtr pEffect = (*aIter++);
+
+ EffectSequence::iterator aDownEffectPos( pSequence->find( pEffect ) );
++ // coverity[copy_paste_error] - this is correct, checking if it exists
+ if( aDownEffectPos != rEffectSequence.end() )
+ {
+ EffectSequence::iterator aInsertPos( rEffectSequence.erase( aDownEffectPos ) );
+diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
+index a254bbe4a8b6..737710bcf4b2 100644
+--- a/sd/source/ui/unoidl/unosrch.cxx
++++ b/sd/source/ui/unoidl/unosrch.cxx
+@@ -56,11 +56,10 @@ class SearchContext_impl
+ {
+ uno::Reference< drawing::XShapes > mxShapes;
+ sal_Int32 mnIndex;
+- SearchContext_impl* mpParent;
+
+ public:
+- SearchContext_impl( uno::Reference< drawing::XShapes > const & xShapes, SearchContext_impl* pParent = nullptr )
+- : mxShapes( xShapes ), mnIndex( -1 ), mpParent( pParent ) {}
++ SearchContext_impl(uno::Reference const& xShapes)
++ : mxShapes( xShapes ), mnIndex( -1 ) {}
+
+ uno::Reference< drawing::XShape > firstShape()
+ {
+@@ -78,8 +77,6 @@ public:
+ }
+ return xShape;
+ }
+-
+- SearchContext_impl* getParent() const { return mpParent; }
+ };
+
+ /* ================================================================= */
+@@ -113,7 +110,7 @@ sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< ut
+ uno::Reference< drawing::XShapes > xShapes;
+ uno::Reference< drawing::XShape > xShape;
+
+- SearchContext_impl* pContext = nullptr;
++ std::vector aContexts;
+ if(mpPage)
+ {
+ uno::Reference< drawing::XDrawPage > xPage( mpPage );
+@@ -122,8 +119,8 @@ sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< ut
+
+ if( xShapes.is() && (xShapes->getCount() > 0) )
+ {
+- pContext = new SearchContext_impl( xShapes );
+- xShape = pContext->firstShape();
++ aContexts.push_back(SearchContext_impl(xShapes));
++ xShape = aContexts.back().firstShape();
+ }
+ else
+ {
+@@ -154,34 +151,24 @@ sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< ut
+ uno::Reference< drawing::XShapes > xGroupShape( xShape, uno::UNO_QUERY );
+ if( xGroupShape.is() && ( xGroupShape->getCount() > 0 ) )
+ {
+- pContext = new SearchContext_impl( xGroupShape, pContext );
+- xShape = pContext->firstShape();
++ aContexts.push_back(SearchContext_impl(xGroupShape));
++ xShape = aContexts.back().firstShape();
+ }
+ else
+ {
+- if( pContext )
+- xShape = pContext->nextShape();
++ if (!aContexts.empty())
++ xShape = aContexts.back().nextShape();
+ else
+ xShape = nullptr;
+ }
+
+ // test parent contexts for next shape if none
+ // is found in the current context
+- while( pContext && !xShape.is() )
++ while (!aContexts.empty() && !xShape.is())
+ {
+- if( pContext->getParent() )
+- {
+- SearchContext_impl* pOldContext = pContext;
+- pContext = pContext->getParent();
+- delete pOldContext;
+- xShape = pContext->nextShape();
+- }
+- else
+- {
+- delete pContext;
+- pContext = nullptr;
+- xShape = nullptr;
+- }
++ aContexts.pop_back();
++ if (!aContexts.empty())
++ xShape = aContexts.back().nextShape();
+ }
+ }
+
+@@ -210,7 +197,7 @@ uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape:
+ uno::Reference< drawing::XShapes > xShapes;
+ uno::Reference< drawing::XShape > xShape;
+
+- SearchContext_impl* pContext = nullptr;
++ std::vector aContexts;
+ if(mpPage)
+ {
+ uno::Reference< drawing::XDrawPage > xPage( mpPage );
+@@ -218,8 +205,8 @@ uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape:
+
+ if( xShapes.is() && xShapes->getCount() > 0 )
+ {
+- pContext = new SearchContext_impl( xShapes );
+- xShape = pContext->firstShape();
++ aContexts.push_back(SearchContext_impl(xShapes));
++ xShape = aContexts.back().firstShape();
+ }
+ else
+ {
+@@ -259,34 +246,24 @@ uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape:
+
+ if( xGroupShape.is() && xGroupShape->getCount() > 0 )
+ {
+- pContext = new SearchContext_impl( xGroupShape, pContext );
+- xShape = pContext->firstShape();
++ aContexts.push_back(SearchContext_impl(xGroupShape));
++ xShape = aContexts.back().firstShape();
+ }
+ else
+ {
+- if( pContext )
+- xShape = pContext->nextShape();
++ if (!aContexts.empty())
++ xShape = aContexts.back().nextShape();
+ else
+ xShape = nullptr;
+ }
+
+ // test parent contexts for next shape if none
+ // is found in the current context
+- while( pContext && !xShape.is() )
++ while (!aContexts.empty() && !xShape.is())
+ {
+- if( pContext->getParent() )
+- {
+- SearchContext_impl* pOldContext = pContext;
+- pContext = pContext->getParent();
+- delete pOldContext;
+- xShape = pContext->nextShape();
+- }
+- else
+- {
+- delete pContext;
+- pContext = nullptr;
+- xShape = nullptr;
+- }
++ aContexts.pop_back();
++ if (!aContexts.empty())
++ xShape = aContexts.back().nextShape();
+ }
+ }
+
+diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx
+index 9ee76fd6a2bb..806b0895f2a5 100644
+--- a/sfx2/source/control/itemdel.cxx
++++ b/sfx2/source/control/itemdel.cxx
+@@ -77,7 +77,7 @@ void DeleteItemOnIdle(SfxPoolItem* pItem)
+ DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" );
+ SfxItemDisruptor_Impl *pDesruptor = new SfxItemDisruptor_Impl(pItem);
+ pDesruptor->LaunchDeleteOnIdle();
+- // coverity[leaked_storage] pDesruptor takes care of its own destruction at idle time
++ // coverity[leaked_storage] - pDesruptor takes care of its own destruction at idle time
+ }
+
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/solenv/bin/pack_images.py b/solenv/bin/pack_images.py
+index 0f493c8f3035..384b61db8bc6 100755
+--- a/solenv/bin/pack_images.py
++++ b/solenv/bin/pack_images.py
+@@ -512,7 +512,7 @@ def parse_image_list(imagelist_filenames):
+
+ if line.startswith('%MODULE%'):
+ key = line.replace('%MODULE%/', '')
+- if key in global_image_list:
++ if key in module_image_list:
+ module_image_list[key] += 1
+ else:
+ module_image_list[key] = 0
+diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
+index 7d15d57ed45a..2ee9215524a2 100644
+--- a/soltools/cpp/_unix.c
++++ b/soltools/cpp/_unix.c
+@@ -204,6 +204,7 @@ void
+ error(FATAL, "Can't open output file %s", argv[optind + 1]);
+
+ dup2(fdo, 1);
++ // coverity[leaked_handle] - on purpose
+ }
+ includelist[NINCLUDE - 1].always = 0;
+ includelist[NINCLUDE - 1].file = dp;
+diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c
+index b538c87be22b..7f87ca7e3529 100644
+--- a/soltools/mkdepend/parse.c
++++ b/soltools/mkdepend/parse.c
+@@ -158,6 +158,7 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis
+ break;
+ }
+ }
++ // coverity[leaked_storage] - on purpose
+ return -1;
+ }
+
+diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
+index a4d030631398..4d3ff3006a73 100644
+--- a/svtools/source/svhtml/htmlout.cxx
++++ b/svtools/source/svhtml/htmlout.cxx
+@@ -465,7 +465,7 @@ static OString lcl_ConvertCharToHTML( sal_uInt32 c,
+ // If the character could not be converted to the destination
+ // character set, the UNICODE character is exported as character
+ // entity.
+- // coverity[callee_ptr_arith]
++ // coverity[callee_ptr_arith] - its ok
+ nLen = lcl_FlushContext(rContext, cBuffer, nFlags);
+ sal_Char *pBuffer = cBuffer;
+ while( nLen-- )
+diff --git a/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh
+index b4d10458650a..5f644c6702bb 100755
+--- a/svx/source/gengal/gengal.sh
++++ b/svx/source/gengal/gengal.sh
+@@ -55,8 +55,6 @@ for arg in "$@"
+ do
+ case "$arg" in
+ -env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
+- -v) VERBOSE=true;;
+- --verbose) VERBOSE=true;;
+ esac
+ done
+
+diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
+index e762ab1f5842..68850b179d3f 100644
+--- a/sw/source/core/text/itrform2.cxx
++++ b/sw/source/core/text/itrform2.cxx
+@@ -722,6 +722,8 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
+
+ // Reinit the tab overflow flag after the line
+ rInf.SetTabOverflow( false );
++
++ // coverity[leaked_storage] - ownership is too complicated to hazard a fix, it definitely normally doesn't leak
+ }
+
+ void SwTextFormatter::CalcAdjustLine( SwLineLayout *pCurrent )
+diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
+index bd3693404b76..934676e47033 100644
+--- a/sw/source/ui/index/cnttab.cxx
++++ b/sw/source/ui/index/cnttab.cxx
+@@ -4047,8 +4047,9 @@ bool SwEntryBrowseBox::SaveModified()
+ pController = m_xCheckController.get();
+ bVal = static_cast< ::svt::CheckBoxCellController*>(pController)->GetCheckBox().IsChecked();
+ }
+- AutoMarkEntry* pEntry = (nRow >= m_Entries.size()) ? new AutoMarkEntry
+- : m_Entries[nRow].get();
++ const bool bAddEntry = nRow >= m_Entries.size();
++ std::unique_ptr xNewEntry(bAddEntry ? new AutoMarkEntry : nullptr);
++ AutoMarkEntry* pEntry = bAddEntry ? xNewEntry.get() : m_Entries[nRow].get();
+ switch(nCol)
+ {
+ case ITEM_SEARCH : pEntry->sSearch = sNew; break;
+@@ -4059,9 +4060,9 @@ bool SwEntryBrowseBox::SaveModified()
+ case ITEM_CASE : pEntry->bCase = bVal; break;
+ case ITEM_WORDONLY : pEntry->bWord = bVal; break;
+ }
+- if (nRow >= m_Entries.size())
++ if (bAddEntry)
+ {
+- m_Entries.push_back(std::unique_ptr(pEntry));
++ m_Entries.push_back(std::move(xNewEntry));
+ RowInserted(nRow, 1, true, true);
+ if(nCol < ITEM_WORDONLY)
+ {
+diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx
+index a7eb47fc7a88..eb9462c733f2 100644
+--- a/unoidl/source/legacyprovider.cxx
++++ b/unoidl/source/legacyprovider.cxx
+@@ -259,9 +259,9 @@ rtl::Reference< Entity > readEntity(
+ {
+ sal_uInt16 m
+ = reader.getMethodExceptionCount(k);
+- // coverity[tainted_data] cid#1213376
+- // unhelpfully warns about an untrusted loop
+- // bound here:
++ // cid#1213376 unhelpfully warns about an
++ // untrusted loop bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 l = 0; l != m; ++l) {
+ getExcs.push_back(
+ reader.getMethodExceptionTypeName(k, l).
+@@ -273,9 +273,9 @@ rtl::Reference< Entity > readEntity(
+ {
+ sal_uInt16 m
+ = reader.getMethodExceptionCount(k);
+- // coverity[tainted_data] cid#1213376
+- // unhelpfully warns about an untrusted loop
+- // bound here:
++ // cid#1213376 unhelpfully warns about an
++ // untrusted loop bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 l = 0; l != m; ++l) {
+ setExcs.push_back(
+ reader.getMethodExceptionTypeName(k, l).
+@@ -309,8 +309,9 @@ rtl::Reference< Entity > readEntity(
+ std::vector< InterfaceTypeEntity::Method::Parameter >
+ params;
+ sal_uInt16 m = reader.getMethodParameterCount(j);
+- // coverity[tainted_data] cid#1213376 unhelpfully warns
+- // about an untrusted loop bound here:
++ // cid#1213376 unhelpfully warns about an untrusted loop
++ // bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 k = 0; k != m; ++k) {
+ RTParamMode mode = reader.getMethodParameterFlags(j, k);
+ InterfaceTypeEntity::Method::Parameter::Direction dir;
+@@ -342,8 +343,9 @@ rtl::Reference< Entity > readEntity(
+ }
+ std::vector< OUString > excs;
+ m = reader.getMethodExceptionCount(j);
+- // coverity[tainted_data] cid#1213376 unhelpfully warns
+- // about an untrusted loop bound here:
++ // cid#1213376 unhelpfully warns about an untrusted loop
++ // bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 k = 0; k != m; ++k) {
+ excs.push_back(
+ reader.getMethodExceptionTypeName(j, k).replace(
+@@ -607,8 +609,9 @@ rtl::Reference< Entity > readEntity(
+ SingleInterfaceBasedServiceEntity::Constructor::
+ Parameter > params;
+ sal_uInt16 m = reader.getMethodParameterCount(j);
+- // coverity[tainted_data] cid#1213376 unhelpfully warns
+- // about an untrusted loop bound here:
++ // cid#1213376 unhelpfully warns about an untrusted
++ // loop bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 k = 0; k != m; ++k) {
+ RTParamMode mode
+ = reader.getMethodParameterFlags(j, k);
+@@ -647,8 +650,9 @@ rtl::Reference< Entity > readEntity(
+ }
+ std::vector< OUString > excs;
+ m = reader.getMethodExceptionCount(j);
+- // coverity[tainted_data] cid#1213376 unhelpfully warns
+- // about an untrusted loop bound here:
++ // cid#1213376 unhelpfully warns about an untrusted
++ // loop bound here:
++ // coverity[tainted_data] - trusted data source
+ for (sal_uInt16 k = 0; k != m; ++k) {
+ excs.push_back(
+ reader.getMethodExceptionTypeName(j, k).replace(
+diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx
+index a82471e3b921..c85ad7b72e5f 100644
+--- a/unotest/source/cpp/officeconnection.cxx
++++ b/unotest/source/cpp/officeconnection.cxx
+@@ -78,7 +78,7 @@ void OfficeConnection::setUp() {
+ {
+ envs = &argEnv.pData;
+ }
+- // coverity[callee_ptr_arith]
++ // coverity[callee_ptr_arith] - arith is fine
+ CPPUNIT_ASSERT_EQUAL(
+ osl_Process_E_None,
+ osl_executeProcess(
+diff --git a/vcl/source/bitmap/BitmapScaleConvolution.cxx b/vcl/source/bitmap/BitmapScaleConvolution.cxx
+index 49aed5d5940b..a8b9bc4b2494 100644
+--- a/vcl/source/bitmap/BitmapScaleConvolution.cxx
++++ b/vcl/source/bitmap/BitmapScaleConvolution.cxx
+@@ -36,9 +36,9 @@ void ImplCalculateContributions(
+ const long aSourceSize,
+ const long aDestinationSize,
+ long& aNumberOfContributions,
+- double*& pWeights,
+- long*& pPixels,
+- long*& pCount,
++ std::vector& rWeights,
++ std::vector& rPixels,
++ std::vector& rCounts,
+ const Kernel& aKernel)
+ {
+ const double fSamplingRadius(aKernel.GetWidth());
+@@ -48,9 +48,9 @@ void ImplCalculateContributions(
+
+ aNumberOfContributions = (long(fabs(ceil(fScaledRadius))) * 2) + 1;
+ const long nAllocSize(aDestinationSize * aNumberOfContributions);
+- pWeights = new double[nAllocSize];
+- pPixels = new long[nAllocSize];
+- pCount = new long[aDestinationSize];
++ rWeights.resize(nAllocSize);
++ rPixels.resize(nAllocSize);
++ rCounts.resize(aDestinationSize);
+
+ for(long i(0); i < aDestinationSize; i++)
+ {
+@@ -74,13 +74,13 @@ void ImplCalculateContributions(
+ const long aPixelIndex(MinMax(j, 0, aSourceSize - 1));
+ const long nIndex(aIndex + aCurrentCount);
+
+- pWeights[nIndex] = aWeight;
+- pPixels[nIndex] = aPixelIndex;
++ rWeights[nIndex] = aWeight;
++ rPixels[nIndex] = aPixelIndex;
+
+ aCurrentCount++;
+ }
+
+- pCount[i] = aCurrentCount;
++ rCounts[i] = aCurrentCount;
+ }
+ }
+
+@@ -100,13 +100,13 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+
+ if(pReadAcc)
+ {
+- double* pWeights = nullptr;
+- long* pPixels = nullptr;
+- long* pCount = nullptr;
++ std::vector aWeights;
++ std::vector aPixels;
++ std::vector aCounts;
+ long aNumberOfContributions(0);
+
+ const long nHeight(rSource.GetSizePixel().Height());
+- ImplCalculateContributions(nWidth, nNewWidth, aNumberOfContributions, pWeights, pPixels, pCount, aKernel);
++ ImplCalculateContributions(nWidth, nNewWidth, aNumberOfContributions, aWeights, aPixels, aCounts, aKernel);
+ rTarget = Bitmap(Size(nNewWidth, nHeight), 24);
+ Bitmap::ScopedWriteAccess pWriteAcc(rTarget);
+ bool bResult(nullptr != pWriteAcc);
+@@ -123,21 +123,21 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+ double aValueGreen(0.0);
+ double aValueBlue(0.0);
+
+- for(long j(0); j < pCount[x]; j++)
++ for(long j(0); j < aCounts[x]; j++)
+ {
+ const long aIndex(aBaseIndex + j);
+- const double aWeight(pWeights[aIndex]);
++ const double aWeight(aWeights[aIndex]);
+ BitmapColor aColor;
+
+ aSum += aWeight;
+
+ if(pReadAcc->HasPalette())
+ {
+- aColor = pReadAcc->GetPaletteColor(pReadAcc->GetPixelIndex(y, pPixels[aIndex]));
++ aColor = pReadAcc->GetPaletteColor(pReadAcc->GetPixelIndex(y, aPixels[aIndex]));
+ }
+ else
+ {
+- aColor = pReadAcc->GetPixel(y, pPixels[aIndex]);
++ aColor = pReadAcc->GetPixel(y, aPixels[aIndex]);
+ }
+
+ aValueRed += aWeight * aColor.GetRed();
+@@ -157,9 +157,9 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+ pWriteAcc.reset();
+ }
+
+- delete[] pWeights;
+- delete[] pCount;
+- delete[] pPixels;
++ aWeights.clear();
++ aCounts.clear();
++ aPixels.clear();
+
+ if(bResult)
+ {
+@@ -186,13 +186,13 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+
+ if(pReadAcc)
+ {
+- double* pWeights = nullptr;
+- long* pPixels = nullptr;
+- long* pCount = nullptr;
++ std::vector aWeights;
++ std::vector aPixels;
++ std::vector aCounts;
+ long aNumberOfContributions(0);
+
+ const long nWidth(rSource.GetSizePixel().Width());
+- ImplCalculateContributions(nHeight, nNewHeight, aNumberOfContributions, pWeights, pPixels, pCount, aKernel);
++ ImplCalculateContributions(nHeight, nNewHeight, aNumberOfContributions, aWeights, aPixels, aCounts, aKernel);
+ rTarget = Bitmap(Size(nWidth, nNewHeight), 24);
+ Bitmap::ScopedWriteAccess pWriteAcc(rTarget);
+ bool bResult(nullptr != pWriteAcc);
+@@ -209,21 +209,21 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+ double aValueGreen(0.0);
+ double aValueBlue(0.0);
+
+- for(long j(0); j < pCount[y]; j++)
++ for(long j(0); j < aCounts[y]; j++)
+ {
+ const long aIndex(aBaseIndex + j);
+- const double aWeight(pWeights[aIndex]);
++ const double aWeight(aWeights[aIndex]);
+ BitmapColor aColor;
+
+ aSum += aWeight;
+
+ if(pReadAcc->HasPalette())
+ {
+- aColor = pReadAcc->GetPaletteColor(pReadAcc->GetPixelIndex(pPixels[aIndex], x));
++ aColor = pReadAcc->GetPaletteColor(pReadAcc->GetPixelIndex(aPixels[aIndex], x));
+ }
+ else
+ {
+- aColor = pReadAcc->GetPixel(pPixels[aIndex], x);
++ aColor = pReadAcc->GetPixel(aPixels[aIndex], x);
+ }
+
+ aValueRed += aWeight * aColor.GetRed();
+@@ -248,9 +248,9 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
+ }
+ }
+
+- delete[] pWeights;
+- delete[] pCount;
+- delete[] pPixels;
++ aWeights.clear();
++ aCounts.clear();
++ aPixels.clear();
+
+ if(bResult)
+ {
+diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
+index b509f6059737..70225ce146c9 100644
+--- a/vcl/source/gdi/bitmap3.cxx
++++ b/vcl/source/gdi/bitmap3.cxx
+@@ -2127,7 +2127,9 @@ bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
+ return bRet;
+ }
+
+-bool Bitmap::ImplConvolutionPass(Bitmap& aNewBitmap, BitmapReadAccess const * pReadAcc, int aNumberOfContributions, const double* pWeights, int const * pPixels, const int* pCount)
++bool Bitmap::ImplConvolutionPass(Bitmap& aNewBitmap, BitmapReadAccess const * pReadAcc, int aNumberOfContributions,
++ const std::vector& rWeights, const std::vector& rPixels,
++ const std::vector& rCounts)
+ {
+ if (!pReadAcc)
+ return false;
+@@ -2153,12 +2155,12 @@ bool Bitmap::ImplConvolutionPass(Bitmap& aNewBitmap, BitmapReadAccess const * pR
+ aBaseIndex = nSourceX * aNumberOfContributions;
+ aSum = aValueRed = aValueGreen = aValueBlue = 0.0;
+
+- for (int j = 0; j < pCount[nSourceX]; ++j)
++ for (int j = 0; j < rCounts[nSourceX]; ++j)
+ {
+ aIndex = aBaseIndex + j;
+- aSum += aWeight = pWeights[ aIndex ];
++ aSum += aWeight = rWeights[ aIndex ];
+
+- aColor = pReadAcc->GetColor(nSourceY, pPixels[aIndex]);
++ aColor = pReadAcc->GetColor(nSourceY, rPixels[aIndex]);
+
+ aValueRed += aWeight * aColor.GetRed();
+ aValueGreen += aWeight * aColor.GetGreen();
+diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
+index d5e995770993..28bd9fab7f3f 100644
+--- a/vcl/source/gdi/bitmap4.cxx
++++ b/vcl/source/gdi/bitmap4.cxx
+@@ -1042,10 +1042,10 @@ bool Bitmap::ImplPopArt()
+ return bRet;
+ }
+
+-double* MakeBlurKernel(const double radius, int& rows) {
++std::vector MakeBlurKernel(const double radius, int& rows) {
+ int intRadius = (int) radius + 1.0;
+ rows = intRadius * 2 + 1;
+- double* matrix = new double[rows];
++ std::vector matrix(rows);
+
+ double sigma = radius / 3;
+ double radius2 = radius * radius;
+@@ -1064,11 +1064,12 @@ double* MakeBlurKernel(const double radius, int& rows) {
+ }
+
+ void Bitmap::ImplBlurContributions( const int aSize, const int aNumberOfContributions,
+- const double* pBlurVector, double*& pWeights, int*& pPixels, int*& pCount )
++ const std::vector& rBlurVector,
++ std::vector& rWeights, std::vector& rPixels, std::vector& rCounts)
+ {
+- pWeights = new double[ aSize*aNumberOfContributions ];
+- pPixels = new int[ aSize*aNumberOfContributions ];
+- pCount = new int[ aSize ];
++ rWeights.resize(aSize*aNumberOfContributions);
++ rPixels.resize(aSize*aNumberOfContributions);
++ rCounts.resize(aSize);
+
+ int aLeft, aRight, aCurrentCount, aPixelIndex;
+ double aWeight;
+@@ -1080,7 +1081,7 @@ void Bitmap::ImplBlurContributions( const int aSize, const int aNumberOfContribu
+ aCurrentCount = 0;
+ for ( int j = aLeft; j <= aRight; j++ )
+ {
+- aWeight = pBlurVector[aCurrentCount];
++ aWeight = rBlurVector[aCurrentCount];
+
+ // Mirror edges
+ if (j < 0)
+@@ -1102,12 +1103,12 @@ void Bitmap::ImplBlurContributions( const int aSize, const int aNumberOfContribu
+ aWeight = 0.0;
+ }
+
+- pWeights[ i*aNumberOfContributions + aCurrentCount ] = aWeight;
+- pPixels[ i*aNumberOfContributions + aCurrentCount ] = aPixelIndex;
++ rWeights[ i*aNumberOfContributions + aCurrentCount ] = aWeight;
++ rPixels[ i*aNumberOfContributions + aCurrentCount ] = aPixelIndex;
+
+ aCurrentCount++;
+ }
+- pCount[ i ] = aCurrentCount;
++ rCounts[ i ] = aCurrentCount;
+ }
+ }
+
+@@ -1126,31 +1127,31 @@ bool Bitmap::ImplSeparableBlurFilter(const double radius)
+
+ // Prepare Blur Vector
+ int aNumberOfContributions;
+- double* pBlurVector = MakeBlurKernel(radius, aNumberOfContributions);
++ std::vector aBlurVector(MakeBlurKernel(radius, aNumberOfContributions));
+
+- double* pWeights;
+- int* pPixels;
+- int* pCount;
++ std::vector aWeights;
++ std::vector aPixels;
++ std::vector aCounts;
+
+ // Do horizontal filtering
+- ImplBlurContributions( nWidth, aNumberOfContributions, pBlurVector, pWeights, pPixels, pCount);
++ ImplBlurContributions( nWidth, aNumberOfContributions, aBlurVector, aWeights, aPixels, aCounts);
+
+ ScopedReadAccess pReadAcc(*this);
+
+ // switch coordinates as convolution pass transposes result
+ Bitmap aNewBitmap( Size( nHeight, nWidth ), 24 );
+
+- bool bResult = ImplConvolutionPass( aNewBitmap, pReadAcc.get(), aNumberOfContributions, pWeights, pPixels, pCount );
++ bool bResult = ImplConvolutionPass( aNewBitmap, pReadAcc.get(), aNumberOfContributions, aWeights, aPixels, aCounts );
+
+ // Cleanup
+ pReadAcc.reset();
+- delete[] pWeights;
+- delete[] pPixels;
+- delete[] pCount;
++ aWeights.clear();
++ aPixels.clear();
++ aCounts.clear();
+
+ if ( !bResult )
+ {
+- delete[] pBlurVector;
++ aBlurVector.clear();
+ return bResult;
+ }
+
+@@ -1158,18 +1159,18 @@ bool Bitmap::ImplSeparableBlurFilter(const double radius)
+ ImplAssignWithSize( aNewBitmap );
+
+ // Do vertical filtering
+- ImplBlurContributions(nHeight, aNumberOfContributions, pBlurVector, pWeights, pPixels, pCount );
++ ImplBlurContributions(nHeight, aNumberOfContributions, aBlurVector, aWeights, aPixels, aCounts );
+
+ pReadAcc = ScopedReadAccess(*this);
+ aNewBitmap = Bitmap( Size( nWidth, nHeight ), 24 );
+- bResult = ImplConvolutionPass( aNewBitmap, pReadAcc.get(), aNumberOfContributions, pWeights, pPixels, pCount );
++ bResult = ImplConvolutionPass( aNewBitmap, pReadAcc.get(), aNumberOfContributions, aWeights, aPixels, aCounts );
+
+ // Cleanup
+ pReadAcc.reset();
+- delete[] pWeights;
+- delete[] pCount;
+- delete[] pPixels;
+- delete[] pBlurVector;
++ aWeights.clear();
++ aCounts.clear();
++ aPixels.clear();
++ aBlurVector.clear();
+
+ if ( !bResult )
+ return bResult;
+diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
+index 58711a9d862b..f6eea9242327 100644
+--- a/vcl/source/gdi/pdfwriter_impl.cxx
++++ b/vcl/source/gdi/pdfwriter_impl.cxx
+@@ -6337,6 +6337,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const OUString& rText, bool
+ aTextLineColor = Color( COL_WHITE );
+ if( aOverlineColor == COL_BLACK )
+ aOverlineColor = Color( COL_WHITE );
++ // coverity[copy_paste_error] - aReliefColor depending on aTextColor is correct
+ if( aTextColor == COL_WHITE )
+ aReliefColor = Color( COL_BLACK );
+
+diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
+index a1195dbde18a..b89e7ea4832c 100644
+--- a/vcl/unx/generic/plugadapt/salplug.cxx
++++ b/vcl/unx/generic/plugadapt/salplug.cxx
+@@ -127,6 +127,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals
+ SAL_INFO("vcl.plugadapt", "could not load shared object " << aModule);
+ }
+
++ // coverity[leaked_storage] - this is on purpose
+ return pInst;
+ }
+
+diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
+index cc42aa95552a..6ba529c1428f 100644
+--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py
++++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
+@@ -458,8 +458,9 @@ class TopicsControl(ControlScroller):
+
+ def rowDown(self, guiRow=None, control=None):
+ try:
+- if guiRow is None and control is None:
++ if guiRow is None:
+ guiRow = self.lastFocusRow - self.nscrollvalue
++ if control is None:
+ control = self.lastFocusControl
+ # only perform if this is not the last row.
+ actuallRow = guiRow + self.nscrollvalue
+@@ -490,8 +491,9 @@ class TopicsControl(ControlScroller):
+
+ def rowUp(self, guiRow=None, control=None):
+ try:
+- if guiRow is None and control is None:
++ if guiRow is None:
+ guiRow = self.lastFocusRow - self.nscrollvalue
++ if control is None:
+ control = self.lastFocusControl
+ # only perform if this is not the first row
+ actuallRow = guiRow + self.nscrollvalue
+diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py
+index 3886f1eb1c70..acef6139f737 100644
+--- a/wizards/com/sun/star/wizards/document/OfficeDocument.py
++++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py
+@@ -234,7 +234,6 @@ class OfficeDocument(object):
+ bState = False
+
+ else:
+- xComponent.dispose()
+ bState = True
+
+ return bState
+--
+2.17.1
+
diff --git a/SOURCES/0001-disable-libe-book-support.patch b/SOURCES/0001-disable-libe-book-support.patch
new file mode 100644
index 0000000..dfb95ea
--- /dev/null
+++ b/SOURCES/0001-disable-libe-book-support.patch
@@ -0,0 +1,144 @@
+From 613af296887aede8f5b0fa6f94f7fb2781403ef2 Mon Sep 17 00:00:00 2001
+From: David Tardon
+Date: Thu, 21 Aug 2014 16:10:51 +0200
+Subject: [PATCH] disable libe-book support
+
+Change-Id: Ie915a9bd2acf7f3aeb8b0933252da33c17043bc4
+---
+ configure.ac | 3 ---
+ external/Module_external.mk | 1 -
+ filter/Configuration_filter.mk | 8 --------
+ writerperfect/Library_wpftwriter.mk | 2 --
+ writerperfect/qa/unit/WpftFilterFixture.hxx | 3 ---
+ writerperfect/qa/unit/WpftWriterFilterTest.cxx | 5 -----
+ writerperfect/source/writer/wpftwriter.component | 5 -----
+ 7 files changed, 27 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ac8dbc5..bb08d21 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7696,9 +7696,6 @@ libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.5])
+
+ libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
+
+-libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
+-libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
+-
+ libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
+
+ libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
+diff --git a/external/Module_external.mk b/external/Module_external.mk
+index 590e216..8f19768 100644
+--- a/external/Module_external.mk
++++ b/external/Module_external.mk
+@@ -32,7 +32,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\
+ $(call gb_Helper_optional,CPPUNIT,cppunit) \
+ $(call gb_Helper_optional,CT2N,ct2n) \
+ $(call gb_Helper_optional,CURL,curl) \
+- $(call gb_Helper_optional,EBOOK,libebook) \
+ $(call gb_Helper_optional,EPM,epm) \
+ $(call gb_Helper_optional,EPOXY,epoxy) \
+ $(call gb_Helper_optional,EPUBGEN,libepubgen) \
+diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
+index 7b39020..588fa01 100644
+--- a/filter/Configuration_filter.mk
++++ b/filter/Configuration_filter.mk
+@@ -346,10 +346,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu
+ writer_OOXML \
+ writer_OOXML_Template \
+ writer_layout_dump_xml \
+- writer_BroadBand_eBook \
+- writer_FictionBook_2 \
+- writer_PalmDoc \
+- writer_Plucker_eBook \
+ writer_ApplePages \
+ MWAW_Text_Document \
+ Palm_Text_Document \
+@@ -394,10 +390,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters
+ OOXML_Text \
+ OOXML_Text_Template \
+ writer_layout_dump \
+- BroadBand_eBook \
+- FictionBook_2 \
+- PalmDoc \
+- Plucker_eBook \
+ ApplePages \
+ MWAW_Text_Document \
+ Palm_Text_Document \
+diff --git a/writerperfect/Library_wpftwriter.mk b/writerperfect/Library_wpftwriter.mk
+index bf605e7..54a702e 100644
+--- a/writerperfect/Library_wpftwriter.mk
++++ b/writerperfect/Library_wpftwriter.mk
+@@ -48,7 +48,6 @@ $(eval $(call gb_Library_use_libraries,wpftwriter,\
+ $(eval $(call gb_Library_use_externals,wpftwriter,\
+ abw \
+ boost_headers \
+- ebook \
+ epubgen \
+ etonyek \
+ icu_headers \
+@@ -67,7 +66,6 @@ $(eval $(call gb_Library_use_externals,wpftwriter,\
+
+ $(eval $(call gb_Library_add_exception_objects,wpftwriter,\
+ writerperfect/source/writer/AbiWordImportFilter \
+- writerperfect/source/writer/EBookImportFilter \
+ writerperfect/source/writer/EPUBExportDialog \
+ writerperfect/source/writer/EPUBExportFilter \
+ writerperfect/source/writer/EPUBExportUIComponent \
+diff --git a/writerperfect/qa/unit/WpftFilterFixture.hxx b/writerperfect/qa/unit/WpftFilterFixture.hxx
+index 14ad4ea..63aff41 100644
+--- a/writerperfect/qa/unit/WpftFilterFixture.hxx
++++ b/writerperfect/qa/unit/WpftFilterFixture.hxx
+@@ -27,9 +27,6 @@
+ ((minor) > (req_minor) \
+ || ((minor) == (req_minor) && ((micro) >= (req_micro)))))
+
+-#define REQUIRE_EBOOK_VERSION(major, minor, micro) \
+- REQUIRE_VERSION(EBOOK_VERSION_MAJOR, EBOOK_VERSION_MINOR, EBOOK_VERSION_MICRO, major, minor, micro)
+-
+ #define REQUIRE_ETONYEK_VERSION(major, minor, micro) \
+ REQUIRE_VERSION(ETONYEK_VERSION_MAJOR, ETONYEK_VERSION_MINOR, ETONYEK_VERSION_MICRO, major, minor, micro)
+
+diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+index 515a2b8..3180a99 100644
+--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
++++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+@@ -31,10 +31,6 @@ WpftWriterFilterTest::WpftWriterFilterTest()
+
+ void WpftWriterFilterTest::test()
+ {
+- const writerperfect::test::WpftOptionalMap_t aEBookOptional
+- {
+- {"FictionBook2.fb2.zip", REQUIRE_EBOOK_VERSION(0, 1, 1)},
+- };
+ const writerperfect::test::WpftOptionalMap_t aEtonyekOptional
+ {
+ {"Pages_4.pages", REQUIRE_ETONYEK_VERSION(0, 1, 2)},
+@@ -58,7 +54,6 @@ void WpftWriterFilterTest::test()
+ };
+
+ doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
+- doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/", aEBookOptional);
+ doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/", aWpsOptional);
+ doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/", aMWAWOptional);
+ doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/", aEtonyekOptional);
+diff --git a/writerperfect/source/writer/wpftwriter.component b/writerperfect/source/writer/wpftwriter.component
+index 8ab4366..2720023 100644
+--- a/writerperfect/source/writer/wpftwriter.component
++++ b/writerperfect/source/writer/wpftwriter.component
+@@ -38,11 +38,6 @@
+
+
+
+-
+-
+-
+-
+
+
+--
+2.14.1
+
diff --git a/SOURCES/0001-don-t-suppress-crashes.patch b/SOURCES/0001-don-t-suppress-crashes.patch
new file mode 100644
index 0000000..fcd1f1d
--- /dev/null
+++ b/SOURCES/0001-don-t-suppress-crashes.patch
@@ -0,0 +1,35 @@
+From a0e6d2abeed9d64fe7862a7664ba80a6178bf3f2 Mon Sep 17 00:00:00 2001
+From: David Tardon
+Date: Tue, 8 Nov 2016 11:50:06 +0100
+Subject: [PATCH] don't suppress crashes
+
+An automatic restart after a crash makes the crash invisible to abrt.
+
+Change-Id: I3854e619356049b144b08575879d289a3c12e4c9
+---
+ desktop/source/app/app.cxx | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
+index 53365f4..3a3bac8 100644
+--- a/desktop/source/app/app.cxx
++++ b/desktop/source/app/app.cxx
+@@ -1312,14 +1312,12 @@ void Desktop::Exception(ExceptionCategory nCategory)
+ if( bRestart )
+ {
+ RequestHandler::Disable();
+- if( pSignalHandler )
+- osl_removeSignalHandler( pSignalHandler );
+
+ restartOnMac(false);
+ if ( m_rSplashScreen.is() )
+ m_rSplashScreen->reset();
+
+- _exit( EXITHELPER_CRASH_WITH_RESTART );
++ return;
+ }
+ else
+ {
+--
+2.9.3
+
diff --git a/SOURCES/0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch b/SOURCES/0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch
new file mode 100644
index 0000000..c7aaec8
--- /dev/null
+++ b/SOURCES/0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch
@@ -0,0 +1,74 @@
+From 2b69156c43261ceae55eb4d3b644c4c2d73231ba Mon Sep 17 00:00:00 2001
+Message-Id: <2b69156c43261ceae55eb4d3b644c4c2d73231ba.1531843216.git.erack@redhat.com>
+From: David Tardon
+Date: Tue, 6 Mar 2018 15:17:13 +0100
+Subject: [PATCH] forcepoint: fix out-of-bounds read in ICU
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"
+
+This is a multi-part message in MIME format.
+--------------erAck-patch-parts
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+Change-Id: I5061d38d0e7df0de9a5c7574d522ce69934e4a24
+---
+ external/icu/UnpackedTarball_icu.mk | 1 +
+ external/icu/ofz4860.patch.2 | 25 +++++++++++++++++++++++++
+ 2 files changed, 26 insertions(+)
+ create mode 100644 external/icu/ofz4860.patch.2
+
+
+--------------erAck-patch-parts
+Content-Type: text/x-patch; name="0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-forcepoint-fix-out-of-bounds-read-in-ICU.patch"
+
+diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
+index 499650976a55..a4d0b16ecb36 100644
+--- a/external/icu/UnpackedTarball_icu.mk
++++ b/external/icu/UnpackedTarball_icu.mk
+@@ -35,6 +35,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
+ $(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.patch.1) \
+ external/icu/icu4c-khmerbreakengine.patch.1 \
+ external/icu/icu4c-59-werror-shadow.patch.1 \
++ external/icu/ofz4860.patch.2 \
+ ))
+
+ $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
+diff --git a/external/icu/ofz4860.patch.2 b/external/icu/ofz4860.patch.2
+new file mode 100644
+index 000000000000..14114d52878b
+--- /dev/null
++++ b/external/icu/ofz4860.patch.2
+@@ -0,0 +1,25 @@
++From 529ba01ee606940ca273b187be8ce9ba31cf2d90 Mon Sep 17 00:00:00 2001
++From: David Tardon
++Date: Fri, 19 Jan 2018 10:41:02 +0100
++Subject: [PATCH] ofz#4860 fix past-the-end read from array
++
++---
++ icu4c/source/common/locmap.cpp | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/icu4c/source/common/locmap.cpp b/icu4c/source/common/locmap.cpp
++index cbb2b810a..6d62d8310 100644
++--- a/icu4c/source/common/locmap.cpp
+++++ b/icu4c/source/common/locmap.cpp
++@@ -1015,7 +1015,7 @@ static const char*
++ getPosixID(const ILcidPosixMap *this_0, uint32_t hostID)
++ {
++ uint32_t i;
++- for (i = 0; i <= this_0->numRegions; i++)
+++ for (i = 0; i < this_0->numRegions; i++)
++ {
++ if (this_0->regionMaps[i].hostID == hostID)
++ {
++--
++2.14.3
++
+
+--------------erAck-patch-parts--
+
+
diff --git a/SOURCES/0001-gtk3-only-for-3.20.patch b/SOURCES/0001-gtk3-only-for-3.20.patch
new file mode 100644
index 0000000..f7ef00c
--- /dev/null
+++ b/SOURCES/0001-gtk3-only-for-3.20.patch
@@ -0,0 +1,26 @@
+From cd928ec49d4bcf8f9736c3a07ccd1b3fd5df6ad8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Mon, 25 Sep 2017 11:20:34 +0100
+Subject: [PATCH] gtk3 only for >= 3.20
+
+Change-Id: I98008c0028ed5d85fe8770197078360de70010a8
+---
+ vcl/unx/gtk/gtkinst.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
+index e01a267b..7237b6c 100644
+--- a/vcl/unx/gtk/gtkinst.cxx
++++ b/vcl/unx/gtk/gtkinst.cxx
+@@ -82,7 +82,7 @@ extern "C"
+ XInitThreads();
+
+ #if GTK_CHECK_VERSION(3,0,0)
+- if (gtk_minor_version < 14)
++ if (gtk_minor_version < 20)
+ {
+ g_warning("require a newer gtk than 3.%d for theme expectations", gtk_minor_version);
+ return nullptr;
+--
+2.9.5
+
diff --git a/SOURCES/0001-implement-pdf-export-of-underline-for-outlined-font.patch b/SOURCES/0001-implement-pdf-export-of-underline-for-outlined-font.patch
new file mode 100644
index 0000000..c91806c
--- /dev/null
+++ b/SOURCES/0001-implement-pdf-export-of-underline-for-outlined-font.patch
@@ -0,0 +1,48 @@
+From d01b115cb9db9200900f78d614d220b6bec1eb7d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Fri, 20 Jul 2018 14:49:17 +0100
+Subject: [PATCH] implement pdf export of underline for outlined font
+
+just the simplest case of a straight solid line which is outlined,
+i.e. border in font color and filled with white
+
+Change-Id: I7d670a543475b6457cb2827e74a05bba6c4a91ea
+---
+ vcl/source/gdi/pdfwriter_impl.cxx | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
+index 58711a9d862b..bf932ad17ef8 100644
+--- a/vcl/source/gdi/pdfwriter_impl.cxx
++++ b/vcl/source/gdi/pdfwriter_impl.cxx
+@@ -7384,6 +7384,27 @@ void PDFWriterImpl::drawStraightTextLine( OStringBuffer& aLine, long nWidth, Fon
+ if ( !nLineHeight )
+ return;
+
++ // outline attribute ?
++ if (m_aCurrentPDFState.m_aFont.IsOutline() && eTextLine == LINESTYLE_SINGLE)
++ {
++ appendStrokingColor(aColor, aLine); // stroke with text color
++ aLine.append( " " );
++ Color aNonStrokeColor(COL_WHITE); // fill with white
++ appendNonStrokingColor(aNonStrokeColor, aLine);
++ aLine.append( "\n" );
++ aLine.append( "0.25 w \n" ); // same line thickness as in drawLayout
++
++ // draw rectangle instead
++ aLine.append( "0 " );
++ m_aPages.back().appendMappedLength( static_cast(-nLinePos * 1.5), aLine );
++ aLine.append( " " );
++ m_aPages.back().appendMappedLength( static_cast(nWidth), aLine, false );
++ aLine.append( ' ' );
++ m_aPages.back().appendMappedLength( static_cast(nLineHeight), aLine );
++ aLine.append( " re h B\n" );
++ return;
++ }
++
+ m_aPages.back().appendMappedLength( (sal_Int32)nLineHeight, aLine );
+ aLine.append( " w " );
+ appendStrokingColor( aColor, aLine );
+--
+2.17.0
+
diff --git a/SOURCES/0001-keep-pyuno-script-processing-below-base-uri.patch b/SOURCES/0001-keep-pyuno-script-processing-below-base-uri.patch
new file mode 100644
index 0000000..3cfce72
--- /dev/null
+++ b/SOURCES/0001-keep-pyuno-script-processing-below-base-uri.patch
@@ -0,0 +1,70 @@
+From 14c85889616de301e3a214c49fff2e6da3327d1f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Thu, 18 Oct 2018 20:39:23 +0100
+Subject: [PATCH] keep pyuno script processing below base uri
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7
+Reviewed-on: https://gerrit.libreoffice.org/61970
+Reviewed-by: Stephan Bergmann
+Reviewed-by: Thorsten Behrens
+Reviewed-by: Michael Stahl
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+---
+ scripting/source/pyprov/pythonscript.py | 30 +++++++++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
+index 4803d0bebc23..f5aa2173333a 100644
+--- a/scripting/source/pyprov/pythonscript.py
++++ b/scripting/source/pyprov/pythonscript.py
+@@ -25,6 +25,7 @@ import imp
+ import time
+ import ast
+ import platform
++from com.sun.star.uri.RelativeUriExcessParentSegments import RETAIN
+
+ try:
+ unicode
+@@ -212,8 +213,33 @@ class MyUriHelper:
+
+ def scriptURI2StorageUri( self, scriptURI ):
+ try:
+- myUri = self.m_uriRefFac.parse(scriptURI)
+- ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" )
++ # base path to the python script location
++ sBaseUri = self.m_baseUri + "/"
++ xBaseUri = self.m_uriRefFac.parse(sBaseUri)
++
++ # path to the .py file + "$functionname, arguments, etc
++ xStorageUri = self.m_uriRefFac.parse(scriptURI)
++ sStorageUri = xStorageUri.getName().replace( "|", "/" );
++
++ # path to the .py file, relative to the base
++ sFileUri = sStorageUri[0:sStorageUri.find("$")]
++ xFileUri = self.m_uriRefFac.parse(sFileUri)
++ if not xFileUri:
++ message = "pythonscript: invalid relative uri '" + sFileUri+ "'"
++ log.debug( message )
++ raise RuntimeException( message )
++
++ # absolute path to the .py file
++ xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, True, RETAIN)
++ sAbsScriptUri = xAbsScriptUri.getUriReference()
++
++ # ensure py file is under the base path
++ if not sAbsScriptUri.startswith(sBaseUri):
++ message = "pythonscript: storage uri '" + sAbsScriptUri + "' not in base uri '" + self.m_baseUri + "'"
++ log.debug( message )
++ raise RuntimeException( message )
++
++ ret = sBaseUri + sStorageUri
+ log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
+ return ret
+ except UnoException as e:
+--
+2.20.1
+
diff --git a/SOURCES/0001-request-installation-of-langpack-via-packagekit.patch b/SOURCES/0001-request-installation-of-langpack-via-packagekit.patch
new file mode 100644
index 0000000..f74c057
--- /dev/null
+++ b/SOURCES/0001-request-installation-of-langpack-via-packagekit.patch
@@ -0,0 +1,946 @@
+From 44686bc81055c7bee7f41f9e219c35115ce8119f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?=
+Date: Wed, 20 Dec 2017 15:29:39 +0000
+Subject: [PATCH] request installation of langpack via packagekit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+if ui is set to track the locale automatically and the current locale
+has no match in installed resources but has a match in the list of
+languages that libreoffice was compiled to contain
+
+so e.g. de_AT locale shouldn't trigger the installation of anything if
+langpack-de is already installed and yue_HK shouldn't trigger install
+of anything cause that not supported (at time of writing) for libreoffice
+
+put Fedora/RHEL/Ubuntu naming schemes in here.
+
+I moved the lang code from svl to svtools so I could use the restart dialog
+to prompt to restart after the langpack is installed, but packagekit's blocking
+mode seems to be no longer blocking and control returns immediately which is a
+change since the last time I played with this stuff, so drop the restart thing
+for now. The lack of a blocking modal also makes the "run this on idle when there's
+a toplevel window up and running" a bit futile, but lets keep that for now anyway.
+
+also...
+
+set dbus id for existing DbusSessionHelper users
+
+Change-Id: I64329e21ae79b6607856de9781bee0274b9cb136
+Reviewed-on: https://gerrit.libreoffice.org/46854
+Tested-by: Jenkins
+Reviewed-by: Caolán McNamara
+Tested-by: Caolán McNamara
+(cherry picked from commit 7cf4eeed81fd333c87dedffa792f5d547b7981f0)
+
+Change-Id: Ice731be539850338ccdd8af87839e0b4d83f01e7
+---
+ config_host/config_langs.h.in | 10 ++
+ config_host/config_vendor.h.in | 10 ++
+ configure.ac | 4 +
+ cui/source/options/optgdlg.cxx | 3 +-
+ desktop/source/app/langselect.cxx | 3 +-
+ include/svl/languageoptions.hxx | 3 -
+ include/svtools/langhelp.hxx | 3 +
+ offapi/org/freedesktop/PackageKit/XModify.idl | 22 ++--
+ .../registry/data/org/openoffice/Office/Common.xcu | 3 +
+ .../schema/org/openoffice/Office/Common.xcs | 6 +
+ sfx2/source/appl/appserv.cxx | 3 +-
+ .../sessioninstall/SyncDbusSessionHelper.cxx | 57 +++++----
+ .../sessioninstall/SyncDbusSessionHelper.hxx | 20 ++--
+ svl/source/config/languageoptions.cxx | 33 ------
+ svtools/source/misc/langhelp.cxx | 130 ++++++++++++++++++++-
+ sw/source/uibase/app/apphdl.cxx | 3 +-
+ vcl/inc/unx/fontmanager.hxx | 6 +-
+ vcl/unx/generic/fontmanager/fontconfig.cxx | 93 ++-------------
+ vcl/unx/generic/fontmanager/fontmanager.cxx | 2 -
+ 19 files changed, 235 insertions(+), 179 deletions(-)
+ create mode 100644 config_host/config_langs.h.in
+ create mode 100644 config_host/config_vendor.h.in
+
+diff --git a/config_host/config_langs.h.in b/config_host/config_langs.h.in
+new file mode 100644
+index 0000000..d60a5c1
+--- /dev/null
++++ b/config_host/config_langs.h.in
+@@ -0,0 +1,10 @@
++/* Configuration of restriction on supported ui languages, by the
++ * --with-lang option.
++ */
++
++#ifndef CONFIG_LANGS_H
++#define CONFIG_LANGS_H
++
++#define WITH_LANG ""
++
++#endif
+diff --git a/config_host/config_vendor.h.in b/config_host/config_vendor.h.in
+new file mode 100644
+index 0000000..3260221
+--- /dev/null
++++ b/config_host/config_vendor.h.in
+@@ -0,0 +1,10 @@
++/* Configuration of restriction on supported ui languages, by the
++ * --with-lang option.
++ */
++
++#ifndef CONFIG_VENDOR_H
++#define CONFIG_VENDOR_H
++
++#define OOO_VENDOR ""
++
++#endif
+diff --git a/configure.ac b/configure.ac
+index bbb47e6..55e2aa0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11777,6 +11777,7 @@ if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
+ ALL_LANGS=`echo $ALL_LANGS qtz`
+ fi
+ AC_SUBST(ALL_LANGS)
++AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
+ AC_SUBST(WITH_LANG)
+ AC_SUBST(WITH_LANG_LIST)
+ AC_SUBST(GIT_NEEDED_SUBMODULES)
+@@ -11925,6 +11926,7 @@ else
+ OOO_VENDOR="$with_vendor"
+ AC_MSG_RESULT([$OOO_VENDOR])
+ fi
++AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
+ AC_SUBST(OOO_VENDOR)
+
+ if test "$_os" = "Android" ; then
+@@ -12538,6 +12540,7 @@ AC_CONFIG_HEADERS([config_host/config_gio.h])
+ AC_CONFIG_HEADERS([config_host/config_global.h])
+ AC_CONFIG_HEADERS([config_host/config_gpgme.h])
+ AC_CONFIG_HEADERS([config_host/config_java.h])
++AC_CONFIG_HEADERS([config_host/config_langs.h])
+ AC_CONFIG_HEADERS([config_host/config_lgpl.h])
+ AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
+ AC_CONFIG_HEADERS([config_host/config_locales.h])
+@@ -12549,6 +12552,7 @@ AC_CONFIG_HEADERS([config_host/config_options.h])
+ AC_CONFIG_HEADERS([config_host/config_options_calc.h])
+ AC_CONFIG_HEADERS([config_host/config_test.h])
+ AC_CONFIG_HEADERS([config_host/config_typesizes.h])
++AC_CONFIG_HEADERS([config_host/config_vendor.h])
+ AC_CONFIG_HEADERS([config_host/config_vcl.h])
+ AC_CONFIG_HEADERS([config_host/config_vclplug.h])
+ AC_CONFIG_HEADERS([config_host/config_version.h])
+diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
+index 1c90931..7965179 100644
+--- a/cui/source/options/optgdlg.cxx
++++ b/cui/source/options/optgdlg.cxx
+@@ -21,6 +21,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+ #include
+@@ -1122,7 +1123,7 @@ namespace
+ LanguageTag GetInstalledLocaleForSystemUILanguage()
+ {
+ css::uno::Sequence inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
+- return LanguageTag(getInstalledLocaleForSystemUILanguage(inst)).makeFallback();
++ return LanguageTag(getInstalledLocaleForSystemUILanguage(inst, false)).makeFallback();
+ }
+ }
+
+diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
+index 4ce877a..86ce743 100644
+--- a/desktop/source/app/langselect.cxx
++++ b/desktop/source/app/langselect.cxx
+@@ -37,6 +37,7 @@
+ #include
+ #include
+ #include
++#include
+
+ #include
+
+@@ -103,7 +104,7 @@ bool prepareLocale() {
+ }
+ }
+ if (locale.isEmpty()) {
+- locale = getInstalledLocaleForSystemUILanguage(inst);
++ locale = getInstalledLocaleForSystemUILanguage(inst, true);
+ }
+ if (locale.isEmpty()) {
+ return false;
+diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx
+index f386cb6..6de8eb5 100644
+--- a/include/svl/languageoptions.hxx
++++ b/include/svl/languageoptions.hxx
+@@ -131,9 +131,6 @@ public:
+ bool isCJKKeyboardLayoutInstalled() const;
+ };
+
+-OUString SVL_DLLPUBLIC getInstalledLocaleForLanguage(css::uno::Sequence const & installed, OUString const & locale);
+-OUString SVL_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence const & installed);
+-
+ #endif // INCLUDED_SVL_LANGUAGEOPTIONS_HXX
+
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/include/svtools/langhelp.hxx b/include/svtools/langhelp.hxx
+index a3a84df..db22bb3 100644
+--- a/include/svtools/langhelp.hxx
++++ b/include/svtools/langhelp.hxx
+@@ -22,6 +22,9 @@
+ */
+ SVT_DLLPUBLIC void localizeWebserviceURI( OUString& io_rURI );
+
++OUString SVT_DLLPUBLIC getInstalledLocaleForLanguage(css::uno::Sequence const & installed, OUString const & locale);
++OUString SVT_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence const & installed, bool bRequestInstallIfMissing);
++
+ #endif
+
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/offapi/org/freedesktop/PackageKit/XModify.idl b/offapi/org/freedesktop/PackageKit/XModify.idl
+index a712bb5..69544e9 100644
+--- a/offapi/org/freedesktop/PackageKit/XModify.idl
++++ b/offapi/org/freedesktop/PackageKit/XModify.idl
+@@ -22,7 +22,7 @@ module PackageKit
+ * The interface used for modifying the package database.
+ *
+ * @sa
+- * https://git.gnome.org/browse/gnome-software/tree/src/org.freedesktop.PackageKit.xml
++ * https://git.gnome.org/browse/gnome-software/tree/src/org.freedesktop.PackageKit.Modify2.xml
+ * for documentation of the corresponding D-Bus interface
+ */
+ interface XModify : com::sun::star::uno::XInterface
+@@ -32,70 +32,70 @@ interface XModify : com::sun::star::uno::XInterface
+ * @since LibreOffice 4.0
+ */
+
+- void InstallPackageFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
++ void InstallPackageFiles([in] sequence< string > files, [in] string interaction);
+
+ /**
+ * Installs sequence< string > packages to provide sequence< string > files.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallProvideFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
++ void InstallProvideFiles([in] sequence< string > files, [in] string interaction);
+
+ /**
+ * Installs sequence< string > packages to provide sequence< string > files.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallCatalogs( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
++ void InstallCatalogs([in] sequence< string > files, [in] string interaction);
+
+ /**
+ * Installs sequence< string > packages from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallPackageNames( [in] unsigned long xid, [in] sequence< string > packages, [in] string interaction);
++ void InstallPackageNames([in] sequence< string > packages, [in] string interaction);
+
+ /**
+ * Installs mimetype handlers from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallMimeTypes( [in] unsigned long xid, [in] sequence< string > mimeTypes, [in] string interaction);
++ void InstallMimeTypes([in] sequence< string > mimeTypes, [in] string interaction);
+
+ /**
+ * Installs fontconfig resources ( [in] usually fonts) from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallFontconfigResources( [in] unsigned long xid, [in] sequence< string > resources, [in] string interaction);
++ void InstallFontconfigResources([in] sequence< string > resources, [in] string interaction);
+
+ /**
+ * Installs GStreamer resources ( [in] usually codecs) from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallGStreamerResources( [in] unsigned long xid, [in] sequence< string > resources, [in] string interaction);
++ void InstallGStreamerResources([in] sequence< string > resources, [in] string interaction);
+
+ /**
+ * Installs resources of a given type from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallResources( [in] unsigned long xid, [in] sequence< string > types, [in] sequence< string > resources, [in] string interaction);
++ void InstallResources([in] sequence< string > types, [in] sequence< string > resources, [in] string interaction);
+
+ /**
+ * Removes sequence< string > packages that provide the given local sequence< string > files.
+ * @since LibreOffice 4.0
+ */
+
+- void RemovePackageByFiles( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
++ void RemovePackageByFiles([in] sequence< string > files, [in] string interaction);
+
+ /**
+ * Installs printer drivers from a configured software source.
+ * @since LibreOffice 4.0
+ */
+
+- void InstallPrinterDrivers( [in] unsigned long xid, [in] sequence< string > files, [in] string interaction);
++ void InstallPrinterDrivers([in] sequence< string > files, [in] string interaction);
+ };
+
+ } ; // PackageKit
+diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
+index 6b94ff9..26d1ba0 100644
+--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
++++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
+@@ -535,6 +535,9 @@
+
+ true
+
++
++ true
++
+
+
+
+diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+index f9816fc..2884179 100644
+--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
++++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+@@ -6382,6 +6382,12 @@
+
+ true
+
++
++
++ Specifies if missing langpack installation should be triggered.
++
++ true
++
+
+
+
+diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
+index 1e2a2ec..e48e5aa 100644
+--- a/sfx2/source/appl/appserv.cxx
++++ b/sfx2/source/appl/appserv.cxx
+@@ -59,6 +59,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+ #include
+@@ -196,7 +197,7 @@ namespace
+ using namespace svtools;
+ Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
+ Sequence< OUString > vPackages { "libreoffice-base" };
+- xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, OUString());
++ xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
+ // Ill be back (hopefully)!
+ SolarMutexGuard aGuard;
+ executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_BIBLIOGRAPHY_INSTALL);
+diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+index a1211f7..1938077 100644
+--- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
++++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx
+@@ -18,7 +18,7 @@ using namespace ::com::sun::star::uno;
+
+ namespace
+ {
+- struct GVariantDeleter { void operator()(GVariant* pV) { g_variant_unref(pV); } };
++ struct GVariantDeleter { void operator()(GVariant* pV) { if (pV) g_variant_unref(pV); } };
+ struct GVariantBuilderDeleter { void operator()(GVariantBuilder* pVB) { g_variant_builder_unref(pVB); } };
+ template struct GObjectDeleter { void operator()(T* pO) { g_object_unref(pO); } };
+ class GErrorWrapper
+@@ -55,8 +55,15 @@ namespace
+ return proxy;
+ }
+
++ static GVariant* pk_make_platform_data()
++ {
++ GVariantBuilder builder;
++ g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
++ return g_variant_builder_end(&builder);
++ }
++
+ void request(
+- char const * method, sal_uInt32 xid,
++ char const * method,
+ css::uno::Sequence const & resources,
+ OUString const & interaction)
+ {
+@@ -70,14 +77,14 @@ void request(
+ }
+ auto iactUtf8(OUStringToOString(interaction, RTL_TEXTENCODING_UTF8));
+ std::shared_ptr proxy(
+- lcl_GetPackageKitProxy("Modify"), GObjectDeleter());
++ lcl_GetPackageKitProxy("Modify2"), GObjectDeleter());
+ GErrorWrapper error;
+- g_dbus_proxy_call_sync(
++ std::shared_ptr result(g_dbus_proxy_call_sync(
+ proxy.get(), method,
+ g_variant_new(
+- "(uass)", static_cast(xid), builder.get(),
+- iactUtf8.getStr()),
+- G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef());
++ "(asss@a{sv})", builder.get(), iactUtf8.getStr(),
++ "libreoffice-startcenter.desktop", pk_make_platform_data()),
++ G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error.getRef()), GVariantDeleter());
+ }
+
+ }
+@@ -92,66 +99,66 @@ namespace shell { namespace sessioninstall
+ }
+
+ void SyncDbusSessionHelper::InstallPackageFiles(
+- sal_uInt32 xid, css::uno::Sequence const & files,
++ css::uno::Sequence const & files,
+ OUString const & interaction)
+ {
+- request("InstallPackageFiles", xid, files, interaction);
++ request("InstallPackageFiles", files, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallProvideFiles(
+- sal_uInt32 xid, css::uno::Sequence const & files,
++ css::uno::Sequence const & files,
+ OUString const & interaction)
+ {
+- request("InstallProvideFiles", xid, files, interaction);
++ request("InstallProvideFiles", files, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallCatalogs(
+- sal_uInt32 xid, css::uno::Sequence const & files,
++ css::uno::Sequence const & files,
+ OUString const & interaction)
+ {
+- request("InstallCatalogs", xid, files, interaction);
++ request("InstallCatalogs", files, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallPackageNames(
+- sal_uInt32 xid, css::uno::Sequence const & packages,
++ css::uno::Sequence const & packages,
+ OUString const & interaction)
+ {
+- request("InstallPackageNames", xid, packages, interaction);
++ request("InstallPackageNames", packages, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallMimeTypes(
+- sal_uInt32 xid, css::uno::Sequence const & mimeTypes,
++ css::uno::Sequence const & mimeTypes,
+ OUString const & interaction)
+ {
+- request("InstallMimeTypes", xid, mimeTypes, interaction);
++ request("InstallMimeTypes", mimeTypes, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallFontconfigResources(
+- sal_uInt32 xid, css::uno::Sequence const & resources,
++ css::uno::Sequence const & resources,
+ OUString const & interaction)
+ {
+- request("InstallFontconfigResources", xid, resources, interaction);
++ request("InstallFontconfigResources", resources, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallGStreamerResources(
+- sal_uInt32 xid, css::uno::Sequence const & resources,
++ css::uno::Sequence const & resources,
+ OUString const & interaction)
+ {
+- request("InstallGStreamerResources", xid, resources, interaction);
++ request("InstallGStreamerResources", resources, interaction);
+ }
+
+ void SyncDbusSessionHelper::RemovePackageByFiles(
+- sal_uInt32 xid, css::uno::Sequence const & files,
++ css::uno::Sequence const & files,
+ OUString const & interaction)
+ {
+- request("RemovePackageByFiles", xid, files, interaction);
++ request("RemovePackageByFiles", files, interaction);
+ }
+
+ void SyncDbusSessionHelper::InstallPrinterDrivers(
+- sal_uInt32 xid, css::uno::Sequence const & files,
++ css::uno::Sequence const & files,
+ OUString const & interaction)
+ {
+- request("InstallPrinteDrivers", xid, files, interaction);
++ request("InstallPrinteDrivers", files, interaction);
+ }
+
+ void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled )
+diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
+index 731b649..72b17ba 100644
+--- a/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
++++ b/shell/source/sessioninstall/SyncDbusSessionHelper.hxx
+@@ -23,26 +23,26 @@ namespace shell { namespace sessioninstall
+ SyncDbusSessionHelper(css::uno::Reference< css::uno::XComponentContext> const&);
+
+ // XModify Methods
+- virtual void SAL_CALL InstallPackageFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallPackageFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallProvideFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallProvideFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallCatalogs( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallCatalogs( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallPackageNames( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallPackageNames( const css::uno::Sequence< OUString >& packages, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallMimeTypes( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallMimeTypes( const css::uno::Sequence< OUString >& mimeTypes, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallFontconfigResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallFontconfigResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallGStreamerResources( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallGStreamerResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallResources( ::sal_uInt32 /* xid */, const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
++ virtual void SAL_CALL InstallResources( const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
+ { throw css::uno::RuntimeException(); } // not implemented
+
+- virtual void SAL_CALL RemovePackageByFiles( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
++ virtual void SAL_CALL RemovePackageByFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+
+- virtual void SAL_CALL InstallPrinterDrivers( ::sal_uInt32 xid, const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
++ virtual void SAL_CALL InstallPrinterDrivers( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
+
+ // XQuery Methods
+ virtual void SAL_CALL IsInstalled( const OUString& /* package_name */, const OUString& /* interaction */, sal_Bool& /* installed */ ) override;
+diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
+index 9f9fe45..74af031 100644
+--- a/svl/source/config/languageoptions.cxx
++++ b/svl/source/config/languageoptions.cxx
+@@ -27,7 +27,6 @@
+ #include
+ #include
+ #include
+-#include
+
+ #ifdef _WIN32
+ #if !defined WIN32_LEAN_AND_MEAN
+@@ -256,41 +255,9 @@ bool SvtSystemLanguageOptions::isKeyboardLayoutTypeInstalled(sal_Int16 scriptTyp
+ return isInstalled;
+ }
+
+-
+ bool SvtSystemLanguageOptions::isCJKKeyboardLayoutInstalled() const
+ {
+ return isKeyboardLayoutTypeInstalled(css::i18n::ScriptType::ASIAN);
+ }
+
+-OUString getInstalledLocaleForLanguage(css::uno::Sequence const & installed, OUString const & locale)
+-{
+- if (locale.isEmpty())
+- return OUString(); // do not attempt to resolve anything
+-
+- for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
+- if (installed[i] == locale) {
+- return installed[i];
+- }
+- }
+- std::vector fallbacks(LanguageTag(locale).getFallbackStrings(false));
+- for (OUString & rf : fallbacks) {
+- for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
+- if (installed[i] == rf) {
+- return installed[i];
+- }
+- }
+- }
+- return OUString();
+-}
+-
+-OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence& rLocaleElementNames)
+-{
+- OUString locale = getInstalledLocaleForLanguage(rLocaleElementNames, officecfg::System::L10N::UILocale::get());
+- if (locale.isEmpty())
+- locale = getInstalledLocaleForLanguage(rLocaleElementNames, "en-US");
+- if (locale.isEmpty() && rLocaleElementNames.hasElements())
+- locale = rLocaleElementNames[0];
+- return locale;
+-}
+-
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx
+index 16a3a1d..1e4c5c5 100644
+--- a/svtools/source/misc/langhelp.cxx
++++ b/svtools/source/misc/langhelp.cxx
+@@ -7,12 +7,20 @@
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+-
++#include
++#include
++#include
++#include
++#include
++#include
+ #include
+-
++#include
+ #include
++#include
+ #include
+-#include
++#include
++#include
++#include
+
+ void localizeWebserviceURI( OUString& rURI )
+ {
+@@ -33,4 +41,120 @@ void localizeWebserviceURI( OUString& rURI )
+ rURI += aLang;
+ }
+
++OUString getInstalledLocaleForLanguage(css::uno::Sequence const & installed, OUString const & locale)
++{
++ if (locale.isEmpty())
++ return OUString(); // do not attempt to resolve anything
++
++ for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
++ if (installed[i] == locale) {
++ return installed[i];
++ }
++ }
++ std::vector fallbacks(LanguageTag(locale).getFallbackStrings(false));
++ for (OUString & rf : fallbacks) {
++ for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
++ if (installed[i] == rf) {
++ return installed[i];
++ }
++ }
++ }
++ return OUString();
++}
++
++static std::unique_ptr xLangpackInstaller;
++
++class InstallLangpack : public Idle
++{
++ std::vector m_aPackages;
++public:
++ explicit InstallLangpack(const std::vector& rPackages)
++ : Idle("install langpack")
++ , m_aPackages(rPackages)
++ {
++ SetPriority(TaskPriority::LOWEST);
++ }
++
++ virtual void Invoke() override
++ {
++ vcl::Window* pTopWindow = Application::GetActiveTopWindow();
++ if (!pTopWindow)
++ pTopWindow = Application::GetFirstTopLevelWindow();
++ if (!pTopWindow)
++ {
++ Start();
++ return;
++ }
++ try
++ {
++ using namespace org::freedesktop::PackageKit;
++ css::uno::Reference xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
++ xSyncDbusSessionHelper->InstallPackageNames(comphelper::containerToSequence(m_aPackages), OUString());
++ }
++ catch (const css::uno::Exception& e)
++ {
++ SAL_INFO("svl", "trying to install a LibreOffice langpack, caught " << e);
++ }
++ xLangpackInstaller.reset();
++ }
++};
++
++OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence& rLocaleElementNames, bool bRequestInstallIfMissing)
++{
++ OUString wantedLocale = officecfg::System::L10N::UILocale::get();
++ OUString locale = getInstalledLocaleForLanguage(rLocaleElementNames, wantedLocale);
++ if (bRequestInstallIfMissing && locale.isEmpty() && !wantedLocale.isEmpty() && !Application::IsHeadlessModeEnabled() &&
++ officecfg::Office::Common::PackageKit::EnableLangpackInstallation::get())
++ {
++ LanguageTag aWantedTag(wantedLocale);
++ if (aWantedTag.getLanguage() != "en")
++ {
++ // We try these bases + the exact locale + fallback locale.
++ //
++ // The theory is that we can request a bunch of packages
++ // and it's a success if one of them is available
++ std::vector aPackages;
++ OUString sAvailableLocales(WITH_LANG);
++ std::vector aAvailable;
++ sal_Int32 nIndex = 0;
++ do
++ {
++ aAvailable.emplace_back(sAvailableLocales.getToken(0, ' ', nIndex));
++ }
++ while (nIndex >= 0);
++ OUString install = getInstalledLocaleForLanguage(comphelper::containerToSequence(aAvailable), wantedLocale);
++ if (!install.isEmpty() && install != "en-US")
++ {
++ if (strcmp(OOO_VENDOR, "Red Hat, Inc.") == 0 || strcmp(OOO_VENDOR, "The Fedora Project") == 0)
++ {
++ // langpack is the typical Fedora/RHEL naming convention
++ LanguageType eType = aWantedTag.getLanguageType();
++ if (MsLangId::isSimplifiedChinese(eType))
++ aPackages.emplace_back("libreoffice-langpack-zh-Hans");
++ else if (MsLangId::isTraditionalChinese(eType))
++ aPackages.emplace_back("libreoffice-langpack-zh-Hant");
++ else
++ aPackages.emplace_back("libreoffice-langpack-" + install);
++ }
++ //Debian would be: "The Document Foundation/Debian"
++ else if (strcmp(OOO_VENDOR, "The Document Foundation, Debian and Ubuntu") == 0)
++ {
++ // l10n is the typical Debian/Ubuntu naming convention
++ aPackages.emplace_back("libreoffice-l10n-" + install);
++ }
++ }
++ if (!aPackages.empty())
++ {
++ xLangpackInstaller.reset(new InstallLangpack(aPackages));
++ xLangpackInstaller->Start();
++ }
++ }
++ }
++ if (locale.isEmpty())
++ locale = getInstalledLocaleForLanguage(rLocaleElementNames, "en-US");
++ if (locale.isEmpty() && rLocaleElementNames.hasElements())
++ locale = rLocaleElementNames[0];
++ return locale;
++}
++
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
+index 467112e..6986807 100644
+--- a/sw/source/uibase/app/apphdl.cxx
++++ b/sw/source/uibase/app/apphdl.cxx
+@@ -44,6 +44,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+ #include
+@@ -420,7 +421,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs
+ using namespace svtools;
+ css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
+ const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" };
+- xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, OUString());
++ xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
+ SolarMutexGuard aGuard;
+ executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL);
+ }
+diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
+index 03d033e..14aebde 100644
+--- a/vcl/inc/unx/fontmanager.hxx
++++ b/vcl/inc/unx/fontmanager.hxx
+@@ -192,14 +192,10 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
+ static void addFontconfigDir(const OString& rDirectory);
+
+ std::set m_aPreviousLangSupportRequests;
+-#if ENABLE_GIO
+- std::vector m_aCurrentRequests;
+-#endif
++ std::vector m_aCurrentRequests;
+ Timer m_aFontInstallerTimer;
+
+-#if ENABLE_GIO
+ DECL_LINK( autoInstallFontLangSupport, Timer*, void );
+-#endif
+ PrintFontManager();
+ public:
+ ~PrintFontManager();
+diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
+index 2c16e04..59acfa5 100644
+--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
++++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
+@@ -20,6 +20,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+ #include
+@@ -31,8 +32,8 @@
+ #include
+ #include
+ #include
+-#include
+ #include
++#include
+
+ using namespace psp;
+
+@@ -40,10 +41,6 @@ using namespace psp;
+ #include
+ #include
+
+-#if ENABLE_GIO
+-#include
+-#endif
+-
+ #include
+ #include
+
+@@ -862,96 +859,28 @@ namespace
+ aBuf.append('-').append(pScriptCode);
+ return OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
+ }
+-
+-#if ENABLE_GIO
+- guint get_xid_for_dbus()
+- {
+- // FIXME: Application::GetActiveTopWindow only returns something sensible if LO currently has the focus
+- // (which is not the case when you are trying to debug this...). It should instead return the last active window.
+- const vcl::Window *pTopWindow = Application::IsHeadlessModeEnabled() ? nullptr : Application::GetActiveTopWindow();
+- const SystemEnvData* pEnvData = pTopWindow ? pTopWindow->GetSystemData() : nullptr;
+- return pEnvData ? pEnvData->aWindow : 0;
+- }
+-#endif
+ }
+
+-#if ENABLE_GIO
+ IMPL_LINK_NOARG(PrintFontManager, autoInstallFontLangSupport, Timer *, void)
+ {
+- if (!officecfg::Office::Common::PackageKit::EnableFontInstallation::get())
+- return;
+-
+- guint xid = get_xid_for_dbus();
+-
+- if (!xid)
++ try
+ {
+- SAL_WARN("vcl", "Could not retrieve X Window ID for DBUS");
+- return;
++ using namespace org::freedesktop::PackageKit;
++ css::uno::Reference xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
++ xSyncDbusSessionHelper->InstallFontconfigResources(comphelper::containerToSequence(m_aCurrentRequests), "hide-finished");
+ }
+-
+-
+- GError *error = nullptr;
+- /* get the DBUS session connection */
+- GDBusConnection *session_connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
+- if (error != nullptr)
+- {
+- g_debug ("DBUS cannot connect : %s", error->message);
+- g_error_free (error);
+- return;
+- }
+-
+- /* get the proxy with gnome-session-manager */
+- GDBusProxy *proxy = g_dbus_proxy_new_sync(session_connection,
+- G_DBUS_PROXY_FLAGS_NONE,
+- nullptr, // GDBusInterfaceInfo
+- "org.freedesktop.PackageKit",
+- "/org/freedesktop/PackageKit",
+- "org.freedesktop.PackageKit.Modify",
+- nullptr, // GCancellable
+- &error);
+- if (proxy == nullptr && error != nullptr)
+- {
+- g_debug("Could not get DBUS proxy: org.freedesktop.PackageKit: %s", error->message);
+- g_error_free(error);
+- return;
+- }
+-
+- GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE("as")); // 'as'=array of strings
+- for (std::vector::const_iterator aI = m_aCurrentRequests.begin(); aI != m_aCurrentRequests.end(); ++aI)
+- g_variant_builder_add (builder, "s", aI->getStr());
+-
+- GVariant *res = g_dbus_proxy_call_sync(proxy,
+- "InstallFontconfigResources",
+- // Create a new variant with the following types:
+- // 'u'=guint32 (xid); 'as'=array of strings (builder); 's'=string ("hide-finished")
+- // See also https://people.gnome.org/~ryanl/glib-docs/gvariant-format-strings.html
+- g_variant_new("(uass)", xid, builder, "hide-finished"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1, // Timeout
+- nullptr, // GCancellable
+- &error);
+-
+- if (res == nullptr && error != nullptr)
++ catch (const css::uno::Exception& e)
+ {
++ SAL_INFO("vcl", "InstallFontconfigResources problem, caught " << e);
+ // Disable this method from now on. It's simply not available on some systems
+ // and leads to an error dialog being shown each time this is called tdf#104883
+ std::shared_ptr batch( comphelper::ConfigurationChanges::create() );
+ officecfg::Office::Common::PackageKit::EnableFontInstallation::set(false, batch);
+ batch->commit();
+- g_debug("InstallFontconfigResources problem : %s", error->message);
+- g_error_free(error);
+- }
+- else
+- {
+- g_variant_unref(res);
+ }
+
+- g_variant_builder_unref(builder);
+- g_object_unref(G_OBJECT (proxy));
+-
+ m_aCurrentRequests.clear();
+ }
+-#endif
+
+ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes )
+ {
+@@ -1107,8 +1036,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
+ }
+ }
+ OUString sStillMissing(pRemainingCodes.get(), nRemainingLen);
+-#if ENABLE_GIO
+- if (get_xid_for_dbus())
++ if (!Application::IsHeadlessModeEnabled() && officecfg::Office::Common::PackageKit::EnableFontInstallation::get())
+ {
+ if (sStillMissing == rMissingCodes) //replaced nothing
+ {
+@@ -1127,7 +1055,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
+ if (!sTag.isEmpty() && m_aPreviousLangSupportRequests.find(sTag) == m_aPreviousLangSupportRequests.end())
+ {
+ OString sReq = OString(":lang=") + sTag;
+- m_aCurrentRequests.push_back(sReq);
++ m_aCurrentRequests.push_back(OUString::fromUtf8(sReq));
+ m_aPreviousLangSupportRequests.insert(sTag);
+ }
+ }
+@@ -1138,7 +1066,6 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
+ m_aFontInstallerTimer.Start();
+ }
+ }
+-#endif
+ rMissingCodes = sStillMissing;
+ }
+ }
+diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
+index c956345..d1743dd 100644
+--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
++++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
+@@ -146,10 +146,8 @@ PrintFontManager::PrintFontManager()
+ : m_nNextFontID( 1 )
+ , m_nNextDirAtom( 1 )
+ {
+-#if ENABLE_GIO
+ m_aFontInstallerTimer.SetInvokeHandler(LINK(this, PrintFontManager, autoInstallFontLangSupport));
+ m_aFontInstallerTimer.SetTimeout(5000);
+-#endif
+ }
+
+ PrintFontManager::~PrintFontManager()
+--
+2.9.5
+
diff --git a/SOURCES/0001-tdf-121203-DOCX-import-fix-loss-of-free-form-text-in.patch b/SOURCES/0001-tdf-121203-DOCX-import-fix-loss-of-free-form-text-in.patch
new file mode 100644
index 0000000..7fdfd6b
--- /dev/null
+++ b/SOURCES/0001-tdf-121203-DOCX-import-fix-loss-of-free-form-text-in.patch
@@ -0,0 +1,334 @@
+From 920f64d73cbb1b41f5a9eb26f8069aef45f29ff0 Mon Sep 17 00:00:00 2001
+From: Miklos Vajna
+Date: Mon, 12 Nov 2018 23:01:12 +0100
+Subject: [PATCH] tdf#121203 DOCX import: fix loss of free-form text in date
+ control
+
+Date SDT from DOCX is imported as date control since commit
+3ec2d26dc2017ac4a27483febfc63328632f352d (bnc#779630 initial DOCX import
+of w:sdt's w:date, 2013-04-30).
+
+One detail I missed there is our date control is strict: it doesn't
+allow free-form text. However, DOCX date SDT has an optional ISO date,
+but the actual value can be free-form text. This means that importing
+free-form text without an ISO date is lost on import.
+
+Fix the data loss by restricting the creation of the date control: only
+do this if we recognize the date format or in case we have an ISO date.
+Otherwise just show the free-form text to avoid data loss.
+
+Change-Id: I8125bdc749954a6a1c496de74b6682744adb7680
+Reviewed-on: https://gerrit.libreoffice.org/63311
+Tested-by: Jenkins
+Reviewed-by: Miklos Vajna
+---
+ sw/qa/extras/ooxmlimport/data/tdf121203.docx | Bin 0 -> 12702 bytes
+ writerfilter/source/dmapper/DomainMapper.cxx | 2 +-
+ writerfilter/source/dmapper/SdtHelper.cxx | 44 ++++++++++++++++---
+ writerfilter/source/dmapper/SdtHelper.hxx | 4 ++
+ 4 files changed, 44 insertions(+), 6 deletions(-)
+ create mode 100644 sw/qa/extras/ooxmlimport/data/tdf121203.docx
+
+diff --git a/sw/qa/extras/ooxmlimport/data/tdf121203.docx b/sw/qa/extras/ooxmlimport/data/tdf121203.docx
+new file mode 100644
+index 0000000000000000000000000000000000000000..5aa3b2ed74744972aca0224e6f7c4102aedb7462
+GIT binary patch
+literal 12702
+zcmeHtWmufqvTozJdmtgWTX1)GclY4#?lclyf;$9)y9R<2+;3<0%$b?&+4tW6
+zXE#sxS9E{%QdC#1dTXtcmx6%A1V95|0RR9Q0FE*=z#j|%h=BqCFaWUNn(u6FoQ!Rp
+zbd}xhj2*R^+^nrg^C7`$asl9=`~Um+U+jT~L>ak2A=Hpls%MzG4-m^9ECY$xxmTq!
+zmFMkD?-qxAj7%S{PKhL?%JYgeI$}Swo<58rumw&@rc8nJ(^)Fc$$2nci{}JHM*7Uid32ONtpiPcRfbyT3c1`
+z-X>+Z0_BlwU<1!pLl1U<-Hj({`R8dqjT#50w%fA;kE>s-51ftRu
+zDoJ-f2iSkuZ&o=GQR{ga?NT@jcMaHK$5%Sn>46J>VTlrL#UTIE4zaHFVCraP6r(T{?Pl9f4mw{T5gEX10zUdrYf==#u3xtIdOtgew-{kw>8eS>~sqU0KB|F0ObFc
+zxx{h!O&6eWlm#Uw0w{BJ9gM9UnVEjR{x@U)7pLi8{`IK%Wl0EO#E?^{b^Rf4u4Q=g
+z>BTkiJXi8Vh@iA1FjwTU!lllR0@7CbWu0%Ad!ur58G#uyd?ozQHTvqaxeFP3V(XS}
+z)=iNx^6EpH=>eulViQ1f8{0W%{B?f<VocmMBxR3^yC1+n~VnV)XMRMn1Nti$10tf)R;VN@~;N_HARdG5ffhabs@VUjUP
+z@0|Q9(WcQgt8xiW99{4zMiAwgj>VY`}_an&7e)G5bL-yKZd^-!}Jb`MtGHblqp~ADMkjcoy!!
+z)rq3`gtbwS_e0cDerE7xCH;puid$6F9ZA9dP=~P76{Zglb#@PezpclIA2u>2gcEyC
+zUnZtiPs+0gKUhj`S;>ZfSXh1WNb2~e6NDnDb&dSj7z2P9RJoIxOlUECl`m)wPJ;me
+z&_Gf4Ta5iRx>S_m01znrJDNYA&Ta?*FvxvSJVF|Q;;cwz*k+jpwPTMSat%wOx(PNe
+zkW(~(FbZ47gUKu+K1`lcc-m#P<}^&B3euk-r*CnsJ&jDP$<u`zUrZi=JC-o!f`-PuNu}4LUY*dYO{1$g@kYH&!&D
+zy6?-e7zei88FzTkIFxv>yWlM)xE%w_UGGTL#-l=t(ng2)an!mY=p-H!5z5Y!At?5n
+zKdg#3wEo~zK$|#ji-J5yh5P=kpjk%$0?weW+u!3|gzL-_pM+vN4EqKyH)MjhB)+N1hY`ff}Mj
+zUu;>IRT|E^Fb;cTQ*_)gLiK~q2hFcCG7Au+8`HR8%LzL2AaOg{Ub+)io*!}eH;%;;
+zhS@8tMZxwK(I>jY*9SfgOD-r+v1>F-_5J9%-cr?|AJzHBPN0Smp#;z8``TWemG)R@
+z%ylljL_K_G7B{*lXs-Gl{UZ*^r#9S7xcfkL@R_bLKI(b=d59a9fNSGsd(IcX+1WRL
+zXA~@}?`TV*0f0gR000XVoWDh~lbNx#G4pS)uYazUN9uC6%bb{9C=0HnPPT^BF8DCc
+z5eu~$j4}j$Hlf7k;mHf~`9jkY-ULhAeqg<=`k`10)}i{E{@4pe5A2J)RzzQFfMSaA
+z{c1Y#oC^_Ef|TfY+Yc|qBxM!zCxeJY=w!5VOFB;u$E(EG%vJ8nqHosQBIZ>@3;5tBNHX(Q<4i&dewBk(MssqjJ=P-YLBp^MZJaH
+zAFwiSQPtFrcrC-9xPd#ghX1il?u&fFC8xud0CY`wyvJu#gIoy=)8KAs80Y9%rA1?K
+zB7?bWKe^8zLv}iUp!O$s?I)!MLmve31CwoB7oC5M(*`145SSe0za
+zS1aQ>wR~tJ5(3BDPfHetj*Hy{vHe_oXVDWTO>GAoNJCp6_RgN@t7bzYxpKp%cJz>|
+zh?Y)GXAp)`>yIUG@juU7;CY1vn9<}*)#F}>Fh+dBUEj_}0U#NvO+l8KOAaiA(wuC$
+zQPRvIp7C}U;qmQ^wvde@Na%i1{?vh@goyXL;O5}&rY8H%`$3d!qBpnSZ#R3lVcuxG
+zohY}?4BAy;?s__!93&}tlkIcyV+v>1O?}|yzL&b|@zI?Fb=s6_B9b}h@%m^uvPSUf
+zsZ9*)OvYc#_%?PxBtK&Z_V@x9lTFqB6*Yx@Csr@)*B=q%l!@Hk=~7Tn*%5@7fP8=q9wUjmV#V+X5+_@!sEWQ~i4jdbL
+zsr9!-Vhnb5NWeR@p-73H+lUapzQL8nM3#7qIqmr97Yl!UqIj_2oN^x^C8)a3^qxqX
+zUWT=hf;!zKve6vTCr$M`;^rDWH;@|XkzEIK`zKMlF&Br~qSAkmJwF%jGJ%fU-?asHe_1!H>5OubA{O;RbEa+Uv6|cS^cAn;7G*yzL-dA%DJzSeUEXICBy=rr5f%0@J9rt-)vqFN
+z)8dd{Nwx&_=HpctR-J#jrT3h%I(QdWMTlOZO}wy)C6JlJ0naL0{)N!YQItOYvwB*U
+z)^J#WO-*lQbucemQ!Cmy=KE01ygJTWp2WamgjqcxkcyoHR)Y-qgD&%q!;*PZZqR
+z^{`-taR345J2~E_pON6S$K*q)O=jZYNG7=k3IXE%hFip}8JO?OpG%(92EZQvEj0^RAuVOmv2Y!dmp=%{v?#giOxUnZ5O
+z9^h64DV_s8W!M(lCWk}oS3sw_YZex&0Mq@=&LH|&!dW6P9X;o^uQNFe;fGJ#>
+zVG*AM7RZO^d*YcaTp-WIv+LzZr(S!rM0i`mN0Kp?o2VHo^Dbez3$@k^#iXrV+ctU6
+z(^ef#;I(BvzPl=*ep>a*$n-PEd+t3|OZvIYfzfd-?z64-0TwlO5!w|pvL~49H*{Vm
+zT`v1b&Oz(J<3c)5tNo_H}`rsqD0tOO?*ks-s+o2q#VmozziP
+zulORnCe4rXc^nscTHN9WCK!$umSPy$Ioz&|B6_}XzZt?EOr12^WmflcLLuycT1TXk
+zmcWoc%aYXF&x4^tA-!W1t9ROF1{JP}!>xK45X>&Aoax%9ub^KY@
+z8dR5Umbp>AnSn2)`|d;%FlUrkKBE1`lc(~%D>@Qs`6t3+T
+zOiLe4!^=*~V_p{&k0ZiWtDdE+ksaYTEdQEVu}b&i(Uh&dljba%Sz4SooZ_5+Oe
+z1M&eTe$3Vn#@sS#n&)FLP>mFkP3=(NaVA!PoZzDaIldzQ2Jj4vQtUe{ml>`qW6qfn
+z;ZRC_KAlAOO{_#~3FZ|dbAl42bVAsHH#r{PY#~lH4K49;{9QIVh?JE$?#zps3~oGLT@toJlC`
+z+*DmRjv6o}GbDrHhBe7mxSxq8H&9H|0
+zJuX09$z~jB8CtED447djhTx_U;dph2HabZdh?47xQGg^QT}TsLfgOqVk=}LGIDWa)
+zIzFXG;YD_q{(cug3{0&yEhXwi&6~9iUwTEAn(l4wb@!?FoSPVt+9(Jqk^jnZ|ylzdXGUgsemAK736Dm=9qzVGj9G6oUjKBWd#Jf;n;
+z({}cF8sIvd-cWFM#st{wFCEF(!>klWIfSCLY%0gYXjSg=Blegv4k_H6gjb3E82A>>
+zUeHHItCD*W?uZ-cySsJcGFWSzQD9Z#{OBpIWp{{gV&}+*q~@TOEF21v^sK4%1j@vJ
+z&rzIQY*}zn`&|ioV*Zh%uEqvRe@WA*FWr(5uTh~l+BWzYTACJ<$m^V%NEOe?1MUIl
+zE-nOPMm^FNm2$RA<)k_uqm*eM(|lX*g>*Y0A`8Bhndnr&2NZP&mnqdSA1+3hQ>L-t
+z%7O8If>Ee={$Y@|jF@36UiO$+P9v<*khN5dsae%;0~S3-`D@SS0an_HB#b!)##>~p>Zr62xo_Of
+zv~G>l``^H38KdKWZD%Nu!}t!NvXpV}_O^zu;kXwwY^aAJ0tAJ^7{~M)*m@pZZvAK^1Bk+kaQPZt
+z4R2J!4UcUTmF$Q)01dG=JU3nBR<}_C^z6Sb1oh6!UG7O|Km?^^dyk
+z@!l+Z*nG^C{;FDZ@4>r9X{(hqieJa84)bs>GeG&C*L(fRp!=ILwj
+zH6&TTsI`tFMYbFUt@VT27>q{v&jrVqV+vT`J7LPsid@I%8Bpq!y`^muwhYfDUM|!{
+z)eo$g)ehk7VbH-<--1DR>4=uuZ4yjOAF*Otou&|6&8^wCvsb7+(0FaiV!nPtu@bD+
+z+ng}jO`zZHt}q3QBpxy4=WW$h6;N-!o`OGO(n=;|WKOCLN3MTtLbrLObGt3n4o`!j
+zN8z^0vPUJ8f87rkG;(5v9AP5(I5N9a$DaTtLI6;kW$>yT=QhKjnVqKL^ctOCFT5Fg
+zGKSV=&>9a2z2RyKkA)lB@9}<6eZ9FEAG%d>=3R|1a(*PZ1e^0xzd7YS^0a!9lkg2O7^`@e^
+zd=*8WKq_DOZ6qnEqmc(8h>~YnYwt|vaKB?ql!Iv6PElzO!@8#6Rp_y80=!#(`;*)H
+zVH*8Ml3#PbCM3(!hL+$@(*
+zQG9He{x->rHzgaUt404HF*7nN2AyWd2{%H=>Q-$?qHK6A5fzO`m}4&LGk)`O$EIbe2CmoXqssIj+brGOOtEgv8dAcNA#0pmhX&Z)+2z!hh
+zh0t~w7x-^NZ+{yJYqlGOnvpdyT?5M&QoQT!oyvMZ`BpR_?o)TE_BmHU-KjbKYS&5(
+z=^6-JSms<*erVAg!xmDi>up&O{-`8T0LR}j|1)?P0}8hCzy8QnNXJ&yhbLPcTgc$d
+z++sHhnw_H=$XOdjGzNzN3kLc%*kqqzMMNkm9IjWT_I(6sQ`{hvqAAv3zx))Ca87-O
+z+_s|iKt@_vsI;Sz*72*!|90g(!m{na^=be
+zp%lpR#oE!({=Z>GeSU>)|J`0^*twr}eeWS;Sc8rA*#*Svyia5Y0f&VRpxHv2HM`xs
+z8vr>ivJy#EsRDFo+-~>pUKY-(55CCX-!A)_O#V5WjYf_m*S|iQQs4i*U)OCqwOvK*
+zO%5_1ECU54s^$m;!Il^;3DHXT$=76X;etLoR7H~SK2s%5bU0|TdqiAtC(oS@o#_ZH
+z(e|x{IyvqB%kO3n-`;z~w{k=Jm@vQAS_~ge*d4*wLRGwJji490m)%Fwf~BjzD(ybV
+zMrki)R>Ass^|Fkue2W+6p@*?+?YG+|04YXHQnr#VnE5w|1l~M9A(Az5?CCpOp8qd$6l-E$OoOJ1s
+za-B
+zYTl39+~eabw~?}vW~`|3+%VbrOr&@d(?eN5Hbf3_`8EA`RIg1B;PjLF7qSo1w2xCk
+zS+d(YmX33Q5Dy!DLRRTi=5;nvEN{9=BKPKPX4OjP=%GvLxJNtAIFz9}`Flr?J3IaF
+z1O*_$^sr0k8<(VNt3Dl$Otj1$GZGS5w;&`H&?Gw8jlpmCB6+SVkOM6b9?1!vU-`Wu
+zWM=evXHAXZIrSVG;ZzmEax|m9@DZLLzIdl2*mOt0(@SGQfkR@Lor+SnL@IuFQ9HXh
+z=UBAhey&iEOs@V(_uQw_4SRna&v)zq#6ka^oyt-~2lIhGvE~H;Q2x$Nf9tt3)*Ul`
+zQc~M*&oCi3GqqU*^U|xb>5cPa4IK@#-?EKk4Q0UWNx39m?lr4e$n^BMzLcbrEPYgM
+zyRSYHuUTIkjJr`XX_+3L>a77D$8SRUST`?rM2m^L*k=w&%pJpcDuJDN$~JS|-@EnRsLzDmQePIiCi
+zcDOdki=Q65EYzn_6)tw{c+LDdE&On*FFoMfSHnk4u}&Nq)0C$0i9X(d?zW8VTU))I
+zw?yqJ1htXUHq7-EmCX#*XOm)CsVi-K81A_<9Eh~IVOR_IPT4ynq11{y-}palZS+=o
+zA8sU&a$#AXDwjTnzxvko`I{UX