Skip to content

Commit

Permalink
Fix build for poppler-22.03.0
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
StevenMaude committed Nov 27, 2023
1 parent 80455cf commit d65ef22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down Expand Up @@ -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<FileSpec> spec = catalog->embeddedFile(i);
EmbFile *file = spec->getEmbeddedFile();

packer.pack_array(6);
Expand Down

0 comments on commit d65ef22

Please sign in to comment.