Ticket #22231: libreoffice-25.8.2.2-poppler_25.10-1.patch

File libreoffice-25.8.2.2-poppler_25.10-1.patch, 2.6 KB (added by martyj19, 12 months ago)

Address build failure with poppler-25.10

  • sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx

    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  
    201201                // Try opening the document with any password we have
    202202                {
    203203                    // PDFDoc takes over ownership for all strings below
    204                     GooString* pFileName = new GooString(myStringToStdString(argv[1]));
    205204
    206205                    // 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
    209208                                                 : (ownerPassword
    210                                                     ? new GooString(myStringToStdString(ownerPassword))
     209                                                    ? myStringToStdString(ownerPassword)
    211210                                                    : nullptr));
    212                     GooString* pUserPasswordStr(aPwBuf[0] != 0
    213                                                 ? new GooString(aPwBuf)
     211                    std::optional<GooString> pUserPasswordStr(aPwBuf[0] != 0
     212                                                ? aPwBuf
    214213                                                : (userPassword
    215                                                   ? new GooString(myStringToStdString(userPassword))
     214                                                  ? myStringToStdString(userPassword)
    216215                                                  : nullptr));
    217216#if POPPLER_CHECK_VERSION(22, 6, 0)
    218217                    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));
    222221#else
    223222                    pDocUnique = std::unique_ptr<PDFDoc>(
    224223                        new PDFDoc(pFileName, pOwnerPasswordStr, pUserPasswordStr));