Skip to content

Commit

Permalink
pdftoipe: fix building with poppler-22.03.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oreo639 committed Mar 26, 2022
1 parent d02bfa0 commit 1433518
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pdftoipe/pdftoipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,20 @@ int main(int argc, char *argv[])
if (quiet)
globalParams->setErrQuiet(quiet);

GooString *ownerPW, *userPW;
std::optional<GooString> ownerPW, userPW;
if (ownerPassword[0]) {
ownerPW = new GooString(ownerPassword);
ownerPW = GooString(ownerPassword);
} else {
ownerPW = 0;
ownerPW = std::nullopt;
}
if (userPassword[0]) {
userPW = new GooString(userPassword);
userPW = GooString(userPassword);
} else {
userPW = 0;
userPW = std::nullopt;
}

// open PDF file
PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
delete userPW;
delete ownerPW;
PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);

if (!doc->isOk())
return 1;
Expand Down

0 comments on commit 1433518

Please sign in to comment.