Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master_github
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdgeos committed Jan 2, 2024
2 parents 0604c92 + f1c6996 commit 1852f19
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 28 deletions.
30 changes: 28 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/<LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>/<LINK_FLAGS>/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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cpp/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions poppler/Annot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions poppler/FontInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// 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, 2019 Adam Reichold <adam.reichold@t-online.de>
// Copyright (C) 2019, 2021, 2022 Oliver Sander <oliver.sander@tu-dresden.de>
// Copyright (C) 2023 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
//
// 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
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions poppler/GlobalParams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 1 addition & 16 deletions poppler/JPEG2000Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// A JPX stream decoder using OpenJPEG
//
// Copyright 2008-2010, 2012, 2017-2022 Albert Astals Cid <aacid@kde.org>
// Copyright 2008-2010, 2012, 2017-2023 Albert Astals Cid <aacid@kde.org>
// Copyright 2011 Daniel Glöckner <daniel-gl@gmx.net>
// Copyright 2014, 2016 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright 2013, 2014 Adrian Johnson <ajohnson@redneon.com>
Expand All @@ -20,17 +20,6 @@
#include "JPEG2000Stream.h"
#include <openjpeg.h>

#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;
Expand Down Expand Up @@ -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);
Expand Down
16 changes: 12 additions & 4 deletions poppler/NSSCryptoSignBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,18 @@ NSSSignatureVerification::NSSSignatureVerification(std::vector<unsigned char> &&
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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion qt5/src/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion qt6/src/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1852f19

Please sign in to comment.