guix-devel/gnu/packages/patches/texlive-bin-pdftex-poppler-...

189 lines
7.2 KiB
Diff

Fix compatibility with Poppler 0.72.
These files are taken from the upstream "poppler0.72.0.cc" variants and
diffed against the "newpoppler" files from the 20180414 distribution.
See revision 49336:
https://tug.org/svn/texlive/trunk/Build/source/texk/web2c/pdftexdir/
--- a/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc 1970-01-01 01:00:00.000000000 +0100
+++ b/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc 2018-12-09 21:14:58.479732695 +0100
@@ -22,7 +22,7 @@
https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk
by Arch Linux. A little modifications are made to avoid a crash for
some kind of pdf images, such as figure_missing.pdf in gnuplot.
-The poppler should be 0.59.0 or newer versions.
+The poppler should be 0.72.0 or newer versions.
POPPLER_VERSION should be defined.
*/
@@ -120,7 +120,7 @@
static InObj *inObjList;
static UsedEncoding *encodingList;
-static GBool isInit = gFalse;
+static bool isInit = false;
// --------------------------------------------------------------------
// Maintain list of open embedded PDF files
@@ -317,7 +317,7 @@
pdf_puts("<<\n");
assert(r->type == objFont); // FontDescriptor is in fd_tree
for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
- key = obj->dictGetKey(i);
+ key = (char *)obj->dictGetKey(i);
if (strncmp("FontDescriptor", key, strlen("FontDescriptor")) == 0
|| strncmp("BaseFont", key, strlen("BaseFont")) == 0
|| strncmp("Encoding", key, strlen("Encoding")) == 0)
@@ -427,7 +427,7 @@
charset = fontdesc.dictLookup("CharSet");
if (!charset.isNull() &&
charset.isString() && is_subsetable(fontmap))
- epdf_mark_glyphs(fd, (char *)charset.getString()->getCString());
+ epdf_mark_glyphs(fd, (char *)charset.getString()->c_str());
else
embed_whole_font(fd);
addFontDesc(fontdescRef.getRef(), fd);
@@ -454,7 +454,7 @@
for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
fontRef = obj->dictGetValNF(i);
if (fontRef.isRef())
- copyFont(obj->dictGetKey(i), &fontRef);
+ copyFont((char *)obj->dictGetKey(i), &fontRef);
else if (fontRef.isDict()) { // some programs generate pdf with embedded font object
copyName((char *)obj->dictGetKey(i));
pdf_puts(" ");
@@ -566,7 +566,7 @@
pdf_printf("%s", convertNumToPDF(obj->getNum()));
} else if (obj->isString()) {
s = (GooString *)obj->getString();
- p = s->getCString();
+ p = (char *)s->c_str();
l = s->getLength();
if (strlen(p) == (unsigned int) l) {
pdf_puts("(");
@@ -664,7 +664,7 @@
("PDF inclusion: CID fonts are not supported"
" (try to disable font replacement to fix this)");
}
- if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
+ if ((s = (char *)((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
glyphNames[i] = s;
else
glyphNames[i] = notdef;
@@ -683,7 +683,7 @@
}
// get the pagebox according to the pagebox_spec
-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
{
if (pagebox_spec == pdfboxspecmedia)
return page->getMediaBox();
@@ -715,7 +715,7 @@
{
PdfDocument *pdf_doc;
Page *page;
- PDFRectangle *pagebox;
+ const PDFRectangle *pagebox;
#ifdef POPPLER_VERSION
int pdf_major_version_found, pdf_minor_version_found;
#else
@@ -724,8 +724,8 @@
// initialize
if (!isInit) {
globalParams = new GlobalParams();
- globalParams->setErrQuiet(gFalse);
- isInit = gTrue;
+ globalParams->setErrQuiet(false);
+ isInit = true;
}
// open PDF file
pdf_doc = find_add_document(image_name);
@@ -849,7 +849,7 @@
pageObj = xref->fetch(pageRef->num, pageRef->gen);
pageDict = pageObj.getDict();
rotate = page->getRotate();
- PDFRectangle *pagebox;
+ const PDFRectangle *pagebox;
// write the Page header
pdf_puts("/Type /XObject\n");
pdf_puts("/Subtype /Form\n");
@@ -977,7 +977,7 @@
}
l = dic1.getLength();
for (i = 0; i < l; i++) {
- groupDict.dictAdd(copyString(dic1.getKey(i)),
+ groupDict.dictAdd((const char *)copyString(dic1.getKey(i)),
dic1.getValNF(i));
}
// end modification
@@ -1001,14 +1001,14 @@
pdf_puts("/Resources <<\n");
for (i = 0, l = obj1->dictGetLength(); i < l; ++i) {
obj2 = obj1->dictGetVal(i);
- key = obj1->dictGetKey(i);
+ key = (char *)obj1->dictGetKey(i);
if (strcmp("Font", key) == 0)
copyFontResources(&obj2);
else if (strcmp("ProcSet", key) == 0)
copyProcSet(&obj2);
else
- copyOtherResources(&obj2, key);
+ copyOtherResources(&obj2, (char *)key);
}
pdf_puts(">>\n");
}
--- a/texk/web2c/pdftexdir/pdftosrc-newpoppler.cc 1970-01-01 01:00:00.000000000 +0100
+++ b/texk/web2c/pdftexdir/pdftosrc-newpoppler.cc 2018-12-09 21:14:58.479732695 +0100
@@ -20,7 +20,7 @@
/*
This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at
https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk
-by Arch Linux. The poppler should be 0.59.0 or newer versions.
+by Arch Linux. The poppler should be 0.72.0 or newer versions.
POPPLER_VERSION should be defined.
*/
@@ -109,7 +109,7 @@
fprintf(stderr, "No SourceName found\n");
exit(1);
}
- outname = (char *)srcName.getString()->getCString();
+ outname = (char *)srcName.getString()->c_str();
// We cannot free srcName, as objname shares its string.
// srcName.free();
} else if (objnum > 0) {
@@ -118,7 +118,7 @@
fprintf(stderr, "Not a Stream object\n");
exit(1);
}
- sprintf(buf, "%s", fileName->getCString());
+ sprintf(buf, "%s", fileName->c_str());
if ((p = strrchr(buf, '.')) == 0)
p = strchr(buf, 0);
if (objgen == 0)
@@ -128,7 +128,7 @@
outname = buf;
} else { // objnum < 0 means we are extracting the XRef table
extract_xref_table = true;
- sprintf(buf, "%s", fileName->getCString());
+ sprintf(buf, "%s", fileName->c_str());
if ((p = strrchr(buf, '.')) == 0)
p = strchr(buf, 0);
sprintf(p, ".xref");
@@ -173,9 +173,9 @@
// parse the header: object numbers and offsets
objStr.streamReset();
- str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first);
+ str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);
lexer = new Lexer(xref, str);
- parser = new Parser(xref, lexer, gFalse);
+ parser = new Parser(xref, lexer, false);
for (n = 0; n < nObjects; ++n) {
obj1 = parser->getObj();
obj2 = parser->getObj();