RepositoryExternal.mk                                                          
    |    6 
 download.lst                                                                   
    |   13 
 external/lcms2/0001-Added-an-extra-check-to-MLU-bounds.patch.1                 
    |   25 
 external/lcms2/0017-Upgrade-Visual-studio-2017-15.8.patch.1                    
    |  172 +++
 external/lcms2/UnpackedTarball_lcms2.mk                                        
    |    2 
 
external/libxml2/0001-Fix-buffer-size-checks-in-xmlSnprintfElementContent.patch.1
  |  116 --
 external/libxml2/0001-Fix-handling-of-parameter-entity-references.patch.1      
    |  287 -----
 external/libxml2/0001-Fix-type-confusion-in-xmlValidateOneNamespace.patch.1    
    |   43 
 
external/libxml2/0001-Increase-buffer-space-for-port-in-HTTP-redirect-supp.patch.1
 |   31 
 external/libxml2/0001-Prevent-unwanted-external-entity-reference.patch.1       
    |   35 
 external/libxml2/ExternalPackage_xml2.mk                                       
    |    2 
 external/libxml2/UnpackedTarball_xml2.mk                                       
    |    6 
 external/libxml2/libxml2-android.patch                                         
    |   14 
 external/libxml2/libxml2-global-symbols.patch                                  
    |    4 
 external/libxml2/libxml2-icu.patch.0                                           
    |   15 
 external/libxml2/libxml2-vc10.patch                                            
    |    2 
 external/libxml2/ubsan.patch.0                                                 
    |   84 -
 external/poppler/ExternalProject_poppler.mk                                    
    |   51 -
 external/poppler/Module_poppler.mk                                             
    |    2 
 external/poppler/StaticLibrary_poppler.mk                                      
    |  140 ++
 external/poppler/UnpackedTarball_poppler.mk                                    
    |   16 
 external/poppler/poppler-c++11.patch.1                                         
    |   31 
 external/poppler/poppler-config.patch.1                                        
    |  484 ++++++++++
 external/poppler/poppler-libjpeg.patch.1                                       
    |   23 
 external/poppler/poppler-mac-fake.patch.1                                      
    |   13 
 external/poppler/poppler-notests.patch.1                                       
    |   11 
 external/poppler/ubsan.patch.0                                                 
    |  228 ----
 
external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
 |   59 +
 external/python3/UnpackedTarball_python3.mk                                    
    |    1 
 include/o3tl/make_unique.hxx                                                   
    |   19 
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx                          
    |   60 -
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx                          
    |   53 -
 sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx                               
    |    6 
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx                             
    |    4 
 34 files changed, 1026 insertions(+), 1032 deletions(-)

New commits:
commit c5e45a3719ec0959cda143131cf7ee850d7b4791
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Jan 14 15:12:24 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    poppler: upgrade to release 0.73.0
    
    Change-Id: If20998f8565b5534a96b3f29ccec572273edca1d
    Reviewed-on: https://gerrit.libreoffice.org/66306
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 0609ea4fc27f34367716bf41c0cdaa7785aed9da)
    Reviewed-on: https://gerrit.libreoffice.org/66369
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit 033ff5b3eb90deaf6fd5eb8a74100233aa5fe772)

diff --git a/download.lst b/download.lst
index f83b97c8e1d3..cc0082bfad21 100644
--- a/download.lst
+++ b/download.lst
@@ -190,8 +190,8 @@ export PIXMAN_SHA256SUM := 
21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export PNG_SHA256SUM := 
b6cec903e74e9fdd7b5bbcde0ab2415dd12f2f9e84d9e4d9ddd2ba26a41623b2
 export PNG_TARBALL := libpng-1.6.28.tar.gz
-export POPPLER_SHA256SUM := 
2c096431adfb74bc2f53be466889b7646e1b599f28fa036094f3f7235cc9eae7
-export POPPLER_TARBALL := poppler-0.66.0.tar.xz
+export POPPLER_SHA256SUM := 
e44b5543903128884ba4538c2a97d3bcc8889e97ffacc4636112101f0238db03
+export POPPLER_TARBALL := poppler-0.73.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 export PYTHON_SHA256SUM := 
6ed87a8b6c758cc3299a8b433e8a9a9122054ad5bc8aad43299cff3a53d8ca44
diff --git a/external/poppler/StaticLibrary_poppler.mk 
b/external/poppler/StaticLibrary_poppler.mk
index fd7f5c467973..17e921cb82d8 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -53,11 +53,8 @@ $(eval $(call 
gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc))
 
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
        UnpackedTarball/poppler/goo/gfile \
-       UnpackedTarball/poppler/goo/gmempp \
-       UnpackedTarball/poppler/goo/GooList \
        UnpackedTarball/poppler/goo/GooTimer \
        UnpackedTarball/poppler/goo/GooString \
-       UnpackedTarball/poppler/goo/gmem \
        UnpackedTarball/poppler/goo/FixedPoint \
        UnpackedTarball/poppler/goo/NetPBMWriter \
        UnpackedTarball/poppler/goo/PNGWriter \
@@ -80,6 +77,7 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,poppler,\
        UnpackedTarball/poppler/poppler/BuiltinFontTables \
        UnpackedTarball/poppler/poppler/CachedFile \
        UnpackedTarball/poppler/poppler/Catalog \
+       UnpackedTarball/poppler/poppler/CertificateInfo \
        UnpackedTarball/poppler/poppler/CharCodeToUnicode \
        UnpackedTarball/poppler/poppler/CMap \
        UnpackedTarball/poppler/poppler/DateInfo \
@@ -114,7 +112,6 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,poppler,\
        UnpackedTarball/poppler/poppler/PDFDoc \
        UnpackedTarball/poppler/poppler/PDFDocEncoding \
        UnpackedTarball/poppler/poppler/PDFDocFactory \
-       UnpackedTarball/poppler/poppler/PopplerCache \
        UnpackedTarball/poppler/poppler/ProfileData \
        UnpackedTarball/poppler/poppler/PreScanOutputDev \
        UnpackedTarball/poppler/poppler/PSTokenizer \
@@ -135,7 +132,6 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,poppler,\
        UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \
        UnpackedTarball/poppler/poppler/Sound \
        UnpackedTarball/poppler/poppler/ViewerPreferences \
-       UnpackedTarball/poppler/poppler/XpdfPluginAPI \
        UnpackedTarball/poppler/poppler/Movie \
        UnpackedTarball/poppler/poppler/Rendition \
        UnpackedTarball/poppler/poppler/DCTStream \
diff --git a/external/poppler/UnpackedTarball_poppler.mk 
b/external/poppler/UnpackedTarball_poppler.mk
index 68fd06d9403b..5b91e1628ba6 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -13,6 +13,17 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler
 
 $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
        external/poppler/poppler-config.patch.1 \
+       external/poppler/poppler-c++11.patch.1 \
 ))
 
+# std::make_unique is only available in C++14
+# use "env -i" to avoid Cygwin "environment is too large for exec"
+# Mac OS X sed says "sed: RE error: illegal byte sequence"; Apple clang should
+# be happy with std::make_unique so just skip it
+ifneq ($(OS_FOR_BUILD),MACOSX)
+$(eval $(call gb_UnpackedTarball_set_post_action,poppler,\
+       env -i PATH="$(PATH)" $(FIND) . -name '*.cc' -exec sed -i -e 
's/std::make_unique/o3tl::make_unique/' {} \\; \
+))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/poppler/poppler-c++11.patch.1 
b/external/poppler/poppler-c++11.patch.1
new file mode 100644
index 000000000000..5a4d1a24e2e2
--- /dev/null
+++ b/external/poppler/poppler-c++11.patch.1
@@ -0,0 +1,31 @@
+remove usage of newfangled C++ that baseline toolchains don't support
+
+--- poppler/goo/gfile.cc.orig  2019-01-16 11:02:21.112911552 +0100
++++ poppler/goo/gfile.cc       2019-01-16 11:01:33.125975178 +0100
+@@ -67,7 +67,7 @@
+ 
+ #ifndef _WIN32
+ 
+-using namespace std::string_literals;
++//using namespace std::string_literals;
+ 
+ namespace {
+ 
+@@ -366,7 +366,7 @@
+   }
+ #else
+   // First try to atomically open the file with CLOEXEC
+-  const std::string modeStr = mode + "e"s;
++  const std::string modeStr = mode + std::string("e");
+   FILE *file = fopen(path, modeStr.c_str());
+   if (file != nullptr)
+     return file;
+--- poppler/goo/gmem.h.orig    2019-01-16 11:25:28.161920038 +0100
++++ poppler/goo/gmem.h 2019-01-16 11:25:53.756882295 +0100
+@@ -177,4 +177,6 @@
+   return std::strncpy(r, s, n);
+ }
+ 
++#include <o3tl/make_unique.hxx>
++
+ #endif // GMEM_H
diff --git a/external/poppler/poppler-config.patch.1 
b/external/poppler/poppler-config.patch.1
index 5328e680e2f2..e312573f1ff3 100644
--- a/external/poppler/poppler-config.patch.1
+++ b/external/poppler/poppler-config.patch.1
@@ -195,7 +195,7 @@ index 0fbd336a..451213f8 100644
 +#define PACKAGE_NAME "poppler"
 +
 +/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "poppler 0.66.0"
++#define PACKAGE_STRING "poppler 0.73.0"
 +
 +/* Define to the one symbol short name of this package. */
 +#define PACKAGE_TARNAME "poppler"
@@ -204,7 +204,7 @@ index 0fbd336a..451213f8 100644
 +#define PACKAGE_URL ""
 +
 +/* Define to the version of this package. */
-+#define PACKAGE_VERSION "0.66.0"
++#define PACKAGE_VERSION "0.73.0"
 +
 +/* Poppler data dir */
 +#define POPPLER_DATADIR "/usr/local/share/poppler"
@@ -228,7 +228,7 @@ index 0fbd336a..451213f8 100644
 +/* #undef USE_FLOAT */
 +
 +/* Version number of package */
-+#define VERSION "0.66.0"
++#define VERSION "0.73.0"
 +
 +#if defined(__APPLE__)
 +#elif defined (_WIN32)
@@ -304,7 +304,7 @@ index 0fbd336a..451213f8 100644
 +
 +/* Defines the poppler version. */
 +#ifndef POPPLER_VERSION
-+#define POPPLER_VERSION "0.66.0"
++#define POPPLER_VERSION "0.73.0"
 +#endif
 +
 +/* Enable multithreading support. */
@@ -466,9 +466,9 @@ index 0fbd336a..451213f8 100644
 +
 +#include "poppler-global.h"
 +
-+#define POPPLER_VERSION "0.66.0"
++#define POPPLER_VERSION "0.73.0"
 +#define POPPLER_VERSION_MAJOR 0
-+#define POPPLER_VERSION_MINOR 66
++#define POPPLER_VERSION_MINOR 73
 +#define POPPLER_VERSION_MICRO 0
 +
 +namespace poppler
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 433c44ac22bb..4b73e9a122e6 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -28,7 +28,9 @@
 # pragma GCC diagnostic ignored "-Wundef"
 # pragma GCC diagnostic ignored "-Wunused-parameter"
 #elif defined _MSC_VER
-#pragma warning(push, 1)
+#pragma warning(push)
+#pragma warning(disable : 4100) // unreferenced formal parameter
+#pragma warning(disable : 4310) // cast truncates constant value
 #endif
 
 #include "GfxState.h"
commit 131882e6615540cd9fa34d5875cba417fecf5c84
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Jul 14 08:52:33 2017 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    Fix o3tl::make_unique
    
    ...after 3f20471490c61b19fe4222f8c40df255051f6e3d "use std::unique_ptr in
    FlatFndBox: and extend o3tl::make_unique to cope with arrays"
    
    Change-Id: I17a07d0be677aa4a5427be4a5c2f05ed8b675726
    (cherry picked from commit 64d06e5f168ec498b2d5dda139263f56dfe9772d)

diff --git a/include/o3tl/make_unique.hxx b/include/o3tl/make_unique.hxx
index 40658f5734d4..555e9ca538b8 100644
--- a/include/o3tl/make_unique.hxx
+++ b/include/o3tl/make_unique.hxx
@@ -23,7 +23,8 @@ namespace o3tl
  * Can be replaced by std::make_unique when we allow C++14.
  */
 template<typename T, typename... Args>
