92 lines
3.4 KiB
Diff
92 lines
3.4 KiB
Diff
--- texlive-base-20210325/source/configure
|
|
+++ texlive-base-20210325/source/configure
|
|
@@ -22090,7 +22090,7 @@ $as_echo_n "checking requested system \`
|
|
int
|
|
main ()
|
|
{
|
|
-GfxFont *gfxFont; gfxFont->decRefCnt();
|
|
+GfxFont *gfxFont; gfxFont->getFlags();
|
|
;
|
|
return 0;
|
|
}
|
|
--- texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc
|
|
+++ texlive-base-20210325/source/texk/web2c/pdftexdir/pdftoepdf.cc
|
|
@@ -167,8 +167,8 @@ static PdfDocument *find_add_document(ch
|
|
p->file_name = xstrdup(file_name);
|
|
p->xref = xref = 0;
|
|
p->occurences = 0;
|
|
- GString *docName = new GString(p->file_name);
|
|
- p->doc = new PDFDoc(docName); // takes ownership of docName
|
|
+ std::unique_ptr<GString> docName = std::make_unique<GString>(p->file_name);
|
|
+ p->doc = new PDFDoc(std::move(docName)); // takes ownership of docName
|
|
if (!p->doc->isOk() || !p->doc->okToPrint()) {
|
|
pdftex_fail("xpdf: reading PDF image failed");
|
|
}
|
|
@@ -395,7 +395,7 @@ static void copyFont(const char *tag, Ob
|
|
{
|
|
Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
|
|
stemV;
|
|
- GfxFont *gfont;
|
|
+ std::shared_ptr<GfxFont> gfont;
|
|
fd_entry *fd;
|
|
fm_entry *fontmap;
|
|
// Check whether the font has already been embedded before analysing it.
|
|
@@ -444,7 +444,7 @@ static void copyFont(const char *tag, Ob
|
|
gfont = GfxFont::makeFont(xref, tag, fontRef->getRef(),
|
|
fontdict.getDict());
|
|
pdf_printf(" %d 0 R ", addFont(fontRef->getRef(), fd,
|
|
- addEncoding(gfont)));
|
|
+ addEncoding(gfont.get())));
|
|
} else {
|
|
copyName(tag);
|
|
pdf_puts(" ");
|
|
@@ -682,7 +682,6 @@ static void writeEncodings()
|
|
}
|
|
for (r = encodingList; r != 0; r = n) {
|
|
n = r->next;
|
|
- r->font->decRefCnt();
|
|
delete r;
|
|
}
|
|
}
|
|
--- texlive-base-20210325/source/texk/web2c/pdftexdir/pdftosrc.cc
|
|
+++ texlive-base-20210325/source/texk/web2c/pdftexdir/pdftosrc.cc
|
|
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
|
{
|
|
char *p, buf[1024];
|
|
PDFDoc *doc;
|
|
- GString *fileName;
|
|
+ std::unique_ptr<GooString> fileName;
|
|
Stream *s;
|
|
Object srcStream, srcName, catalogDict;
|
|
FILE *outfile;
|
|
@@ -86,9 +86,9 @@ int main(int argc, char *argv[])
|
|
"Usage: pdftosrc <PDF-file> [<stream-object-number>]\n");
|
|
exit(1);
|
|
}
|
|
- fileName = new GString(argv[1]);
|
|
+ fileName = std::make_unique<GString>(argv[1]);
|
|
globalParams = std::unique_ptr<GlobalParams>(new GlobalParams());
|
|
- doc = new PDFDoc(fileName);
|
|
+ doc = new PDFDoc(std::move(fileName));
|
|
if (!doc->isOk()) {
|
|
fprintf(stderr, "Invalid PDF file\n");
|
|
exit(1);
|
|
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
|
|
fprintf(stderr, "Not a Stream object\n");
|
|
exit(1);
|
|
}
|
|
- sprintf(buf, "%s", fileName->c_str());
|
|
+ sprintf(buf, "%s", argv[1]);
|
|
if ((p = strrchr(buf, '.')) == 0)
|
|
p = strchr(buf, 0);
|
|
if (objgen == 0)
|
|
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
|
outname = buf;
|
|
} else { // objnum < 0 means we are extracting the XRef table
|
|
extract_xref_table = true;
|
|
- sprintf(buf, "%s", fileName->c_str());
|
|
+ sprintf(buf, "%s", argv[1]);
|
|
if ((p = strrchr(buf, '.')) == 0)
|
|
p = strchr(buf, 0);
|
|
sprintf(p, ".xref");
|