diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a1cfb290..5428cf68f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,8 +56,8 @@ build_clang16_libcpp: - srcdir=`pwd` && mkdir -p /tmp/poppler_build && cd /tmp/poppler_build - clang++-16 -fPIC -shared -o goostring-format-checker.so $srcdir/test/goostring-format-checker/goostring-format-checker.cc -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I /usr/lib/llvm-16/include/ - echo "We disable Qt6 tests since Qt6 exposes std::string in its ABI which makes it not build in this CI since we're using libc++ but Qt6 in debian is build with libstdc++" - - CC=clang-16 CXX=clang++-16 cmake -G Ninja -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Xclang -load -Xclang $PWD/goostring-format-checker.so -Xclang -add-plugin -Xclang goostring-format-checker -Werror -Wno-deprecated-declarations" -DTESTDATADIR=$srcdir/test-data -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_QT6_TESTS=OFF -DENABLE_GPGME=OFF $srcdir - - ninja -j ${FDO_CI_CONCURRENT} + - CC=clang-16 CXX=clang++-16 cmake -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Xclang -load -Xclang $PWD/goostring-format-checker.so -Xclang -add-plugin -Xclang goostring-format-checker -Werror -Wno-deprecated-declarations" -DTESTDATADIR=$srcdir/test-data -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_QT6_TESTS=OFF -DENABLE_GPGME=OFF $srcdir + - make -j ${FDO_CI_CONCURRENT} - ctest --output-on-failure - echo "This is a complex way of not running clang-tidy over autogenerated files, unfortunately -DCMAKE_CXX_CLANG_TIDY doesn't support that https://gitlab.kitware.com/cmake/cmake/-/issues/19772" - cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json @@ -131,6 +131,32 @@ build_qt5_android: -DCMAKE_TOOLCHAIN_FILE=/opt/nativetooling/share/ECM/toolchain/Android.cmake' - ninja -j ${FDO_CI_CONCURRENT} +build_qt5_android_generic: + stage: build + image: kdeorg/android-sdk + before_script: + - echo "workaround for ECM Android toolchain wanting all binaries to be shared libraries" + - sed -i -e 's/ //g' /opt/nativetooling/share/ECM/toolchain/Android.cmake + script: + - mkdir -p build && cd build + - 'ANDROID_ARCH_ABI=arm64-v8a cmake -G Ninja .. + -DCMAKE_ANDROID_API=28 + -DCMAKE_PREFIX_PATH="/opt/Qt/;/opt/kdeandroid-arm64/" + -DCMAKE_BUILD_TYPE=debug + -DCMAKE_POSITION_INDEPENDENT_CODE=OFF + -DENABLE_DCTDECODER=unmaintained + -DENABLE_LIBOPENJPEG=unmaintained + -DENABLE_BOOST=OFF + -DENABLE_LCMS=OFF + -DENABLE_LIBCURL=OFF + -DENABLE_LIBTIFF=OFF + -DENABLE_QT6=OFF + -DENABLE_NSS3=OFF + -DENABLE_GPGME=OFF + -DFONT_CONFIGURATION=generic + -DCMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" + -DCMAKE_TOOLCHAIN_FILE=/opt/nativetooling/share/ECM/toolchain/Android.cmake' + - ninja -j ${FDO_CI_CONCURRENT} build_qt6_android: stage: build diff --git a/CMakeLists.txt b/CMakeLists.txt index 766d13195..e1e8d138e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ if (ECM_FOUND) endif() set(POPPLER_MAJOR_VERSION "23") -set(POPPLER_MINOR_VERSION_STRING "11") +set(POPPLER_MINOR_VERSION_STRING "12") # We want the string version to have 08 but the integer version can't have a leading 0 since otherwise it's considered octal # So strip a leading 0 if found in POPPLER_MINOR_VERSION_STRING and store the result in POPPLER_MINOR_VERSION string(REGEX REPLACE "^0?(.+)$" "\\1" POPPLER_MINOR_VERSION "${POPPLER_MINOR_VERSION_STRING}") diff --git a/NEWS b/NEWS index 9ffaf173b..950c674ea 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Release 23.12.0: + core: + * Rewrite FoFiType1::parse to be more flexible. Issue #1422 + * Small internal code refactoring + Release 23.11.0: core: * CairoOutputDev: Use internal downscaling algorithm if image exceeds Cairo's maximum dimensions. diff --git a/cpp/Doxyfile b/cpp/Doxyfile index fe372f90f..6cca9bb6c 100644 --- a/cpp/Doxyfile +++ b/cpp/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = "Poppler CPP" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 23.11.0 +PROJECT_NUMBER = 23.12.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/poppler/Annot.cc b/poppler/Annot.cc index c8f029f8d..e8db39ff3 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -3036,7 +3036,7 @@ class HorizontalTextLayouter *availableWidth -= blockWidth; } - while (newFontNeeded && (!availableWidth || *availableWidth > 0)) { + while (newFontNeeded && (!availableWidth || *availableWidth > 0 || (isUnicode && i == 2) || (!isUnicode && i == 0))) { if (!form) { // There's no fonts to look for, so just skip the characters i += isUnicode ? 2 : 1; @@ -3067,7 +3067,9 @@ class HorizontalTextLayouter } // layoutText will always at least layout one character even if it doesn't fit in // the given space which makes sense (except in the case of switching fonts, so we control if we ran out of space here manually) - if (!availableWidth || *availableWidth > 0) { + // we also need to allow the character if we have not layouted anything yet because otherwise we will end up in an infinite loop + // because it is assumed we at least layout one character + if (!availableWidth || *availableWidth > 0 || (isUnicode && i == 2) || (!isUnicode && i == 0)) { i += isUnicode ? 2 : 1; data.emplace_back(outputText.toStr(), auxFontName, blockWidth, charCount); } diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc index 8fb4f3e77..2f1ff7fc4 100644 --- a/poppler/FontInfo.cc +++ b/poppler/FontInfo.cc @@ -15,6 +15,7 @@ // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, . Work sponsored by the LiMux project of the city of Munich // Copyright (C) 2018, 2019 Adam Reichold // Copyright (C) 2019, 2021, 2022 Oliver Sander +// Copyright (C) 2023 Suzuki Toshiya // // 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 @@ -175,6 +176,7 @@ FontInfo::FontInfo(GfxFont *font, XRef *xref) // check for an embedded font if (font->getType() == fontType3) { emb = true; + embRef = Ref::INVALID(); } else { emb = font->getEmbeddedFontID(&embRef); } diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc index 46c349f7e..70e4036bd 100644 --- a/poppler/GlobalParams.cc +++ b/poppler/GlobalParams.cc @@ -1560,7 +1560,9 @@ void GlobalParams::setErrQuiet(bool errQuietA) #ifdef ANDROID void GlobalParams::setFontDir(const std::string &fontDir) { +# if defined(WITH_FONTCONFIGURATION_ANDROID) displayFontDir = fontDir; +# endif } #endif diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc index c480ba273..4d68f9552 100644 --- a/poppler/JPEG2000Stream.cc +++ b/poppler/JPEG2000Stream.cc @@ -4,7 +4,7 @@ // // A JPX stream decoder using OpenJPEG // -// Copyright 2008-2010, 2012, 2017-2022 Albert Astals Cid +// Copyright 2008-2010, 2012, 2017-2023 Albert Astals Cid // Copyright 2011 Daniel Glöckner // Copyright 2014, 2016 Thomas Freitag // Copyright 2013, 2014 Adrian Johnson @@ -20,17 +20,6 @@ #include "JPEG2000Stream.h" #include -#define OPENJPEG_VERSION_ENCODE(major, minor, micro) (((major)*10000) + ((minor)*100) + ((micro)*1)) - -#ifdef OPJ_VERSION_MAJOR -# define OPENJPEG_VERSION OPENJPEG_VERSION_ENCODE(OPJ_VERSION_MAJOR, OPJ_VERSION_MINOR, OPJ_VERSION_BUILD) -#else -// OpenJPEG started providing version macros in version 2.1. -// If the version macro is not found, set the version to 2.0.0 and -// assume there will be no API changes in 2.0.x. -# define OPENJPEG_VERSION OPENJPEG_VERSION_ENCODE(2, 0, 0) -#endif - struct JPXStreamPrivate { opj_image_t *image = nullptr; @@ -333,11 +322,7 @@ void JPXStreamPrivate::init2(OPJ_CODEC_FORMAT format, const unsigned char *buf, stream = opj_stream_default_create(OPJ_TRUE); -#if OPENJPEG_VERSION >= OPENJPEG_VERSION_ENCODE(2, 1, 0) opj_stream_set_user_data(stream, &jpxData, nullptr); -#else - opj_stream_set_user_data(stream, &jpxData); -#endif opj_stream_set_read_function(stream, jpxRead_callback); opj_stream_set_skip_function(stream, jpxSkip_callback); diff --git a/poppler/NSSCryptoSignBackend.cc b/poppler/NSSCryptoSignBackend.cc index ab0d2890f..dd61d4ed8 100644 --- a/poppler/NSSCryptoSignBackend.cc +++ b/poppler/NSSCryptoSignBackend.cc @@ -776,10 +776,18 @@ NSSSignatureVerification::NSSSignatureVerification(std::vector && CMSSignedData = CMS_SignedDataCreate(CMSMessage); if (CMSSignedData) { CMSSignerInfo = CMS_SignerInfoCreate(CMSSignedData); - SECItem usedAlgorithm = NSS_CMSSignedData_GetDigestAlgs(CMSSignedData)[0]->algorithm; - auto hashAlgorithm = SECOID_FindOIDTag(&usedAlgorithm); - HASH_HashType hashType = HASH_GetHashTypeByOidTag(hashAlgorithm); - hashContext = HashContext::create(ConvertHashTypeFromNss(hashType)); + SECAlgorithmID **algs = NSS_CMSSignedData_GetDigestAlgs(CMSSignedData); + while (*algs != nullptr) { + SECItem usedAlgorithm = (*algs)->algorithm; + auto hashAlgorithm = SECOID_FindOIDTag(&usedAlgorithm); + HASH_HashType hashType = HASH_GetHashTypeByOidTag(hashAlgorithm); + hashContext = HashContext::create(ConvertHashTypeFromNss(hashType)); + + if (hashContext) { + break; + } + ++algs; + } } } diff --git a/qt5/src/Doxyfile b/qt5/src/Doxyfile index 6dba49594..b09b48e8f 100644 --- a/qt5/src/Doxyfile +++ b/qt5/src/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = "Poppler Qt5" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 23.11.0 +PROJECT_NUMBER = 23.12.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/qt6/src/Doxyfile b/qt6/src/Doxyfile index 52502ec48..40c56177e 100644 --- a/qt6/src/Doxyfile +++ b/qt6/src/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = "Poppler Qt6" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 23.11.0 +PROJECT_NUMBER = 23.12.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put.