-typename std::unique_ptr<T> make_unique(Args&& ... args)
+typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
+make_unique(Args&& ... args)
 {
     return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
 }
commit 95dedde1fbe7cca86cd02b2d9b6e5375acef50af
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jun 14 15:58:42 2017 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    use std::unique_ptr in FlatFndBox [only make_unique.hxx]
    
    and extend o3tl::make_unique to cope with arrays
    
    Reviewed-on: https://gerrit.libreoffice.org/38794
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 3f20471490c61b19fe4222f8c40df255051f6e3d)
    
    Change-Id: I84caa46ab5060f9777bfe275f229499cb0b407be

diff --git a/include/o3tl/make_unique.hxx b/include/o3tl/make_unique.hxx
index 2be03e9dc9cf..40658f5734d4 100644
--- a/include/o3tl/make_unique.hxx
+++ b/include/o3tl/make_unique.hxx
@@ -12,6 +12,7 @@
 
 #include <memory>
 #include <utility>
+#include <type_traits>
 
 namespace o3tl
 {
@@ -27,6 +28,21 @@ typename std::unique_ptr<T> make_unique(Args&& ... args)
     return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
 }
 
+/**
+ * for arrays
+ */
+template <class T>
+typename std::enable_if
+<
+    std::is_array<T>::value,
+    std::unique_ptr<T>
+>::type
+make_unique(std::size_t n)
+{
+    typedef typename std::remove_extent<T>::type RT;
+    return std::unique_ptr<T>(new RT[n]);
+}
+
 }
 
 #endif
commit 66f87f7bece79a4929e347acbd4eb13efcfe78d5
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Jan 14 15:08:42 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    sdext: fix build with poppler 0.73
    
    ... which has removed Guchar, Gushort, Guint, Gulong...
    
    Change-Id: Ia54ad378031f167f6779f6ffe574b85c1e72f26d
    Reviewed-on: https://gerrit.libreoffice.org/66305
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 50d371ae08c66648d9f32f633b2245e1746e2bb6)
    Reviewed-on: https://gerrit.libreoffice.org/66363
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit b5698ac28a8a79105edf28ffc1db19bbcbecda3a)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index cf58634239b3..18a0f8e8e8ff 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -310,7 +310,7 @@ void writePpm_( OutputBuffer&     o_rOutputBuf,
     o_rOutputBuf.resize(header_size);
 
     // initialize stream
-    Guchar *p;
+    unsigned char *p;
     GfxRGB rgb;
     std::unique_ptr<ImageStream> imgStr(
         new ImageStream(str,
@@ -420,7 +420,7 @@ void writeImage_( OutputBuffer&     o_rOutputBuf,
                 oneColor = { byteToCol( 0xff ), byteToCol( 0xff ), byteToCol( 
0xff ) };
         if( colorMap->getColorSpace()->getMode() == csIndexed || 
colorMap->getColorSpace()->getMode() == csDeviceGray )
         {
-            Guchar nIndex = 0;
+            unsigned char nIndex = 0;
             colorMap->getRGB( &nIndex, &zeroColor );
             nIndex = 1;
             colorMap->getRGB( &nIndex, &oneColor );
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 72abc4132be5..433c44ac22bb 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -289,9 +289,13 @@ extern FILE* g_binary_out;
 
 // note: if you ever change Output_t, please keep in mind that the current code
 // relies on it being of 8 bit size
-typedef Guchar Output_t;
+typedef unsigned char Output_t;
 typedef std::vector< Output_t > OutputBuffer;
 
+#if !POPPLER_CHECK_VERSION(0, 73, 0)
+static_assert(std::is_same<Guchar, unsigned char>::value, "unexpected 
typedef");
+#endif
+
 #endif // INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PDFIOUTDEV_GPL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
index 46185ea08f29..ec5c147797b2 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
@@ -242,7 +242,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
     appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image
 
     // initialize stream
-    Guchar *p, *pm;
+    unsigned char *p, *pm;
     GfxRGB rgb;
     GfxGray alpha;
     ImageStream* imgStr =
@@ -328,7 +328,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
     appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image
 
     // initialize stream
-    Guchar *p;
+    unsigned char *p;
     GfxRGB rgb;
     ImageStream* imgStr =
         new ImageStream(str,
@@ -374,7 +374,7 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
     {
         for( int x = 0; x < maskWidth; ++x )
         {
-            Guchar aPixel = 0;
+            unsigned char aPixel = 0;
             imgStrMask->getPixel( &aPixel );
             int nIndex = (y*height/maskHeight) * (width*4+1) + // mapped line
                          (x*width/maskWidth)*4 + 1  + 3        // mapped column
commit f662f1ba5126d0726d530a4d66fd8f516690e5ac
Author:     Andreas Sturmlechner <ast...@gentoo.org>
AuthorDate: Tue Jan 8 11:24:40 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    Fix build with poppler-0.72
    
    Change-Id: I0664d1b39e97b7555c0a3cba442db52b84f37134
    Reviewed-on: https://gerrit.libreoffice.org/65960
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 65a6c9ae4791188ffcecf489073cf38873ce5e17)
    Reviewed-on: https://gerrit.libreoffice.org/66376
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit a5a188d5bbb99f6e305dad6f81b9e3760aa32676)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 480f88c58150..cf58634239b3 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -574,7 +574,11 @@ void PDFOutDev::processLink(Link* link, Catalog*)
     LinkAction* pAction = link->getAction();
     if (pAction && pAction->getKind() == actionURI)
     {
+#if POPPLER_CHECK_VERSION(0, 72, 0)
+        const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str();
+#else
         const char* pURI = 
static_cast<LinkURI*>(pAction)->getURI()->getCString();
+#endif
 
         std::vector<char> aEsc( lcl_escapeLineFeeds(pURI) );
 
@@ -776,7 +780,11 @@ void PDFOutDev::updateFont(GfxState *state)
 
             aFont = it->second;
 
+#if POPPLER_CHECK_VERSION(0, 72, 0)
+            std::vector<char> aEsc( 
lcl_escapeLineFeeds(aFont.familyName.c_str()) );
+#else
             std::vector<char> aEsc( 
lcl_escapeLineFeeds(aFont.familyName.getCString()) );
+#endif
             printf( " %d %d %d %d %f %d %s",
                     aFont.isEmbedded,
                     aFont.isBold,
commit f38cc8953bd76c925b8d7eb4b160c1a7a1d01447
Author:     Aleksei Nikiforov <darktemp...@basealt.ru>
AuthorDate: Thu Nov 22 17:54:00 2018 +0300
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    Fix build with poppler 0.71
    
    Change-Id: I470ece9dc4766e10e1ccb5e99b25a8d8cc4cbf38
    Reviewed-on: https://gerrit.libreoffice.org/63860
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 8ff41a26caf51544699863c89598d37d93dc1b21)
    Reviewed-on: https://gerrit.libreoffice.org/66375
    Reviewed-by: Aleksei Nikiforov <darktemp...@basealt.ru>
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 704ff8be10ecfb39be064bd08b2f9c11312e3428)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index ee27eb24fd1c..480f88c58150 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -597,7 +597,11 @@ void PDFOutDev::restoreState(GfxState*)
     printf( "restoreState\n" );
 }
 
+#if POPPLER_CHECK_VERSION(0, 71, 0)
+void PDFOutDev::setDefaultCTM(const double *pMat)
+#else
 void PDFOutDev::setDefaultCTM(double *pMat)
+#endif
 {
     assert(pMat);
 
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 70a2660dd63f..72abc4132be5 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -172,7 +172,11 @@ namespace pdfi
         //----- initialization and control
 
         // Set default transform matrix.
+#if POPPLER_CHECK_VERSION(0, 71, 0)
+        virtual void setDefaultCTM(const double *ctm) override;
+#else
         virtual void setDefaultCTM(double *ctm) override;
+#endif
 
         // Start a page.
         virtual void startPage(int pageNum, GfxState *state
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 16db05afe870..cd559cab08ee 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
 
     // read config file
     globalParams = new GlobalParams();
-    globalParams->setErrQuiet(gTrue);
+    globalParams->setErrQuiet(true);
 #if defined(_MSC_VER)
     globalParams->setupBaseFonts(nullptr);
 #endif
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
                 i,
                 PDFI_OUTDEV_RESOLUTION,
                 PDFI_OUTDEV_RESOLUTION,
-                0, gTrue, gTrue, gTrue);
+                0, true, true, true);
         rDoc.processLinks(&aOutDev, i);
     }
 
commit ed8f236f1175877d4f60fa2f871275d05dc8fc07
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Nov 20 08:45:38 2018 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    poppler dropped GBool since 0.71
    
    See 
https://lists.freedesktop.org/archives/libreoffice/2018-November/081410.html
    
    Change-Id: I258e08894486a925bed50a3a4232b6e805af6784
    Reviewed-on: https://gerrit.libreoffice.org/63625
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>
    (cherry picked from commit 5e8bdd9203dd642111c62a6668ee665a20d4ba19)
    Reviewed-on: https://gerrit.libreoffice.org/66374
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit c85bd2c443b9a509b028a90ee9e766929e63089f)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index dd26f2da3961..ee27eb24fd1c 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -533,7 +533,7 @@ void PDFOutDev::printPath( GfxPath* pPath )
 PDFOutDev::PDFOutDev( PDFDoc* pDoc ) :
     m_pDoc( pDoc ),
     m_aFontMap(),
-    m_pUtf8Map( new UnicodeMap("UTF-8", gTrue, &mapUTF8) ),
+    m_pUtf8Map( new UnicodeMap("UTF-8", true, &mapUTF8) ),
     m_bSkipImages(false)
 {
 }
@@ -958,11 +958,11 @@ void PDFOutDev::endTextObject(GfxState*)
 }
 
 void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
-                              int width, int height, GBool invert,
+                              int width, int height, poppler_bool invert,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                              GBool /*interpolate*/,
+                              poppler_bool /*interpolate*/,
 #endif
-                              GBool /*inlineImg*/ )
+                              poppler_bool /*inlineImg*/ )
 {
     if (m_bSkipImages)
         return;
@@ -991,9 +991,9 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, 
Stream* str,
 void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
                           int width, int height, GfxImageColorMap* colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                          GBool /*interpolate*/,
+                          poppler_bool /*interpolate*/,
 #endif
-                          int* maskColors, GBool /*inlineImg*/ )
+                          int* maskColors, poppler_bool /*inlineImg*/ )
 {
     if (m_bSkipImages)
         return;
@@ -1042,13 +1042,13 @@ void PDFOutDev::drawMaskedImage(GfxState*, Object*, 
Stream* str,
                                 int width, int height,
                                 GfxImageColorMap* colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                GBool /*interpolate*/,
+                                poppler_bool /*interpolate*/,
 #endif
                                 Stream* maskStr,
                                 int maskWidth, int maskHeight,
-                                GBool maskInvert
+                                poppler_bool maskInvert
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                , GBool /*maskInterpolate*/
+                                , poppler_bool /*maskInterpolate*/
 #endif
                                )
 {
@@ -1064,13 +1064,13 @@ void PDFOutDev::drawSoftMaskedImage(GfxState*, Object*, 
Stream* str,
                                     int width, int height,
                                     GfxImageColorMap* colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                    GBool /*interpolate*/,
+                                    poppler_bool /*interpolate*/,
 #endif
                                     Stream* maskStr,
                                     int maskWidth, int maskHeight,
                                     GfxImageColorMap* maskColorMap
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                    , GBool /*maskInterpolate*/
+                                    , poppler_bool /*maskInterpolate*/
 #endif
                                    )
 {
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 1ffe4207b1ee..70a2660dd63f 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -129,6 +129,13 @@ namespace pdfi
         { return const_cast<GooString &>(familyName); }
     };
 
+    // Versions before 0.15 defined GBool as int; 0.15 redefined it as bool; 
0.71 dropped GBool
+#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR < 71
+    typedef GBool poppler_bool;
+#else
+    typedef bool poppler_bool;
+#endif
+
     class PDFOutDev : public OutputDev
     {
         // not owned by this class
@@ -150,17 +157,17 @@ namespace pdfi
 
         // Does this device use upside-down coordinates?
         // (Upside-down means (0,0) is the top left corner of the page.)
-        virtual GBool upsideDown() override { return gTrue; }
+        virtual poppler_bool upsideDown() override { return true; }
 
         // Does this device use drawChar() or drawString()?
-        virtual GBool useDrawChar() override { return gTrue; }
+        virtual poppler_bool useDrawChar() override { return true; }
 
         // Does this device use beginType3Char/endType3Char?  Otherwise,
         // text in Type 3 fonts will be drawn with drawChar/drawString.
-        virtual GBool interpretType3Chars() override { return gFalse; }
+        virtual poppler_bool interpretType3Chars() override { return false; }
 
         // Does this device need non-text content?
-        virtual GBool needNonText() override { return gTrue; }
+        virtual poppler_bool needNonText() override { return true; }
 
         //----- initialization and control
 
@@ -232,40 +239,40 @@ namespace pdfi
 
         //----- image drawing
         virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
-                                   int width, int height, GBool invert,
+                                   int width, int height, poppler_bool invert,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                   GBool interpolate,
+                                   poppler_bool interpolate,
 #endif
-                                   GBool inlineImg) override;
+                                   poppler_bool inlineImg) override;
         virtual void drawImage(GfxState *state, Object *ref, Stream *str,
                                int width, int height, GfxImageColorMap 
*colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                               GBool interpolate,
+                               poppler_bool interpolate,
 #endif
-                               int *maskColors, GBool inlineImg) override;
+                               int *maskColors, poppler_bool inlineImg) 
override;
         virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
                                      int width, int height,
                                      GfxImageColorMap *colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                     GBool interpolate,
