1 --- libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx.orig 2022-03-03 14:25:45.000000000 +0100
2 +++ libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 2022-04-19 20:30:14.031282962 +0200
3 @@ -115,6 +115,21 @@ int main(int argc, char **argv)
6 // PDFDoc takes over ownership for all strings below
7 +#if POPPLER_CHECK_VERSION(22, 3, 0)
8 + auto pFileName = std::make_unique<GooString>(argv[1]);
9 + auto pErrFileName = std::make_unique<GooString>(argv[2]);
11 + // check for password string(s)
12 + std::optional<GooString> pOwnerPasswordStr, pUserPasswordStr;
13 + if( aPwBuf[0] != 0 )
14 + pOwnerPasswordStr = GooString(aPwBuf);
15 + else if( ownerPassword[0] != '\001' )
16 + pOwnerPasswordStr = GooString(ownerPassword);
17 + if( aPwBuf[0] != 0 )
18 + pUserPasswordStr = GooString(aPwBuf);
19 + else if( userPassword[0] != '\001' )
20 + pUserPasswordStr = GooString(userPassword);
22 GooString* pFileName = new GooString(argv[1]);
23 GooString* pErrFileName = new GooString(argv[2]);
25 @@ -129,6 +144,7 @@ int main(int argc, char **argv)
26 : (userPassword[0] != '\001'
27 ? new GooString(userPassword)
30 if( outputFile[0] != '\001' )
31 g_binary_out = fopen(outputFile,"wb");
33 @@ -138,6 +154,15 @@ int main(int argc, char **argv)
34 _setmode( _fileno( g_binary_out ), _O_BINARY );
37 +#if POPPLER_CHECK_VERSION(22, 3, 0)
38 + PDFDoc aDoc( std::move(pFileName),
42 + PDFDoc aErrDoc( std::move(pErrFileName),
46 PDFDoc aDoc( pFileName,
49 @@ -145,6 +170,7 @@ int main(int argc, char **argv)
50 PDFDoc aErrDoc( pErrFileName,
55 // Check various permissions for aDoc.
56 PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
57 --- libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx.orig 2022-03-03 14:25:45.000000000 +0100
58 +++ libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 2022-04-19 19:53:39.226719292 +0200
59 @@ -147,8 +147,13 @@ namespace pdfi
60 std::unique_ptr<UnicodeMap> m_pUtf8Map;
63 +#if POPPLER_CHECK_VERSION(22, 4, 0)
64 + int parseFont( long long nNewId, std::shared_ptr<GfxFont> pFont, GfxState* state ) const;
65 + void writeFontFile( std::shared_ptr<GfxFont> gfxFont ) const;
67 int parseFont( long long nNewId, GfxFont* pFont, GfxState* state ) const;
68 void writeFontFile( GfxFont* gfxFont ) const;
70 #if POPPLER_CHECK_VERSION(0, 83, 0)
71 static void printPath( const GfxPath* pPath );
73 --- libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx.orig 2022-03-03 14:25:45.000000000 +0100
74 +++ libreoffice-7.2.6.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 2022-04-19 19:58:44.165967063 +0200
75 @@ -427,7 +427,11 @@ static void writeMaskLF( OutputBuffer&
76 bool bInvert ) { writeMask_(o_rOutputBuf,str,width,height,bInvert); }
79 +#if POPPLER_CHECK_VERSION(22, 4, 0)
80 +int PDFOutDev::parseFont( long long nNewId, std::shared_ptr<GfxFont> gfxFont, GfxState* state ) const
82 int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, GfxState* state ) const
85 FontAttributes aNewFont;
87 @@ -461,23 +465,49 @@ int PDFOutDev::parseFont( long long nNew
89 // TODO(P3): Unfortunately, need to read stream twice, since
90 // we must write byte count to stdout before
91 +#if POPPLER_CHECK_VERSION(22, 4, 0)
92 + auto buf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
95 + aNewFont.isEmbedded = true;
96 + nSize = buf->size();
99 char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
102 aNewFont.isEmbedded = true;
108 m_aFontMap[ nNewId ] = aNewFont;
112 +#if POPPLER_CHECK_VERSION(22, 4, 0)
113 +void PDFOutDev::writeFontFile( std::shared_ptr<GfxFont> gfxFont ) const
115 void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
118 if( gfxFont->getType() != fontTrueType && gfxFont->getType() != fontType1 )
121 +#if POPPLER_CHECK_VERSION(22, 4, 0)
122 + auto buf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
126 + // ---sync point--- see SYNC STREAMS above
129 + if( fwrite(buf->data(), 1, buf->size(), g_binary_out) != buf->size() )
131 + // ---sync point--- see SYNC STREAMS above
132 + fflush(g_binary_out);
135 char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
137 @@ -494,6 +524,7 @@ void PDFOutDev::writeFontFile( GfxFont*
138 // ---sync point--- see SYNC STREAMS above
139 fflush(g_binary_out);
144 #if POPPLER_CHECK_VERSION(0, 83, 0)
145 @@ -747,7 +778,11 @@ void PDFOutDev::updateFont(GfxState *sta
149 +#if POPPLER_CHECK_VERSION(22, 4, 0)
150 + auto gfxFont = state->getFont();
152 GfxFont *gfxFont = state->getFont();