Add patch to fix build with poppler 0.73

This commit is contained in:
Andrey Bondrov 2019-10-15 18:40:30 +10:00
parent 415364f883
commit cad11504e6
2 changed files with 142 additions and 1 deletions

View file

@ -0,0 +1,138 @@
diff -urN libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
--- libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 2018-10-31 02:55:21.000000000 +1000
+++ libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 2019-10-15 18:35:58.981281235 +1000
@@ -310,7 +310,7 @@
o_rOutputBuf.resize(header_size);
// initialize stream
- Guchar *p;
+ unsigned char *p;
GfxRGB rgb;
std::unique_ptr<ImageStream> imgStr(
new ImageStream(str,
@@ -415,7 +415,7 @@
oneColor = { byteToCol( 0xff ), byteToCol( 0xff ), byteToCol( 0xff ) };
if( colorMap->getColorSpace()->getMode() == csIndexed || colorMap->getColorSpace()->getMode() == csDeviceGray )
{
- Guchar nIndex = 0;
+ unsigned char nIndex = 0;
colorMap->getRGB( &nIndex, &zeroColor );
nIndex = 1;
colorMap->getRGB( &nIndex, &oneColor );
@@ -569,7 +569,11 @@
LinkAction* pAction = link->getAction();
if (pAction && pAction->getKind() == actionURI)
{
+#if POPPLER_CHECK_VERSION(0, 72, 0)
+ const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str();
+#else
const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString();
+#endif
std::vector<char> aEsc( lcl_escapeLineFeeds(pURI) );
@@ -592,7 +596,11 @@
printf( "restoreState\n" );
}
+#if POPPLER_CHECK_VERSION(0, 71, 0)
+void PDFOutDev::setDefaultCTM(const double *pMat)
+#else
void PDFOutDev::setDefaultCTM(double *pMat)
+#endif
{
assert(pMat);
@@ -767,7 +775,11 @@
aFont = it->second;
+#if POPPLER_CHECK_VERSION(0, 72, 0)
+ std::vector<char> aEsc( lcl_escapeLineFeeds(aFont.familyName.c_str()) );
+#else
std::vector<char> aEsc( lcl_escapeLineFeeds(aFont.familyName.getCString()) );
+#endif
printf( " %d %d %d %d %f %d %s",
aFont.isEmbedded,
aFont.isBold,
diff -urN libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
--- libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 2018-10-31 02:55:21.000000000 +1000
+++ libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 2019-10-15 18:35:58.981281235 +1000
@@ -165,7 +165,11 @@
//----- initialization and control
// Set default transform matrix.
+#if POPPLER_CHECK_VERSION(0, 71, 0)
+ virtual void setDefaultCTM(const double *ctm) override;
+#else
virtual void setDefaultCTM(double *ctm) override;
+#endif
// Start a page.
virtual void startPage(int pageNum, GfxState *state
@@ -278,9 +282,13 @@
// note: if you ever change Output_t, please keep in mind that the current code
// relies on it being of 8 bit size
-typedef Guchar Output_t;
+typedef unsigned char Output_t;
typedef std::vector< Output_t > OutputBuffer;
+#if !POPPLER_CHECK_VERSION(0, 73, 0)
+static_assert(std::is_same_v<Guchar, unsigned char>, "unexpected typedef");
+#endif
+
#endif // INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PDFIOUTDEV_GPL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff -urN libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
--- libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx 2018-10-31 02:55:21.000000000 +1000
+++ libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx 2019-10-15 18:35:58.981281235 +1000
@@ -242,7 +242,7 @@
appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image
// initialize stream
- Guchar *p, *pm;
+ unsigned char *p, *pm;
GfxRGB rgb;
GfxGray alpha;
ImageStream* imgStr =
@@ -328,7 +328,7 @@
appendIHDR( o_rOutputBuf, width, height, 8, 6 ); // RGBA image
// initialize stream
- Guchar *p;
+ unsigned char *p;
GfxRGB rgb;
ImageStream* imgStr =
new ImageStream(str,
@@ -374,7 +374,7 @@
{
for( int x = 0; x < maskWidth; ++x )
{
- Guchar aPixel = 0;
+ unsigned char aPixel = 0;
imgStrMask->getPixel( &aPixel );
int nIndex = (y*height/maskHeight) * (width*4+1) + // mapped line
(x*width/maskWidth)*4 + 1 + 3 // mapped column
diff -urN libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
--- libreoffice-6.0.7.3/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 2018-10-31 02:55:21.000000000 +1000
+++ libreoffice-6.0.7.3-patched/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 2019-10-15 18:34:55.807287181 +1000
@@ -69,7 +69,7 @@
// read config file
globalParams = new GlobalParams();
- globalParams->setErrQuiet(gTrue);
+ globalParams->setErrQuiet(true);
#if defined(_MSC_VER)
globalParams->setupBaseFonts(nullptr);
#endif
@@ -143,7 +143,7 @@
i,
PDFI_OUTDEV_RESOLUTION,
PDFI_OUTDEV_RESOLUTION,
- 0, gTrue, gTrue, gTrue);
+ 0, true, true, true);
rDoc.processLinks(&aOutDev, i);
}

View file

@ -42,7 +42,7 @@ Summary: Office suite
Name: libreoffice
Epoch: 1
Version: 6.0.7
Release: 8
Release: 9
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic
Group: Office
Url: http://www.libreoffice.org
@ -103,6 +103,9 @@ Patch111: CVE-2019-9849.patch
Patch112: CVE-2019-9850_1_2.patch
Patch113: CVE-2019-9854.patch
# Backport poppler support fixes from upstream
Patch200: libreoffice-6.0.7.3-poppler-0.73.patch
BuildRequires: bison
BuildRequires: bsh
%if %{with ccache}