+                                     poppler_bool interpolate,
 #endif
                                      Stream *maskStr, int maskWidth, int 
maskHeight,
-                                     GBool maskInvert
+                                     poppler_bool maskInvert
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                     , GBool maskInterpolate
+                                     , poppler_bool maskInterpolate
 #endif
                                     ) override;
         virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream 
*str,
                                          int width, int height,
                                          GfxImageColorMap *colorMap,
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                         GBool interpolate,
+                                         poppler_bool interpolate,
 #endif
                                          Stream *maskStr,
                                          int maskWidth, int maskHeight,
                                          GfxImageColorMap *maskColorMap
 #if POPPLER_CHECK_VERSION(0, 12, 0)
-                                         , GBool maskInterpolate
+                                         , poppler_bool maskInterpolate
 #endif
                                         ) override;
 
commit c3fcd6c81b9335c985cd61f546ef3b76ba30d92a
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Jun 25 11:30:09 2018 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:26 2019 +0100

    poppler: fix incorrect GCC_VERSION check
    
    The minor version is encoded into the last 2 digits, the micro version
    is not avialable.
    
    Change-Id: I4eee40511d732ec8cfc8d85943b965bb6e06d66e
    Reviewed-on: https://gerrit.libreoffice.org/56380
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Tested-by: Jenkins
    (cherry picked from commit 16b10d9ac976d40daffee1d15456016f4a89cd2e)

diff --git a/external/poppler/StaticLibrary_poppler.mk 
b/external/poppler/StaticLibrary_poppler.mk
index da85aff3f710..fd7f5c467973 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -34,11 +34,12 @@ $(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
 endif
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58864
+# can't easily check for 4.8.2 exactly so just apply to GCC 4.8.x
 ifeq ($(COM),GCC)
 ifeq ($(COM_IS_CLANG),)
 ifeq ($(CPUNAME),INTEL)
-ifeq ($(shell expr '$(GCC_VERSION)' '<' 483),1)
-ifeq ($(shell expr '$(GCC_VERSION)' '>=' 480),1)
+ifeq ($(shell expr '$(GCC_VERSION)' '<' 409),1)
+ifeq ($(shell expr '$(GCC_VERSION)' '>=' 408),1)
 $(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
        -march=i586 \
 ))
commit 96349e8d3f75c1b46744cc615b4cecd28d6e58eb
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Fri Jun 22 10:44:02 2018 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:25 2019 +0100

    poppler: try to work around GCC 4.8.2 bug
    
    As seen on Linux-rpm_deb-x86@71-TDF:
    
    poppler/Annot.cc:2491:1: internal compiler error: in connect_traces, at 
dwarf2cfi.c:2676
    
    The bug report claims that -march=i586 works around the bug.
    
    Change-Id: I1d97d2df9049e058d49987424cc8e4818a9fa9c6
    (cherry picked from commit 1c7921c43960a4a6717c816d646cf0f65fbaec12)
    Reviewed-on: https://gerrit.libreoffice.org/56292
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit dce6401f7e1f466c30996ad606699479713209e5)

diff --git a/external/poppler/StaticLibrary_poppler.mk 
b/external/poppler/StaticLibrary_poppler.mk
index bb5f51b571ca..da85aff3f710 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -33,6 +33,21 @@ $(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
 ))
 endif
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58864
+ifeq ($(COM),GCC)
+ifeq ($(COM_IS_CLANG),)
+ifeq ($(CPUNAME),INTEL)
+ifeq ($(shell expr '$(GCC_VERSION)' '<' 483),1)
+ifeq ($(shell expr '$(GCC_VERSION)' '>=' 480),1)
+$(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
+       -march=i586 \
+))
+endif
+endif
+endif
+endif
+endif
+
 $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc))
 
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
commit 807c43374cdc8a622a193ff799328a4ff9fe8483
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Wed Jun 20 16:10:44 2018 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:25 2019 +0100

    poppler: upgrade to release 0.66.0
    
    Unfortunately the autotools build system was removed in 0.60.0, and the
    CMake one is a bit overeager in linking against system libraries that
    happen to be installed on the build machine, and we currently don't
    require CMake anyway, so avoid the problems by using a gbuild makefile
    and a patch to add the generated header files.
    
    Remove all current patches:
    
    poppler-notests.patch.1: obsolete (autotools build system)
    
    poppler-mac-fake.patch.1: presumed obsolete
    
    ubsan.patch.0: presumably fixed differently upstream in
    
https://cgit.freedesktop.org/poppler/poppler/commit/?id=f43cb73939f85952d83afc87a6dc638dc1ae311b
    
    poppler-libjpeg.patch.1: obsolete (autotools build system; there appears
    to be no way to do this with CMake?)
    
    0001-Fix-building-with-old-clang.patch.1: merged upstream
    
    Change-Id: I271c87ab3ec25cc9d1e8fafb04dae7c004acc350
    Reviewed-on: https://gerrit.libreoffice.org/56166
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 67e5355a8b0d51111934e0a0c30870b053c8e0d3)
    Reviewed-on: https://gerrit.libreoffice.org/56235
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>
    (cherry picked from commit b893993869e720bbc078324c201ad9a3be8c0749)

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 8ce8555a7233..a02b399679ff 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2707,11 +2707,7 @@ $(call gb_LinkTarget_set_include,$(1),\
        $$(INCLUDE) \
 )
 
-$(call gb_LinkTarget_add_libs,$(1),\
-       $(call 
gb_UnpackedTarball_get_dir,poppler)/fofi/.libs/libfofi$(gb_StaticLibrary_PLAINEXT)
 \
-       $(call 
gb_UnpackedTarball_get_dir,poppler)/goo/.libs/libgoo$(gb_StaticLibrary_PLAINEXT)
 \
-       $(call 
gb_UnpackedTarball_get_dir,poppler)/poppler/.libs/libpoppler$(gb_StaticLibrary_PLAINEXT)
 \
-)
+$(call gb_LinkTarget_use_static_libraries,$(1),poppler)
 
 $(call gb_LinkTarget_use_external,$(1),jpeg)
 
diff --git a/download.lst b/download.lst
index 3f746a81f4b0..f83b97c8e1d3 100644
--- a/download.lst
+++ b/download.lst
@@ -190,8 +190,8 @@ export PIXMAN_SHA256SUM := 
21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export PNG_SHA256SUM := 
b6cec903e74e9fdd7b5bbcde0ab2415dd12f2f9e84d9e4d9ddd2ba26a41623b2
 export PNG_TARBALL := libpng-1.6.28.tar.gz
-export POPPLER_SHA256SUM := 
a3d626b24cd14efa9864e12584b22c9c32f51c46417d7c10ca17651f297c9641
-export POPPLER_TARBALL := poppler-0.59.0.tar.xz
+export POPPLER_SHA256SUM := 
2c096431adfb74bc2f53be466889b7646e1b599f28fa036094f3f7235cc9eae7
+export POPPLER_TARBALL := poppler-0.66.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 export PYTHON_SHA256SUM := 
6ed87a8b6c758cc3299a8b433e8a9a9122054ad5bc8aad43299cff3a53d8ca44
diff --git a/external/poppler/0001-Fix-building-with-old-clang.patch.1 
b/external/poppler/0001-Fix-building-with-old-clang.patch.1
deleted file mode 100644
index dcddd11d2967..000000000000
--- a/external/poppler/0001-Fix-building-with-old-clang.patch.1
+++ /dev/null
@@ -1,25 +0,0 @@
-From dd80c182cbcb188af0dd590f222ba9bbb31e3fb7 Mon Sep 17 00:00:00 2001
-From: Albert Astals Cid <aa...@kde.org>
-Date: Mon, 4 Sep 2017 19:36:06 +0200
-Subject: [PATCH] Fix building with old clang
-
----
- poppler/StructElement.cc | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/poppler/StructElement.cc b/poppler/StructElement.cc
-index 0fbd336a..451213f8 100644
---- a/poppler/StructElement.cc
-+++ b/poppler/StructElement.cc
-@@ -248,6 +248,8 @@ struct AttributeMapEntry {
- };
- 
- struct AttributeDefaults {
-+  AttributeDefaults() {}; // needed to support old clang
-+
-   Object Inline  = Object(objName, "Inline");
-   Object LrTb = Object(objName, "LrTb");
-   Object Normal = Object(objName, "Normal");
--- 
-2.13.5
-
diff --git a/external/poppler/ExternalProject_poppler.mk 
b/external/poppler/ExternalProject_poppler.mk
deleted file mode 100644
index 83d51b9ea9e7..000000000000
--- a/external/poppler/ExternalProject_poppler.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_ExternalProject_ExternalProject,poppler))
-
-$(eval $(call gb_ExternalProject_use_autoconf,poppler,build))
-
-$(eval $(call gb_ExternalProject_use_externals,poppler,\
-       jpeg \
-))
-
-$(eval $(call gb_ExternalProject_register_targets,poppler,\
-       build \
-))
-
-$(call gb_ExternalProject_get_state_target,poppler,build) :
-       $(call gb_ExternalProject_run,build,\
-               $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) 
$(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) 
$(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(gb_COMPILEROPTFLAGS)",$(if 
$(filter MSC-120,$(COM)-$(VCVER)),CXXFLAGS="$(CXXFLAGS) -I$(SRCDIR)/include")) \
-               MAKE=$(MAKE) PKG_CONFIG="" ./configure \
-                       --with-pic \
-                       --enable-static \
-                       --disable-shared \
-                       --enable-xpdf-headers \
-                       --disable-poppler-cpp \
-                       --enable-libopenjpeg=none \
-                       --disable-libtiff \
-                       --enable-libjpeg \
-                       --disable-libpng \
-                       --disable-zlib \
-                       --disable-libcurl \
-                       --disable-splash-output \
-                       --disable-cairo-output \
-                       --disable-poppler-glib \
-                       --disable-poppler-qt4 \
-                       --disable-poppler-qt5 \
-                       --disable-gtk-test \
-                       --disable-utils \
-                       --disable-cms \
-                       $(if 
$(verbose),--disable-silent-rules,--enable-silent-rules) \
-                       $(if $(filter WNT 
MACOSX,$(OS)),--with-font-configuration=win32,--with-font-configuration=fontconfig)
 \
