From d65ef22f0af366d6cb94fe08c9d0685565278294 Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Fri, 21 Jul 2023 16:59:51 +0000 Subject: [PATCH] Fix build for poppler-22.03.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std::optional` for font name: https://gitlab.freedesktop.org/poppler/poppler/-/commit/996dfb015f5567cdaf191c127c2cf804f852d80b The C++ 17 standard allows checking this with `value_or`, so we don't need the `?` if…then…else construct. `Catalog::embeddedFile`: https://gitlab.freedesktop.org/poppler/poppler/-/commit/beb5519f723cd84d8d4afa989118df5fffbe50fb?merge_request_iid=1064 --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e75d6ba..a8e5928 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,7 +173,7 @@ void dump_font_info(PDFDoc *doc) { packer.pack_map(6); packer.pack("Name"); - packer.pack(font->getName() ? font->getName()->toStr() : "[none]"); + packer.pack(font->getName().value_or("[none]")); packer.pack("Type"); packer.pack(fontTypeNames[font->getType()]); @@ -239,7 +239,7 @@ void dump_meta_xfa(Catalog *catalog, const UnicodeMap *uMap) { void dump_meta_embedded_files(Catalog *catalog) { packer.pack_array(catalog->numEmbeddedFiles()); for (int i = 0; i < catalog->numEmbeddedFiles(); i++) { - FileSpec *spec = catalog->embeddedFile(i); + std::unique_ptr spec = catalog->embeddedFile(i); EmbFile *file = spec->getEmbeddedFile(); packer.pack_array(6);