34 lines
861 B
Diff
34 lines
861 B
Diff
diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
|
|
--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
|
|
+++ b/ipe-tools/pdftoipe/pdftoipe.cpp
|
|
@@ -84,22 +84,20 @@
|
|
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;
|
|
|