-                       $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM)) \
-               && $(MAKE) \
-       )
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/poppler/Module_poppler.mk 
b/external/poppler/Module_poppler.mk
index 9e9f540531c2..ebae6e7aaddd 100644
--- a/external/poppler/Module_poppler.mk
+++ b/external/poppler/Module_poppler.mk
@@ -10,7 +10,7 @@
 $(eval $(call gb_Module_Module,poppler))
 
 $(eval $(call gb_Module_add_targets,poppler,\
-       ExternalProject_poppler \
+       StaticLibrary_poppler \
        UnpackedTarball_poppler \
 ))
 
diff --git a/external/poppler/StaticLibrary_poppler.mk 
b/external/poppler/StaticLibrary_poppler.mk
new file mode 100644
index 000000000000..bb5f51b571ca
--- /dev/null
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -0,0 +1,128 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 
100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,poppler))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,poppler,poppler))
+
+$(eval $(call gb_StaticLibrary_use_external,poppler,jpeg))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,poppler))
+
+$(eval $(call gb_StaticLibrary_set_include,poppler,\
+       -I$(WORKDIR)/UnpackedTarball/poppler \
+       -I$(WORKDIR)/UnpackedTarball/poppler/fofi \
+       -I$(WORKDIR)/UnpackedTarball/poppler/goo \
+       -I$(WORKDIR)/UnpackedTarball/poppler/poppler \
+       $$(INCLUDE) \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_StaticLibrary_add_defs,poppler,\
+       -DWIN32_LEAN_AND_MEAN \
+       -D_CRT_SECURE_NO_WARNINGS \
+))
+$(eval $(call gb_StaticLibrary_add_cxxflags,poppler,\
+       /Zc:wchar_t- \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,poppler,cc))
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
+       UnpackedTarball/poppler/goo/gfile \
+       UnpackedTarball/poppler/goo/gmempp \
+       UnpackedTarball/poppler/goo/GooList \
+       UnpackedTarball/poppler/goo/GooTimer \
+       UnpackedTarball/poppler/goo/GooString \
+       UnpackedTarball/poppler/goo/gmem \
+       UnpackedTarball/poppler/goo/FixedPoint \
+       UnpackedTarball/poppler/goo/NetPBMWriter \
+       UnpackedTarball/poppler/goo/PNGWriter \
+       UnpackedTarball/poppler/goo/TiffWriter \
+       UnpackedTarball/poppler/goo/JpegWriter \
+       UnpackedTarball/poppler/goo/ImgWriter \
+       UnpackedTarball/poppler/goo/gstrtod \
+       UnpackedTarball/poppler/goo/grandom \
+       UnpackedTarball/poppler/goo/glibc \
+       UnpackedTarball/poppler/goo/glibc_strtok_r \
+       UnpackedTarball/poppler/fofi/FoFiBase \
+       UnpackedTarball/poppler/fofi/FoFiEncodings \
+       UnpackedTarball/poppler/fofi/FoFiTrueType \
+       UnpackedTarball/poppler/fofi/FoFiType1 \
+       UnpackedTarball/poppler/fofi/FoFiType1C \
+       UnpackedTarball/poppler/fofi/FoFiIdentifier \
+       UnpackedTarball/poppler/poppler/Annot \
+       UnpackedTarball/poppler/poppler/Array \
+       UnpackedTarball/poppler/poppler/BuiltinFont \
+       UnpackedTarball/poppler/poppler/BuiltinFontTables \
+       UnpackedTarball/poppler/poppler/CachedFile \
+       UnpackedTarball/poppler/poppler/Catalog \
+       UnpackedTarball/poppler/poppler/CharCodeToUnicode \
+       UnpackedTarball/poppler/poppler/CMap \
+       UnpackedTarball/poppler/poppler/DateInfo \
+       UnpackedTarball/poppler/poppler/Decrypt \
+       UnpackedTarball/poppler/poppler/Dict \
+       UnpackedTarball/poppler/poppler/Error \
+       UnpackedTarball/poppler/poppler/FileSpec \
+       UnpackedTarball/poppler/poppler/FontEncodingTables \
+       UnpackedTarball/poppler/poppler/Form \
+       UnpackedTarball/poppler/poppler/FontInfo \
+       UnpackedTarball/poppler/poppler/Function \
+       UnpackedTarball/poppler/poppler/Gfx \
+       UnpackedTarball/poppler/poppler/GfxFont \
+       UnpackedTarball/poppler/poppler/GfxState \
+       UnpackedTarball/poppler/poppler/GlobalParams \
+       UnpackedTarball/poppler/poppler/Hints \
+       UnpackedTarball/poppler/poppler/JArithmeticDecoder \
+       UnpackedTarball/poppler/poppler/JBIG2Stream \
+       UnpackedTarball/poppler/poppler/Lexer \
+       UnpackedTarball/poppler/poppler/Link \
+       UnpackedTarball/poppler/poppler/Linearization \
+       UnpackedTarball/poppler/poppler/LocalPDFDocBuilder \
+       UnpackedTarball/poppler/poppler/MarkedContentOutputDev \
+       UnpackedTarball/poppler/poppler/NameToCharCode \
+       UnpackedTarball/poppler/poppler/Object \
+       UnpackedTarball/poppler/poppler/OptionalContent \
+       UnpackedTarball/poppler/poppler/Outline \
+       UnpackedTarball/poppler/poppler/OutputDev \
+       UnpackedTarball/poppler/poppler/Page \
+       UnpackedTarball/poppler/poppler/PageTransition \
+       UnpackedTarball/poppler/poppler/Parser \
+       UnpackedTarball/poppler/poppler/PDFDoc \
+       UnpackedTarball/poppler/poppler/PDFDocEncoding \
+       UnpackedTarball/poppler/poppler/PDFDocFactory \
+       UnpackedTarball/poppler/poppler/PopplerCache \
+       UnpackedTarball/poppler/poppler/ProfileData \
+       UnpackedTarball/poppler/poppler/PreScanOutputDev \
+       UnpackedTarball/poppler/poppler/PSTokenizer \
+       UnpackedTarball/poppler/poppler/SignatureInfo \
+       UnpackedTarball/poppler/poppler/Stream \
+       UnpackedTarball/poppler/poppler/StructTreeRoot \
+       UnpackedTarball/poppler/poppler/StructElement \
+       UnpackedTarball/poppler/poppler/UnicodeMap \
+       UnpackedTarball/poppler/poppler/UnicodeMapFuncs \
+       UnpackedTarball/poppler/poppler/UnicodeTypeTable \
+       UnpackedTarball/poppler/poppler/UTF \
+       UnpackedTarball/poppler/poppler/XRef \
+       UnpackedTarball/poppler/poppler/PSOutputDev \
+       UnpackedTarball/poppler/poppler/TextOutputDev \
+       UnpackedTarball/poppler/poppler/PageLabelInfo \
+       UnpackedTarball/poppler/poppler/SecurityHandler \
+       UnpackedTarball/poppler/poppler/StdinCachedFile \
+       UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \
+       UnpackedTarball/poppler/poppler/Sound \
+       UnpackedTarball/poppler/poppler/ViewerPreferences \
+       UnpackedTarball/poppler/poppler/XpdfPluginAPI \
+       UnpackedTarball/poppler/poppler/Movie \
+       UnpackedTarball/poppler/poppler/Rendition \
+       UnpackedTarball/poppler/poppler/DCTStream \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/poppler/UnpackedTarball_poppler.mk 
b/external/poppler/UnpackedTarball_poppler.mk
index fc62974521fa..68fd06d9403b 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -12,11 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,poppler))
 $(eval $(call 
gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler))
 
 $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
