diff -Naur libreoffice-25.8.2.2.orig/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx libreoffice-25.8.2.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
|
old
|
new
|
|
| 201 | 201 | // Try opening the document with any password we have |
| 202 | 202 | { |
| 203 | 203 | // PDFDoc takes over ownership for all strings below |
| 204 | | GooString* pFileName = new GooString(myStringToStdString(argv[1])); |
| 205 | 204 | |
| 206 | 205 | // check for password string(s) |
| 207 | | GooString* pOwnerPasswordStr(aPwBuf[0] != 0 |
| 208 | | ? new GooString(aPwBuf) |
| | 206 | std::optional<GooString> pOwnerPasswordStr(aPwBuf[0] != 0 |
| | 207 | ? aPwBuf |
| 209 | 208 | : (ownerPassword |
| 210 | | ? new GooString(myStringToStdString(ownerPassword)) |
| | 209 | ? myStringToStdString(ownerPassword) |
| 211 | 210 | : nullptr)); |
| 212 | | GooString* pUserPasswordStr(aPwBuf[0] != 0 |
| 213 | | ? new GooString(aPwBuf) |
| | 211 | std::optional<GooString> pUserPasswordStr(aPwBuf[0] != 0 |
| | 212 | ? aPwBuf |
| 214 | 213 | : (userPassword |
| 215 | | ? new GooString(myStringToStdString(userPassword)) |
| | 214 | ? myStringToStdString(userPassword) |
| 216 | 215 | : nullptr)); |
| 217 | 216 | #if POPPLER_CHECK_VERSION(22, 6, 0) |
| 218 | 217 | pDocUnique = std::unique_ptr<PDFDoc>( |
| 219 | | new PDFDoc(std::make_unique<GooString>(pFileName), |
| 220 | | std::optional<GooString>(pOwnerPasswordStr), |
| 221 | | std::optional<GooString>(pUserPasswordStr))); |
| | 218 | new PDFDoc(std::make_unique<GooString>(GooString(myStringToStdString(argv[1]))), |
| | 219 | pOwnerPasswordStr, |
| | 220 | pUserPasswordStr)); |
| 222 | 221 | #else |
| 223 | 222 | pDocUnique = std::unique_ptr<PDFDoc>( |
| 224 | 223 | new PDFDoc(pFileName, pOwnerPasswordStr, pUserPasswordStr)); |