diff options
Diffstat (limited to 'Build')
57 files changed, 2168 insertions, 1030 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README index 334a0df72b8..eec2731f8b4 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -49,8 +49,8 @@ mpfr 4.0.1 - checked 10feb18 pixman 0.34.0 - checked 04feb16 http://cairographics.org/releases/ -poppler 0.68.0 - checked 20aug18 - http://poppler.freedesktop.org/ - used by luatex and xetex +poppler 0.69.0 - checked 22sep18 + http://poppler.freedesktop.org/ - used by xetex (requires C++11) teckit 2.5.8 - checked 24jul18 diff --git a/Build/source/libs/poppler/ChangeLog b/Build/source/libs/poppler/ChangeLog index e5cd68be0e2..db7d9b507dd 100644 --- a/Build/source/libs/poppler/ChangeLog +++ b/Build/source/libs/poppler/ChangeLog @@ -1,3 +1,8 @@ +2018-09-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + Import poppler-0.69.0. + * Makefile.am, version.ac: Adjust. + 2018-08-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> Import poppler-0.68.0. diff --git a/Build/source/libs/poppler/Makefile.am b/Build/source/libs/poppler/Makefile.am index e20f407f543..949621cdfa6 100644 --- a/Build/source/libs/poppler/Makefile.am +++ b/Build/source/libs/poppler/Makefile.am @@ -43,8 +43,6 @@ nodist_libpoppler_a_SOURCES = \ goo_libGoo_a_sources = \ @POPPLER_TREE@/goo/gfile.cc \ @POPPLER_TREE@/goo/glibc.cc \ - @POPPLER_TREE@/goo/gmem.cc \ - @POPPLER_TREE@/goo/gmempp.cc \ @POPPLER_TREE@/goo/grandom.cc \ @POPPLER_TREE@/goo/gstrtod.cc \ @POPPLER_TREE@/goo/FixedPoint.cc \ diff --git a/Build/source/libs/poppler/Makefile.in b/Build/source/libs/poppler/Makefile.in index fc8765c2bde..e3d3ee03046 100644 --- a/Build/source/libs/poppler/Makefile.in +++ b/Build/source/libs/poppler/Makefile.in @@ -117,8 +117,6 @@ libpoppler_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = @POPPLER_TREE@/goo/gfile.$(OBJEXT) \ @POPPLER_TREE@/goo/glibc.$(OBJEXT) \ - @POPPLER_TREE@/goo/gmem.$(OBJEXT) \ - @POPPLER_TREE@/goo/gmempp.$(OBJEXT) \ @POPPLER_TREE@/goo/grandom.$(OBJEXT) \ @POPPLER_TREE@/goo/gstrtod.$(OBJEXT) \ @POPPLER_TREE@/goo/FixedPoint.$(OBJEXT) \ @@ -224,8 +222,6 @@ am__depfiles_remade = @POPPLER_TREE@/fofi/$(DEPDIR)/FoFiBase.Po \ @POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po \ @POPPLER_TREE@/goo/$(DEPDIR)/gfile.Po \ @POPPLER_TREE@/goo/$(DEPDIR)/glibc.Po \ - @POPPLER_TREE@/goo/$(DEPDIR)/gmem.Po \ - @POPPLER_TREE@/goo/$(DEPDIR)/gmempp.Po \ @POPPLER_TREE@/goo/$(DEPDIR)/grandom.Po \ @POPPLER_TREE@/goo/$(DEPDIR)/gstrtod.Po \ @POPPLER_TREE@/poppler/$(DEPDIR)/Annot.Po \ @@ -533,8 +529,6 @@ nodist_libpoppler_a_SOURCES = \ goo_libGoo_a_sources = \ @POPPLER_TREE@/goo/gfile.cc \ @POPPLER_TREE@/goo/glibc.cc \ - @POPPLER_TREE@/goo/gmem.cc \ - @POPPLER_TREE@/goo/gmempp.cc \ @POPPLER_TREE@/goo/grandom.cc \ @POPPLER_TREE@/goo/gstrtod.cc \ @POPPLER_TREE@/goo/FixedPoint.cc \ @@ -701,11 +695,6 @@ clean-noinstLIBRARIES: @POPPLER_TREE@/goo/glibc.$(OBJEXT): \ @POPPLER_TREE@/goo/$(am__dirstamp) \ @POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp) -@POPPLER_TREE@/goo/gmem.$(OBJEXT): @POPPLER_TREE@/goo/$(am__dirstamp) \ - @POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp) -@POPPLER_TREE@/goo/gmempp.$(OBJEXT): \ - @POPPLER_TREE@/goo/$(am__dirstamp) \ - @POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp) @POPPLER_TREE@/goo/grandom.$(OBJEXT): \ @POPPLER_TREE@/goo/$(am__dirstamp) \ @POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp) @@ -970,8 +959,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/gfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/glibc.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/gmem.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/gmempp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/grandom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/gstrtod.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/poppler/$(DEPDIR)/Annot.Po@am__quote@ # am--include-marker @@ -1421,8 +1408,6 @@ distclean: distclean-recursive -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gfile.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/glibc.Po - -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gmem.Po - -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gmempp.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/grandom.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gstrtod.Po -rm -f @POPPLER_TREE@/poppler/$(DEPDIR)/Annot.Po @@ -1547,8 +1532,6 @@ maintainer-clean: maintainer-clean-recursive -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gfile.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/glibc.Po - -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gmem.Po - -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gmempp.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/grandom.Po -rm -f @POPPLER_TREE@/goo/$(DEPDIR)/gstrtod.Po -rm -f @POPPLER_TREE@/poppler/$(DEPDIR)/Annot.Po diff --git a/Build/source/libs/poppler/TLpatches/ChangeLog b/Build/source/libs/poppler/TLpatches/ChangeLog index 418de163d1c..fb96bc15078 100644 --- a/Build/source/libs/poppler/TLpatches/ChangeLog +++ b/Build/source/libs/poppler/TLpatches/ChangeLog @@ -1,3 +1,7 @@ +2018-09-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * patch-03-time: Adapted. + 2018-08-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * patch-03-time: Adapted. diff --git a/Build/source/libs/poppler/TLpatches/TL-Changes b/Build/source/libs/poppler/TLpatches/TL-Changes index 3a36f6927f8..113c41807b5 100644 --- a/Build/source/libs/poppler/TLpatches/TL-Changes +++ b/Build/source/libs/poppler/TLpatches/TL-Changes @@ -1,9 +1,12 @@ -Changes applied to the poppler-0.68.0 tree as obtained from: +Changes applied to the poppler-0.69.0 tree as obtained from: http://poppler.freedesktop.org/ Removed unused dirs: cmake cpp glib qt5 test utils +Removed unused file: + .gitlab-ci.yml + Removed unused files in splash: only SplashTypes.h is used diff --git a/Build/source/libs/poppler/TLpatches/patch-03-time b/Build/source/libs/poppler/TLpatches/patch-03-time index 6b9d3d12a56..ce313dcf175 100644 --- a/Build/source/libs/poppler/TLpatches/patch-03-time +++ b/Build/source/libs/poppler/TLpatches/patch-03-time @@ -1,6 +1,6 @@ -diff -ur poppler-0.68.0/goo/gfile.h poppler-src/goo/gfile.h ---- poppler-0.68.0/goo/gfile.h Mon Aug 20 06:37:51 2018 -+++ poppler-src/goo/gfile.h Mon Aug 20 11:17:15 2018 +diff -ur poppler-0.69.0/goo/gfile.h poppler-src/goo/gfile.h +--- poppler-0.69.0/goo/gfile.h Sat Sep 22 06:41:09 2018 ++++ poppler-src/goo/gfile.h Sat Sep 22 15:30:17 2018 @@ -51,8 +51,6 @@ # include <windows.h> # endif @@ -10,9 +10,9 @@ diff -ur poppler-0.68.0/goo/gfile.h poppler-src/goo/gfile.h #else # include <unistd.h> # include <sys/types.h> -diff -ur poppler-0.68.0/poppler/Form.h poppler-src/poppler/Form.h ---- poppler-0.68.0/poppler/Form.h Mon Aug 20 06:37:51 2018 -+++ poppler-src/poppler/Form.h Mon Aug 20 11:18:08 2018 +diff -ur poppler-0.69.0/poppler/Form.h poppler-src/poppler/Form.h +--- poppler-0.69.0/poppler/Form.h Sat Sep 22 06:41:09 2018 ++++ poppler-src/poppler/Form.h Sat Sep 22 15:30:57 2018 @@ -36,6 +36,7 @@ #include <set> diff --git a/Build/source/libs/poppler/configure b/Build/source/libs/poppler/configure index 906dee62485..d77ad4469b6 100755 --- a/Build/source/libs/poppler/configure +++ b/Build/source/libs/poppler/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for poppler (TeX Live) 0.68.0. +# Generated by GNU Autoconf 2.69 for poppler (TeX Live) 0.69.0. # # Report bugs to <tex-k@tug.org>. # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='poppler (TeX Live)' PACKAGE_TARNAME='poppler--tex-live-' -PACKAGE_VERSION='0.68.0' -PACKAGE_STRING='poppler (TeX Live) 0.68.0' +PACKAGE_VERSION='0.69.0' +PACKAGE_STRING='poppler (TeX Live) 0.69.0' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures poppler (TeX Live) 0.68.0 to adapt to many kinds of systems. +\`configure' configures poppler (TeX Live) 0.69.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1374,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of poppler (TeX Live) 0.68.0:";; + short | recursive ) echo "Configuration of poppler (TeX Live) 0.69.0:";; esac cat <<\_ACEOF @@ -1487,7 +1487,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -poppler (TeX Live) configure 0.68.0 +poppler (TeX Live) configure 0.69.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2134,7 +2134,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by poppler (TeX Live) $as_me 0.68.0, which was +It was created by poppler (TeX Live) $as_me 0.69.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4057,7 +4057,7 @@ fi # Define the identity of the package. PACKAGE='poppler--tex-live-' - VERSION='0.68.0' + VERSION='0.69.0' # Some tools Automake needs. @@ -7647,7 +7647,7 @@ ac_config_headers="$ac_config_headers poppler-config.h:poppler-src/poppler/poppl cat >>confdefs.h <<_ACEOF -#define POPPLER_VERSION "0.68.0" +#define POPPLER_VERSION "0.69.0" _ACEOF @@ -8341,7 +8341,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by poppler (TeX Live) $as_me 0.68.0, which was +This file was extended by poppler (TeX Live) $as_me 0.69.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8407,7 +8407,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -poppler (TeX Live) config.status 0.68.0 +poppler (TeX Live) config.status 0.69.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/poppler/poppler-src/CMakeLists.txt b/Build/source/libs/poppler/poppler-src/CMakeLists.txt index cf3a542389e..b664e5f3d9a 100644 --- a/Build/source/libs/poppler/poppler-src/CMakeLists.txt +++ b/Build/source/libs/poppler/poppler-src/CMakeLists.txt @@ -30,11 +30,11 @@ if (ECM_FOUND) endif() set(POPPLER_MAJOR_VERSION "0") -set(POPPLER_MINOR_VERSION "68") +set(POPPLER_MINOR_VERSION "69") set(POPPLER_MICRO_VERSION "0") set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}") -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_EXTENSIONS OFF) # command line switches @@ -315,11 +315,9 @@ configure_file(poppler/poppler-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/popple set(poppler_SRCS goo/gfile.cc - goo/gmempp.cc goo/GooList.cc goo/GooTimer.cc goo/GooString.cc - goo/gmem.cc goo/FixedPoint.cc goo/NetPBMWriter.cc goo/PNGWriter.cc @@ -489,7 +487,7 @@ add_library(poppler STATIC ${poppler_SRCS}) else() add_library(poppler ${poppler_SRCS}) endif() -set_target_properties(poppler PROPERTIES VERSION 79.0.0 SOVERSION 79) +set_target_properties(poppler PROPERTIES VERSION 80.0.0 SOVERSION 80) if(MINGW) get_target_property(POPPLER_SOVERSION poppler SOVERSION) set_target_properties(poppler PROPERTIES SUFFIX "-${POPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") @@ -584,9 +582,11 @@ if(ENABLE_XPDF_HEADERS) goo/GooString.h goo/gtypes.h goo/gmem.h + goo/gdir.h goo/gfile.h goo/FixedPoint.h goo/ImgWriter.h + goo/GooCheckedOps.h goo/GooLikely.h goo/gstrtod.h goo/grandom.h diff --git a/Build/source/libs/poppler/poppler-src/ChangeLog b/Build/source/libs/poppler/poppler-src/ChangeLog index a5d852168ec..153cc6a0cb5 100644 --- a/Build/source/libs/poppler/poppler-src/ChangeLog +++ b/Build/source/libs/poppler/poppler-src/ChangeLog @@ -1,3 +1,1081 @@ +commit 2052dc60f5b7403418384237d4bad2c7faf0acee +Author: Albert Astals Cid <aacid@kde.org> +Date: Fri Sep 21 23:41:09 2018 +0200 + + Poppler 0.69 + + CMakeLists.txt | 4 ++-- + NEWS | 31 +++++++++++++++++++++++++++++++ + cpp/Doxyfile | 2 +- + qt5/src/CMakeLists.txt | 2 +- + qt5/src/Doxyfile | 2 +- + 5 files changed, 36 insertions(+), 5 deletions(-) + +commit 554e87a1ea76ce73b4cfe6fca5b9c1bb47502dad +Author: Albert Astals Cid <aacid@kde.org> +Date: Fri Sep 21 18:00:24 2018 +0200 + + offset from beginning of file can't be < 0 + + poppler/XRef.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 06c344ccb8ccfafa9c506f40226ea2cce0e5f75c +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Sep 21 09:43:40 2018 +0200 + + Use deferred sorting with Dict again to avoid performance regression + + This tries to move sorting a Dict into the first find call again, + but tries + harder to make the double-checked locking work correctly so that + at least + concurrent calls to find are correct (but concurrent calls to find and + add, set or remove are still not allowed). + + poppler/Dict.cc | 24 ++++++++++++++---------- + poppler/Dict.h | 2 +- + 2 files changed, 15 insertions(+), 11 deletions(-) + +commit 22ea442de8776e7e6fa78062cb8bb224b98e736f +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Sep 20 23:23:56 2018 +0200 + + SplashOutputDev::drawImage: gmallocn -> checkoverflow + + oss-fuzz/10194 + + And also add a likely for the previous change in the file + + poppler/SplashOutputDev.cc | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +commit 8ff1bddc6a97a5f8b43ff95405f0642fb03f962b +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Sep 20 23:21:02 2018 +0200 + + Splash::scaleImageYdXd: gmallocn -> gmallocn_checkoverflow + + oss-fuzz/10205 + + splash/Splash.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit cf25cd0c4893b62a9993034079a6c89c6ca370ee +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Sep 20 23:17:06 2018 +0200 + + SplashOutputDev::drawSoftMaskedImage: gmallocn -> + gmallocn_checkoverflow + + oss-fuzz/10298 + + poppler/SplashOutputDev.cc | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit b5db021a71e38d56079cbcfcaf3345765e9ed782 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Sep 20 23:10:55 2018 +0200 + + GfxUnivariateShading::setupCache: gmallocn -> gmallocn_checkoverflow + + oss-fuzz/10508 + + poppler/GfxState.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit ab1b051a9f65b7f8e4dc9f8f9c28a0aff0c86596 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Sep 20 23:05:55 2018 +0200 + + Remove unused variable + + poppler/Gfx.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d1a4c5a9faf95618fc302c358021a745afc0527c +Author: Denis Onishchenko <denis.onischenko@gmail.com> +Date: Thu Sep 20 22:57:03 2018 +0200 + + Fix 2 errors in computation of type3 glyphs transformation matrix + + poppler/Gfx.cc | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +commit 5dadcc93c4d4d44d0ec3bdc6bb54851f6ffaee98 +Author: Tobias Deiminger <haxtibal@posteo.de> +Date: Sun Sep 9 09:28:22 2018 +0200 + + Compile Qt5 frontend with -DQT_STRICT_ITERATORS + + QT_STRICT_ITERATORS prevents conversion from non-const iterator to + const iterator. + + It helps detecting situations where we waste resources due to + needless detach from implicitely shared container data (i.e. deep + copy). + + If anyone should run into problems, they can disable strict iterators + using a global cache variable: + + $ cmake DENABLE_QT_STRICT_ITERATORS=OFF [...] + + qt5/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 3105b61e0912df397dd712632d8ea16269ff4d94 +Author: Albert Astals Cid <aacid@kde.org> +Date: Wed Sep 19 23:17:07 2018 +0200 + + Update (C) + + poppler/OptionalContent.h | 1 + + poppler/StructTreeRoot.cc | 1 + + poppler/StructTreeRoot.h | 1 + + qt5/src/poppler-link.cc | 1 + + qt5/src/poppler-optcontent.cc | 1 + + 5 files changed, 5 insertions(+) + +commit 5bbb2fc4b159b003a22a9d3327ba290a7bba15f0 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Sep 18 21:36:13 2018 +0200 + + Add a separate build job using Ubuntu 14.04 and GCC 4.9 to + compatibility with older systems. + + .gitlab-ci.yml | 35 +++++++++++++++++++++++++++-------- + 1 file changed, 27 insertions(+), 8 deletions(-) + +commit 560b34a6e2d3fd58edfb5f0af751f1aa7d3dc3d8 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Sep 18 11:35:55 2018 +0200 + + Prevent leaking OptionalContentGroup by using unique_ptr as early + as possible. oss-fuzz/10418 + + poppler/OptionalContent.cc | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 7ac84c1d633b49d69b1ec80606fdca8ee14d80e0 +Author: Oliver Sander <oliver.sander@tu-dresden.de> +Date: Tue Sep 18 11:18:33 2018 +0200 + + Document the new 'ArthurFontID' type + + qt5/src/ArthurOutputDev.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5048bec585be382f9d37110c6b2e16d26d29d5b2 +Author: Oliver Sander <oliver.sander@tu-dresden.de> +Date: Tue Sep 18 11:02:58 2018 +0200 + + Bugfix: Do not disregard Ref::gen when using Ref as a cache key + + According to Leonard Rosenthol's book, the 'gen' field of a + reference is almost always zero. However, this doesn't mean that + it can be ignored when comparing two Refs. + + Incidentally, this patch also makes use of the recently introduced + Ref::operator<, which allows to replace the small custom class + ArthurFontID by a std::pair. + + qt5/src/ArthurOutputDev.h | 14 +------------- + 1 file changed, 1 insertion(+), 13 deletions(-) + +commit 7e9b6f1dba716e7adba1ed2ecd765b207def9747 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Sat Sep 15 09:54:01 2018 +0200 + + Fix TODO in OCGs by creating a look-up table from Ref to + OptionalContentGroup (and make Ref a regular type to do so). + + glib/poppler-document.cc | 12 ++++-------- + poppler/Object.h | 31 +++++++++++++++++++++++++------ + poppler/OptionalContent.cc | 42 + ++++++++++-------------------------------- + poppler/OptionalContent.h | 9 +++++---- + poppler/StructTreeRoot.cc | 2 +- + poppler/StructTreeRoot.h | 2 +- + qt5/src/poppler-link.cc | 5 ----- + qt5/src/poppler-optcontent.cc | 9 ++++----- + utils/pdfinfo.cc | 2 +- + 9 files changed, 51 insertions(+), 63 deletions(-) + +commit 94527d5a61eb3402b49436b978bad69f71884051 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Sat Sep 15 09:31:37 2018 +0200 + + Check for Ref type before unwrapping Object as such + + oss-fuzz/10359 + + poppler/OptionalContent.cc | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 3af4c151cf09e1e98d311e8308060eb832bdd7d2 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Sun Sep 2 13:48:17 2018 +0200 + + Make Object::takeString leave a dead object instead of a null string + and hence assert non-null strings during object creation. + + poppler/Object.h | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit a238d170dd89e27efd44ea09126b84272c0ac47b +Author: Tobias Deiminger <haxtibal@posteo.de> +Date: Fri Sep 7 16:30:48 2018 +0200 + + Add missing newline after Tf in setTextFont + + Until now AnnotAppearanceBuilder::setTextFont was only used to write + last operation in apperance string for /DA. There you don't notice + the missing delimiter. Delimiter will however be required in general, + e.g. when writing appearance string for /AP. + + poppler/Annot.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 1acbe6af40e598b3afae18709eb32ec44d7b1afc +Author: Tobias Deiminger <haxtibal@posteo.de> +Date: Sat Sep 8 12:39:25 2018 +0200 + + Fix compilation with QT_STRICT_ITERATORS + + qt5/tests/check_annotations.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 574840c5a61a9a20c930dd6fec63e6cf11bacfa5 +Author: Christian Persch <chpe@src.gnome.org> +Date: Wed Sep 5 21:19:04 2018 +0200 + + goo: Split GDir and GDirEntry out of gfile.h + + This allows including gfile.h together with glib.h which has + a conflicting GDir type. + + https://gitlab.freedesktop.org/poppler/poppler/issues/370 + + CMakeLists.txt | 1 + + goo/gdir.h | 91 + +++++++++++++++++++++++++++++++++++++++++++++++++ + goo/gfile.cc | 1 + + goo/gfile.h | 49 -------------------------- + poppler/GlobalParams.cc | 1 + + 5 files changed, 94 insertions(+), 49 deletions(-) + +commit f2223e12e401648a24d559ba766759b8afac2d5e +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Sun Sep 2 10:43:18 2018 +0200 + + Assert validity of Object contents where at least constructor or + destructor seem to assume it to catch errors as early as possible + when using debug builds. + + poppler/Object.cc | 8 ++------ + poppler/Object.h | 9 +++++---- + 2 files changed, 7 insertions(+), 10 deletions(-) + +commit 7c6c1fef6a7eab712ad335d63c5fe7ff05e6e59f +Author: Albert Astals Cid <aacid@kde.org> +Date: Sun Sep 2 13:32:01 2018 +0200 + + pdftotext: Fix memory leak in printLine + + utils/pdftotext.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit e8e95d2ca4f1c108cc69cab72c7c5ab31f80a597 +Author: Sanchit Anand <sanxchit@gmail.com> +Date: Tue Aug 28 02:58:39 2018 -0400 + + pdftotext: Fix only outputs first page content with -bbox-layout + option + + Issue #88 + + poppler/TextOutputDev.cc | 5 +++++ + poppler/TextOutputDev.h | 5 +++++ + utils/pdftotext.cc | 6 ++---- + 3 files changed, 12 insertions(+), 4 deletions(-) + +commit 09cc5fd1b4ef758b1f496b33bc5c5cb9e63b08eb +Author: Albert Astals Cid <aacid@kde.org> +Date: Sun Sep 2 13:10:45 2018 +0200 + + qt5: test: Compile with old qt + + qt5/tests/check_annotations.cpp | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 042d2483c04652036ab921983b4967851f3bb8cf +Author: Albert Astals Cid <aacid@kde.org> +Date: Sun Sep 2 12:39:09 2018 +0200 + + Add missing (C) + + And minor style change by Albert + + poppler/Annot.cc | 6 ++++-- + poppler/Annot.h | 6 ++++-- + qt5/src/poppler-annotation-helper.h | 1 + + qt5/src/poppler-annotation.cc | 2 ++ + qt5/src/poppler-annotation.h | 1 + + 5 files changed, 12 insertions(+), 4 deletions(-) + +commit d4b4be23c8b55a118f7b9194a93a8e9da38793c1 +Author: Tobias Deiminger <haxtibal@posteo.de> +Date: Sat Aug 25 23:08:39 2018 +0200 + + More review fixes + + Text color is indicated by nonstroking color in graphics state + Assumption: Text rendering mode is 'fill'. + + Increase color precision for lossless roundtrip of 16 bit integers + Our API takes QColor from user. We want to support a lossless + roundtrip + of QColor (16 bit per channel internally) through document + save and + load, and empirically found .5f is best match. + + Check only .5f case of color channel roundtrip. Include 65535. + We check if precision == 5 is sufficient, and fail if not. We + know that + precision < 5 will never work, because target set contains + less numbers + than uint16 range. + + Use smart pointer in textFont and textColor + + Add test for CMYK QColor roundtrip + + Support QColor::Cmyk to AnnotColor::colorCMYK conversion + + Add simple test for font size. Fix actual/expected args. + + Model font name as class Object, type objName + Take into account that ISO 32000 says Tf operand is always + an object of + PDF type "name". Further benefit: class Object introduces + ownership + semantcis. + + Use more std::unique_ptr and fix some coding syle + Some places assumed ownership implicitely. Make it more + explicit. + + Move parse/constructAppearanceString into DefaultAppearance + We gain cohesion and automatic memory management. + + Fix minor styling issues + + Use std::make_unique from C++14 + + poppler/Annot.cc | 163 + ++++++++++++++++++++-------------------- + poppler/Annot.h | 29 ++++--- + qt5/src/poppler-annotation.cc | 85 +++++++++++++-------- + qt5/tests/check_annotations.cpp | 66 +++++++++++----- + 4 files changed, 199 insertions(+), 144 deletions(-) + +commit b67e7ab708a0606298fd3707347bed935390d062 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 24 20:14:14 2018 +0200 + + Add a roundtrip consistency test for the text color properties + of annotations. + + qt5/tests/CMakeLists.txt | 1 + + qt5/tests/check_annotations.cpp | 75 + +++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 76 insertions(+) + +commit db0451ab16060509d13415162a95db269ca0d4f3 +Author: Tobias Deiminger <haxtibal@posteo.de> +Date: Sat Aug 25 19:57:13 2018 +0200 + + Fix open review comments from #50 + + Make fontTag optional for AnnotFreeText::parseAppearanceString. + Handle fontColor == nullptr in + AnnotFreeText::constructAppearanceString. + Use AnnotAppearanceBuilder in + AnnotFreeText::constructAppearanceString. + Delete copy assignment operator for DefaultAppearance. + Rename setAppearanceString to setDefaultAppearance. + + poppler/Annot.cc | 45 + +++++++++++++++++-------------------------- + poppler/Annot.h | 8 +++++--- + qt5/src/poppler-annotation.cc | 2 +- + 3 files changed, 24 insertions(+), 31 deletions(-) + +commit 64531344de3dc663a4429e94381d68cc198d0425 +Author: Dileep Sankhla <sankhla.dileep96@gmail.com> +Date: Thu Aug 23 17:48:39 2018 +0200 + + Add annotation font color + + poppler/Annot.cc | 73 +++++++++++++++++++++----- + poppler/Annot.h | 29 +++++++++-- + qt5/src/poppler-annotation-helper.h | 2 +- + qt5/src/poppler-annotation.cc | 101 + ++++++++++++++++++++++-------------- + qt5/src/poppler-annotation.h | 4 ++ + 5 files changed, 152 insertions(+), 57 deletions(-) + +commit f506b8bc52efd0781a933a44bb58d02fb000c78d +Author: Albert Astals Cid <aacid@kde.org> +Date: Sat Sep 1 23:54:26 2018 +0200 + + Fix handling of Signature Info Location and Reason + + We can't call GooString->getCString and just store that char * + as it belonged to us since it may very well be the inner array + of the GooString and be invalid once the GooString goes away + + poppler/Form.cc | 6 +++--- + poppler/SignatureInfo.cc | 8 ++++---- + poppler/SignatureInfo.h | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) + +commit 7418616dbfc9c4e5b05b7a57f4fabed3bf9fdcb0 +Author: Albert Astals Cid <aacid@kde.org> +Date: Sat Sep 1 23:51:48 2018 +0200 + + Link: Fix memory leak regarding next actions + + poppler/Link.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 45f0f6d21d51c0408fe1d876f18ef05489e69bc0 +Author: Evangelos Rigas <erigas@rnd2.org> +Date: Mon Aug 6 10:57:47 2018 +0100 + + [utils] Add PDF subtype to pdfinfo + + If the document is compliant with PDF A, E, VT, UA or X standard + print PDF subtype version, title, subtitle and explain the part + and conformance levels. + + utils/pdfinfo.cc | 238 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 238 insertions(+) + +commit 98d1b3dcc2c0530c12fb4422067c529ab375c680 +Author: Evangelos Rigas <erigas@rnd2.org> +Date: Wed Aug 22 10:51:12 2018 +0300 + + [core] Add support for PDF subtype property + + Parse /GTS_PDF(A,E,UA,VT,X)Version from the PDF Information + Dictionary into three enums: PDFSubtype, PDFSubtypePart, and + PDFSubtypeConformance. + + poppler/PDFDoc.cc | 132 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + poppler/PDFDoc.h | 46 +++++++++++++++++++ + 2 files changed, 178 insertions(+) + +commit 4f039c57fee4413a500a9e36bf8350eae1130442 +Author: Albert Astals Cid <aacid@kde.org> +Date: Sat Sep 1 01:05:02 2018 +0200 + + Update (C) from last commits + + cpp/poppler-image.cpp | 1 + + poppler/GfxState.cc | 1 + + poppler/JBIG2Stream.cc | 1 + + qt5/src/ArthurOutputDev.cc | 1 + + splash/SplashPath.cc | 1 + + 5 files changed, 5 insertions(+) + +commit 9df44cf1e0e300b751cd1c562f2b48335db72ac7 +Author: Jakub Wilk <jwilk@jwilk.net> +Date: Fri Aug 31 12:05:56 2018 +0200 + + Install goo/GooCheckedOps.h + + goo/gmem.h includes goo/GooCheckedOps.h, so they should be installed + together. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 55e2b746e6bd3e495c30fe7e5154ec2c956d3faa +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 31 19:17:59 2018 +0200 + + Check for allocation failure during processing of JBIG2 + streams. oss-fuzz/10146 + + poppler/JBIG2Stream.cc | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +commit bb078cbd88252e421d14747b98c5c71062cf7571 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 31 20:18:23 2018 +0200 + + Always check for allocation failure after calling SplashPath::grow + and also set curSubpath to zero so that noCurrentPoint applies after + allocation failure. oss-fuzz/10148 + + splash/SplashPath.cc | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit f200264ddb0a16f54ae2711f399867e659957b1d +Author: Albert Astals Cid <aacid@kde.org> +Date: Fri Aug 31 20:03:36 2018 +0200 + + FoFiType1C::getDeltaIntArray: Fix undefined inf to int conversion + + fofi/FoFiType1C.cc | 3 +++ + 1 file changed, 3 insertions(+) + +commit 9bfc10eecb57354270806aa1d9278eebb1db2287 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 31 18:47:52 2018 +0200 + + Bump required C++ standard version to C++14 and convert a few + hopefully obvious call sites where types are repeated to using + std::make_unique. + + CMakeLists.txt | 2 +- + cpp/poppler-image.cpp | 2 +- + cpp/poppler-page.cpp | 14 +++++++------- + poppler/GfxState.cc | 2 +- + qt5/src/ArthurOutputDev.cc | 46 + +++++++++++++++++++++++++++------------------- + 5 files changed, 37 insertions(+), 29 deletions(-) + +commit d2fa4a727fc994256219a4c4f777a1c38dcc26c5 +Author: Albert Astals Cid <aacid@kde.org> +Date: Fri Aug 31 19:53:05 2018 +0200 + + (C) of previous commits + + fofi/FoFiType1C.cc | 1 + + poppler/SplashOutputDev.h | 1 + + 2 files changed, 2 insertions(+) + +commit 51f1c813970627db0b8804f6a729eed79ac9dfb4 +Author: Stefan Brüns <stefan.bruens@rwth-aachen.de> +Date: Fri Aug 31 00:27:13 2018 +0200 + + SplashPath: Allocate temporary pathes on the stack + + The majority of SplashPath'es are created using + convertPath(GfxState *, GfxPath *), and are only temporary, + i.e. with function scope. + + Returning a SplashPath instead of a pointer from convertPath() + - which is cheap due to the move constructor - saves recurrent + new/delete's for each stroke/fill/... operation. + + poppler/SplashOutputDev.cc | 69 + ++++++++++++++++------------------------------ + poppler/SplashOutputDev.h | 2 +- + 2 files changed, 25 insertions(+), 46 deletions(-) + +commit a31a9e1b9a1eefcea4c8e08f2d84deb0ac6cc4ae +Author: Stefan Brüns <stefan.bruens@rwth-aachen.de> +Date: Fri Aug 31 00:23:32 2018 +0200 + + SplashPath: Add move constructor + + After moving, the new SplashPath is in the same state as it + has been copy constructed, the moved from is in the same + state as default constructed, i.e. empty. + + splash/SplashPath.cc | 17 +++++++++++++++++ + splash/SplashPath.h | 1 + + 2 files changed, 18 insertions(+) + +commit 2190b9997ac786189368fc03e46e540c308f11b5 +Author: Stefan Brüns <stefan.bruens@rwth-aachen.de> +Date: Wed Aug 29 00:21:57 2018 +0200 + + Allocate temporary SplashXPath on the stack + + SplashXPath is only used inside the each fill function, but newer + passed to the outside. As it is small, there is no reason not to + allocate it on the stack. + + splash/Splash.cc | 36 +++++++++++++----------------------- + 1 file changed, 13 insertions(+), 23 deletions(-) + +commit 38caf0adac8811e663b51656638177397f1400f6 +Author: Albert Astals Cid <aacid@kde.org> +Date: Fri Aug 31 10:00:15 2018 +0200 + + Add clang + libc++ testing pipeline + + Would have catched the missing array include in PSOutputDev + + .gitlab-ci.yml | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +commit 4244a048e55d7cce0caddc68b6bb21983e670bc4 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 31 07:33:31 2018 +0200 + + Replace #pragma once by standard-supported include guards and add + missing copyright preamble for new header. + + goo/GooCheckedOps.h | 15 ++++++++++++++- + goo/gmem.h | 5 ++++- + 2 files changed, 18 insertions(+), 2 deletions(-) + +commit 5671d3acc6a723ac3cb63866e2f429e0f0075c68 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Thu Aug 30 21:27:13 2018 +0200 + + Extend checked operations header with support for Clang in addition + to checking for GCC version 5 or later. + + goo/GooCheckedOps.h | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit ed28a5612fc0bf8580ccd360ae086fc715d19b35 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Thu Aug 30 20:56:33 2018 +0200 + + Fix delta decoding for Type1C fonts to avoid signed integer + overflow. oss-fuzz/8424 + + fofi/FoFiType1C.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit de20e92a70e73d828984f41f52212051fba51700 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Thu Aug 30 20:54:17 2018 +0200 + + Factor out overflow-checked multiplication into a separate header + for extension and reuse. + + goo/GooCheckedOps.h | 32 ++++++++++++++++++++++++++++++++ + goo/gmem.h | 16 ++-------------- + 2 files changed, 34 insertions(+), 14 deletions(-) + +commit 3407c5c8003e67deba2b477741ac471927d40f14 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 31 07:38:34 2018 +0200 + + Reintroduce the assertion in Array::remove since there it is not + possible to check any return value. + + poppler/Array.cc | 1 + + 1 file changed, 1 insertion(+) + +commit 2c25d197c921e292f49aa2b25f4006acd57c1440 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Thu Aug 30 20:26:55 2018 +0200 + + Remove index out of range assertions from Array getters + + A lot of code seems to have been incompatible with the recently + removed DEBUG_MEM + flag, i.e. it relied on the Array getters returning a null object + when the index + was out of range and rather checked the returned object type (since + they had to do + that in any case) than the index. + + Due to this, debug builds became much harder to test, especially + using fuzzing. This + commit thereby removes the assertions to restore the situation when + DEBUG_MEM was + present but disabeld by default and should thereby fix oss-fuzz/10121. + + poppler/Array.cc | 3 --- + 1 file changed, 3 deletions(-) + +commit 987bbb684e688651e3d06502e2ff9b6f08130538 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 30 22:49:19 2018 +0200 + + PSOutputDev: Hopefully fix compilation under MSVC + + poppler/PSOutputDev.cc | 1 + + 1 file changed, 1 insertion(+) + +commit df818b383cf4fa402b89f7b2dd0f958a749a4790 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 30 20:46:20 2018 +0200 + + SplashPath: Fix overflow check + + What signals overflow is size being 0 not length being 0 + + splash/SplashPath.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 23d570a6f47bc9bc7bf0bcb5dd561885c9a2c55a +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 30 18:54:55 2018 +0200 + + SplashPath: Check for overflow + + fixes oss-fuzz/10120 + + splash/SplashPath.cc | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit ad107bbb8e4d8eb1a23e530d040d5b11bb8ff859 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 30 18:28:50 2018 +0200 + + JBIG2Bitmap: Fix overflow check + + Fixes oss-fuzz/10113 + + poppler/JBIG2Stream.cc | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +commit e3a3e3fa996f318c36f9926fa8cc5dfc9edfac20 +Author: Philipp Knechtges <philipp-dev@knechtges.com> +Date: Sun Aug 26 19:37:29 2018 +0200 + + PSOutputDev: add native support for type 7 shadings when using level 3 + + Type 7 shadings are identical for PS and PDF, so we can just emit + the corresponding + information rather than tiling the whole domain. + + poppler/PSOutputDev.cc | 55 + ++++++++++++++++++++++++++++++++++++++++++++++++++ + poppler/PSOutputDev.h | 4 +++- + 2 files changed, 58 insertions(+), 1 deletion(-) + +commit de34900993bff73c8da651319027b2fa8c490172 +Author: Ed Porras <ed@motologic.com> +Date: Sun Aug 26 20:24:23 2018 +0200 + + fix macOS compilation due to boolean define in jpeglib + + typedef enum { FALSE = 0, TRUE = 1 } boolean; + + goo/JpegWriter.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit be05f7640ca13a6eb327dfac0073acc5dae1e3b4 +Author: Albert Astals Cid <aacid@kde.org> +Date: Wed Aug 29 19:02:34 2018 +0200 + + Add (c) of the last few commits + + goo/gmem.h | 1 + + poppler/Array.cc | 1 + + poppler/CairoRescaleBox.cc | 1 + + poppler/GfxFont.cc | 1 + + poppler/Object.cc | 1 + + poppler/poppler-config.h.cmake | 1 + + utils/pdfdetach.cc | 1 + + utils/pdffonts.cc | 1 + + utils/pdfimages.cc | 1 + + utils/pdfinfo.cc | 1 + + utils/pdftocairo.cc | 1 + + utils/pdftohtml.cc | 1 + + utils/pdftoppm.cc | 2 +- + utils/pdftops.cc | 1 + + utils/pdftotext.cc | 1 + + 15 files changed, 15 insertions(+), 1 deletion(-) + +commit 7d523aeae16daf2d504c058031fff90a1a17bf64 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 20:03:17 2018 +0200 + + Use GCC instrinsics to perform overflow checking in the gmem + allocation functions. + + goo/gmem.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 2b4371b434b27874b64742dcd885e4f303082810 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 19:55:44 2018 +0200 + + Turn gmem into a header-only wrapper to allow unnecessary branches + to be optimized away and function call overhead to be aovided. + + CMakeLists.txt | 1 - + goo/gmem.cc | 171 + ----------------------------------------- + goo/gmem.h | 185 + +++++++++++++++++++++++++++++++++++---------- + poppler/CairoRescaleBox.cc | 6 +- + poppler/GfxFont.cc | 2 +- + 5 files changed, 147 insertions(+), 218 deletions(-) + +commit c362ab1b97f20c5b73b3bad8d52015f679178748 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 19:42:29 2018 +0200 + + Remove DEBUG_MEM from Object since this uses RAII now and hence + cannot leak. (The existing tracking also is not thread-safe and + hence unreliable.) + + poppler/Object.cc | 31 ------------------------------- + poppler/Object.h | 17 ----------------- + poppler/poppler-config.h.cmake | 3 +-- + utils/pdfdetach.cc | 3 --- + utils/pdffonts.cc | 3 --- + utils/pdfimages.cc | 3 --- + utils/pdfinfo.cc | 3 --- + utils/pdftocairo.cc | 3 --- + utils/pdftohtml.cc | 3 --- + utils/pdftoppm.cc | 3 --- + utils/pdftops.cc | 3 --- + utils/pdftotext.cc | 3 --- + 12 files changed, 1 insertion(+), 77 deletions(-) + +commit 122b3ca5838f9648646d7a2940badaae86756f03 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 19:39:20 2018 +0200 + + Replace specific DEBUG_MEM in Array implementation by debug + assertions. + + poppler/Array.cc | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +commit f89446f6917a869b0f1a80fcc8ce81a7213dade4 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 19:37:25 2018 +0200 + + Remove generic heap debugging from gmem since external tools and + compiler instrumentation achieve the same effect. + + goo/gmem.cc | 151 + ---------------------------------------------------- + goo/gmem.h | 9 ---- + utils/pdfdetach.cc | 1 - + utils/pdffonts.cc | 1 - + utils/pdfimages.cc | 1 - + utils/pdfinfo.cc | 1 - + utils/pdftocairo.cc | 1 - + utils/pdftohtml.cc | 1 - + utils/pdftoppm.cc | 1 - + utils/pdftops.cc | 1 - + utils/pdftotext.cc | 1 - + 11 files changed, 169 deletions(-) + +commit 38b67245941a8672372953142b06c80cd0a142c0 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon Aug 27 19:27:41 2018 +0200 + + Remove gmempp implementing C++ memory allocation operators using + gmalloc for heap debugging. + + CMakeLists.txt | 1 - + goo/gmempp.cc | 32 -------------------------------- + 2 files changed, 33 deletions(-) + +commit d62d65c21f01c7b0a7c28adebcab43d667bcaed9 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Sat Aug 25 20:06:13 2018 +0200 + + Use --output-on-failure ctest flag to make failed CI runs more + informative. + + .gitlab-ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 93b214986aa89bc085c7937f63e5eafe795d985c +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Fri Aug 24 07:42:52 2018 +0200 + + Reconstruct iterator via index arithmetic instead of relying on a + non-standard constructor to fix builds on MSVC. + + poppler/Dict.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit dcd8ad25023db542ade5edc23fc5f943d8ee6376 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 23 23:07:41 2018 +0200 + + Also delete Object::dictAdd that takes a char * + + Makes sure noone gets a char * -> const char * promotion via Object + + poppler/Object.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d63564b2bca955c7ef6ec694e3c64f9e4ee46d57 +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 23 23:10:57 2018 +0200 + + Add Adam's copyright for the last patchset + + poppler/Annot.cc | 1 + + poppler/Catalog.cc | 1 + + poppler/Catalog.h | 1 + + poppler/Dict.cc | 1 + + poppler/Dict.h | 1 + + poppler/Form.cc | 1 + + poppler/Object.h | 1 + + poppler/PDFDoc.cc | 2 +- + poppler/Parser.cc | 1 + + utils/pdfunite.cc | 1 + + 10 files changed, 10 insertions(+), 1 deletion(-) + +commit ff2b670062d1315435b418f7ce47b28adb4b789b +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Thu Aug 23 20:29:08 2018 +0200 + + Delete the previously ownership taking overload of Dict::add to + avoid unexpected memory leaks due to the initial API change. + + poppler/Dict.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 8cb364059d3a8d502811565acd166116dbcd0785 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue May 8 18:54:32 2018 +0200 + + Adjust all users of Dict::add to avoid leaking memory due to by now + unnecessary calls to copyString. + + poppler/Annot.cc | 28 ++++++++++++++-------------- + poppler/Gfx.cc | 9 +++------ + poppler/Object.h | 4 ++-- + poppler/PDFDoc.cc | 8 ++++---- + poppler/Parser.cc | 8 +++----- + utils/pdfunite.cc | 4 ++-- + 6 files changed, 28 insertions(+), 33 deletions(-) + +commit d479e37d34435c6afedf1343a7f60334f351220c +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue May 8 18:19:03 2018 +0200 + + Fix linking errors in release builds due to non exported weak symbols. + + poppler/Dict.cc | 4 ++++ + poppler/Dict.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +commit d4230e3b72d22a24ffe747891a15635ebf0df628 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue May 8 08:32:03 2018 +0200 + + But do use swap-and-pop if the Dict is still small enough to be + unsorted. + + poppler/Dict.cc | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit ca202af16ac9bd177d7417f3e74b8987e9256bc6 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Mon May 7 22:58:43 2018 +0200 + + Try to simplify Dict by implementing it in terms of std::vector + and std::string. + + poppler/Catalog.cc | 2 +- + poppler/Catalog.h | 2 +- + poppler/Dict.cc | 240 + ++++++++++++++++------------------------------------- + poppler/Dict.h | 46 +++++----- + poppler/Form.cc | 2 +- + poppler/Object.h | 4 +- + 6 files changed, 99 insertions(+), 197 deletions(-) + +commit 670171ba7507bc8ea39c3a33316c86b68fed5e0d +Author: Albert Astals Cid <aacid@kde.org> +Date: Thu Aug 23 18:11:45 2018 +0200 + + Don't abort if the SampleFunction has too many samples + + Fixes issue #634 + + poppler/Function.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 5fbce88ec9f6d360c5b6436837dfa760c8fa8d95 +Author: Volker Krause <vkrause@kde.org> +Date: Thu Aug 23 00:56:27 2018 +0200 + + Fix memory issues in GfxImageColorMap copy ctor + + - byte_lookup and lookup2 could contain uninitialized memory + - lookup2 was not copied at all + - lookup could be copied with the wrong size + + Issue #145 + + poppler/GfxState.cc | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +commit 2b5f35e59d234aed0805f0ea8ac5086e35837153 +Author: Oliver Sander <oliver.sander@tu-dresden.de> +Date: Tue Nov 28 16:40:40 2017 +0100 + + Document the OutputDev::clip and OutputDev::oeClip methods + + poppler/OutputDev.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 2a67883de1c896c5a8956226db7871e97724ed2b +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Wed Aug 22 06:10:29 2018 +0200 + + Also install Curl development files since it is a default enabled + dependency. + + .gitlab-ci.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit c220ef254f326866016930ac9c1c2b430fcb11ea +Author: Albert Astals Cid <aacid@kde.org> +Date: Wed Aug 22 00:57:33 2018 +0200 + + Fix uninitialized memory read + + Fixes oss-fuzz/10009 + + poppler/Gfx.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b8082c67943ea7ef7c115b86cffb0785da32d227 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Aug 21 20:21:36 2018 +0200 + + Since the CI directory is cached, we need to make sure we create it + if necessary instead of failing. + + .gitlab-ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f1b8626e021a11d2b649be69c563a2a9af210c84 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Aug 21 08:35:31 2018 +0200 + + Use a proper UTF-8 locale for non-ASCII file names in the tests and + rebase onto Debian unstable + + .gitlab-ci.yml | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +commit 534aca90732c199e96057111272afbc22796ea60 +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Aug 21 08:13:10 2018 +0200 + + Also download test-data to be able to run unit tests + + .gitlab-ci.yml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 78f8a6abed64a1b9ad320587b614ee87bc7791ab +Author: Adam Reichold <adam.reichold@t-online.de> +Date: Tue Aug 21 08:00:41 2018 +0200 + + Add initial GitLab CI manifest + + .gitlab-ci.yml | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + commit c666833e4163a93451eab27c675af9ca82d11593 Author: Albert Astals Cid <aacid@kde.org> Date: Sun Aug 19 23:37:51 2018 +0200 diff --git a/Build/source/libs/poppler/poppler-src/NEWS b/Build/source/libs/poppler/poppler-src/NEWS index 485f89ea57a..e38866e2c8a 100644 --- a/Build/source/libs/poppler/poppler-src/NEWS +++ b/Build/source/libs/poppler/poppler-src/NEWS @@ -1,3 +1,34 @@ +Release 0.69.0 + core: + * Add annotation font color + * Splash: Some speed improvements + * PSOutputDev: add native support for type 7 shadings when using level 3 + * Add support for PDF subtype property + * Link: Fix memory leak regarding next actions + * Fix handling of Signature Info Location and Reason + * Fix errors in computation of type3 glyphs transformation matrix + * Reimplement Dict class in a more modern way + * Fix security issues found by oss-fuzz + * Fix memory issues in GfxImageColorMap copy ctor + * Don't abort if the SampleFunction has too many samples. Issue #634 + * Document the OutputDev::clip and OutputDev::oeClip methods + * fix macOS compilation due to boolean define in jpeglib + * Split GDir and GDirEntry out of gfile.h. Issue #370 + + qt5: + * Add annotation font color + + cpp: + + utils: + * pdfinfo: Show PDF subtype + * pdftotext: Fix only outputs first page content with -bbox-layout option. Issue #88 + * pdftotext: Fix memory leak in printLine + + + build system: + * Require C++14 + Release 0.68.0 core: * Add Reason and Location to SignatureInfo. Bug #107299 diff --git a/Build/source/libs/poppler/poppler-src/fofi/FoFiType1C.cc b/Build/source/libs/poppler/poppler-src/fofi/FoFiType1C.cc index caa4b42b6cf..ebf68a44e94 100644 --- a/Build/source/libs/poppler/poppler-src/fofi/FoFiType1C.cc +++ b/Build/source/libs/poppler/poppler-src/fofi/FoFiType1C.cc @@ -15,6 +15,7 @@ // // Copyright (C) 2009, 2010, 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag@alfa.de> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -2663,7 +2664,14 @@ int FoFiType1C::getDeltaIntArray(int *arr, int maxLen) { } x = 0; for (i = 0; i < n; ++i) { - x += (int)ops[i].num; + int y; + if (unlikely(isinf(ops[i].num))) { + return i; + } + if (checkedAdd(x, (int)ops[i].num, &y)) { + return i; + } + x = y; arr[i] = x; } return n; diff --git a/Build/source/libs/poppler/poppler-src/goo/GooCheckedOps.h b/Build/source/libs/poppler/poppler-src/goo/GooCheckedOps.h new file mode 100644 index 00000000000..3da6b337f64 --- /dev/null +++ b/Build/source/libs/poppler/poppler-src/goo/GooCheckedOps.h @@ -0,0 +1,49 @@ +//======================================================================== +// +// GooCheckedOps.h +// +// This file is licensed under the GPLv2 or later +// +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> +// +//======================================================================== + +#ifndef GOO_CHECKED_OPS_H +#define GOO_CHECKED_OPS_H + +#include <climits> + +inline bool checkedAssign(long long lz, int *z) { + static_assert(LLONG_MAX > INT_MAX, "Need type larger than int to perform overflow checks."); + + if (lz > INT_MAX || lz < INT_MIN) { + return true; + } + + *z = static_cast<int>(lz); + return false; +} + +#ifndef __has_builtin + #define __has_builtin(x) 0 +#endif + +inline bool checkedAdd(int x, int y, int *z) { +#if __GNUC__ >= 5 || __has_builtin(__builtin_sadd_overflow) + return __builtin_sadd_overflow(x, y, z); +#else + const auto lz = static_cast<long long>(x) + static_cast<long long>(y); + return checkedAssign(lz, z); +#endif +} + +inline bool checkedMultiply(int x, int y, int *z) { +#if __GNUC__ >= 5 || __has_builtin(__builtin_smul_overflow) + return __builtin_smul_overflow(x, y, z); +#else + const auto lz = static_cast<long long>(x) * static_cast<long long>(y); + return checkedAssign(lz, z); +#endif +} + +#endif // GOO_CHECKED_OPS_H diff --git a/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc b/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc index 16c97afe768..26fa77a7ca6 100644 --- a/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc +++ b/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc @@ -11,6 +11,7 @@ // Copyright (C) 2013 Peter Breitenlohner <peb@mppmu.mpg.de> // Copyright (C) 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2018 Martin Packman <gzlist@googlemail.com> +// Copyright (C) 2018 Ed Porras <ed@motologic.com> // //======================================================================== @@ -143,7 +144,7 @@ bool JpegWriter::init(FILE *f, int width, int height, int hDPI, int vDPI) } // Set whether to compute optimal Huffman coding tables - priv->cinfo.optimize_coding = priv->optimize; + priv->cinfo.optimize_coding = static_cast<boolean>(priv->optimize); // Get ready for data jpeg_start_compress(&priv->cinfo, TRUE); diff --git a/Build/source/libs/poppler/poppler-src/goo/gdir.h b/Build/source/libs/poppler/poppler-src/goo/gdir.h new file mode 100644 index 00000000000..1eb1dae5856 --- /dev/null +++ b/Build/source/libs/poppler/poppler-src/goo/gdir.h @@ -0,0 +1,91 @@ +//======================================================================== +// +// gfile.h +// +// Miscellaneous file and directory name manipulation. +// +// Copyright 1996-2003 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) 2006 Kristian Høgsberg <krh@redhat.com> +// Copyright (C) 2009, 2011, 2012, 2017, 2018 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net> +// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com> +// Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2014 Bogdan Cristea <cristeab@gmail.com> +// Copyright (C) 2014 Peter Breitenlohner <peb@mppmu.mpg.de> +// Copyright (C) 2017 Christoph Cullmann <cullmann@kde.org> +// Copyright (C) 2017 Thomas Freitag <Thomas.Freitag@alfa.de> +// Copyright (C) 2018 Mojca Miklavec <mojca@macports.org> +// +// 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 GDIR_H +#define GDIR_H + +#include "poppler-config.h" +#include "gtypes.h" + +class GooString; + +//------------------------------------------------------------------------ +// GDir and GDirEntry +//------------------------------------------------------------------------ + +class GDirEntry { +public: + + GDirEntry(char *dirPath, char *nameA, GBool doStat); + ~GDirEntry(); + GooString *getName() { return name; } + GooString *getFullPath() { return fullPath; } + GBool isDir() { return dir; } + +private: + GDirEntry(const GDirEntry &other); + GDirEntry& operator=(const GDirEntry &other); + + GooString *name; // dir/file name + GooString *fullPath; + GBool dir; // is it a directory? +}; + +class GDir { +public: + + GDir(char *name, GBool doStatA = gTrue); + ~GDir(); + GDirEntry *getNextEntry(); + void rewind(); + +private: + GDir(const GDir &other); + GDir& operator=(const GDir &other); + + GooString *path; // directory path + GBool doStat; // call stat() for each entry? +#if defined(_WIN32) + WIN32_FIND_DATAA ffd; + HANDLE hnd; +#elif defined(ACORN) +#elif defined(MACOS) +#else + DIR *dir; // the DIR structure from opendir() +#ifdef VMS + GBool needParent; // need to return an entry for [-] +#endif +#endif +}; + +#endif diff --git a/Build/source/libs/poppler/poppler-src/goo/gfile.cc b/Build/source/libs/poppler/poppler-src/goo/gfile.cc index 381a0ce265d..720f75aa797 100644 --- a/Build/source/libs/poppler/poppler-src/goo/gfile.cc +++ b/Build/source/libs/poppler/poppler-src/goo/gfile.cc @@ -56,6 +56,7 @@ #include <limits> #include "GooString.h" #include "gfile.h" +#include "gdir.h" // Some systems don't define this, so just make it something reasonably // large. diff --git a/Build/source/libs/poppler/poppler-src/goo/gfile.h b/Build/source/libs/poppler/poppler-src/goo/gfile.h index 25595aae6d4..e826caac37d 100644 --- a/Build/source/libs/poppler/poppler-src/goo/gfile.h +++ b/Build/source/libs/poppler/poppler-src/goo/gfile.h @@ -169,53 +169,4 @@ private: #endif // _WIN32 }; -//------------------------------------------------------------------------ -// GDir and GDirEntry -//------------------------------------------------------------------------ - -class GDirEntry { -public: - - GDirEntry(char *dirPath, char *nameA, GBool doStat); - ~GDirEntry(); - GooString *getName() { return name; } - GooString *getFullPath() { return fullPath; } - GBool isDir() { return dir; } - -private: - GDirEntry(const GDirEntry &other); - GDirEntry& operator=(const GDirEntry &other); - - GooString *name; // dir/file name - GooString *fullPath; - GBool dir; // is it a directory? -}; - -class GDir { -public: - - GDir(char *name, GBool doStatA = gTrue); - ~GDir(); - GDirEntry *getNextEntry(); - void rewind(); - -private: - GDir(const GDir &other); - GDir& operator=(const GDir &other); - - GooString *path; // directory path - GBool doStat; // call stat() for each entry? -#if defined(_WIN32) - WIN32_FIND_DATAA ffd; - HANDLE hnd; -#elif defined(ACORN) -#elif defined(MACOS) -#else - DIR *dir; // the DIR structure from opendir() -#ifdef VMS - GBool needParent; // need to return an entry for [-] -#endif -#endif -}; - #endif diff --git a/Build/source/libs/poppler/poppler-src/goo/gmem.cc b/Build/source/libs/poppler/poppler-src/goo/gmem.cc deleted file mode 100644 index f118fd715d4..00000000000 --- a/Build/source/libs/poppler/poppler-src/goo/gmem.cc +++ /dev/null @@ -1,322 +0,0 @@ -/* - * gmem.c - * - * Memory routines with out-of-memory checking. - * - * Copyright 1996-2003 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) 2005 Takashi Iwai <tiwai@suse.de> -// Copyright (C) 2007-2010, 2012 Albert Astals Cid <aacid@kde.org> -// Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org> -// -// 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 -// -//======================================================================== - -#include <config.h> -#include <stdio.h> -#include <stdlib.h> -#include <stddef.h> -#include <string.h> -#include <limits.h> -#include "gmem.h" - -#ifdef DEBUG_MEM - -typedef struct _GMemHdr { - unsigned int magic; - int size; - int index; - struct _GMemHdr *next, *prev; -} GMemHdr; - -#define gMemHdrSize ((sizeof(GMemHdr) + 7) & ~7) -#define gMemTrlSize (sizeof(long)) - -#define gMemMagic 0xabcd9999 - -#if gmemTrlSize==8 -#define gMemDeadVal 0xdeadbeefdeadbeefUL -#else -#define gMemDeadVal 0xdeadbeefUL -#endif - -/* round data size so trailer will be aligned */ -#define gMemDataSize(size) \ - ((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize) - -static GMemHdr *gMemHead = NULL; -static GMemHdr *gMemTail = NULL; - -static int gMemIndex = 0; -static int gMemAlloc = 0; -static int gMemInUse = 0; - -#endif /* DEBUG_MEM */ - -inline static void *gmalloc(size_t size, bool checkoverflow) { -#ifdef DEBUG_MEM - int size1; - char *mem; - GMemHdr *hdr; - void *data; - unsigned long *trl, *p; - - if (size == 0) { - return NULL; - } - size1 = gMemDataSize(size); - if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { - fprintf(stderr, "Out of memory\n"); - if (checkoverflow) return NULL; - else exit(1); - } - hdr = (GMemHdr *)mem; - data = (void *)(mem + gMemHdrSize); - trl = (unsigned long *)(mem + gMemHdrSize + size1); - hdr->magic = gMemMagic; - hdr->size = size; - hdr->index = gMemIndex++; - if (gMemTail) { - gMemTail->next = hdr; - hdr->prev = gMemTail; - gMemTail = hdr; - } else { - hdr->prev = NULL; - gMemHead = gMemTail = hdr; - } - hdr->next = NULL; - ++gMemAlloc; - gMemInUse += size; - for (p = (unsigned long *)data; p <= trl; ++p) { - *p = gMemDeadVal; - } - return data; -#else - void *p; - - if (size == 0) { - return nullptr; - } - if (!(p = malloc(size))) { - fprintf(stderr, "Out of memory\n"); - if (checkoverflow) return nullptr; - else exit(1); - } - return p; -#endif -} - -void *gmalloc(size_t size) { - return gmalloc(size, false); -} - -void *gmalloc_checkoverflow(size_t size) { - return gmalloc(size, true); -} - -inline static void *grealloc(void *p, size_t size, bool checkoverflow) { -#ifdef DEBUG_MEM - GMemHdr *hdr; - void *q; - int oldSize; - - if (size == 0) { - if (p) { - gfree(p); - } - return NULL; - } - if (p) { - hdr = (GMemHdr *)((char *)p - gMemHdrSize); - oldSize = hdr->size; - q = gmalloc(size, checkoverflow); - memcpy(q, p, size < oldSize ? size : oldSize); - gfree(p); - } else { - q = gmalloc(size, checkoverflow); - } - return q; -#else - void *q; - - if (size == 0) { - if (p) { - free(p); - } - return nullptr; - } - if (p) { - q = realloc(p, size); - } else { - q = malloc(size); - } - if (!q) { - fprintf(stderr, "Out of memory\n"); - if (checkoverflow) return nullptr; - else exit(1); - } - return q; -#endif -} - -void *grealloc(void *p, size_t size) { - return grealloc(p, size, false); -} - -void *grealloc_checkoverflow(void *p, size_t size) { - return grealloc(p, size, true); -} - -inline static void *gmallocn(int nObjs, int objSize, bool checkoverflow) { - if (nObjs == 0) { - return nullptr; - } - if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) { - fprintf(stderr, "Bogus memory allocation size\n"); - if (checkoverflow) return nullptr; - else exit(1); - } - const int n = nObjs * objSize; - return gmalloc(n, checkoverflow); -} - -void *gmallocn(int nObjs, int objSize) { - return gmallocn(nObjs, objSize, false); -} - -void *gmallocn_checkoverflow(int nObjs, int objSize) { - return gmallocn(nObjs, objSize, true); -} - -inline static void *gmallocn3(int a, int b, int c, bool checkoverflow) { - int n = a * b; - if (b <= 0 || a < 0 || a >= INT_MAX / b) { - fprintf(stderr, "Bogus memory allocation size\n"); - if (checkoverflow) return nullptr; - else exit(1); - } - return gmallocn(n, c, checkoverflow); -} - -void *gmallocn3(int a, int b, int c) { - return gmallocn3(a, b, c, false); -} - -void *gmallocn3_checkoverflow(int a, int b, int c) { - return gmallocn3(a, b, c, true); -} - -inline static void *greallocn(void *p, int nObjs, int objSize, bool checkoverflow) { - if (nObjs == 0) { - if (p) { - gfree(p); - } - return nullptr; - } - if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) { - fprintf(stderr, "Bogus memory allocation size\n"); - if (checkoverflow) { - gfree(p); - return nullptr; - } else { - exit(1); - } - } - const int n = nObjs * objSize; - return grealloc(p, n, checkoverflow); -} - -void *greallocn(void *p, int nObjs, int objSize) { - return greallocn(p, nObjs, objSize, false); -} - -void *greallocn_checkoverflow(void *p, int nObjs, int objSize) { - return greallocn(p, nObjs, objSize, true); -} - -void gfree(void *p) { -#ifdef DEBUG_MEM - int size; - GMemHdr *hdr; - unsigned long *trl, *clr; - - if (p) { - hdr = (GMemHdr *)((char *)p - gMemHdrSize); - if (hdr->magic == gMemMagic && - ((hdr->prev == NULL) == (hdr == gMemHead)) && - ((hdr->next == NULL) == (hdr == gMemTail))) { - if (hdr->prev) { - hdr->prev->next = hdr->next; - } else { - gMemHead = hdr->next; - } - if (hdr->next) { - hdr->next->prev = hdr->prev; - } else { - gMemTail = hdr->prev; - } - --gMemAlloc; - gMemInUse -= hdr->size; - size = gMemDataSize(hdr->size); - trl = (unsigned long *)((char *)hdr + gMemHdrSize + size); - if (*trl != gMemDeadVal) { - fprintf(stderr, "Overwrite past end of block %d at address %p\n", - hdr->index, p); - } - for (clr = (unsigned long *)hdr; clr <= trl; ++clr) { - *clr = gMemDeadVal; - } - free(hdr); - } else { - fprintf(stderr, "Attempted to free bad address %p\n", p); - } - } -#else - if (p) { - free(p); - } -#endif -} - -#ifdef DEBUG_MEM -void gMemReport(FILE *f) { - GMemHdr *p; - - fprintf(f, "%d memory allocations in all\n", gMemIndex); - if (gMemAlloc > 0) { - fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc); - fprintf(f, " index size\n"); - fprintf(f, "-------- --------\n"); - for (p = gMemHead; p; p = p->next) { - fprintf(f, "%8d %8d\n", p->index, p->size); - } - } else { - fprintf(f, "No memory blocks left allocated\n"); - } -} -#endif - -char *copyString(const char *s) { - char *s1; - - s1 = (char *)gmalloc(strlen(s) + 1); - strcpy(s1, s); - return s1; -} - -char *gstrndup(const char *s, size_t n) { - char *s1 = (char*)gmalloc(n + 1); /* cannot return NULL for size > 0 */ - s1[n] = '\0'; - memcpy(s1, s, n); - return s1; -} diff --git a/Build/source/libs/poppler/poppler-src/goo/gmem.h b/Build/source/libs/poppler/poppler-src/goo/gmem.h index 4c76f0fb65e..9b187c1dafc 100644 --- a/Build/source/libs/poppler/poppler-src/goo/gmem.h +++ b/Build/source/libs/poppler/poppler-src/goo/gmem.h @@ -16,6 +16,7 @@ // Copyright (C) 2005 Takashi Iwai <tiwai@suse.de> // Copyright (C) 2007-2010, 2017 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -25,68 +26,155 @@ #ifndef GMEM_H #define GMEM_H -#include <stdio.h> -#include "poppler-config.h" +#include <cstring> +#include <cstdlib> +#include <cstdio> -#ifdef __cplusplus -extern "C" { -#endif +#include "GooCheckedOps.h" -/* - * Same as malloc, but prints error message and exits if malloc() - * returns NULL. - */ -extern void *gmalloc(size_t size); -extern void *gmalloc_checkoverflow(size_t size); +/// Same as malloc, but prints error message and exits if malloc() returns NULL. +inline void *gmalloc(size_t size, bool checkoverflow = false) { + if (size == 0) { + return nullptr; + } -/* - * Same as realloc, but prints error message and exits if realloc() - * returns NULL. If <p> is NULL, calls malloc instead of realloc(). - */ -extern void *grealloc(void *p, size_t size); -extern void *grealloc_checkoverflow(void *p, size_t size); + if (void *p = std::malloc(size)) { + return p; + } + + std::fputs("Out of memory\n", stderr); + + if (checkoverflow) { + return nullptr; + } + + std::abort(); +} + +inline void *gmalloc_checkoverflow(size_t size) { + return gmalloc(size, true); +} + +/// Same as free, but checks for and ignores NULL pointers. +inline void gfree(void *p) { + if (p) { + std::free(p); + } +} + +/// Same as realloc, but prints error message and exits if realloc() returns NULL. +/// If <p> is NULL, calls malloc() instead of realloc(). +inline void *grealloc(void *p, size_t size, bool checkoverflow = false) { + if (size == 0) { + gfree(p); + return nullptr; + } + + if (void *q = p ? std::realloc(p, size) : std::malloc(size)) { + return q; + } + + std::fputs("Out of memory\n", stderr); + + if (checkoverflow) { + return nullptr; + } + + std::abort(); +} + +inline void *grealloc_checkoverflow(void *p, size_t size) { + return grealloc(p, size, true); +} /* * These are similar to gmalloc and grealloc, but take an object count - * and size. The result is similar to allocating nObjs * objSize + * and size. The result is similar to allocating <count> * <size> * bytes, but there is an additional error check that the total size * doesn't overflow an int. * The gmallocn_checkoverflow variant returns NULL instead of exiting - * the application if a overflow is detected + * the application if a overflow is detected. */ -extern void *gmallocn(int nObjs, int objSize); -extern void *gmallocn_checkoverflow(int nObjs, int objSize); -extern void *gmallocn3(int a, int b, int c); -extern void *gmallocn3_checkoverflow(int a, int b, int c); -extern void *greallocn(void *p, int nObjs, int objSize); -extern void *greallocn_checkoverflow(void *p, int nObjs, int objSize); -/* - * Same as free, but checks for and ignores NULL pointers. - */ -extern void gfree(void *p); +inline void *gmallocn(int count, int size, bool checkoverflow = false) { + if (count == 0) { + return nullptr; + } -#ifdef DEBUG_MEM -/* - * Report on unfreed memory. - */ -extern void gMemReport(FILE *f); -#else -#define gMemReport(f) -#endif + int bytes; + if (count < 0 || size <= 0 || checkedMultiply(count, size, &bytes)) { + std::fputs("Bogus memory allocation size\n", stderr); -/* - * Allocate memory and copy a string into it. - */ -extern char *copyString(const char *s); + if (checkoverflow) { + return nullptr; + } -/* - * Allocate memory and copy a limited-length string to it. - */ -extern char *gstrndup(const char *s, size_t n); + std::abort(); + } + + return gmalloc(bytes, checkoverflow); +} + +inline void *gmallocn_checkoverflow(int count, int size) { + return gmallocn(count, size, true); +} + +inline void *gmallocn3(int width, int height, int size, bool checkoverflow = false) { + if (width == 0 || height == 0) { + return nullptr; + } + + int count; + int bytes; + if (width < 0 || height < 0 || size <= 0 || checkedMultiply(width, height, &count) || checkedMultiply(count, size, &bytes)) { + std::fputs("Bogus memory allocation size\n", stderr); + + if (checkoverflow) { + return nullptr; + } + + std::abort(); + } + + return gmalloc(bytes, checkoverflow); +} + +inline void *greallocn(void *p, int count, int size, bool checkoverflow = false) { + if (count == 0) { + gfree(p); + return nullptr; + } + + int bytes; + if (count < 0 || size <= 0 || checkedMultiply(count, size, &bytes)) { + std::fputs("Bogus memory allocation size\n", stderr); + + if (checkoverflow) { + gfree(p); + return nullptr; + } + + std::abort(); + } + + return grealloc(p, bytes, checkoverflow); +} + +inline void *greallocn_checkoverflow(void *p, int count, int size) { + return greallocn(p, count, size, true); +} + +/// Allocate memory and copy a string into it. +inline char *copyString(const char *s) { + char *r = static_cast<char *>(gmalloc(std::strlen(s) + 1, false)); + return std::strcpy(r, s); +} -#ifdef __cplusplus +/// Allocate memory and copy a limited-length string to it. +inline char *copyString(const char *s, size_t n) { + char *r = static_cast<char *>(gmalloc(n + 1, false)); + r[n] = '\0'; + return std::strncpy(r, s, n); } -#endif -#endif +#endif // GMEM_H diff --git a/Build/source/libs/poppler/poppler-src/goo/gmempp.cc b/Build/source/libs/poppler/poppler-src/goo/gmempp.cc deleted file mode 100644 index a70338ca3ce..00000000000 --- a/Build/source/libs/poppler/poppler-src/goo/gmempp.cc +++ /dev/null @@ -1,32 +0,0 @@ -//======================================================================== -// -// gmempp.cc -// -// Use gmalloc/gfree for C++ new/delete operators. -// -// Copyright 1996-2003 Glyph & Cog, LLC -// -//======================================================================== - -#include <config.h> -#include "gmem.h" - -#ifdef DEBUG_MEM - -void *operator new(size_t size) { - return gmalloc((int)size); -} - -void *operator new[](size_t size) { - return gmalloc((int)size); -} - -void operator delete(void *p) { - gfree(p); -} - -void operator delete[](void *p) { - gfree(p); -} - -#endif diff --git a/Build/source/libs/poppler/poppler-src/poppler/Annot.cc b/Build/source/libs/poppler/poppler-src/poppler/Annot.cc index d37824c1d38..61870bd5193 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Annot.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Annot.cc @@ -38,6 +38,9 @@ // Copyright (C) 2017 Hans-Ulrich Jüttner <huj@froreich-bioscientia.de> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright 2018 Andre Heinecke <aheinecke@intevation.de> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> +// Copyright (C) 2018 Dileep Sankhla <sankhla.dileep96@gmail.com> +// Copyright (C) 2018 Tobias Deiminger <haxtibal@posteo.de> // // 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 @@ -792,6 +795,73 @@ Object AnnotColor::writeToObject(XRef *xref) const { } //------------------------------------------------------------------------ +// DefaultAppearance +//------------------------------------------------------------------------ + +DefaultAppearance::DefaultAppearance(Object &&fontNameA, double fontPtSizeA, std::unique_ptr<AnnotColor> fontColorA) : + fontName(std::move(fontNameA)), fontPtSize(fontPtSizeA), fontColor(std::move(fontColorA)) { +} + +DefaultAppearance::DefaultAppearance(GooString *da) { + fontPtSize = -1; + + if (da) { + GooList * daToks = new GooList(); + int i = FormFieldText::tokenizeDA(da, daToks, "Tf"); + + if (i >= 1) { + fontPtSize = gatof(( (GooString *)daToks->get(i-1) )->getCString()); + } + if (i >= 2) { + // We are expecting a name, therefore the first letter should be '/'. + if (((const char*)daToks->get(i-2)) && ((const char*)daToks->get(i-2))[0] == '/') { + // The +1 is here to skip the leading '/'. + fontName = Object(objName, ((const char*)daToks->get(i-2))+1); + } + } + // Scan backwards: we are looking for the last set value + for (i = daToks->getLength()-1; i >= 0; --i) { + if (!fontColor) { + if (!((GooString *)daToks->get(i))->cmp("g") && i >= 1) { + fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-1) )->getCString())); + } else if (!((GooString *)daToks->get(i))->cmp("rg") && i >= 3) { + fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-3) )->getCString()), + gatof(( (GooString *)daToks->get(i-2) )->getCString()), + gatof(( (GooString *)daToks->get(i-1) )->getCString())); + } else if (!((GooString *)daToks->get(i))->cmp("k") && i >= 4) { + fontColor = std::make_unique<AnnotColor>(gatof(( (GooString *)daToks->get(i-4) )->getCString()), + gatof(( (GooString *)daToks->get(i-3) )->getCString()), + gatof(( (GooString *)daToks->get(i-2) )->getCString()), + gatof(( (GooString *)daToks->get(i-1) )->getCString())); + } + } + } + deleteGooList(daToks, GooString); + } +} + +void DefaultAppearance::setFontName(Object &&fontNameA) { + fontName = std::move(fontNameA); +} + +void DefaultAppearance::setFontPtSize(double fontPtSizeA) { + fontPtSize = fontPtSizeA; +} + +void DefaultAppearance::setFontColor(std::unique_ptr<AnnotColor> fontColorA) { + fontColor = std::move(fontColorA); +} + +GooString *DefaultAppearance::toAppearanceString() const { + AnnotAppearanceBuilder appearBuilder; + if (fontColor) { + appearBuilder.setDrawColor(fontColor.get(), gTrue); + } + appearBuilder.setTextFont(fontName, fontPtSize); + return appearBuilder.buffer()->copy(); +} + +//------------------------------------------------------------------------ // AnnotIconFit //------------------------------------------------------------------------ @@ -1616,17 +1686,17 @@ void AnnotAppearanceBuilder::setDrawColor(const AnnotColor *drawColor, GBool fil switch (drawColor->getSpace()) { case AnnotColor::colorCMYK: - appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:.2f} {4:c}\n", + appearBuf->appendf("{0:.5f} {1:.5f} {2:.5f} {3:.5f} {4:c}\n", values[0], values[1], values[2], values[3], fill ? 'k' : 'K'); break; case AnnotColor::colorRGB: - appearBuf->appendf("{0:.2f} {1:.2f} {2:.2f} {3:s}\n", + appearBuf->appendf("{0:.5f} {1:.5f} {2:.5f} {3:s}\n", values[0], values[1], values[2], fill ? "rg" : "RG"); break; case AnnotColor::colorGray: - appearBuf->appendf("{0:.2f} {1:c}\n", + appearBuf->appendf("{0:.5f} {1:c}\n", values[0], fill ? 'g' : 'G'); break; @@ -1636,6 +1706,11 @@ void AnnotAppearanceBuilder::setDrawColor(const AnnotColor *drawColor, GBool fil } } +void AnnotAppearanceBuilder::setTextFont(const Object &fontName, double fontSize) { + if (fontName.isName() && strlen(fontName.getName()) > 0) + appearBuf->appendf("/{0:s} {1:.2f} Tf\n", fontName.getName(), fontSize); +} + void AnnotAppearanceBuilder::setLineStyleForBorder(const AnnotBorder *border) { int i, dashLength; double *dash; @@ -2593,12 +2668,13 @@ void AnnotLink::draw(Gfx *gfx, GBool printing) { //------------------------------------------------------------------------ // AnnotFreeText //------------------------------------------------------------------------ -AnnotFreeText::AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, GooString *da) : +AnnotFreeText::AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, const DefaultAppearance &da) : AnnotMarkup(docA, rect) { type = typeFreeText; + GooString *daStr = da.toAppearanceString(); annotObj.dictSet ("Subtype", Object(objName, "FreeText")); - annotObj.dictSet("DA", Object(da->copy())); + annotObj.dictSet("DA", Object(daStr)); initialize (docA, annotObj.getDict()); } @@ -2726,14 +2802,10 @@ void AnnotFreeText::setContents(GooString *new_content) { invalidateAppearance(); } -void AnnotFreeText::setAppearanceString(GooString *new_string) { +void AnnotFreeText::setDefaultAppearance(const DefaultAppearance &da) { delete appearanceString; - if (new_string) { - appearanceString = new GooString(new_string); - } else { - appearanceString = new GooString(); - } + appearanceString = da.toAppearanceString(); update ("DA", Object(appearanceString->copy())); invalidateAppearance(); @@ -2805,55 +2877,27 @@ void AnnotFreeText::setIntent(AnnotFreeTextIntent new_intent) { update ("IT", Object(objName, intentName)); } -static GfxFont * createAnnotDrawFont(XRef * xref, Dict *fontResDict) +std::unique_ptr<DefaultAppearance> AnnotFreeText::getDefaultAppearance() const { + return std::make_unique<DefaultAppearance>(appearanceString); +} + +static GfxFont *createAnnotDrawFont(XRef * xref, Dict *fontResDict) { const Ref dummyRef = { -1, -1 }; Dict *fontDict = new Dict(xref); - fontDict->add(copyString("BaseFont"), Object(objName, "Helvetica")); - fontDict->add(copyString("Subtype"), Object(objName, "Type0")); - fontDict->add(copyString("Encoding"), Object(objName, "WinAnsiEncoding")); + fontDict->add("BaseFont", Object(objName, "Helvetica")); + fontDict->add("Subtype", Object(objName, "Type0")); + fontDict->add("Encoding", Object(objName, "WinAnsiEncoding")); Dict *fontsDict = new Dict(xref); - fontsDict->add(copyString("AnnotDrawFont"), Object(fontDict)); + fontsDict->add("AnnotDrawFont", Object(fontDict)); - fontResDict->add(copyString("Font"), Object(fontsDict)); + fontResDict->add("Font", Object(fontsDict)); return GfxFont::makeFont(xref, "AnnotDrawFont", dummyRef, fontDict); } -void AnnotFreeText::parseAppearanceString(GooString *da, double &fontsize, AnnotColor* &fontcolor) { - fontsize = -1; - fontcolor = nullptr; - if (da) { - GooList * daToks = new GooList(); - int i = FormFieldText::tokenizeDA(da, daToks, "Tf"); - - if (i >= 1) { - fontsize = gatof(( (GooString *)daToks->get(i-1) )->getCString()); - // TODO: Font name - } - // Scan backwards: we are looking for the last set value - for (i = daToks->getLength()-1; i >= 0; --i) { - if (fontcolor == nullptr) { - if (!((GooString *)daToks->get(i))->cmp("g") && i >= 1) { - fontcolor = new AnnotColor(gatof(( (GooString *)daToks->get(i-1) )->getCString())); - } else if (!((GooString *)daToks->get(i))->cmp("rg") && i >= 3) { - fontcolor = new AnnotColor(gatof(( (GooString *)daToks->get(i-3) )->getCString()), - gatof(( (GooString *)daToks->get(i-2) )->getCString()), - gatof(( (GooString *)daToks->get(i-1) )->getCString())); - } else if (!((GooString *)daToks->get(i))->cmp("k") && i >= 4) { - fontcolor = new AnnotColor(gatof(( (GooString *)daToks->get(i-4) )->getCString()), - gatof(( (GooString *)daToks->get(i-3) )->getCString()), - gatof(( (GooString *)daToks->get(i-2) )->getCString()), - gatof(( (GooString *)daToks->get(i-1) )->getCString())); - } - } - } - deleteGooList(daToks, GooString); - } -} - void AnnotFreeText::generateFreeTextAppearance() { double borderWidth, ca = opacity; @@ -2870,14 +2914,13 @@ void AnnotFreeText::generateFreeTextAppearance() const double height = rect->y2 - rect->y1; // Parse some properties from the appearance string - double fontsize; - AnnotColor *fontcolor; - parseAppearanceString(appearanceString, fontsize, fontcolor); + DefaultAppearance da{appearanceString}; + // Default values - if (fontsize <= 0) - fontsize = 10; - if (fontcolor == nullptr) - fontcolor = new AnnotColor(0, 0, 0); // Black + if (da.getFontPtSize() <= 0) + da.setFontPtSize(10); + if (!da.getFontColor()) + da.setFontColor(std::make_unique<AnnotColor>(0, 0, 0)); if (!contents) contents = new GooString (); @@ -2886,7 +2929,7 @@ void AnnotFreeText::generateFreeTextAppearance() GBool doStroke = (borderWidth != 0); if (doFill || doStroke) { if (doStroke) { - appearBuilder.setDrawColor(fontcolor, gFalse); // Border color: same as font color + appearBuilder.setDrawColor(da.getFontColor(), gFalse); // Border color: same as font color } appearBuilder.appendf ("{0:.2f} {0:.2f} {1:.2f} {2:.2f} re\n", borderWidth/2, width-borderWidth, height-borderWidth); if (doFill) { @@ -2906,17 +2949,17 @@ void AnnotFreeText::generateFreeTextAppearance() GfxFont *font = createAnnotDrawFont(xref, fontResDict); // Set font state - appearBuilder.setDrawColor(fontcolor, gTrue); - appearBuilder.appendf ("BT 1 0 0 1 {0:.2f} {1:.2f} Tm\n", textmargin, height - textmargin - fontsize * font->getDescent()); - appearBuilder.appendf ("/AnnotDrawFont {0:.2f} Tf\n", fontsize); + appearBuilder.setDrawColor(da.getFontColor(), gTrue); + appearBuilder.appendf ("BT 1 0 0 1 {0:.2f} {1:.2f} Tm\n", textmargin, height - textmargin - da.getFontPtSize() * font->getDescent()); + appearBuilder.appendf ("/AnnotDrawFont {0:.2f} Tf\n", da.getFontPtSize()); int i = 0; double xposPrev = 0; while (i < contents->getLength()) { GooString out; double linewidth, xpos; - layoutText(contents, &out, &i, font, &linewidth, textwidth/fontsize, nullptr, gFalse); - linewidth *= fontsize; + layoutText(contents, &out, &i, font, &linewidth, textwidth/da.getFontPtSize(), nullptr, gFalse); + linewidth *= da.getFontPtSize(); switch (quadding) { case quaddingCentered: xpos = (textwidth - linewidth) / 2; @@ -2928,14 +2971,13 @@ void AnnotFreeText::generateFreeTextAppearance() xpos = 0; break; } - appearBuilder.appendf("{0:.2f} {1:.2f} Td\n", xpos - xposPrev, -fontsize); + appearBuilder.appendf("{0:.2f} {1:.2f} Td\n", xpos - xposPrev, -da.getFontPtSize()); appearBuilder.writeString(out); appearBuilder.append("Tj\n"); xposPrev = xpos; } font->decRefCnt(); - delete fontcolor; appearBuilder.append ("ET Q\n"); double bbox[4]; @@ -4883,19 +4925,19 @@ void AnnotWidget::generateFieldAppearance(bool *addedDingbatsResource) { const GooString *appearBuf = appearBuilder.buffer(); // build the appearance stream dictionary Dict *appearDict = new Dict(xref); - appearDict->add(copyString("Length"), Object(appearBuf->getLength())); - appearDict->add(copyString("Subtype"), Object(objName, "Form")); + appearDict->add("Length", Object(appearBuf->getLength())); + appearDict->add("Subtype", Object(objName, "Form")); Array *bbox = new Array(xref); bbox->add(Object(0)); bbox->add(Object(0)); bbox->add(Object(rect->x2 - rect->x1)); bbox->add(Object(rect->y2 - rect->y1)); - appearDict->add(copyString("BBox"), Object(bbox)); + appearDict->add("BBox", Object(bbox)); // set the resource dictionary Object *resDict = form->getDefaultResourcesObj(); if (resDict->isDict()) { - appearDict->add(copyString("Resources"), resDict->copy()); + appearDict->add("Resources", resDict->copy()); } // build the appearance stream @@ -4934,7 +4976,7 @@ void AnnotWidget::updateAppearanceStream() // Write the AP dictionary obj1 = Object(new Dict(xref)); - obj1.dictAdd(copyString("N"), Object(updatedAppearanceStream.num, updatedAppearanceStream.gen)); + obj1.dictAdd("N", Object(updatedAppearanceStream.num, updatedAppearanceStream.gen)); // Update our internal pointers to the appearance dictionary appearStreams = new AnnotAppearance(doc, &obj1); @@ -4967,14 +5009,14 @@ void AnnotWidget::draw(Gfx *gfx, GBool printing) { // We are forcing ZaDb but the font does not exist // so create a fake one Dict *fontDict = new Dict(gfx->getXRef()); - fontDict->add(copyString("BaseFont"), Object(objName, "ZapfDingbats")); - fontDict->add(copyString("Subtype"), Object(objName, "Type1")); + fontDict->add("BaseFont", Object(objName, "ZapfDingbats")); + fontDict->add("Subtype", Object(objName, "Type1")); Dict *fontsDict = new Dict(gfx->getXRef()); - fontsDict->add(copyString("ZaDb"), Object(fontDict)); + fontsDict->add("ZaDb", Object(fontDict)); Dict *dict = new Dict(gfx->getXRef()); - dict->add(copyString("Font"), Object(fontsDict)); + dict->add("Font", Object(fontsDict)); gfx->pushResources(dict); delete dict; } diff --git a/Build/source/libs/poppler/poppler-src/poppler/Annot.h b/Build/source/libs/poppler/poppler-src/poppler/Annot.h index 83c10b397b1..d564c413be1 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Annot.h +++ b/Build/source/libs/poppler/poppler-src/poppler/Annot.h @@ -27,6 +27,8 @@ // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Dileep Sankhla <sankhla.dileep96@gmail.com> +// Copyright (C) 2018 Tobias Deiminger <haxtibal@posteo.de> // // 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 @@ -40,6 +42,7 @@ #pragma interface #endif +#include <memory> #include "Object.h" class XRef; @@ -348,6 +351,33 @@ private: }; //------------------------------------------------------------------------ +// DefaultAppearance +//------------------------------------------------------------------------ + +class DefaultAppearance { +public: + + DefaultAppearance(Object &&fontNameA, double fontPtSizeA, std::unique_ptr<AnnotColor> fontColorA); + DefaultAppearance(GooString *da); + void setFontName(Object &&fontNameA); + const Object &getFontName() const { return fontName; } + void setFontPtSize(double fontPtSizeA); + double getFontPtSize() const { return fontPtSize; } + void setFontColor(std::unique_ptr<AnnotColor> fontColorA); + const AnnotColor *getFontColor() const { return fontColor.get(); } + GooString *toAppearanceString() const; + + DefaultAppearance(const DefaultAppearance &) = delete; + DefaultAppearance& operator=(const DefaultAppearance&) = delete; + +private: + + Object fontName; + double fontPtSize; + std::unique_ptr<AnnotColor> fontColor; +}; + +//------------------------------------------------------------------------ // AnnotIconFit //------------------------------------------------------------------------ @@ -511,6 +541,7 @@ public: void setDrawColor(const AnnotColor *color, GBool fill); void setLineStyleForBorder(const AnnotBorder *border); + void setTextFont(const Object &fontName, double fontSize); void drawCircle(double cx, double cy, double r, GBool fill); void drawCircleTopLeft(double cx, double cy, double r); void drawCircleBottomRight(double cx, double cy, double r); @@ -969,7 +1000,7 @@ public: intentFreeTextTypeWriter // FreeTextTypeWriter }; - AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, GooString *da); + AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, const DefaultAppearance &da); AnnotFreeText(PDFDoc *docA, Object *dictObject, Object *obj); ~AnnotFreeText(); @@ -977,14 +1008,14 @@ public: Object getAppearanceResDict() override; void setContents(GooString *new_content) override; - void setAppearanceString(GooString *new_string); + void setDefaultAppearance(const DefaultAppearance &da); void setQuadding(AnnotFreeTextQuadding new_quadding); void setStyleString(GooString *new_string); void setCalloutLine(AnnotCalloutLine *line); void setIntent(AnnotFreeTextIntent new_intent); // getters - const GooString *getAppearanceString() const { return appearanceString; } + std::unique_ptr<DefaultAppearance> getDefaultAppearance() const; AnnotFreeTextQuadding getQuadding() const { return quadding; } // return rc const GooString *getStyleString() const { return styleString; } @@ -997,7 +1028,6 @@ public: protected: void initialize(PDFDoc *docA, Dict *dict); - static void parseAppearanceString(GooString *da, double &fontsize, AnnotColor* &fontcolor); void generateFreeTextAppearance(); // required diff --git a/Build/source/libs/poppler/poppler-src/poppler/Array.cc b/Build/source/libs/poppler/poppler-src/poppler/Array.cc index e8aa34eafe6..f2dc23631f2 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Array.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Array.cc @@ -18,6 +18,7 @@ // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2013, 2017 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -32,6 +33,7 @@ #include <stdlib.h> #include <stddef.h> +#include <cassert> #include "goo/gmem.h" #include "Object.h" #include "Array.h" @@ -105,11 +107,8 @@ void Array::add(Object &&elem) { void Array::remove(int i) { arrayLocker(); if (i < 0 || i >= length) { -#ifdef DEBUG_MEM - abort(); -#else + assert(i >= 0 && i < length); return; -#endif } --length; memmove( static_cast<void*>(elems + i), elems + i + 1, sizeof(elems[0]) * (length - i) ); @@ -117,22 +116,14 @@ void Array::remove(int i) { Object Array::get(int i, int recursion) const { if (i < 0 || i >= length) { -#ifdef DEBUG_MEM - abort(); -#else return Object(objNull); -#endif } return elems[i].fetch(xref, recursion); } Object Array::getNF(int i) const { if (i < 0 || i >= length) { -#ifdef DEBUG_MEM - abort(); -#else return Object(objNull); -#endif } return elems[i].copy(); } diff --git a/Build/source/libs/poppler/poppler-src/poppler/CairoRescaleBox.cc b/Build/source/libs/poppler/poppler-src/poppler/CairoRescaleBox.cc index f34b1e1c79c..59a5c190226 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/CairoRescaleBox.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/CairoRescaleBox.cc @@ -32,6 +32,7 @@ // // Copyright (C) 2012 Hib Eris <hib@hiberis.nl> // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -281,10 +282,10 @@ GBool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, dest = (unsigned int *)cairo_image_surface_get_data (dest_surface); dst_stride = cairo_image_surface_get_stride (dest_surface); - scanline = (uint32_t*)gmallocn3 (orig_width, 1, sizeof(int)); + scanline = (uint32_t*)gmallocn (orig_width, sizeof(int)); - x_coverage = (int *)gmallocn3 (orig_width, 1, sizeof(int)); - y_coverage = (int *)gmallocn3 (orig_height, 1, sizeof(int)); + x_coverage = (int *)gmallocn (orig_width, sizeof(int)); + y_coverage = (int *)gmallocn (orig_height, sizeof(int)); /* we need to allocate enough room for ceil(src_height/dest_height)+1 Example: diff --git a/Build/source/libs/poppler/poppler-src/poppler/Catalog.cc b/Build/source/libs/poppler/poppler-src/poppler/Catalog.cc index e6fde7ab34d..55b7528b450 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Catalog.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Catalog.cc @@ -34,6 +34,7 @@ // Copyright (C) 2015 Even Rouault <even.rouault@spatialys.com> // Copyright (C) 2016 Masamichi Hosoda <trueroad@trueroad.jp> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -428,7 +429,7 @@ int Catalog::numDests() return obj->dictGetLength(); } -char *Catalog::getDestsName(int i) +const char *Catalog::getDestsName(int i) { Object *obj; diff --git a/Build/source/libs/poppler/poppler-src/poppler/Catalog.h b/Build/source/libs/poppler/poppler-src/poppler/Catalog.h index 0467159a2d4..5c8c50704b7 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Catalog.h +++ b/Build/source/libs/poppler/poppler-src/poppler/Catalog.h @@ -27,6 +27,7 @@ // Copyright (C) 2013 José Aliste <jaliste@src.gnome.org> // Copyright (C) 2016 Masamichi Hosoda <trueroad@trueroad.jp> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -163,7 +164,7 @@ public: int numDests(); // Get the i'th named destination name in name-dict - char *getDestsName(int i); + const char *getDestsName(int i); // Get the i'th named destination link destination in name-dict LinkDest *getDestsDest(int i); diff --git a/Build/source/libs/poppler/poppler-src/poppler/Dict.cc b/Build/source/libs/poppler/poppler-src/poppler/Dict.cc index bc86fd77ad9..0a0ceab3f01 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Dict.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Dict.cc @@ -22,6 +22,7 @@ // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2014 Scott West <scott.gregory.west@gmail.com> // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -35,10 +36,7 @@ #endif #include <algorithm> -#include <stddef.h> -#include <string.h> -#include "goo/gmem.h" -#include "Object.h" + #include "XRef.h" #include "Dict.h" @@ -51,247 +49,164 @@ // Dict //------------------------------------------------------------------------ -static const int SORT_LENGTH_LOWER_LIMIT = 32; - -static inline bool cmpDictEntries(const DictEntry &e1, const DictEntry &e2) -{ - return strcmp(e1.key, e2.key) < 0; -} +constexpr int SORT_LENGTH_LOWER_LIMIT = 32; -static int binarySearch(const char *key, DictEntry *entries, int length) -{ - int first = 0; - int end = length - 1; - while (first <= end) { - const int middle = (first + end) / 2; - const int res = strcmp(key, entries[middle].key); - if (res == 0) { - return middle; - } else if (res < 0) { - end = middle - 1; - } else { - first = middle + 1; - } +struct Dict::CmpDictEntry { + bool operator()(const DictEntry &lhs, const DictEntry &rhs) const { + return lhs.first < rhs.first; } - return -1; -} + bool operator()(const DictEntry &lhs, const char *rhs) const { + return lhs.first < rhs; + } + bool operator()(const char *lhs, const DictEntry &rhs) const { + return lhs < rhs.first; + } +}; Dict::Dict(XRef *xrefA) { xref = xrefA; - entries = nullptr; - size = length = 0; ref = 1; - sorted = gFalse; #ifdef MULTITHREADED gInitMutex(&mutex); #endif + + sorted = false; } -Dict::Dict(Dict* dictA) { +Dict::Dict(const Dict* dictA) { xref = dictA->xref; - size = length = dictA->length; ref = 1; #ifdef MULTITHREADED gInitMutex(&mutex); #endif - sorted = dictA->sorted; - entries = (DictEntry *)gmallocn(size, sizeof(DictEntry)); - for (int i=0; i<length; i++) { - entries[i].key = copyString(dictA->entries[i].key); - entries[i].val.initNullAfterMalloc(); - entries[i].val = dictA->entries[i].val.copy(); + entries.reserve(dictA->entries.size()); + for (const auto& entry : dictA->entries) { + entries.emplace_back(entry.first, entry.second.copy()); } + + sorted = dictA->sorted.load(); } -Dict *Dict::copy(XRef *xrefA) { +Dict *Dict::copy(XRef *xrefA) const { dictLocker(); Dict *dictA = new Dict(this); dictA->xref = xrefA; - for (int i=0; i<length; i++) { - if (dictA->entries[i].val.getType() == objDict) { - Dict *copy = dictA->entries[i].val.getDict()->copy(xrefA); - dictA->entries[i].val = Object(copy); + for (auto &entry : dictA->entries) { + if (entry.second.getType() == objDict) { + entry.second = Object(entry.second.getDict()->copy(xrefA)); } } return dictA; } Dict::~Dict() { - int i; - - for (i = 0; i < length; ++i) { - gfree(entries[i].key); - entries[i].val.free(); - } - gfree(entries); #ifdef MULTITHREADED gDestroyMutex(&mutex); #endif } -int Dict::incRef() { +void Dict::add(const char *key, Object &&val) { dictLocker(); - ++ref; - return ref; + entries.emplace_back(key, std::move(val)); + sorted = false; } -int Dict::decRef() { - dictLocker(); - --ref; - return ref; -} - -void Dict::add(char *key, Object &&val) { - dictLocker(); - if (sorted) { - // We use add on very few occasions so - // virtually this will never be hit - sorted = gFalse; - } +inline const Dict::DictEntry *Dict::find(const char *key) const { + if (entries.size() >= SORT_LENGTH_LOWER_LIMIT) { + if (!sorted) { + dictLocker(); + if (!sorted) { + auto& entries = const_cast<std::vector<DictEntry>&>(this->entries); + auto& sorted = const_cast<std::atomic_bool&>(this->sorted); - if (length == size) { - if (length == 0) { - size = 8; - } else { - size *= 2; + std::sort(entries.begin(), entries.end(), CmpDictEntry{}); + sorted = true; + } } - entries = (DictEntry *)greallocn(entries, size, sizeof(DictEntry)); - } - entries[length].key = key; - entries[length].val.initNullAfterMalloc(); - entries[length].val = std::move(val); - ++length; -} - -inline DictEntry *Dict::find(const char *key) const { - if (!sorted && length >= SORT_LENGTH_LOWER_LIMIT) - { - dictLocker(); - sorted = gTrue; - std::sort(entries, entries+length, cmpDictEntries); } if (sorted) { - const int pos = binarySearch(key, entries, length); - if (pos != -1) { - return &entries[pos]; + const auto pos = std::lower_bound(entries.begin(), entries.end(), key, CmpDictEntry{}); + if (pos != entries.end() && pos->first == key) { + return &*pos; } } else { - int i; - - for (i = length - 1; i >=0; --i) { - if (!strcmp(key, entries[i].key)) - return &entries[i]; + const auto pos = std::find_if(entries.rbegin(), entries.rend(), [key](const DictEntry& entry) { + return entry.first == key; + }); + if (pos != entries.rend()) { + return &*pos; } } return nullptr; } -GBool Dict::hasKey(const char *key) const { - return find(key) != nullptr; +inline Dict::DictEntry *Dict::find(const char *key) { + return const_cast<DictEntry *>(const_cast<const Dict *>(this)->find(key)); } void Dict::remove(const char *key) { dictLocker(); - if (sorted) { - const int pos = binarySearch(key, entries, length); - if (pos != -1) { - length -= 1; - gfree(entries[pos].key); - entries[pos].val.free(); - if (pos != length) { - memmove(static_cast<void*>(&entries[pos]), &entries[pos + 1], (length - pos) * sizeof(DictEntry)); - } - } - } else { - int i; - bool found = false; - if(length == 0) { - return; - } - - for(i=0; i<length; i++) { - if (!strcmp(key, entries[i].key)) { - found = true; - break; - } - } - if(!found) { - return; - } - //replace the deleted entry with the last entry - gfree(entries[i].key); - entries[i].val.free(); - length -= 1; - if (i!=length) { - //don't copy the last entry if it is deleted - entries[i].key = entries[length].key; - entries[i].val = std::move(entries[length].val); + if (auto *entry = find(key)) { + if (sorted) { + const auto index = entry - &entries.front(); + entries.erase(entries.begin() + index); + } else { + swap(*entry, entries.back()); + entries.pop_back(); } } } void Dict::set(const char *key, Object &&val) { - DictEntry *e; if (val.isNull()) { remove(key); return; } - e = find (key); - if (e) { - dictLocker(); - e->val = std::move(val); + dictLocker(); + if (auto *entry = find(key)) { + entry->second = std::move(val); } else { - add (copyString(key), std::move(val)); + add(key, std::move(val)); } } GBool Dict::is(const char *type) const { - DictEntry *e; - - return (e = find("Type")) && e->val.isName(type); + if (const auto *entry = find("Type")) { + return entry->second.isName(type); + } + return gFalse; } Object Dict::lookup(const char *key, int recursion) const { - DictEntry *e; - - return (e = find(key)) ? e->val.fetch(xref, recursion) : Object(objNull); + if (const auto *entry = find(key)) { + return entry->second.fetch(xref, recursion); + } + return Object(objNull); } Object Dict::lookupNF(const char *key) const { - DictEntry *e; - - return (e = find(key)) ? e->val.copy() : Object(objNull); + if (const auto *entry = find(key)) { + return entry->second.copy(); + } + return Object(objNull); } GBool Dict::lookupInt(const char *key, const char *alt_key, int *value) const { - GBool success = gFalse; - Object obj1 = lookup ((char *) key); - if (obj1.isNull () && alt_key != nullptr) { - obj1.free (); - obj1 = lookup ((char *) alt_key); + auto obj1 = lookup(key); + if (obj1.isNull() && alt_key != nullptr) { + obj1 = lookup(alt_key); } - if (obj1.isInt ()) { - *value = obj1.getInt (); - success = gTrue; + if (obj1.isInt()) { + *value = obj1.getInt(); + return gTrue; } - - obj1.free (); - - return success; + return gFalse; } -char *Dict::getKey(int i) const { - return entries[i].key; -} - -Object Dict::getVal(int i) const { - return entries[i].val.fetch(xref); -} - -Object Dict::getValNF(int i) const { - return entries[i].val.copy(); +GBool Dict::hasKey(const char *key) const { + return find(key) != nullptr; } diff --git a/Build/source/libs/poppler/poppler-src/poppler/Dict.h b/Build/source/libs/poppler/poppler-src/poppler/Dict.h index 9fd732a1561..a4fd1c56138 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Dict.h +++ b/Build/source/libs/poppler/poppler-src/poppler/Dict.h @@ -20,6 +20,7 @@ // Copyright (C) 2010 PaweÅ‚ Wiejacha <pawel.wiejacha@gmail.com> // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -33,6 +34,11 @@ #pragma interface #endif +#include <atomic> +#include <string> +#include <vector> +#include <utility> + #include "poppler-config.h" #include "Object.h" #include "goo/GooMutex.h" @@ -41,18 +47,13 @@ // Dict //------------------------------------------------------------------------ -struct DictEntry { - char *key; - Object val; -}; - class Dict { public: // Constructor. Dict(XRef *xrefA); - Dict(Dict* dictA); - Dict *copy(XRef *xrefA); + Dict(const Dict *dictA); + Dict *copy(XRef *xrefA) const; // Destructor. ~Dict(); @@ -61,11 +62,14 @@ public: Dict& operator=(const Dict &) = delete; // Get number of entries. - int getLength() const { return length; } + int getLength() const { return static_cast<int>(entries.size()); } - // Add an entry. NB: does not copy key. + // Add an entry. (Copies key into Dict.) // val becomes a dead object after the call - void add(char *key, Object &&val); + void add(const char *key, Object &&val); + + // Add an entry. (Takes ownership of key.) + void add(char *key, Object &&val) = delete; // Update the value of an existing entry, otherwise create it // val becomes a dead object after the call @@ -83,9 +87,9 @@ public: GBool lookupInt(const char *key, const char *alt_key, int *value) const; // Iterative accessors. - char *getKey(int i) const; - Object getVal(int i) const; - Object getValNF(int i) const; + const char *getKey(int i) const { return entries[i].first.c_str(); } + Object getVal(int i) const { return entries[i].second.fetch(xref); } + Object getValNF(int i) const { return entries[i].second.copy(); } // Set the xref pointer. This is only used in one special case: the // trailer dictionary, which is read before the xref table is @@ -100,20 +104,22 @@ private: friend class Object; // for incRef/decRef // Reference counting. - int incRef(); - int decRef(); + int incRef() { return ++ref; } + int decRef() { return --ref; } + + using DictEntry = std::pair<std::string, Object>; + struct CmpDictEntry; - mutable GBool sorted; + std::atomic_bool sorted; XRef *xref; // the xref table for this PDF file - DictEntry *entries; // array of entries - int size; // size of <entries> array - int length; // number of entries in dictionary - int ref; // reference count + std::vector<DictEntry> entries; + std::atomic_int ref; // reference count #ifdef MULTITHREADED mutable GooMutex mutex; #endif - DictEntry *find(const char *key) const; + const DictEntry *find(const char *key) const; + DictEntry *find(const char *key); }; #endif diff --git a/Build/source/libs/poppler/poppler-src/poppler/Form.cc b/Build/source/libs/poppler/poppler-src/poppler/Form.cc index 3f2ab9a10bf..2ff4aafa844 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Form.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Form.cc @@ -5,7 +5,7 @@ // This file is licensed under the GPLv2 or later // // Copyright 2006-2008 Julien Rebetez <julienr@svn.gnome.org> -// Copyright 2007-2012, 2015-2017 Albert Astals Cid <aacid@kde.org> +// Copyright 2007-2012, 2015-2018 Albert Astals Cid <aacid@kde.org> // Copyright 2007-2008, 2011 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright 2007, 2013, 2016 Adrian Johnson <ajohnson@redneon.com> // Copyright 2007 Iñigo MartÃnez <inigomartinez@gmail.com> @@ -22,6 +22,7 @@ // Copyright 2018 Andre Heinecke <aheinecke@intevation.de> // Copyright 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright 2018 Chinmoy Ranjan Pradhan <chinmoyrp65@protonmail.com> +// Copyright 2018 Adam Reichold <adam.reichold@t-online.de> // //======================================================================== @@ -193,7 +194,7 @@ FormWidgetButton::FormWidgetButton (PDFDoc *docA, Object *aobj, unsigned num, Re Object obj2 = obj1.dictLookup("N"); if (obj2.isDict()) { for (int i = 0; i < obj2.dictGetLength(); i++) { - char *key = obj2.dictGetKey(i); + const char *key = obj2.dictGetKey(i); if (strcmp (key, "Off") != 0) { onStr = new GooString (key); break; @@ -1637,12 +1638,12 @@ void FormFieldSignature::parseInfo() const Object location_obj = sig_dict.dictLookup("Location"); if (location_obj.isString()) { - signature_info->setLocation(location_obj.getString()->copy()->getCString()); + signature_info->setLocation(location_obj.getString()->getCString()); } const Object reason_obj = sig_dict.dictLookup("Reason"); if (reason_obj.isString()) { - signature_info->setReason(reason_obj.getString()->copy()->getCString()); + signature_info->setReason(reason_obj.getString()->getCString()); } // retrieve SigningTime diff --git a/Build/source/libs/poppler/poppler-src/poppler/Function.cc b/Build/source/libs/poppler/poppler-src/poppler/Function.cc index cc32414b87b..6918fbcda9e 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Function.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Function.cc @@ -362,7 +362,11 @@ SampledFunction::SampledFunction(Object *funcObj, Dict *dict) { nSamples = n; for (i = 0; i < m; ++i) nSamples *= sampleSize[i]; - samples = (double *)gmallocn(nSamples, sizeof(double)); + samples = (double *)gmallocn_checkoverflow(nSamples, sizeof(double)); + if (!samples) { + error(errSyntaxError, -1, "Function has invalid number of samples"); + return; + } buf = 0; bits = 0; bitMask = (1 << sampleBits) - 1; diff --git a/Build/source/libs/poppler/poppler-src/poppler/Gfx.cc b/Build/source/libs/poppler/poppler-src/poppler/Gfx.cc index 8f2c62d24a7..5b3b8f122a2 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Gfx.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Gfx.cc @@ -40,6 +40,7 @@ // Copyright (C) 2014 Jason Crain <jason@aquaticape.us> // Copyright (C) 2017, 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> +// Copyright (C) 2018 Denis Onishchenko <denis.onischenko@gmail.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 @@ -3884,15 +3885,15 @@ void Gfx::doShowText(const GooString *s) { double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, ddx, ddy; double originX, originY, tOriginX, tOriginY; double x0, y0, x1, y1; - double oldCTM[6], newCTM[6]; - double *mat; + double tmp[4], newCTM[6]; + double *oldCTM, *mat; Dict *resDict; Parser *oldParser; GfxState *savedState; const char *p; int render; GBool patternFill; - int len, n, uLen, nChars, nSpaces, i; + int len, n, uLen, nChars, nSpaces; font = state->getFont(); wMode = font->getWMode(); @@ -3925,26 +3926,23 @@ void Gfx::doShowText(const GooString *s) { // handle a Type 3 char if (font->getType() == fontType3 && out->interpretType3Chars()) { - mat = state->getCTM(); - for (i = 0; i < 6; ++i) { - oldCTM[i] = mat[i]; - } + oldCTM = state->getCTM(); mat = state->getTextMat(); - newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2]; - newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3]; - newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2]; - newCTM[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3]; + tmp[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2]; + tmp[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3]; + tmp[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2]; + tmp[3] = mat[2] * oldCTM[1] + mat[3] * oldCTM[3]; mat = font->getFontMatrix(); - newCTM[0] = mat[0] * newCTM[0] + mat[1] * newCTM[2]; - newCTM[1] = mat[0] * newCTM[1] + mat[1] * newCTM[3]; - newCTM[2] = mat[2] * newCTM[0] + mat[3] * newCTM[2]; - newCTM[3] = mat[2] * newCTM[1] + mat[3] * newCTM[3]; + newCTM[0] = mat[0] * tmp[0] + mat[1] * tmp[2]; + newCTM[1] = mat[0] * tmp[1] + mat[1] * tmp[3]; + newCTM[2] = mat[2] * tmp[0] + mat[3] * tmp[2]; + newCTM[3] = mat[2] * tmp[1] + mat[3] * tmp[3]; newCTM[0] *= state->getFontSize(); newCTM[1] *= state->getFontSize(); newCTM[2] *= state->getFontSize(); newCTM[3] *= state->getFontSize(); newCTM[0] *= state->getHorizScaling(); - newCTM[2] *= state->getHorizScaling(); + newCTM[1] *= state->getHorizScaling(); curX = state->getCurX(); curY = state->getCurY(); oldParser = parser; @@ -4214,7 +4212,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { GBool invert; GfxColorSpace *colorSpace, *maskColorSpace; GBool haveColorKeyMask, haveExplicitMask, haveSoftMask; - int maskColors[2*gfxColorMaxComps]; + int maskColors[2*gfxColorMaxComps] = {}; int maskWidth, maskHeight; GBool maskInvert; GBool maskInterpolate; @@ -4912,7 +4910,6 @@ void Gfx::opBeginImage(Object args[], int numArgs) { } Stream *Gfx::buildImageStream() { - char *key; Stream *str; // build dictionary @@ -4922,13 +4919,11 @@ Stream *Gfx::buildImageStream() { if (!obj.isName()) { error(errSyntaxError, getPos(), "Inline image dictionary key must be a name object"); } else { - key = copyString(obj.getName()); - obj = parser->getObj(); - if (obj.isEOF() || obj.isError()) { - gfree(key); + auto val = parser->getObj(); + if (val.isEOF() || val.isError()) { break; } - dict.dictAdd(key, std::move(obj)); + dict.dictAdd(obj.getName(), std::move(val)); } obj = parser->getObj(); } diff --git a/Build/source/libs/poppler/poppler-src/poppler/GfxFont.cc b/Build/source/libs/poppler/poppler-src/poppler/GfxFont.cc index 7b4d4b5487a..662c9a49412 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/GfxFont.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/GfxFont.cc @@ -33,6 +33,7 @@ // Copyright (C) 2013-2016, 2018 Jason Crain <jason@aquaticape.us> // Copyright (C) 2014 Olly Betts <olly@survex.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -1439,7 +1440,7 @@ static int parseCharName(char *charName, Unicode *uBuf, int uLen, return 0; // .notdef or similar } else if (var_part != nullptr) { // parse names of the form 7.oldstyle, P.swash, s.sc, etc. - char *main_part = gstrndup(charName, var_part - charName); + char *main_part = copyString(charName, var_part - charName); GBool namesRecurse = gTrue, variantsRecurse = gFalse; int n = parseCharName(main_part, uBuf, uLen, namesRecurse, ligatures, numeric, hex, variantsRecurse); diff --git a/Build/source/libs/poppler/poppler-src/poppler/GfxState.cc b/Build/source/libs/poppler/poppler-src/poppler/GfxState.cc index 956a214bf84..b8423f23fc2 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/GfxState.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/GfxState.cc @@ -31,6 +31,8 @@ // Copyright (C) 2016 Marek Kasik <mkasik@redhat.com> // Copyright (C) 2017 Oliver Sander <oliver.sander@tu-dresden.de> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Volker Krause <vkrause@kde.org> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -4006,7 +4008,9 @@ void GfxUnivariateShading::setupCache(const Matrix *ctm, tMax = t0 + sMin * (t1 - t0); } - cacheBounds = (double *)gmallocn(maxSize, sizeof(double) * (nComps + 2)); + cacheBounds = (double *)gmallocn_checkoverflow(maxSize, sizeof(double) * (nComps + 2)); + if (unlikely(!cacheBounds)) + return; cacheCoeff = cacheBounds + maxSize; cacheValues = cacheCoeff + maxSize; @@ -5224,7 +5228,7 @@ GfxPatchMeshShading *GfxPatchMeshShading::parse(GfxResources *res, int typeA, Di nPatchesA = 0; patchesA = nullptr; patchesSize = 0; - std::unique_ptr<GfxShadingBitBuf> bitBuf(new GfxShadingBitBuf(str)); + auto bitBuf = std::make_unique<GfxShadingBitBuf>(str); while (1) { if (!bitBuf->getBits(flagBits, &flag)) { break; @@ -5868,24 +5872,30 @@ GfxImageColorMap::GfxImageColorMap(GfxImageColorMap *colorMap) { colorSpace2 = nullptr; for (k = 0; k < gfxColorMaxComps; ++k) { lookup[k] = nullptr; + lookup2[k] = nullptr; } + byte_lookup = nullptr; n = 1 << bits; + for (k = 0; k < nComps; ++k) { + lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); + memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp)); + } if (colorSpace->getMode() == csIndexed) { colorSpace2 = ((GfxIndexedColorSpace *)colorSpace)->getBase(); for (k = 0; k < nComps2; ++k) { - lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); - memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp)); + lookup2[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); + memcpy(lookup2[k], colorMap->lookup2[k], n * sizeof(GfxColorComp)); } } else if (colorSpace->getMode() == csSeparation) { colorSpace2 = ((GfxSeparationColorSpace *)colorSpace)->getAlt(); for (k = 0; k < nComps2; ++k) { - lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); - memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp)); + lookup2[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); + memcpy(lookup2[k], colorMap->lookup2[k], n * sizeof(GfxColorComp)); } } else { for (k = 0; k < nComps; ++k) { - lookup[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); - memcpy(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp)); + lookup2[k] = (GfxColorComp *)gmallocn(n, sizeof(GfxColorComp)); + memcpy(lookup2[k], colorMap->lookup2[k], n * sizeof(GfxColorComp)); } } if (colorMap->byte_lookup) { diff --git a/Build/source/libs/poppler/poppler-src/poppler/GlobalParams.cc b/Build/source/libs/poppler/poppler-src/poppler/GlobalParams.cc index 6d8941ea3bc..c1131df34b7 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/GlobalParams.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/GlobalParams.cc @@ -68,6 +68,7 @@ #include "goo/GooString.h" #include "goo/GooList.h" #include "goo/gfile.h" +#include "goo/gdir.h" #include "Error.h" #include "NameToCharCode.h" #include "CharCodeToUnicode.h" diff --git a/Build/source/libs/poppler/poppler-src/poppler/JBIG2Stream.cc b/Build/source/libs/poppler/poppler-src/poppler/JBIG2Stream.cc index 25df3db8ae0..2acbc915a15 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/JBIG2Stream.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/JBIG2Stream.cc @@ -23,6 +23,7 @@ // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2013, 2014 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2015 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -2966,17 +2967,19 @@ JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h, if (mmr) { mmrDecoder->reset(); - if (w > INT_MAX - 2) { - error(errSyntaxError, curStr->getPos(), "Bad width in JBIG2 generic bitmap"); - delete bitmap; - return nullptr; - } // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w // ---> max codingLine size = w + 1 // refLine has one extra guard entry at the end // ---> max refLine size = w + 2 - codingLine = (int *)gmallocn(w + 1, sizeof(int)); - refLine = (int *)gmallocn(w + 2, sizeof(int)); + codingLine = (int *)gmallocn_checkoverflow(w + 1, sizeof(int)); + refLine = (int *)gmallocn_checkoverflow(w + 2, sizeof(int)); + + if (unlikely(!codingLine || !refLine)) { + error(errSyntaxError, curStr->getPos(), "Bad width in JBIG2 generic bitmap"); + delete bitmap; + return nullptr; + } + memset(refLine, 0, (w + 2) * sizeof(int)); for (i = 0; i < w + 1; ++i) codingLine[i] = w; @@ -4085,15 +4088,20 @@ void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) { huffDecoder->reset(); huffTabSize = 8; - huffTab = (JBIG2HuffmanTable *) - gmallocn(huffTabSize, sizeof(JBIG2HuffmanTable)); + huffTab = (JBIG2HuffmanTable *)gmallocn_checkoverflow(huffTabSize, sizeof(JBIG2HuffmanTable)); + if (unlikely(!huffTab)) { + goto oomError; + } + i = 0; val = lowVal; while (val < highVal) { if (i == huffTabSize) { huffTabSize *= 2; - huffTab = (JBIG2HuffmanTable *) - greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable)); + huffTab = (JBIG2HuffmanTable *)greallocn_checkoverflow(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable)); + if (unlikely(!huffTab)) { + goto oomError; + } } huffTab[i].val = val; huffTab[i].prefixLen = huffDecoder->readBits(prefixBits); @@ -4103,8 +4111,10 @@ void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) { } if (i + oob + 3 > huffTabSize) { huffTabSize = i + oob + 3; - huffTab = (JBIG2HuffmanTable *) - greallocn(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable)); + huffTab = (JBIG2HuffmanTable *)greallocn_checkoverflow(huffTab, huffTabSize, sizeof(JBIG2HuffmanTable)); + if (unlikely(!huffTab)) { + goto oomError; + } } huffTab[i].val = lowVal - 1; huffTab[i].prefixLen = huffDecoder->readBits(prefixBits); @@ -4132,6 +4142,8 @@ void JBIG2Stream::readCodeTableSeg(Guint segNum, Guint length) { eofError: error(errSyntaxError, curStr->getPos(), "Unexpected EOF in JBIG2 stream"); + oomError: + error(errInternal, curStr->getPos(), "Failed allocation when processing JBIG2 stream"); } void JBIG2Stream::readExtensionSeg(Guint length) { diff --git a/Build/source/libs/poppler/poppler-src/poppler/Link.cc b/Build/source/libs/poppler/poppler-src/poppler/Link.cc index 4a20752c1d4..f88183f9d9e 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Link.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Link.cc @@ -56,7 +56,8 @@ LinkAction::LinkAction() : nextActionList(nullptr) { } LinkAction::~LinkAction() { - delete nextActionList; + if (nextActionList) + deleteGooList(nextActionList, LinkAction); } LinkAction *LinkAction::parseDest(const Object *obj) { diff --git a/Build/source/libs/poppler/poppler-src/poppler/Object.cc b/Build/source/libs/poppler/poppler-src/poppler/Object.cc index d3adc4473ab..9112d31681f 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Object.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Object.cc @@ -15,6 +15,7 @@ // // Copyright (C) 2008, 2010, 2012, 2017 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -58,11 +59,6 @@ static const char *objTypeNames[numObjTypes] = { "dead" }; -#ifdef DEBUG_MEM -int Object::numAlloc[numObjTypes] = - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#endif - Object::Object(Object&& other) { type = other.type; @@ -95,6 +91,7 @@ Object Object::copy() const { obj.string = string->copy(); break; case objName: + case objCmd: obj.cString = copyString(cString); break; case objArray: @@ -106,15 +103,9 @@ Object Object::copy() const { case objStream: stream->incRef(); break; - case objCmd: - obj.cString = copyString(cString); - break; default: break; } -#ifdef DEBUG_MEM - ++numAlloc[type]; -#endif return obj; } @@ -131,6 +122,7 @@ void Object::free() { delete string; break; case objName: + case objCmd: gfree(cString); break; case objArray: @@ -148,15 +140,9 @@ void Object::free() { delete stream; } break; - case objCmd: - gfree(cString); - break; default: break; } -#ifdef DEBUG_MEM - --numAlloc[type]; -#endif type = objNone; } @@ -234,23 +220,3 @@ void Object::print(FILE *f) const { break; } } - -void Object::memCheck(FILE *f) { -#ifdef DEBUG_MEM - int i; - int t; - - t = 0; - for (i = 0; i < numObjTypes; ++i) - t += numAlloc[i]; - if (t > 0) { - fprintf(f, "Allocated objects:\n"); - for (i = 0; i < numObjTypes; ++i) { - if (numAlloc[i] > 0) - fprintf(f, " %-20s: %6d\n", objTypeNames[i], numAlloc[i]); - } - } -#else - (void)f; -#endif -} diff --git a/Build/source/libs/poppler/poppler-src/poppler/Object.h b/Build/source/libs/poppler/poppler-src/poppler/Object.h index 97978f46528..3dcf9e6bbf7 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Object.h +++ b/Build/source/libs/poppler/poppler-src/poppler/Object.h @@ -15,7 +15,7 @@ // // Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org> // Copyright (C) 2008 Kees Cook <kees@outflux.net> -// Copyright (C) 2008, 2010, 2017 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2008, 2010, 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2009 Jakub Wilk <jwilk@jwilk.net> // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> @@ -23,6 +23,7 @@ // Copyright (C) 2013 Adrian Perez de Castro <aperez@igalia.com> // Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -36,6 +37,7 @@ #pragma interface #endif +#include <cassert> #include <set> #include <stdio.h> #include <string.h> @@ -87,14 +89,33 @@ struct Ref { int gen; // generation number }; -struct RefCompare { - bool operator() (const Ref& lhs, const Ref& rhs) const { - if (lhs.num != rhs.num) - return lhs.num < rhs.num; - return lhs.gen < rhs.gen; - } +inline bool operator== (const Ref& lhs, const Ref& rhs) noexcept { + return lhs.num == rhs.num && lhs.gen == rhs.gen; +} + +inline bool operator< (const Ref& lhs, const Ref& rhs) noexcept { + if (lhs.num != rhs.num) + return lhs.num < rhs.num; + return lhs.gen < rhs.gen; +} + +namespace std +{ + +template<> +struct hash<Ref> +{ + using argument_type = Ref; + using result_type = size_t; + + result_type operator() (const argument_type &ref) const noexcept + { + return std::hash<int>{}(ref.num) ^ (std::hash<int>{}(ref.gen) << 1); + } }; +} + //------------------------------------------------------------------------ // object types //------------------------------------------------------------------------ @@ -131,17 +152,8 @@ enum ObjType { // Object //------------------------------------------------------------------------ -#ifdef DEBUG_MEM -#define initObj(t) free(); zeroUnion(); ++numAlloc[type = t] -#else #define initObj(t) free(); zeroUnion(); type = t -#endif - -#ifdef DEBUG_MEM -#define constructObj(t) ++numAlloc[type = t] -#else #define constructObj(t) type = t -#endif class Object { public: @@ -162,17 +174,17 @@ public: explicit Object(double realA) { constructObj(objReal); real = realA; } explicit Object(GooString *stringA) - { constructObj(objString); string = stringA; } + { assert(stringA); constructObj(objString); string = stringA; } Object(ObjType typeA, const char *stringA) - { constructObj(typeA); cString = copyString(stringA); } + { assert(typeA == objName || typeA == objCmd); assert(stringA); constructObj(typeA); cString = copyString(stringA); } explicit Object(long long int64gA) { constructObj(objInt64); int64g = int64gA; } explicit Object(Array *arrayA) - { constructObj(objArray); array = arrayA; } + { assert(arrayA); constructObj(objArray); array = arrayA; } explicit Object(Dict *dictA) - { constructObj(objDict); dict = dictA; } + { assert(dictA); constructObj(objDict); dict = dictA; } explicit Object(Stream *streamA) - { constructObj(objStream); stream = streamA; } + { assert(streamA); constructObj(objStream); stream = streamA; } Object(int numA, int genA) { constructObj(objRef); ref.num = numA; ref.gen = genA; } template<typename T> Object(T) = delete; @@ -238,10 +250,8 @@ public: return type == objInt ? (double)intg : type == objInt64 ? (double)int64g : real; } const GooString *getString() const { OBJECT_TYPE_CHECK(objString); return string; } - // After takeString() the only method that should be called for the object is free() - // because the object it's not expected to have a NULL string. - GooString *takeString() { - OBJECT_TYPE_CHECK(objString); GooString *s = string; string = nullptr; return s; } + // After takeString() the only method that should be called for the object is free(). + GooString *takeString() { OBJECT_TYPE_CHECK(objString); type = objDead; return string; } const char *getName() const { OBJECT_TYPE_CHECK(objName); return cString; } Array *getArray() const { OBJECT_TYPE_CHECK(objArray); return array; } Dict *getDict() const { OBJECT_TYPE_CHECK(objDict); return dict; } @@ -263,13 +273,14 @@ public: // Dict accessors. int dictGetLength() const; - void dictAdd(char *key, Object &&val); + void dictAdd(char *key, Object &&val) = delete; + void dictAdd(const char *key, Object &&val); void dictSet(const char *key, Object &&val); void dictRemove(const char *key); GBool dictIs(const char *dictType) const; Object dictLookup(const char *key, int recursion = 0) const; Object dictLookupNF(const char *key) const; - char *dictGetKey(int i) const; + const char *dictGetKey(int i) const; Object dictGetVal(int i) const; Object dictGetValNF(int i) const; @@ -289,9 +300,6 @@ public: const char *getTypeName() const; void print(FILE *f = stdout) const; - // Memory testing. - static void memCheck(FILE *f); - private: friend class Array; // Needs free and initNullAfterMalloc friend class Dict; // Needs free and initNullAfterMalloc @@ -316,11 +324,6 @@ private: Stream *stream; // stream Ref ref; // indirect reference }; - -#ifdef DEBUG_MEM - static int // number of each type of object - numAlloc[numObjTypes]; // currently allocated -#endif }; //------------------------------------------------------------------------ @@ -353,7 +356,7 @@ inline Object Object::arrayGetNF(int i) const inline int Object::dictGetLength() const { OBJECT_TYPE_CHECK(objDict); return dict->getLength(); } -inline void Object::dictAdd(char *key, Object &&val) +inline void Object::dictAdd(const char *key, Object &&val) { OBJECT_TYPE_CHECK(objDict); dict->add(key, std::move(val)); } inline void Object::dictSet(const char *key, Object &&val) @@ -374,7 +377,7 @@ inline Object Object::dictLookup(const char *key, int recursion) const inline Object Object::dictLookupNF(const char *key) const { OBJECT_TYPE_CHECK(objDict); return dict->lookupNF(key); } -inline char *Object::dictGetKey(int i) const +inline const char *Object::dictGetKey(int i) const { OBJECT_TYPE_CHECK(objDict); return dict->getKey(i); } inline Object Object::dictGetVal(int i) const diff --git a/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.cc b/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.cc index 8376a0e4e4f..717dc33d198 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.cc @@ -7,6 +7,7 @@ // Copyright 2008, 2010 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright 2008, 2010, 2011, 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright 2008 Mark Kaplan <mkaplan@finjan.com> +// Copyright 2018 Adam Reichold <adam.reichold@t-online.de> // // Released under the GPL (version 2, or later, at your option) // @@ -22,7 +23,6 @@ #include "goo/GooString.h" #include "goo/GooList.h" #include "Error.h" -// #include "PDFDocEncoding.h" #include "OptionalContent.h" // Max depth of nested visibility expressions. This is used to catch @@ -40,8 +40,6 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : { // we need to parse the dictionary here, and build optionalContentGroups ok = gTrue; - optionalContentGroups = new GooList(); - display = nullptr; Object ocgList = ocgObject->dictLookup("OCGs"); if (!ocgList.isArray()) { @@ -56,17 +54,15 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : if (!ocg.isDict()) { break; } - OptionalContentGroup *thisOptionalContentGroup = new OptionalContentGroup(ocg.getDict()); + auto thisOptionalContentGroup = std::make_unique<OptionalContentGroup>(ocg.getDict()); ocg = ocgList.arrayGetNF(i); if (!ocg.isRef()) { - delete thisOptionalContentGroup; break; } - // TODO: we should create a lookup map from Ref to the OptionalContentGroup thisOptionalContentGroup->setRef( ocg.getRef() ); // the default is ON - we change state later, depending on BaseState, ON and OFF thisOptionalContentGroup->setState(OptionalContentGroup::On); - optionalContentGroups->append(thisOptionalContentGroup); + optionalContentGroups.emplace(ocg.getRef(), std::move(thisOptionalContentGroup)); } Object defaultOcgConfig = ocgObject->dictLookup("D"); @@ -78,11 +74,8 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : Object baseState = defaultOcgConfig.dictLookup("BaseState"); if (baseState.isName("OFF")) { - for (int i = 0; i < optionalContentGroups->getLength(); ++i) { - OptionalContentGroup *group; - - group = (OptionalContentGroup *)optionalContentGroups->get(i); - group->setState(OptionalContentGroup::Off); + for (auto &group : optionalContentGroups) { + group.second->setState(OptionalContentGroup::Off); } } @@ -126,42 +119,26 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) : rbgroups = defaultOcgConfig.dictLookup("RBGroups"); } -OCGs::~OCGs() -{ - deleteGooList(optionalContentGroups, OptionalContentGroup); - delete display; -} - - bool OCGs::hasOCGs() const { - return ( optionalContentGroups->getLength() > 0 ); + return !( optionalContentGroups.empty() ); } -OptionalContentGroup* OCGs::findOcgByRef( const Ref &ref) +OptionalContentGroup* OCGs::findOcgByRef( const Ref &ref ) { - //TODO: make this more efficient - OptionalContentGroup *ocg = nullptr; - for (int i=0; i < optionalContentGroups->getLength(); ++i) { - ocg = (OptionalContentGroup*)optionalContentGroups->get(i); - if ( (ocg->getRef().num == ref.num) && (ocg->getRef().gen == ref.gen) ) { - return ocg; - } - } - - // not found - return nullptr; + const auto ocg = optionalContentGroups.find( ref ); + return ocg != optionalContentGroups.end() ? ocg->second.get() : nullptr; } OCDisplayNode *OCGs::getDisplayRoot() { if (display) - return display; + return display.get(); if (order.isArray()) - display = OCDisplayNode::parse(&order, this, m_xref); + display.reset(OCDisplayNode::parse(&order, this, m_xref)); - return display; + return display.get(); } bool OCGs::optContentIsVisible( Object *dictRef ) @@ -184,7 +161,6 @@ bool OCGs::optContentIsVisible( Object *dictRef ) return result; } dict = dictObj.getDict(); - // printf("checking if optContent is visible\n"); Object dictType = dict->lookup("Type"); if (dictType.isName("OCMD")) { Object ve = dict->lookup("VE"); @@ -213,13 +189,12 @@ bool OCGs::optContentIsVisible( Object *dictRef ) } } } - } else if ( dictType.isName("OCG") ) { + } else if ( dictType.isName("OCG") && dictRef->isRef() ) { OptionalContentGroup* oc = findOcgByRef( dictRef->getRef() ); if ( oc && oc->getState() == OptionalContentGroup::Off ) { result=false; } } - // printf("visibility: %s\n", result? "on" : "off"); return result; } diff --git a/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.h b/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.h index ea5618e4374..6e9c52a61fd 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.h +++ b/Build/source/libs/poppler/poppler-src/poppler/OptionalContent.h @@ -5,6 +5,7 @@ // Copyright 2007 Brad Hards <bradh@kde.org> // Copyright 2008 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright 2013, 2018 Albert Astals Cid <aacid@kde.org> +// Copyright 2018 Adam Reichold <adam.reichold@t-online.de> // // Released under the GPL (version 2, or later, at your option) // @@ -19,6 +20,8 @@ #include "Object.h" #include "CharTypes.h" +#include <unordered_map> +#include <memory> class GooString; class GooList; @@ -33,7 +36,6 @@ class OCGs { public: OCGs(Object *ocgObject, XRef *xref); - ~OCGs(); OCGs(const OCGs &) = delete; OCGs& operator=(const OCGs &) = delete; @@ -42,7 +44,7 @@ public: GBool isOk() const { return ok; } bool hasOCGs() const; - GooList *getOCGs() const { return optionalContentGroups; } + const std::unordered_map< Ref, std::unique_ptr< OptionalContentGroup > > &getOCGs() const { return optionalContentGroups; } OptionalContentGroup* findOcgByRef( const Ref &ref); @@ -66,12 +68,12 @@ private: bool anyOn( Array *ocgArray ); bool anyOff( Array *ocgArray ); - GooList *optionalContentGroups; + std::unordered_map< Ref, std::unique_ptr< OptionalContentGroup > > optionalContentGroups; Object order; Object rbgroups; XRef *m_xref; - OCDisplayNode *display; // root node of display tree + std::unique_ptr< OCDisplayNode > display; // root node of display tree }; //------------------------------------------------------------------------ diff --git a/Build/source/libs/poppler/poppler-src/poppler/OutputDev.h b/Build/source/libs/poppler/poppler-src/poppler/OutputDev.h index 52635743838..0a769307848 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/OutputDev.h +++ b/Build/source/libs/poppler/poppler-src/poppler/OutputDev.h @@ -244,7 +244,19 @@ public: { return gFalse; } //----- path clipping + + // Update the clipping path. The new path is the intersection of the old path + // with the path given in 'state'. + // Additionally, set the clipping mode to the 'nonzero winding number rule'. + // That is, a point is inside the clipping region if its winding number + // with respect to the clipping path is nonzero. virtual void clip(GfxState * /*state*/) {} + + // Update the clipping path. The new path is the intersection of the old path + // with the path given in 'state'. + // Additionally, set the clipping mode to the 'even-odd rule'. That is, a point is + // inside the clipping region if a ray from it to infinity will cross the clipping + // path an odd number of times (disregarding the path orientation). virtual void eoClip(GfxState * /*state*/) {} virtual void clipToStrokePath(GfxState * /*state*/) {} diff --git a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.cc b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.cc index 631f9a70782..cb8fd0d7ff4 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.cc @@ -29,7 +29,7 @@ // Copyright (C) 2011-2016 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2013, 2014, 2017 Adrian Johnson <ajohnson@redneon.com> -// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com> +// Copyright (C) 2013, 2018 Adam Reichold <adamreichold@myopera.com> // Copyright (C) 2014 Bogdan Cristea <cristeab@gmail.com> // Copyright (C) 2015 Li Junling <lijunling@sina.com> // Copyright (C) 2015 André Guerreiro <aguerreiro1985@gmail.com> @@ -40,6 +40,7 @@ // Copyright (C) 2018 Ben Timby <btimby@gmail.com> // Copyright (C) 2018 Evangelos Foutras <evangelos@foutrelis.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Evangelos Rigas <erigas@rnd2.org> // // 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 @@ -62,6 +63,7 @@ #include <stddef.h> #include <string.h> #include <time.h> +#include <regex> #include <sys/stat.h> #include "goo/glibc.h" #include "goo/gstrtod.h" @@ -318,6 +320,9 @@ GBool PDFDoc::setup(GooString *ownerPassword, GooString *userPassword) { } } + // Extract PDF Subtype information + extractPDFSubtype(); + // done return gTrue; } @@ -482,6 +487,133 @@ GBool PDFDoc::checkEncryption(GooString *ownerPassword, GooString *userPassword) return ret; } +static PDFSubtypePart pdfPartFromString(PDFSubtype subtype, GooString *pdfSubtypeVersion) { + const std::regex regex("PDF/(?:A|X|VT|E|UA)-([[:digit:]])(?:[[:alpha:]]{1,2})?:?([[:digit:]]{4})?"); + std::smatch match; + std::string pdfsubver = pdfSubtypeVersion->toStr(); + PDFSubtypePart subtypePart = subtypePartNone; + + if (std::regex_search(pdfsubver, match, regex)) { + int date = 0; + const int part = std::stoi(match.str(1)); + + if (match[2].matched) { + date = std::stoi(match.str(2)); + } + + switch (subtype) { + case subtypePDFX: + switch (part) { + case 1: + switch (date) { + case 2001: + default: + subtypePart = subtypePart1; + break; + case 2003: + subtypePart = subtypePart4; + break; + } + break; + case 2: + subtypePart = subtypePart5; + break; + case 3: + switch (date) { + case 2002: + default: + subtypePart = subtypePart3; + break; + case 2003: + subtypePart = subtypePart6; + break; + } + break; + case 4: + subtypePart = subtypePart7; + break; + case 5: + subtypePart = subtypePart8; + break; + } + break; + default: + subtypePart = (PDFSubtypePart)part; + break; + + } + } + + return subtypePart; +} + +static PDFSubtypeConformance pdfConformanceFromString(GooString *pdfSubtypeVersion) { + const std::regex regex("PDF/(?:A|X|VT|E|UA)-[[:digit:]]([[:alpha:]]+)"); + std::smatch match; + const std::string pdfsubver = pdfSubtypeVersion->toStr(); + PDFSubtypeConformance pdfConf = subtypeConfNone; + + // match contains the PDF conformance (A, B, G, N, P, PG or U) + if (std::regex_search(pdfsubver, match, regex)) { + GooString *conf = new GooString(match.str(1)); + // Convert to lowercase as the conformance may appear in both cases + conf->lowerCase(); + if (conf->cmp("a")==0) { + pdfConf = subtypeConfA; + } else if (conf->cmp("b")==0) { + pdfConf = subtypeConfB; + } else if (conf->cmp("g")==0) { + pdfConf = subtypeConfG; + } else if (conf->cmp("n")==0) { + pdfConf = subtypeConfN; + } else if (conf->cmp("p")==0) { + pdfConf = subtypeConfP; + } else if (conf->cmp("pg")==0) { + pdfConf = subtypeConfPG; + } else if (conf->cmp("u")==0) { + pdfConf = subtypeConfU; + } else { + pdfConf = subtypeConfNone; + } + delete conf; + } + + return pdfConf; +} + +void PDFDoc::extractPDFSubtype() { + pdfSubtype = subtypeNull; + pdfPart = subtypePartNull; + pdfConformance = subtypeConfNull; + + GooString *pdfSubtypeVersion = nullptr; + // Find PDF InfoDict subtype key if any + if ((pdfSubtypeVersion = getDocInfoStringEntry("GTS_PDFA1Version"))) { + pdfSubtype = subtypePDFA; + } else if ((pdfSubtypeVersion = getDocInfoStringEntry("GTS_PDFEVersion"))) { + pdfSubtype = subtypePDFE; + } else if ((pdfSubtypeVersion = getDocInfoStringEntry("GTS_PDFUAVersion"))) { + pdfSubtype = subtypePDFUA; + } else if ((pdfSubtypeVersion = getDocInfoStringEntry("GTS_PDFVTVersion"))) { + pdfSubtype = subtypePDFVT; + } else if ((pdfSubtypeVersion = getDocInfoStringEntry("GTS_PDFXVersion"))) { + pdfSubtype = subtypePDFX; + } else { + pdfSubtype = subtypeNone; + pdfPart = subtypePartNone; + pdfConformance = subtypeConfNone; + return; + } + + // Extract part from version string + pdfPart = pdfPartFromString(pdfSubtype, pdfSubtypeVersion); + + // Extract conformance from version string + pdfConformance = pdfConformanceFromString(pdfSubtypeVersion); + + delete pdfSubtypeVersion; +} + std::vector<FormWidgetSignature*> PDFDoc::getSignatureWidgets() { int num_pages = getNumPages(); @@ -1645,7 +1777,7 @@ void PDFDoc::replacePageDict(int pageNo, int rotate, mediaBoxArray->add(Object(mediaBox->y2)); Object mediaBoxObject(mediaBoxArray); Object trimBoxObject = mediaBoxObject.copy(); - pageDict->add(copyString("MediaBox"), std::move(mediaBoxObject)); + pageDict->add("MediaBox", std::move(mediaBoxObject)); if (cropBox != nullptr) { Array *cropBoxArray = new Array(getXRef()); cropBoxArray->add(Object(cropBox->x1)); @@ -1654,10 +1786,10 @@ void PDFDoc::replacePageDict(int pageNo, int rotate, cropBoxArray->add(Object(cropBox->y2)); Object cropBoxObject(cropBoxArray); trimBoxObject = cropBoxObject.copy(); - pageDict->add(copyString("CropBox"), std::move(cropBoxObject)); + pageDict->add("CropBox", std::move(cropBoxObject)); } - pageDict->add(copyString("TrimBox"), std::move(trimBoxObject)); - pageDict->add(copyString("Rotate"), Object(rotate)); + pageDict->add("TrimBox", std::move(trimBoxObject)); + pageDict->add("Rotate", Object(rotate)); getXRef()->setModifiedObject(&page, *refPage); } diff --git a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h index 1678d1678e9..3353db7463c 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h +++ b/Build/source/libs/poppler/poppler-src/poppler/PDFDoc.h @@ -31,6 +31,7 @@ // Copyright (C) 2015 André Esser <bepandre@hotmail.com> // Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Evangelos Rigas <erigas@rnd2.org> // // 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 @@ -74,6 +75,41 @@ enum PDFWriteMode { writeForceIncremental }; +enum PDFSubtype { + subtypeNull, + subtypePDFA, + subtypePDFE, + subtypePDFUA, + subtypePDFVT, + subtypePDFX, + subtypeNone +}; + +enum PDFSubtypePart { + subtypePartNull, + subtypePart1, + subtypePart2, + subtypePart3, + subtypePart4, + subtypePart5, + subtypePart6, + subtypePart7, + subtypePart8, + subtypePartNone +}; + +enum PDFSubtypeConformance { + subtypeConfNull, + subtypeConfA, + subtypeConfB, + subtypeConfG, + subtypeConfN, + subtypeConfP, + subtypeConfPG, + subtypeConfU, + subtypeConfNone +}; + //------------------------------------------------------------------------ // PDFDoc //------------------------------------------------------------------------ @@ -273,6 +309,11 @@ public: GooString *getDocInfoCreatDate() { return getDocInfoStringEntry("CreationDate"); } GooString *getDocInfoModDate() { return getDocInfoStringEntry("ModDate"); } + // Return the PDF subtype, part, and conformance + PDFSubtype getPDFSubtype() const { return pdfSubtype; } + PDFSubtypePart getPDFSubtypePart() const { return pdfPart; } + PDFSubtypeConformance getPDFSubtypeConformance() const { return pdfConformance; } + // Return the PDF version specified by the file. int getPDFMajorVersion() { return pdfMajorVersion; } int getPDFMinorVersion() { return pdfMinorVersion; } @@ -346,6 +387,8 @@ private: GBool checkFooter(); void checkHeader(); GBool checkEncryption(GooString *ownerPassword, GooString *userPassword); + void extractPDFSubtype(); + // Get the offset of the start xref table. Goffset getStartXRef(GBool tryingToReconstruct = gFalse); // Get the offset of the entries in the main XRef table of a @@ -365,6 +408,9 @@ private: void *guiData; int pdfMajorVersion; int pdfMinorVersion; + PDFSubtype pdfSubtype; + PDFSubtypePart pdfPart; + PDFSubtypeConformance pdfConformance; Linearization *linearization; // linearizationState = 0: unchecked // linearizationState = 1: checked and valid diff --git a/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.cc b/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.cc index d1ead5862a8..d6a3177313a 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.cc @@ -33,6 +33,7 @@ // Copyright (C) 2016 Caolán McNamara <caolanm@redhat.com> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> +// Copyright (C) 2018 Philipp Knechtges <philipp-dev@knechtges.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 @@ -52,6 +53,7 @@ #include <math.h> #include <limits.h> #include <algorithm> +#include <array> #include "goo/GooString.h" #include "goo/GooList.h" #include "poppler-config.h" @@ -4927,6 +4929,60 @@ GBool PSOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, return gTrue; } +GBool PSOutputDev::patchMeshShadedFill(GfxState *state, + GfxPatchMeshShading *shading) { + // TODO: support parametrized shading + if (level < psLevel3 || shading->isParameterized()) { + return gFalse; + } + + writePS("%% Begin patchMeshShadedFill\n"); + + // ShadingType 7 shadings are pretty much the same for pdf and ps. + // As such, we basically just need to invert GfxPatchMeshShading::parse here. + + writePS("<<\n"); + writePS(" /ShadingType 7\n"); + writePS(" /ColorSpace "); + dumpColorSpaceL2(shading->getColorSpace(), gFalse, gFalse, gFalse); + writePS("\n"); + writePS(" /DataSource [\n"); + + const int ncomps = shading->getColorSpace()->getNComps(); + + for (int i = 0; i < shading->getNPatches(); ++i) { + const auto& patch = *shading->getPatch(i); + // Print Flag, for us always f = 0 + writePS(" 0 \n"); + + // Print coordinates + const std::array<std::pair<int,int>, 16> coordindices = {{ {0,0}, {0,1}, {0,2}, {0,3}, + {1,3}, {2,3}, {3,3}, {3,2}, + {3,1}, {3,0}, {2,0}, {1,0}, + {1,1}, {1,2}, {2,2}, {2,1} }}; + for (const auto& index: coordindices) { + writePSFmt(" {0:.6g} {1:.6g}\n", patch.x[index.first][index.second], + patch.y[index.first][index.second]); + } + + // Print colors + const std::array<std::pair<int, int>, 4> colindices = {{ {0,0}, {0,1}, {1,1}, {1,0} }}; + for (const auto& index: colindices) { + writePS(" "); + for (int comp = 0; comp < ncomps; ++comp) { + writePSFmt(" {0:.6g}", colToDbl(patch.color[index.first][index.second].c[comp])); + } + writePS("\n"); + } + } + + writePS(" ]\n"); + + writePS(">> shfill\n"); + writePS("%% End patchMeshShadedFill\n"); + return gTrue; +} + void PSOutputDev::clip(GfxState *state) { doPath(state->getPath()); writePS("W\n"); diff --git a/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.h b/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.h index b51cf472977..ef6106bbe34 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.h +++ b/Build/source/libs/poppler/poppler-src/poppler/PSOutputDev.h @@ -26,6 +26,7 @@ // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> +// Copyright (C) 2018 Philipp Knechtges <philipp-dev@knechtges.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 @@ -152,7 +153,7 @@ public: // radialShadedFill()? If this returns false, these shaded fills // will be reduced to a series of other drawing operations. GBool useShadedFills(int type) override - { return type < 4 && level >= psLevel2; } + { return (type < 4 && level >= psLevel2) || (type == 7 && level >= psLevel3); } // Does this device use drawForm()? If this returns false, // form-type XObjects will be interpreted (i.e., unrolled). @@ -249,6 +250,7 @@ public: GfxFunctionShading *shading) override; GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double /*tMin*/, double /*tMax*/) override; GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double /*sMin*/, double /*sMax*/) override; + GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading) override; //----- path clipping void clip(GfxState *state) override; diff --git a/Build/source/libs/poppler/poppler-src/poppler/Parser.cc b/Build/source/libs/poppler/poppler-src/poppler/Parser.cc index 8b0093e3fcf..1d5240c9d65 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/Parser.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/Parser.cc @@ -20,6 +20,7 @@ // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -112,20 +113,18 @@ Object Parser::getObj(GBool simpleOnly, if (strict) goto err; shift(); } else { - // buf1 might go away in shift(), so construct the key - char *key = copyString(buf1.getName()); + // buf1 will go away in shift(), so keep the key + const auto key = std::move(buf1); shift(); if (buf1.isEOF() || buf1.isError()) { - gfree(key); if (strict && buf1.isError()) goto err; break; } Object obj2 = getObj(gFalse, fileKey, encAlgorithm, keyLength, objNum, objGen, recursion + 1); if (unlikely(obj2.isError() && recursion + 1 >= recursionLimit)) { - gfree(key); break; } - obj.dictAdd(key, std::move(obj2)); + obj.dictAdd(key.getName(), std::move(obj2)); } } if (buf1.isEOF()) { diff --git a/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.cc b/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.cc index 76a54c0c083..11e47e5bdb2 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.cc @@ -127,16 +127,16 @@ void SignatureInfo::setSubjectDN(const char *subjectDN) subject_dn = strdup(subjectDN); } -void SignatureInfo::setLocation(char *loc) +void SignatureInfo::setLocation(const char *loc) { free(location); - location = loc; + location = strdup(loc); } -void SignatureInfo::setReason(char *signingReason) +void SignatureInfo::setReason(const char *signingReason) { free(reason); - reason = signingReason; + reason = strdup(signingReason); } void SignatureInfo::setHashAlgorithm(int type) diff --git a/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.h b/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.h index 1e9f5f9d63e..f4554c60a6f 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.h +++ b/Build/source/libs/poppler/poppler-src/poppler/SignatureInfo.h @@ -61,8 +61,8 @@ public: void setCertificateValStatus(enum CertificateValidationStatus ); void setSignerName(char *); void setSubjectDN(const char *); - void setLocation(char *); - void setReason(char *); + void setLocation(const char *); + void setReason(const char *); void setHashAlgorithm(int); void setSigningTime(time_t); void setSubFilterSupport(bool isSupported) { sig_subfilter_supported = isSupported; } diff --git a/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.cc b/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.cc index 3e883970e3e..6faa7477866 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.cc @@ -2294,88 +2294,71 @@ reload: } void SplashOutputDev::stroke(GfxState *state) { - SplashPath *path; - if (state->getStrokeColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getStrokeColorSpace(), state->getStrokeOverprint(), state->getOverprintMode(), state->getStrokeColor()); - path = convertPath(state, state->getPath(), gFalse); - splash->stroke(path); - delete path; + SplashPath path = convertPath(state, state->getPath(), gFalse); + splash->stroke(&path); } void SplashOutputDev::fill(GfxState *state) { - SplashPath *path; - if (state->getFillColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); - path = convertPath(state, state->getPath(), gTrue); - splash->fill(path, gFalse); - delete path; + SplashPath path = convertPath(state, state->getPath(), gTrue); + splash->fill(&path, gFalse); } void SplashOutputDev::eoFill(GfxState *state) { - SplashPath *path; - if (state->getFillColorSpace()->isNonMarking()) { return; } setOverprintMask(state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); - path = convertPath(state, state->getPath(), gTrue); - splash->fill(path, gTrue); - delete path; + SplashPath path = convertPath(state, state->getPath(), gTrue); + splash->fill(&path, gTrue); } void SplashOutputDev::clip(GfxState *state) { - SplashPath *path; - - path = convertPath(state, state->getPath(), gTrue); - splash->clipToPath(path, gFalse); - delete path; + SplashPath path = convertPath(state, state->getPath(), gTrue); + splash->clipToPath(&path, gFalse); } void SplashOutputDev::eoClip(GfxState *state) { - SplashPath *path; - - path = convertPath(state, state->getPath(), gTrue); - splash->clipToPath(path, gTrue); - delete path; + SplashPath path = convertPath(state, state->getPath(), gTrue); + splash->clipToPath(&path, gTrue); } void SplashOutputDev::clipToStrokePath(GfxState *state) { - SplashPath *path, *path2; + SplashPath *path2; - path = convertPath(state, state->getPath(), gFalse); - path2 = splash->makeStrokePath(path, state->getLineWidth()); - delete path; + SplashPath path = convertPath(state, state->getPath(), gFalse); + path2 = splash->makeStrokePath(&path, state->getLineWidth()); splash->clipToPath(path2, gFalse); delete path2; } -SplashPath *SplashOutputDev::convertPath(GfxState *state, GfxPath *path, +SplashPath SplashOutputDev::convertPath(GfxState *state, GfxPath *path, GBool dropEmptySubpaths) { - SplashPath *sPath; + SplashPath sPath; GfxSubpath *subpath; int n, i, j; n = dropEmptySubpaths ? 1 : 0; - sPath = new SplashPath(); for (i = 0; i < path->getNumSubpaths(); ++i) { subpath = path->getSubpath(i); if (subpath->getNumPoints() > n) { - sPath->reserve(subpath->getNumPoints() + 1); - sPath->moveTo((SplashCoord)subpath->getX(0), + sPath.reserve(subpath->getNumPoints() + 1); + sPath.moveTo((SplashCoord)subpath->getX(0), (SplashCoord)subpath->getY(0)); j = 1; while (j < subpath->getNumPoints()) { if (subpath->getCurve(j)) { - sPath->curveTo((SplashCoord)subpath->getX(j), + sPath.curveTo((SplashCoord)subpath->getX(j), (SplashCoord)subpath->getY(j), (SplashCoord)subpath->getX(j+1), (SplashCoord)subpath->getY(j+1), @@ -2383,13 +2366,13 @@ SplashPath *SplashOutputDev::convertPath(GfxState *state, GfxPath *path, (SplashCoord)subpath->getY(j+2)); j += 3; } else { - sPath->lineTo((SplashCoord)subpath->getX(j), + sPath.lineTo((SplashCoord)subpath->getX(j), (SplashCoord)subpath->getY(j)); ++j; } } if (subpath->isClosed()) { - sPath->close(); + sPath.close(); } } } @@ -3570,14 +3553,16 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, } break; case splashModeXBGR8: - imgData.lookup = (SplashColorPtr)gmallocn(n, 4); - for (i = 0; i < n; ++i) { - pix = (Guchar)i; - colorMap->getRGB(&pix, &rgb); - imgData.lookup[4*i] = colToByte(rgb.r); - imgData.lookup[4*i+1] = colToByte(rgb.g); - imgData.lookup[4*i+2] = colToByte(rgb.b); - imgData.lookup[4*i+3] = 255; + imgData.lookup = (SplashColorPtr)gmallocn_checkoverflow(n, 4); + if (likely(imgData.lookup != nullptr)) { + for (i = 0; i < n; ++i) { + pix = (Guchar)i; + colorMap->getRGB(&pix, &rgb); + imgData.lookup[4*i] = colToByte(rgb.r); + imgData.lookup[4*i+1] = colToByte(rgb.g); + imgData.lookup[4*i+2] = colToByte(rgb.b); + imgData.lookup[4*i+3] = 255; + } } break; #ifdef SPLASH_CMYK @@ -4086,14 +4071,16 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, } break; case splashModeXBGR8: - imgData.lookup = (SplashColorPtr)gmallocn(n, 4); - for (i = 0; i < n; ++i) { - pix = (Guchar)i; - colorMap->getRGB(&pix, &rgb); - imgData.lookup[4*i] = colToByte(rgb.r); - imgData.lookup[4*i+1] = colToByte(rgb.g); - imgData.lookup[4*i+2] = colToByte(rgb.b); - imgData.lookup[4*i+3] = 255; + imgData.lookup = (SplashColorPtr)gmallocn_checkoverflow(n, 4); + if (likely(imgData.lookup != nullptr)) { + for (i = 0; i < n; ++i) { + pix = (Guchar)i; + colorMap->getRGB(&pix, &rgb); + imgData.lookup[4*i] = colToByte(rgb.r); + imgData.lookup[4*i+1] = colToByte(rgb.g); + imgData.lookup[4*i+2] = colToByte(rgb.b); + imgData.lookup[4*i+3] = 255; + } } break; #ifdef SPLASH_CMYK @@ -4784,7 +4771,6 @@ GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTria GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePattern *pattern, double tMin, double tMax) { double xMin, yMin, xMax, yMax; - SplashPath *path; GBool vaa = getVectorAntialias(); // restore vector antialias because we support it here setVectorAntialias(gTrue); @@ -4831,17 +4817,16 @@ GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePat state->lineTo(xMax, yMax); state->lineTo(xMin, yMax); state->closePath(); - path = convertPath(state, state->getPath(), gTrue); + SplashPath path = convertPath(state, state->getPath(), gTrue); #ifdef SPLASH_CMYK pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), nullptr); - retVal = (splash->shadedFill(path, pattern->getShading()->getHasBBox(), pattern) == splashOk); + retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern) == splashOk); state->clearPath(); setVectorAntialias(vaa); - delete path; return retVal; } @@ -4849,7 +4834,6 @@ GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePat GBool SplashOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) { SplashFunctionPattern *pattern = new SplashFunctionPattern(colorMode, state, shading); double xMin, yMin, xMax, yMax; - SplashPath *path; GBool vaa = getVectorAntialias(); // restore vector antialias because we support it here setVectorAntialias(gTrue); @@ -4896,17 +4880,16 @@ GBool SplashOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *s state->lineTo(xMax, yMax); state->lineTo(xMin, yMax); state->closePath(); - path = convertPath(state, state->getPath(), gTrue); + SplashPath path = convertPath(state, state->getPath(), gTrue); #ifdef SPLASH_CMYK pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); #endif setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), nullptr); - retVal = (splash->shadedFill(path, pattern->getShading()->getHasBBox(), pattern) == splashOk); + retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern) == splashOk); state->clearPath(); setVectorAntialias(vaa); - delete path; delete pattern; diff --git a/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.h b/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.h index 3a1b594e409..4d72d9c7a8f 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.h +++ b/Build/source/libs/poppler/poppler-src/poppler/SplashOutputDev.h @@ -22,6 +22,7 @@ // Copyright (C) 2011, 2017 Adrian Johnson <ajohnson@redneon.com> // Copyright (C) 2012, 2015, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2015, 2016 William Bader <williambader@hotmail.com> +// Copyright (C) 2018 Stefan Brüns <stefan.bruens@rwth-aachen.de> // // 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 @@ -410,7 +411,7 @@ private: static void getMatteColor( SplashColorMode colorMode, GfxImageColorMap *colorMap, GfxColor * matteColor, SplashColor splashMatteColor); void setOverprintMask(GfxColorSpace *colorSpace, GBool overprintFlag, int overprintMode, GfxColor *singleColor, GBool grayIndexed = gFalse); - SplashPath *convertPath(GfxState *state, GfxPath *path, + SplashPath convertPath(GfxState *state, GfxPath *path, GBool dropEmptySubpaths); void drawType3Glyph(GfxState *state, T3FontCache *t3Font, T3FontCacheTag *tag, Guchar *data); diff --git a/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.cc b/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.cc index 58a4b6a63c7..954b76a741c 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.cc @@ -9,6 +9,7 @@ // Copyright 2017 Jan-Erik S <janerik234678@gmail.com> // Copyright 2017, 2018 Albert Astals Cid <aacid@kde.org> // Copyright 2017, 2018 Adrian Johnson <ajohnson@redneon.com> +// Copyright 2018, Adam Reichold <adam.reichold@t-online.de> // //======================================================================== @@ -110,7 +111,7 @@ void StructTreeRoot::parse(Dict *root) } // refToParentMap is only used during parsing. Ensure all memory used by it is freed. - std::multimap<Ref, Parent*, RefCompare>().swap(refToParentMap); + std::multimap<Ref, Parent*>().swap(refToParentMap); } void StructTreeRoot::parseNumberTreeNode(Dict *node) diff --git a/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.h b/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.h index 89c7941cebf..90848649ae5 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.h +++ b/Build/source/libs/poppler/poppler-src/poppler/StructTreeRoot.h @@ -7,6 +7,7 @@ // Copyright 2013, 2014 Igalia S.L. // Copyright 2018 Albert Astals Cid <aacid@kde.org> // Copyright 2018 Adrian Johnson <ajohnson@redneon.com> +// Copyright 2018 Adam Reichold <adam.reichold@t-online.de> // //======================================================================== @@ -79,7 +80,7 @@ private: Object classMap; ElemPtrArray elements; std::map<int, std::vector<Parent> > parentTree; - std::multimap<Ref, Parent*, RefCompare> refToParentMap; + std::multimap<Ref, Parent*> refToParentMap; void parse(Dict *rootDict); void parseNumberTreeNode(Dict *node); diff --git a/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.cc b/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.cc index 4a3070af7c0..7a92ff3b613 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.cc @@ -37,6 +37,7 @@ // Copyright (C) 2013 Ed Catmur <ed@catmur.co.uk> // Copyright (C) 2016 Khaled Hosny <khaledhosny@eglug.org> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Sanchit Anand <sanxchit@gmail.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 @@ -5878,3 +5879,7 @@ TextPage *TextOutputDev::takeText() { text = new TextPage(rawOrder); return ret; } + +TextFlow *TextOutputDev::getFlows() { + return text->getFlows(); +} diff --git a/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.h b/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.h index 092acd6730f..f243554540b 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.h +++ b/Build/source/libs/poppler/poppler-src/poppler/TextOutputDev.h @@ -22,6 +22,7 @@ // Copyright (C) 2012, 2013, 2015, 2016 Jason Crain <jason@aquaticape.us> // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich +// Copyright (C) 2018 Sanchit Anand <sanxchit@gmail.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 @@ -890,6 +891,10 @@ public: // Turn extra processing for HTML conversion on or off. void enableHTMLExtras(GBool doHTMLA) { doHTML = doHTMLA; } + // Get the head of the linked list of TextFlows for the + // last rasterized page. + TextFlow *getFlows(); + private: TextOutputFunc outputFunc; // output function diff --git a/Build/source/libs/poppler/poppler-src/poppler/XRef.cc b/Build/source/libs/poppler/poppler-src/poppler/XRef.cc index 4352146ec45..078274b4518 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/XRef.cc +++ b/Build/source/libs/poppler/poppler-src/poppler/XRef.cc @@ -773,10 +773,10 @@ GBool XRef::readXRefStream(Stream *xrefStr, Goffset *pos) { } obj = dict->lookupNF("Prev"); - if (obj.isInt()) { + if (obj.isInt() && obj.getInt() >= 0) { *pos = obj.getInt(); more = gTrue; - } else if (obj.isInt64()) { + } else if (obj.isInt64() && obj.getInt64() >= 0) { *pos = obj.getInt64(); more = gTrue; } else { diff --git a/Build/source/libs/poppler/poppler-src/poppler/poppler-config.h.cmake b/Build/source/libs/poppler/poppler-src/poppler/poppler-config.h.cmake index f6a6c27ff6b..20e3dd38393 100644 --- a/Build/source/libs/poppler/poppler-src/poppler/poppler-config.h.cmake +++ b/Build/source/libs/poppler/poppler-src/poppler/poppler-config.h.cmake @@ -17,6 +17,7 @@ // Copyright (C) 2014 Hib Eris <hib@hiberis.nl> // Copyright (C) 2016 Tor Lillqvist <tml@collabora.com> // Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de> // // 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 @@ -121,8 +122,7 @@ // 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 +// or cmake: DISABLE_OUTLINE, ENABLE_PLUGINS, DEBUG_FORMS //------------------------------------------------------------------------ // version diff --git a/Build/source/libs/poppler/version.ac b/Build/source/libs/poppler/version.ac index 7f633325435..c03436580de 100644 --- a/Build/source/libs/poppler/version.ac +++ b/Build/source/libs/poppler/version.ac @@ -9,4 +9,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current poppler version -m4_define([poppler_version], [0.68.0]) +m4_define([poppler_version], [0.69.0]) |