-       external/poppler/poppler-notests.patch.1 \
-       external/poppler/poppler-mac-fake.patch.1 \
-       external/poppler/ubsan.patch.0 \
-       external/poppler/poppler-libjpeg.patch.1 \
-       external/poppler/0001-Fix-building-with-old-clang.patch.1 \
+       external/poppler/poppler-config.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/poppler/poppler-config.patch.1 
b/external/poppler/poppler-config.patch.1
new file mode 100644
index 000000000000..5328e680e2f2
--- /dev/null
+++ b/external/poppler/poppler-config.patch.1
@@ -0,0 +1,484 @@
+*three* poppler config headers
+
+mkdir build && cd build && cmake .. -DENABLE_DCTDECODER=libjpeg 
-DHAVE_CAIRO=off -DENABLE_LIBOPENJPEG=none -DENABLE_CMS=none 
-DENABLE_LIBCURL=off -DENABLE_ZLIB=off -DENABLE_ZLIB_UNCOMPRESS=off 
-DENABLE_NSS3=off -DENABLE_LIBPNG=off -DENABLE_LIBTIFF=off -DENABLE_SPLASH=off 
-DENABLE_UTILS=off -DENABLE_CPP=off -DENABLE_GLIB=off 
-DENABLE_GOBJECT_INTROSPECTION=off -DENABLE_GTK_DOC=off -DENABLE_QT5=off
+
+manually disabled these because cmake failed to do it:
+HAVE_CAIRO
+ENABLE_NSS3
+ENABLE_LIBPNG (twice!)
+ENABLE_LIBTIFF (twice!)
+ENABLE_LIBCURL
+
+diff --git a/config.h b/config.h
+new file mode 100644
+index 0fbd336a..451213f8 100644
+--- /dev/null
++++ b/config.h
+@@ -0,0 +1,248 @@
++/* config.h.  Generated from config.h.cmake by cmake.  */
++
++/* Build against libcurl. */
++/* #undef ENABLE_LIBCURL */
++
++/* Use libjpeg instead of builtin jpeg decoder. */
++#define ENABLE_LIBJPEG 1
++
++/* Use libopenjpeg instead of builtin jpeg2000 decoder. */
++/* #undef ENABLE_LIBOPENJPEG */
++
++/* Build against libtiff. */
++/* #define ENABLE_LIBTIFF 1 */
++
++/* Build against libpng. */
++/* #define ENABLE_LIBPNG 1 */
++
++/* Do not hardcode the library location */
++/* #undef ENABLE_RELOCATABLE */
++
++/* Build against zlib. */
++/* #undef ENABLE_ZLIB */
++
++/* Use zlib instead of builtin zlib decoder to uncompress flate streams. */
++/* #undef ENABLE_ZLIB_UNCOMPRESS */
++
++/* Build against libnss3 for digital signature validation */
++/* #define ENABLE_NSS3 1 */
++
++/* Use cairo for rendering. */
++/* #define HAVE_CAIRO 1 */
++
++/* Do we have any DCT decoder?. */
++#define HAVE_DCT_DECODER 1
++
++/* Do we have any JPX decoder?. */
++/* #undef HAVE_JPX_DECODER */
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
++   */
++#define HAVE_DIRENT_H 1
++#endif
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#define HAVE_DLFCN_H 1
++#endif
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#define HAVE_FCNTL_H 1
++
++/* Define to 1 if you have the `fseek64' function. */
++/* #undef HAVE_FSEEK64 */
++
++#if !defined(_WIN32)
++/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
++#define HAVE_FSEEKO 1
++#endif
++
++/* Define to 1 if you have the `ftell64' function. */
++/* #undef HAVE_FTELL64 */
++
++#if !defined(__APPLE__) && !defined(_WIN32)
++/* Define to 1 if you have the `pread64' function. */
++#define HAVE_PREAD64 1
++#endif
++
++#if !defined(__APPLE__) && !defined(_WIN32)
++/* Define to 1 if you have the `lseek64' function. */
++#define HAVE_LSEEK64 1
++#endif
++
++#if !defined(_WIN32)
++/* Defines if gettimeofday is available on your system */
++#define HAVE_GETTIMEOFDAY 1
++#endif
++
++#if !defined(_WIN32)
++/* Defines if gmtime_r is available on your system */
++#define HAVE_GMTIME_R 1
++#endif
++
++#if !defined(_WIN32)
++/* Defines if timegm is available on your system */
++#define HAVE_TIMEGM 1
++#endif
++
++/* Define if you have the iconv() function and it works. */
++/* #undef HAVE_ICONV */
++
++/* Define to 1 if you have the `z' library (-lz). */
++/* #undef HAVE_LIBZ */
++
++#if !defined(_WIN32)
++/* Defines if localtime_r is available on your system */
++#define HAVE_LOCALTIME_R 1
++#endif
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the `mkstemp' function. */
++#define HAVE_MKSTEMP 1
++#endif
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the `rand_r' function. */
++#define HAVE_RAND_R 1
++#endif
++
++#if defined(_WIN32)
++/* Define to 1 if you have the `strcpy_s' function. */
++#define HAVE_STRCPY_S 1
++#endif
++
++#if defined(_WIN32)
++/* Define to 1 if you have the `strcat_s' function. */
++#define HAVE_STRCAT_S 1
++#endif
++
++#if !defined(_WIN32)
++/* Defines if strtok_r is available on your system */
++#define HAVE_STRTOK_R 1
++#endif
++
++/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
++/* #undef HAVE_NDIR_H */
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the `popen' function. */
++#define HAVE_POPEN 1
++#endif
++
++/* Use splash for rendering. */
++/* #undef HAVE_SPLASH */
++
++#if !defined(__APPLE__) && !defined(_WIN32)
++/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
++   */
++#define HAVE_SYS_DIR_H 1
++#endif
++
++#if !defined(__APPLE__) && !defined(_WIN32)
++/* Define to 1 if you have the <sys/mman.h> header file. */
++#define HAVE_SYS_MMAN_H 1
++#endif
++
++/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
++   */
++/* #undef HAVE_SYS_NDIR_H */
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++#if !defined(_WIN32)
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++#endif
++
++/* Define to 1 if you have a big endian machine */
++/* #undef WORDS_BIGENDIAN */
++
++/* Define as const if the declaration of iconv() needs const. */
++#define ICONV_CONST 
++
++/* Enable multithreading support. */
++#define MULTITHREADED 1
++
++/* Generate OPI comments in PS output. */
++#define OPI_SUPPORT 1
++
++/* Name of package */
++#define PACKAGE "poppler"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define PACKAGE_BUGREPORT 
"https://bugs.freedesktop.org/enter_bug.cgi?product=poppler";
++
++/* Define to the full name of this package. */
++#define PACKAGE_NAME "poppler"
++
++/* Define to the full name and version of this package. */
++#define PACKAGE_STRING "poppler 0.66.0"
++
++/* Define to the one symbol short name of this package. */
++#define PACKAGE_TARNAME "poppler"
++
++/* Define to the home page for this package. */
++#define PACKAGE_URL ""
++
++/* Define to the version of this package. */
++#define PACKAGE_VERSION "0.66.0"
++
++/* Poppler data dir */
++#define POPPLER_DATADIR "/usr/local/share/poppler"
++
++/* Support for curl based doc builder is compiled in. */
++/* #undef POPPLER_HAS_CURL_SUPPORT */
++
++/* Include support for CMYK rasterization */
++/* #undef SPLASH_CMYK */
++
++/* Enable word list support. */
++#define TEXTOUT_WORD_LIST 1
++
++/* Defines if use cms */
++/* #undef USE_CMS */
++
++/* Use fixed point arithmetic in the Splash backend */
++/* #undef USE_FIXEDPOINT */
++
++/* Use single precision arithmetic in the Splash backend */
++/* #undef USE_FLOAT */
++
++/* Version number of package */
++#define VERSION "0.66.0"
++
++#if defined(__APPLE__)
++#elif defined (_WIN32)
++/* Use win32 font configuration backend */
++#define WITH_FONTCONFIGURATION_WIN32 1
++#else
++/* Use fontconfig font configuration backend */
++#define WITH_FONTCONFIGURATION_FONTCONFIG 1
++#endif
++
++/* OpenJPEG with the OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG flag */
++/* #undef WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG */
++
++/* MS defined snprintf as deprecated but then added it in Visual Studio 2015. 
*/
++#if defined(_MSC_VER) && _MSC_VER < 1900
++#define snprintf _snprintf
++#endif
++
++//------------------------------------------------------------------------
++// popen
++//------------------------------------------------------------------------
++#if defined(_MSC_VER) || defined(__BORLANDC__)
++#define popen _popen
++#define pclose _pclose
++#endif
++
++/* Number of bits in a file offset, on hosts where this is settable. */
++/* #undef _FILE_OFFSET_BITS */
++
++/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
++/* TODO This is wrong, port if needed #undef _LARGEFILE_SOURCE */
++
++/* Define for large files, on AIX-style hosts. */
++/* TODO This is wrong, port if needed #undef _LARGE_FILES */
+diff --git a/poppler/poppler-config.h b/poppler/poppler-config.h
+new file mode 100644
+index 0fbd336a..451213f8 100644
+--- /dev/null
++++ b/poppler/poppler-config.h
+@@ -0,0 +1,168 @@
++//================================================= -*- mode: c++ -*- ====
++//
++// poppler-config.h
++//
++// Copyright 1996-2011 Glyph & Cog, LLC
++//
++//========================================================================
++
++//========================================================================
++//
++// Modified under the Poppler project - http://poppler.freedesktop.org
++//
++// All changes made under the Poppler project to this file are licensed
++// under GPL version 2 or later
++//
++// Copyright (C) 2014 Bogdan Cristea <crist...@gmail.com>
++// Copyright (C) 2014 Hib Eris <h...@hiberis.nl>
++// Copyright (C) 2016 Tor Lillqvist <t...@collabora.com>
++// Copyright (C) 2017 Adrian Johnson <ajohn...@redneon.com>
++//
++// To see a description of the changes please see the Changelog file that
++// came with your tarball or type make ChangeLog if you are building from git
++//
++//========================================================================
++
++#ifndef POPPLER_CONFIG_H
++#define POPPLER_CONFIG_H
++
++// We duplicate some of the config.h #define's here since they are
++// used in some of the header files we install.  The #ifndef/#endif
++// around #undef look odd, but it's to silence warnings about
++// redefining those symbols.
++
++/* Defines the poppler version. */
++#ifndef POPPLER_VERSION
++#define POPPLER_VERSION "0.66.0"
++#endif
++
++/* Enable multithreading support. */
++#ifndef MULTITHREADED
++#define MULTITHREADED 1
++#endif
++
++/* Use fixedpoint. */
++#ifndef USE_FIXEDPOINT
++/* #undef USE_FIXEDPOINT */
++#endif
++
++/* Use single precision arithmetic in the Splash backend */
++#ifndef USE_FLOAT
++/* #undef USE_FLOAT */
++#endif
++
++/* Include support for OPI comments. */
++#ifndef OPI_SUPPORT
++#define OPI_SUPPORT 1
++#endif
++
++/* Enable word list support. */
++#ifndef TEXTOUT_WORD_LIST
++#define TEXTOUT_WORD_LIST 1
++#endif
++
++/* Support for curl is compiled in. */
++#ifndef POPPLER_HAS_CURL_SUPPORT
++/* #undef POPPLER_HAS_CURL_SUPPORT */
++#endif
++
++/* Use libjpeg instead of builtin jpeg decoder. */
++#ifndef ENABLE_LIBJPEG
++#define ENABLE_LIBJPEG 1
++#endif
++
++/* Build against libtiff. */
++#ifndef ENABLE_LIBTIFF
++/* #define ENABLE_LIBTIFF 1 */
++#endif
++
++/* Build against libpng. */
++#ifndef ENABLE_LIBPNG
++/* #define ENABLE_LIBPNG 1 */
++#endif
++
++/* Use zlib instead of builtin zlib decoder. */
++#ifndef ENABLE_ZLIB
++/* #undef ENABLE_ZLIB */
++#endif
++
++/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
++   */
++#ifndef HAVE_DIRENT_H
++#if !defined(_WIN32)
++#define HAVE_DIRENT_H 1
++#endif
++#endif
++
++/* Defines if gettimeofday is available on your system */
++#ifndef HAVE_GETTIMEOFDAY
++#if !defined(_WIN32)
++#define HAVE_GETTIMEOFDAY 1
++#endif
++#endif
++
++/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
++#ifndef HAVE_NDIR_H
++/* #undef HAVE_NDIR_H */
++#endif
++
++/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
++   */
++#ifndef HAVE_SYS_DIR_H
++#if !defined(__APPLE__) && !defined(_WIN32)
++#define HAVE_SYS_DIR_H 1
++#endif
++#endif
++
++/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
++   */
++#ifndef HAVE_SYS_NDIR_H
++/* #undef HAVE_SYS_NDIR_H */
++#endif
++
++/* Defines if use cms */
++#ifndef USE_CMS
++/* #undef USE_CMS */
++#endif
++
++// Also, there are preprocessor symbols in the header files
++// that are used but never defined when building poppler using configure
++// or cmake: DISABLE_OUTLINE, DEBUG_MEM,
++// ENABLE_PLUGINS, DEBUG_FORMS
++
++//------------------------------------------------------------------------
++// version
++//------------------------------------------------------------------------
++
++// copyright notice
++#define popplerCopyright "Copyright 2005-2018 The Poppler Developers - 
http://poppler.freedesktop.org";
++#define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC"
++
++//------------------------------------------------------------------------
++// Win32 stuff
++//------------------------------------------------------------------------
++
++#if defined(_WIN32) && !defined(_MSC_VER)
++#include <windef.h>
++#else
++#define CDECL
++#endif
++
++//------------------------------------------------------------------------
++// Compiler
++//------------------------------------------------------------------------
++
++#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
++#include <stdio.h> // __MINGW_PRINTF_FORMAT is defined in the mingw stdio.h
++#ifdef __MINGW_PRINTF_FORMAT
++#define GCC_PRINTF_FORMAT(fmt_index, va_index) \
++      __attribute__((__format__(__MINGW_PRINTF_FORMAT, fmt_index, va_index)))
++#else
++#define GCC_PRINTF_FORMAT(fmt_index, va_index) \
++      __attribute__((__format__(__printf__, fmt_index, va_index)))
++#endif
++#else
++#define GCC_PRINTF_FORMAT(fmt_index, va_index)
++#endif
++
++#endif /* POPPLER_CONFIG_H */
+diff --git a/cpp/poppler-version.h b/cpp/poppler-version.h
+new file mode 100644
+index 0fbd336a..451213f8 100644
+--- /dev/null
++++ b/cpp/poppler-version.h
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (C) 2009, Pino Toscano <p...@kde.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
++ */
++
++#ifndef POPPLER_VERSION_H
++#define POPPLER_VERSION_H
++
++#include "poppler-global.h"
++
++#define POPPLER_VERSION "0.66.0"
++#define POPPLER_VERSION_MAJOR 0
++#define POPPLER_VERSION_MINOR 66
++#define POPPLER_VERSION_MICRO 0
++
++namespace poppler
++{
++
++POPPLER_CPP_EXPORT std::string version_string();
++POPPLER_CPP_EXPORT unsigned int version_major();
++POPPLER_CPP_EXPORT unsigned int version_minor();
++POPPLER_CPP_EXPORT unsigned int version_micro();
++
++}
++
++#endif
diff --git a/external/poppler/poppler-libjpeg.patch.1 
b/external/poppler/poppler-libjpeg.patch.1
deleted file mode 100644
index c8d54beb75ae..000000000000
--- a/external/poppler/poppler-libjpeg.patch.1
+++ /dev/null
@@ -1,23 +0,0 @@
-do not override user supplied LIBJPEG_LIBS so we can use the one in WORKDIR
-
---- poppler/configure.orig     2016-11-02 13:58:32.530617038 +0100
-+++ poppler/configure  2016-11-02 13:58:06.233617689 +0100
-@@ -21377,8 +21377,9 @@
-           ac_save_USER_INCLUDES="$USER_INCLUDES"
-   ac_save_USER_LDFLAGS="$USER_LDFLAGS"
-   USER_INCLUDES="$USER_INCLUDES $LIBJPEG_CFLAGS"
--  USER_LDFLAGS="$USER_LDFLAGS $LIBJPEG_CFLAGS"
-+  USER_LDFLAGS="$USER_LDFLAGS $LIBJPEG_LIBS"
- 
-+if test -z "$LIBJPEG_LIBS"; then
- 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libjpeg6b" >&5
- $as_echo_n "checking for libjpeg6b... " >&6; }
-@@ -21489,6 +21490,7 @@
- 
- 
- fi
-+fi
- 
- 
- ac_save_CPPFLAGS="$CPPFLAGS"
diff --git a/external/poppler/poppler-mac-fake.patch.1 
b/external/poppler/poppler-mac-fake.patch.1
deleted file mode 100644
index d0b1936658ca..000000000000
--- a/external/poppler/poppler-mac-fake.patch.1
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ur poppler.org/poppler/GlobalParams.cc poppler/poppler/GlobalParams.cc
---- poppler.org/poppler/GlobalParams.cc        2013-07-09 06:24:38.000000000 
-0500
-+++ poppler/poppler/GlobalParams.cc    2013-07-09 06:25:18.000000000 -0500
-@@ -1327,7 +1327,7 @@
-   return path;
- }
- 
--#elif WITH_FONTCONFIGURATION_WIN32
-+#elif WITH_FONTCONFIGURATION_WIN32 && defined(_WIN32)
- #include "GlobalParamsWin.cc"
- 
- GooString *GlobalParams::findBase14FontFile(GooString *base14Name, GfxFont 
*font) {
-
diff --git a/external/poppler/poppler-notests.patch.1 
b/external/poppler/poppler-notests.patch.1
deleted file mode 100644
index ffac17312959..000000000000
--- a/external/poppler/poppler-notests.patch.1
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -483,7 +483,7 @@
- @BUILD_POPPLER_QT4_TRUE@qt4_pc_file = poppler-qt4.pc
- @BUILD_POPPLER_CPP_TRUE@cpp_subdir = cpp
- @BUILD_POPPLER_CPP_TRUE@cpp_pc_file = poppler-cpp.pc
--SUBDIRS = goo fofi $(splash_subdir) poppler utils $(glib_subdir) test 
$(qt4_subdir) $(qt5_subdir) $(cpp_subdir)
-+SUBDIRS = goo fofi $(splash_subdir) poppler utils $(glib_subdir) 
$(qt4_subdir) $(qt5_subdir) $(cpp_subdir)
- 
- # Add CMake buildsystem files here so they get added on make dist
- EXTRA_DIST = README-XPDF poppler.pc.in poppler-uninstalled.pc.in \
diff --git a/external/poppler/ubsan.patch.0 b/external/poppler/ubsan.patch.0
deleted file mode 100644
index f6e4667dc133..000000000000
--- a/external/poppler/ubsan.patch.0
+++ /dev/null
@@ -1,230 +0,0 @@
---- poppler/Form.cc
-+++ poppler/Form.cc
-@@ -463,12 +463,11 @@
- // FormField
- //========================================================================
- 
--FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField 
*parentA, std::set<int> *usedParents, FormFieldType ty)
-+FormField::FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField 
*parentA, FormFieldType ty)
- {
-   doc = docA;
-   xref = doc->getXRef();
-   obj = aobj->copy();
--  Dict* dict = obj.getDict();
-   ref.num = ref.gen = 0;
-   type = ty;
-   parent = parentA;
-@@ -483,7 +482,11 @@
-   hasQuadding = gFalse;
- 
-   ref = aref;
-+}
- 
-+void FormField::init(std::set<int> *usedParents)
-+{
-+  Dict* dict = obj.getDict();
-   //childs
-   Object obj1 = dict->lookup("Kids");
-   if (obj1.isArray()) {
-@@ -803,9 +806,15 @@
- //------------------------------------------------------------------------
- // FormFieldButton
- //------------------------------------------------------------------------
--FormFieldButton::FormFieldButton(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
--  : FormField(docA, aobj, ref, parent, usedParents, formButton)
-+FormFieldButton::FormFieldButton(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
-+  : FormField(docA, aobj, ref, parent, formButton)
- {
-+}
-+
-+void FormFieldButton::init(std::set<int> *usedParents)
-+{
-+  FormField::init(usedParents);
-+
-   Dict* dict = obj.getDict();
-   active_child = -1;
-   noAllOff = false;
-@@ -983,9 +992,15 @@
- //------------------------------------------------------------------------
- // FormFieldText
- //------------------------------------------------------------------------
--FormFieldText::FormFieldText(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
--  : FormField(docA, aobj, ref, parent, usedParents, formText)
-+FormFieldText::FormFieldText(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
-+  : FormField(docA, aobj, ref, parent, formText)
- {
-+}
-+
-+void FormFieldText::init(std::set<int> *usedParents)
-+{
-+  FormField::init(usedParents);
-+
-   Dict* dict = obj.getDict();
-   Object obj1;
-   content = NULL;
-@@ -1076,9 +1091,15 @@
- //------------------------------------------------------------------------
- // FormFieldChoice
- //------------------------------------------------------------------------
--FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
--  : FormField(docA, aobj, ref, parent, usedParents, formChoice)
-+FormFieldChoice::FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent)
-+  : FormField(docA, aobj, ref, parent, formChoice)
- {
-+}
-+
-+void FormFieldChoice::init(std::set<int> *usedParents)
-+{
-+  FormField::init(usedParents);
-+
-   numChoices = 0;
-   choices = NULL;
-   editedChoice = NULL;
-@@ -1379,11 +1400,17 @@
- //------------------------------------------------------------------------
- // FormFieldSignature
- //------------------------------------------------------------------------
--FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent, std::set<int> *usedParents)
--  : FormField(docA, dict, ref, parent, usedParents, formSignature),
-+FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent)
-+  : FormField(docA, dict, ref, parent, formSignature),
-     signature_type(adbe_pkcs7_detached),
-     signature(nullptr), signature_info(nullptr)
- {
-+}
-+
-+void FormFieldSignature::init(std::set<int> *usedParents)
-+{
-+  FormField::init(usedParents);
-+
-   signature = NULL;
- 
-   signature_info = new SignatureInfo();
-@@ -1691,15 +1718,15 @@
- 
-     Object obj2 = Form::fieldLookup(obj->getDict (), "FT");
-     if (obj2.isName("Btn")) {
--      field = new FormFieldButton(docA, obj, pref, parent, usedParents);
-+      field = FormFieldButton::create(docA, obj, pref, parent, usedParents);
-     } else if (obj2.isName("Tx")) {
--      field = new FormFieldText(docA, obj, pref, parent, usedParents);
-+      field = FormFieldText::create(docA, obj, pref, parent, usedParents);
-     } else if (obj2.isName("Ch")) {
--      field = new FormFieldChoice(docA, obj, pref, parent, usedParents);
-+      field = FormFieldChoice::create(docA, obj, pref, parent, usedParents);
-     } else if (obj2.isName("Sig")) {
--      field = new FormFieldSignature(docA, obj, pref, parent, usedParents);
-+      field = FormFieldSignature::create(docA, obj, pref, parent, 
usedParents);
-     } else { //we don't have an FT entry => non-terminal field
--      field = new FormField(docA, obj, pref, parent, usedParents);
-+      field = FormField::create(docA, obj, pref, parent, usedParents);
-     }
- 
-     return field;
---- poppler/Form.h
-+++ poppler/Form.h
-@@ -264,8 +264,16 @@
- //------------------------------------------------------------------------
- 
- class FormField {
--public:
--  FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *parent, 
std::set<int> *usedParents, FormFieldType t=formUndef);
-+protected:
-+  FormField(PDFDoc *docA, Object *aobj, const Ref& aref, FormField *parent, 
FormFieldType t);
-+  void init(std::set<int> *usedParents);
-+public:
-+  static FormField *create(PDFDoc *docA, Object *aobj, const Ref& aref, 
FormField *parent, std::set<int> *usedParents, FormFieldType t=formUndef)
-+  {
-+    FormField *f = new FormField(docA, aobj, aref, parent, t);
-+    f->init(usedParents);
-+    return f;
-+  }
- 
-   virtual ~FormField();
- 
-@@ -338,8 +346,16 @@
- //------------------------------------------------------------------------
- 
- class FormFieldButton: public FormField {
--public:
--  FormFieldButton(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
-+private:
-+  FormFieldButton(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
-+  void init(std::set<int> *usedParents);
-+public:
-+  static FormFieldButton *create(PDFDoc *docA, Object *dict, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
-+  {
-+    FormFieldButton *f = new FormFieldButton(docA, dict, ref, parent);
-+    f->init(usedParents);
-+    return f;
-+  }
- 
-   FormButtonType getButtonType () { return btype; }
- 
-@@ -384,8 +400,16 @@
- //------------------------------------------------------------------------
- 
- class FormFieldText: public FormField {
--public:
--  FormFieldText(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
-+private:
-+  FormFieldText(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
-+  void init(std::set<int> *usedParents);
-+public:
-+  static FormFieldText *create(PDFDoc *docA, Object *dict, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
-+  {
-+    FormFieldText *f = new FormFieldText(docA, dict, ref, parent);
-+    f->init(usedParents);
-+    return f;
-+  }
-   
-   GooString* getContent () { return content; }
-   GooString* getContentCopy ();
-@@ -422,8 +446,16 @@
- //------------------------------------------------------------------------
- 
- class FormFieldChoice: public FormField {
--public:
--  FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
-+private:
-+  FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, FormField 
*parent);
-+  void init(std::set<int> *usedParents);
-+public:
-+  static FormFieldChoice *create(PDFDoc *docA, Object *aobj, const Ref& ref, 
FormField *parent, std::set<int> *usedParents)
-+  {
-+    FormFieldChoice *f = new FormFieldChoice(docA, aobj, ref, parent);
-+    f->init(usedParents);
-+    return f;
-+  }
- 
-   ~FormFieldChoice();
- 
-@@ -491,8 +523,16 @@
- 
- class FormFieldSignature: public FormField {
-   friend class FormWidgetSignature;
--public:
--  FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
-+private:
-+  FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent);
-+  void init(std::set<int> *usedParents);
-+public:
-+  static FormFieldSignature *create(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent, std::set<int> *usedParents)
-+  {
-+    FormFieldSignature *f = new FormFieldSignature(docA, dict, ref, parent);
-+    f->init(usedParents);
-+    return f;
-+  }
- 
-   // Use -1 for now as validationTime
-   SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation, 
time_t validationTime);
---- poppler/XRef.cc
-+++ poppler/XRef.cc
-@@ -293,6 +293,7 @@
-   xRefStream = gFalse;
-   scannedSpecialFlags = gFalse;
-   encrypted = gFalse;
-+  encAlgorithm = cryptRC4;
-   permFlags = defPermFlags;
-   ownerPasswordOk = gFalse;
-   rootNum = -1;
commit ebe1253820daa3056078ea97e6df1c7d92e552ca
Author:     Rene Engelhard <r...@debian.org>
AuthorDate: Tue Apr 24 15:56:23 2018 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:25 2019 +0100

    fix build with poppler 0.64
    
    GooString became const...
    
    Change-Id: Icc95be2e8603a4e22c6a9ac2008986bacd0bfba5
    Reviewed-on: https://gerrit.libreoffice.org/53422
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 106b2c96e9807af14d6eb6e8f83dcf25095a093e)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index b3f524957cd1..dd26f2da3961 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -451,6 +451,9 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* 
gfxFont, GfxState* state )
     FontAttributes aNewFont;
     int nSize = 0;
 
+#if POPPLER_CHECK_VERSION(0, 64, 0)
+    const
+#endif
     GooString* pFamily = gfxFont->getName();
     if( pFamily )
     {
@@ -747,6 +750,9 @@ void PDFOutDev::updateFont(GfxState *state)
         FontAttributes aFont;
         int nEmbedSize=0;
 
+#if POPPLER_CHECK_VERSION(0, 64, 0)
+        const
+#endif
         Ref* pID = gfxFont->getID();
         // TODO(Q3): Portability problem
         long long fontID = (long long)pID->gen << 32 | (long long)pID->num;
@@ -937,7 +943,11 @@ void PDFOutDev::drawChar(GfxState *state, double x, double 
y,
     printf( "\n" );
 }
 
+#if POPPLER_CHECK_VERSION(0, 64, 0)
+void PDFOutDev::drawString(GfxState*, const GooString* /*s*/)
+#else
 void PDFOutDev::drawString(GfxState*, GooString* /*s*/)
+#endif
 {
     // TODO(F3): NYI
 }
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index f6d6fa41ddcb..1ffe4207b1ee 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -223,7 +223,11 @@ namespace pdfi
                               double dx, double dy,
                               double originX, double originY,
                               CharCode code, int nBytes, Unicode *u, int uLen) 
override;
+#if POPPLER_CHECK_VERSION(0, 64, 0)
+        virtual void drawString(GfxState *state, const GooString *s) override;
+#else
         virtual void drawString(GfxState *state, GooString *s) override;
+#endif
         virtual void endTextObject(GfxState *state) override;
 
         //----- image drawing
commit f9ed05775e39fb7a873dc81f13323fa899c5e019
Author:     Dominique Leuenberger <dims...@suse.de>
AuthorDate: Fri Jan 5 12:16:03 2018 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 14:50:25 2019 +0100

    Allow building with poppler-0.62
    
    Reviewed-on: https://gerrit.libreoffice.org/47460
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit 38368be8527ca655854ee1231d9f355b8c0591ec)
    Reviewed-on: https://gerrit.libreoffice.org/48809
    Reviewed-by: Rene Engelhard <r...@debian.org>
    Tested-by: Rene Engelhard <r...@debian.org>
    (cherry picked from commit 02680aaa7b86998718d6ab25177d8adc420c5c42)
    
    Change-Id: Ia627f1628a67dd8ece7d9318639d9ccd06b89765

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 5d4a797f7c96..b3f524957cd1 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -32,11 +32,13 @@
 #pragma warning(push, 1)
 #endif
 
-// sigh, UTF8.h was removed in poppler-0.21.0 and put back in 0.21.1
+// sigh, UTF8.h was removed in poppler-0.21.0 and put back in 0.21.1, then 
renamed to UnicodeMapFuncs.h in 0.62.0
 // FIXME: we can't use #if POPPLER_CHECK_VERSION(0, 21, 0) && 
!POPPLER_CHECK_VERSION(0, 21, 1)
 //        because the internal poppler does not provide poppler-version.h and 
the macro always returns 0
-#if POPPLER_CHECK_VERSION(0, 21, 1)
-#include "UTF8.h"
+#if POPPLER_CHECK_VERSION(0, 62, 0)
+#include <UnicodeMapFuncs.h>
+#elif POPPLER_CHECK_VERSION(0, 21, 1)
+#include <UTF8.h>
 #elif POPPLER_CHECK_VERSION(0, 21, 0)
 #include "UTF.h"
 #else
@@ -918,7 +920,11 @@ void PDFOutDev::drawChar(GfxState *state, double x, double 
y,
             );
 
     // silence spurious warning
+#if POPPLER_CHECK_VERSION(0, 62, 0)
+    (void)&mapUTF16;
+#else
     (void)&mapUCS2;
+#endif
 
     char buf[9];
     for( int i=0; i<uLen; ++i )
commit f49fdc769f483472146596529fe9f0cc07a937ff
Author:     David Tardon <dtar...@redhat.com>
AuthorDate: Thu Sep 7 15:50:09 2017 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 12:59:50 2019 +0100

    upload poppler 0.59.0
    
    Change-Id: I21dfa3aa04bd960cb2fb87a53213ae4bbd510a24
    Reviewed-on: https://gerrit.libreoffice.org/42061
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: David Tardon <dtar...@redhat.com>
    (cherry picked from commit 1c983335116a6f09cabf0b3eae7f51951111341e)

diff --git a/download.lst b/download.lst
index 4a88348abf07..3f746a81f4b0 100644
--- a/download.lst
+++ b/download.lst
@@ -190,8 +190,8 @@ export PIXMAN_SHA256SUM := 
21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export PNG_SHA256SUM := 
b6cec903e74e9fdd7b5bbcde0ab2415dd12f2f9e84d9e4d9ddd2ba26a41623b2
 export PNG_TARBALL := libpng-1.6.28.tar.gz
-export POPPLER_SHA256SUM := 
0ea37de71b7db78212ebc79df59f99b66409a29c2eac4d882dae9f2397fe44d8
-export POPPLER_TARBALL := poppler-0.57.0.tar.xz
+export POPPLER_SHA256SUM := 
a3d626b24cd14efa9864e12584b22c9c32f51c46417d7c10ca17651f297c9641
+export POPPLER_TARBALL := poppler-0.59.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 export PYTHON_SHA256SUM := 
6ed87a8b6c758cc3299a8b433e8a9a9122054ad5bc8aad43299cff3a53d8ca44
diff --git a/external/poppler/0001-Fix-building-with-old-clang.patch.1 
b/external/poppler/0001-Fix-building-with-old-clang.patch.1
new file mode 100644
index 000000000000..dcddd11d2967
--- /dev/null
+++ b/external/poppler/0001-Fix-building-with-old-clang.patch.1
@@ -0,0 +1,25 @@
+From dd80c182cbcb188af0dd590f222ba9bbb31e3fb7 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aa...@kde.org>
+Date: Mon, 4 Sep 2017 19:36:06 +0200
+Subject: [PATCH] Fix building with old clang
+
+---
+ poppler/StructElement.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/poppler/StructElement.cc b/poppler/StructElement.cc
+index 0fbd336a..451213f8 100644
+--- a/poppler/StructElement.cc
++++ b/poppler/StructElement.cc
+@@ -248,6 +248,8 @@ struct AttributeMapEntry {
+ };
+ 
+ struct AttributeDefaults {
++  AttributeDefaults() {}; // needed to support old clang
++
+   Object Inline  = Object(objName, "Inline");
+   Object LrTb = Object(objName, "LrTb");
+   Object Normal = Object(objName, "Normal");
+-- 
+2.13.5
+
diff --git a/external/poppler/UnpackedTarball_poppler.mk 
b/external/poppler/UnpackedTarball_poppler.mk
index 8c87693b82ec..fc62974521fa 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
        external/poppler/poppler-mac-fake.patch.1 \
        external/poppler/ubsan.patch.0 \
        external/poppler/poppler-libjpeg.patch.1 \
+       external/poppler/0001-Fix-building-with-old-clang.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/poppler/ubsan.patch.0 b/external/poppler/ubsan.patch.0
index e0bf164ce7fc..f6e4667dc133 100644
--- a/external/poppler/ubsan.patch.0
+++ b/external/poppler/ubsan.patch.0
@@ -9,7 +9,7 @@
  {
    doc = docA;
    xref = doc->getXRef();
-   aobj->copy(&obj);
+   obj = aobj->copy();
 -  Dict* dict = obj.getDict();
    ref.num = ref.gen = 0;
    type = ty;
@@ -23,9 +23,9 @@
 +void FormField::init(std::set<int> *usedParents)
 +{
 +  Dict* dict = obj.getDict();
-   Object obj1;
    //childs
-   if (dict->lookup("Kids", &obj1)->isArray()) {
+   Object obj1 = dict->lookup("Kids");
+   if (obj1.isArray()) {
 @@ -803,9 +806,15 @@
  //------------------------------------------------------------------------
  // FormFieldButton
@@ -80,14 +80,16 @@
    numChoices = 0;
    choices = NULL;
    editedChoice = NULL;
-@@ -1379,9 +1400,15 @@
+@@ -1379,11 +1400,17 @@
  //------------------------------------------------------------------------
  // FormFieldSignature
  //------------------------------------------------------------------------
 -FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent, std::set<int> *usedParents)
--  : FormField(docA, dict, ref, parent, usedParents, formSignature)
+-  : FormField(docA, dict, ref, parent, usedParents, formSignature),
 +FormFieldSignature::FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& 
ref, FormField *parent)
-+  : FormField(docA, dict, ref, parent, formSignature)
++  : FormField(docA, dict, ref, parent, formSignature),
+     signature_type(adbe_pkcs7_detached),
+     signature(nullptr), signature_info(nullptr)
  {
 +}
 +
@@ -99,9 +101,9 @@
  
    signature_info = new SignatureInfo();
 @@ -1691,15 +1718,15 @@
-     FormField *field;
  
-     if (Form::fieldLookup(obj->getDict (), "FT", &obj2)->isName("Btn")) {
+     Object obj2 = Form::fieldLookup(obj->getDict (), "FT");
+     if (obj2.isName("Btn")) {
 -      field = new FormFieldButton(docA, obj, pref, parent, usedParents);
 +      field = FormFieldButton::create(docA, obj, pref, parent, usedParents);
      } else if (obj2.isName("Tx")) {
@@ -117,8 +119,8 @@
 -      field = new FormField(docA, obj, pref, parent, usedParents);
 +      field = FormField::create(docA, obj, pref, parent, usedParents);
      }
-     obj2.free();
  
+     return field;
 --- poppler/Form.h
 +++ poppler/Form.h
 @@ -264,8 +264,16 @@
@@ -198,9 +200,9 @@
    ~FormFieldChoice();
  
 @@ -491,8 +523,16 @@
- //------------------------------------------------------------------------
  
  class FormFieldSignature: public FormField {
+   friend class FormWidgetSignature;
 -public:
 -  FormFieldSignature(PDFDoc *docA, Object *dict, const Ref& ref, FormField 
*parent, std::set<int> *usedParents);
 +private:
@@ -214,8 +216,8 @@
 +    return f;
 +  }
  
-   SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation);
- 
+   // Use -1 for now as validationTime
+   SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation, 
time_t validationTime);
 --- poppler/XRef.cc
 +++ poppler/XRef.cc
 @@ -293,6 +293,7 @@
commit e5c5bfcd85cc1ba925b53963926a6e5d16474240
Author:     David Tardon <dtar...@redhat.com>
AuthorDate: Wed Aug 2 13:08:45 2017 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 12:58:11 2019 +0100

    upload poppler 0.57.0
    
    Change-Id: I681c7c409b5ce70cc64615dabe8f079df639bcdf
    Reviewed-on: https://gerrit.libreoffice.org/40673
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: David Tardon <dtar...@redhat.com>
    (cherry picked from commit cb4fd238969aedc139dbbeaf0b22f95a70d525ac)

diff --git a/download.lst b/download.lst
index 0d5eb4180dfe..4a88348abf07 100644
--- a/download.lst
+++ b/download.lst
@@ -190,8 +190,8 @@ export PIXMAN_SHA256SUM := 
21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
 export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
 export PNG_SHA256SUM := 
b6cec903e74e9fdd7b5bbcde0ab2415dd12f2f9e84d9e4d9ddd2ba26a41623b2
 export PNG_TARBALL := libpng-1.6.28.tar.gz
-export POPPLER_SHA256SUM := 
869dbadf99ed882e776acbdbc06689d8a81872a2963440b1e8516cd7a2577173
-export POPPLER_TARBALL := poppler-0.56.0.tar.xz
+export POPPLER_SHA256SUM := 
0ea37de71b7db78212ebc79df59f99b66409a29c2eac4d882dae9f2397fe44d8
+export POPPLER_TARBALL := poppler-0.57.0.tar.xz
 export POSTGRESQL_SHA256SUM := 
db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
 export POSTGRESQL_TARBALL := 
c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
 export PYTHON_SHA256SUM := 
6ed87a8b6c758cc3299a8b433e8a9a9122054ad5bc8aad43299cff3a53d8ca44
commit 5dafe9bbb724ec6795ab27364894c1b91fc1d030
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Jan 14 17:33:37 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 11:14:30 2019 +0100

    python3: add patch bpo-17239: Disable external entities in SAX parser
    
    Change-Id: I44e969d8d3a8fe6b6426d61a1cbe83154c8518dd
    Reviewed-on: https://gerrit.libreoffice.org/66329
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit a57dd8eba9c0799dd42eb547a37622bce8fdb0b3)
    Reviewed-on: https://gerrit.libreoffice.org/66370
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 66b3860fd1772284dc12d0d2d2c76ac59b16883e)

diff --git 
a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
 
b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
new file mode 100644
index 000000000000..489e5d0e89ee
--- /dev/null
+++ 
b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
@@ -0,0 +1,59 @@
+From 582d188e6e3487180891f1fc457a80dec8be26a8 Mon Sep 17 00:00:00 2001
+From: Christian Heimes <christ...@python.org>
+Date: Mon, 24 Sep 2018 14:38:31 +0200
+Subject: [PATCH] [3.6] bpo-17239: Disable external entities in SAX parser
+ (GH-9217) (GH-9512)
+
+The SAX parser no longer processes general external entities by default
+to increase security. Before, the parser created network connections
+to fetch remote files or loaded local files from the file system for DTD
+and entities.
+
+Signed-off-by: Christian Heimes <christ...@python.org>
+
+https://bugs.python.org/issue17239.
+(cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45)
+
+Co-authored-by: Christian Heimes <christ...@python.org>
+
+
+
+https://bugs.python.org/issue17239
+---
+ Doc/library/xml.dom.pulldom.rst               | 14 +++++
+ Doc/library/xml.rst                           |  6 +-
+ Doc/library/xml.sax.rst                       |  8 +++
+ Doc/whatsnew/3.6.rst                          | 18 +++++-
+ Lib/test/test_pulldom.py                      |  7 +++
+ Lib/test/test_sax.py                          | 60 ++++++++++++++++++-
+ Lib/test/test_xml_etree.py                    | 13 ++++
+ Lib/xml/sax/expatreader.py                    |  2 +-
+ .../2018-09-11-18-30-55.bpo-17239.kOpwK2.rst  |  3 +
+ 9 files changed, 125 insertions(+), 6 deletions(-)
+ create mode 100644 
Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
+
+diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py
+index 421358fa5b..5066ffc2fa 100644
+--- a/Lib/xml/sax/expatreader.py
++++ b/Lib/xml/sax/expatreader.py
+@@ -95,7 +95,7 @@ class ExpatParser(xmlreader.IncrementalParser, 
xmlreader.Locator):
+         self._lex_handler_prop = None
+         self._parsing = 0
+         self._entity_stack = []
+-        self._external_ges = 1
++        self._external_ges = 0
+         self._interning = None
+ 
+     # XMLReader methods
+diff --git 
a/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst 
b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
+new file mode 100644
+index 0000000000..8dd0fe8c1b
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
+@@ -0,0 +1,3 @@
++The xml.sax and xml.dom.minidom parsers no longer processes external
++entities by default. External DTD and ENTITY declarations no longer
++load files or create network connections.
+-- 
+2.20.1
+
diff --git a/external/python3/UnpackedTarball_python3.mk 
b/external/python3/UnpackedTarball_python3.mk
index 35d6e643a1b0..ec1bdabe4fdd 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
        external/python3/python-3.3.5-pyexpat-symbols.patch.1 \
        external/python3/ubsan.patch.0 \
        external/python3/python-3.5.tweak.strip.soabi.patch \
+       
external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
 \
 ))
 
 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
commit 1fa7bef510cbd1190769a77850264a73d8dec90a
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Tue Jan 15 17:05:00 2019 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Jan 18 11:11:49 2019 +0100

    lcms2: upgrade to release 2.9
    
    ... at least, that's the plan - this is harder than it appears, as the
    upstream maintainer appears to have released version 2.9 at least 3
    times:
    
    - Fedora has a file evidently downloaded before Nov. 17 with SHA512 of 
e30ad5a9a1ab9e7aaace9431434caa19a5ff6143db46644aba971a5ee37a265b26bf738e886d766405a7eb45a9d620d67c7ab3684ace86a107cf5a76642c04a5
    - Gentoo has a file evidently downloaded before Nov. 19 with SHA256 of 
d4ad6f8718f7f9dc8b2a3276c9f237aa3f5eccdcf98b86dedc4262d8a1e7f009
    - Debian has a file evidently downloaded before Dec. 17 with SHA256 of 
48c6fdf98396fa245ed86e622028caf49b96fa22f3e5734f853f806fbc8e7d20
    
    The lcms2-2.9.tar.gz available from sourceforge currently matches the
    one Debian has, so let's use it.
    
    * 0017-Upgrade-Visual-studio-2017-15.8.patch added (fixing CVE-2018-16435)
    * 0001-Added-an-extra-check-to-MLU-bounds.patch.1 removed (fixed upstream)
    
    Change-Id: Iab8dada8f6d77d5b2da8560993380b3332bc02f6
    Reviewed-on: https://gerrit.libreoffice.org/66400
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 99b20e589e64fbcf374d84ae68911ef2a96e537c)
    Reviewed-on: https://gerrit.libreoffice.org/66428
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 5d6a91c4df0ea51bb32794ff6068fa19bda44307)

diff --git a/download.lst b/download.lst
index 2614c875ee9e..0d5eb4180dfe 100644
--- a/download.lst
+++ b/download.lst
@@ -119,8 +119,8 @@ export LANGTAGREG_SHA256SUM := 
0f87b9428cbc2d96d8e4f54a07e3858b4a428e5fec9396bc3
 export LANGTAGREG_TARBALL := language-subtag-registry-2017-12-14.tar.bz2
 export LANGUAGETOOL_SHA256SUM := 
48c87e41636783bba438b65fd895821e369ed139e1465fac654323ad93c5a82d
 export LANGUAGETOOL_TARBALL := 
b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
-export LCMS2_SHA256SUM := 
66d02b229d2ea9474e62c2b6cd6720fde946155cd1d0d2bffdab829790a0fb22
-export LCMS2_TARBALL := lcms2-2.8.tar.gz
+export LCMS2_SHA256SUM := 
48c6fdf98396fa245ed86e622028caf49b96fa22f3e5734f853f806fbc8e7d20
+export LCMS2_TARBALL := lcms2-2.9.tar.gz
 export LIBASSUAN_SHA256SUM := 
22843a3bdb256f59be49842abf24da76700354293a066d82ade8134bb5aa2b71
 export LIBASSUAN_TARBALL := libassuan-2.4.3.tar.bz2
 export LIBATOMIC_OPS_SHA256SUM := 
cf5c52f08a2067ae4fe7c8919e3c1ccf3ee917f1749e0bcc7efffff59c68d9ad
diff --git a/external/lcms2/0001-Added-an-extra-check-to-MLU-bounds.patch.1 
b/external/lcms2/0001-Added-an-extra-check-to-MLU-bounds.patch.1
deleted file mode 100644
index 913f82887cb2..000000000000
--- a/external/lcms2/0001-Added-an-extra-check-to-MLU-bounds.patch.1
+++ /dev/null
@@ -1,25 +0,0 @@
-From 5ca71a7bc18b6897ab21d815d15e218e204581e2 Mon Sep 17 00:00:00 2001
-From: Marti <marti.ma...@tktbrainpower.com>
-Date: Mon, 15 Aug 2016 23:31:39 +0200
-Subject: [PATCH] Added an extra check to MLU bounds
-
-Thanks to Ibrahim el-sayed for spotting the bug
----
- src/cmstypes.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/cmstypes.c b/src/cmstypes.c
-index cb61860..c7328b9 100644
---- a/src/cmstypes.c
-+++ b/src/cmstypes.c
-@@ -1460,6 +1460,7 @@ void *Type_MLU_Read(struct _cms_typehandler_struct* 
self, cmsIOHANDLER* io, cmsU
- 
-         // Check for overflow
-         if (Offset < (SizeOfHeader + 8)) goto Error;
-+        if ((Offset + Len) > SizeOfTag + 8) goto Error;
- 
-         // True begin of the string
-         BeginOfThisString = Offset - SizeOfHeader - 8;
--- 
-2.7.4
-
diff --git a/external/lcms2/0017-Upgrade-Visual-studio-2017-15.8.patch.1 
b/external/lcms2/0017-Upgrade-Visual-studio-2017-15.8.patch.1
new file mode 100644
index 000000000000..f616e6d38239
--- /dev/null
+++ b/external/lcms2/0017-Upgrade-Visual-studio-2017-15.8.patch.1
@@ -0,0 +1,172 @@
+From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
+From: Marti Maria <i...@littlecms.com>
+Date: Wed, 15 Aug 2018 20:07:56 +0200
+Subject: [PATCH 17/18] Upgrade Visual studio 2017 15.8
+
+- Upgrade to 15.8
+- Add check on CGATS memory allocation (thanks to Quang Nguyen for
+pointing out this)
+---
+ Projects/VC2017/jpegicc/jpegicc.vcxproj           |  1 +
+ Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj       |  2 +-
+ Projects/VC2017/lcms2_static/lcms2_static.vcxproj |  2 +-
+ Projects/VC2017/linkicc/linkicc.vcxproj           |  2 +-
+ Projects/VC2017/psicc/psicc.vcxproj               |  2 +-
+ Projects/VC2017/testbed/testbed.vcxproj           |  2 +-
+ Projects/VC2017/tiffdiff/tiffdiff.vcxproj         |  2 +-
+ Projects/VC2017/tifficc/tifficc.vcxproj           |  2 +-
+ Projects/VC2017/transicc/transicc.vcxproj         |  1 +
+ src/cmscgats.c                                    | 14 ++++++++++----
+ 10 files changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj 
b/Projects/VC2017/jpegicc/jpegicc.vcxproj
+index ab26a53..39cfd00 100644
+--- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
++++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
+@@ -22,6 +22,7 @@
+     <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
+     <RootNamespace>jpegicc</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj 
b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
+index 4c8aa3f..d1bf3eb 100644
+--- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
++++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
+     <RootNamespace>lcms2_DLL</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj 
b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
+index 2a9988a..9fc05ce 100644
+--- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
++++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
+     <RootNamespace>lcms2_static</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj 
b/Projects/VC2017/linkicc/linkicc.vcxproj
+index 30c2b4e..51586dd 100644
+--- a/Projects/VC2017/linkicc/linkicc.vcxproj
++++ b/Projects/VC2017/linkicc/linkicc.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
+     <RootNamespace>linkicc</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/psicc/psicc.vcxproj 
b/Projects/VC2017/psicc/psicc.vcxproj
+index 9dcf89a..8f26e12 100644
+--- a/Projects/VC2017/psicc/psicc.vcxproj
++++ b/Projects/VC2017/psicc/psicc.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
+     <RootNamespace>psicc</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/testbed/testbed.vcxproj 
b/Projects/VC2017/testbed/testbed.vcxproj
+index 0af3762..3f6aea3 100644
+--- a/Projects/VC2017/testbed/testbed.vcxproj
++++ b/Projects/VC2017/testbed/testbed.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
+     <RootNamespace>testbed</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj 
b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
+index 7edfe28..3a6d837 100644
+--- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
++++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
+     <RootNamespace>tiffdiff</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj 
b/Projects/VC2017/tifficc/tifficc.vcxproj
+index cd9f04c..5ef954f 100644
+--- a/Projects/VC2017/tifficc/tifficc.vcxproj
++++ b/Projects/VC2017/tifficc/tifficc.vcxproj
+@@ -22,7 +22,7 @@
+     <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
+     <RootNamespace>tifficc</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
+-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/Projects/VC2017/transicc/transicc.vcxproj 
b/Projects/VC2017/transicc/transicc.vcxproj
+index d9b77c6..b3173d8 100644
+--- a/Projects/VC2017/transicc/transicc.vcxproj
++++ b/Projects/VC2017/transicc/transicc.vcxproj
+@@ -22,6 +22,7 @@
+     <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
+     <RootNamespace>transicc</RootNamespace>
+     <Keyword>Win32Proj</Keyword>
++    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+diff --git a/src/cmscgats.c b/src/cmscgats.c
+index 1a87613..8c3e96d 100644
+--- a/src/cmscgats.c
++++ b/src/cmscgats.c
+@@ -1,7 +1,7 @@
+ 
//---------------------------------------------------------------------------------
+ //
+ //  Little Color Management System
+-//  Copyright (c) 1998-2017 Marti Maria Saguer
++//  Copyright (c) 1998-2018 Marti Maria Saguer
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining
+ // a copy of this software and associated documentation files (the 
"Software"),
+@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
+     t-> nSamples   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
+     t-> nPatches   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
+ 
+-    t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * 
((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
+-    if (t->Data == NULL) {
++    if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || 
t->nPatches > 0x7ffe)
++    {
++        SynError(it8, "AllocateDataSet: too much data");
++    }
++    else {
++        t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) 
* ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
++        if (t->Data == NULL) {
+ 
+-        SynError(it8, "AllocateDataSet: Unable to allocate data array");
++            SynError(it8, "AllocateDataSet: Unable to allocate data array");

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

Reply via email to