1 # Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
3 --- sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx.orig 2022-04-26 16:11:01 UTC
4 +++ sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
5 @@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
7 // TODO(P3): Unfortunately, need to read stream twice, since
8 // we must write byte count to stdout before
9 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
10 char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
12 + std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
16 aNewFont.isEmbedded = true;
17 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
23 @@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
27 - char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
28 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
29 + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
31 + std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
36 // ---sync point--- see SYNC STREAMS above
39 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
40 if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
42 + if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
46 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
51 // ---sync point--- see SYNC STREAMS above
54 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
59 #if POPPLER_CHECK_VERSION(0, 83, 0)
60 @@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
64 +#if !POPPLER_CHECK_VERSION(22, 3, 0)
65 GfxFont *gfxFont = state->getFont();
67 + GfxFont *gfxFont = state->getFont().get();