[poppler] config.h.cmake poppler/GlobalParamsWin.cc poppler/Link.cc poppler/PDFDoc.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Aug 24 10:17:47 UTC 2017
config.h.cmake | 6 ++++++
poppler/GlobalParamsWin.cc | 21 ++++++---------------
poppler/Link.cc | 14 ++------------
poppler/PDFDoc.cc | 4 +---
4 files changed, 15 insertions(+), 30 deletions(-)
New commits:
commit 40cb9f4bf6f35ea62bc7b9e5c23008f98ebd4b36
Author: Albert Astals Cid <aacid at kde.org>
Date: Thu Aug 24 11:14:34 2017 +0200
Fix build with mingw
diff --git a/config.h.cmake b/config.h.cmake
index 4a4da624..a8e1bbd7 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -100,6 +100,12 @@
/* Define to 1 if you have the `rand_r' function. */
#cmakedefine HAVE_RAND_R 1
+/* Define to 1 if you have the `strcpy_s' function. */
+#cmakedefine HAVE_STRCPY_S 1
+
+/* Define to 1 if you have the `strcat_s' function. */
+#cmakedefine HAVE_STRCAT_S 1
+
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#cmakedefine HAVE_NDIR_H 1
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index 335476aa..9dca266a 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -462,37 +462,28 @@ void GlobalParams::setupBaseFonts(char * dir)
if (file != NULL) {
Parser *parser;
- Object obj1, obj2;
-
- obj1.initNull();
parser = new Parser(NULL,
new Lexer(NULL,
- new FileStream(file, 0, gFalse, file->size(), &obj1)),
+ new FileStream(file, 0, gFalse, file->size(), Object(objNull))),
gTrue);
- obj1.free();
- parser->getObj(&obj1);
+ Object obj1 = parser->getObj();
while (!obj1.isEOF()) {
- parser->getObj(&obj2);
+ Object obj2 = parser->getObj();
if (obj1.isName()) {
// Substitutions
if (obj2.isDict()) {
- Object obj3;
- obj2.getDict()->lookup("Path", &obj3);
+ Object obj3 = obj2.getDict()->lookup("Path");
if (obj3.isString())
addFontFile(new GooString(obj1.getName()), obj3.getString()->copy());
- obj3.free();
// Aliases
} else if (obj2.isName()) {
substFiles->add(new GooString(obj1.getName()), new GooString(obj2.getName()));
}
}
- obj2.free();
- obj1.free();
- parser->getObj(&obj1);
+ obj1 = parser->getObj();
// skip trailing ';'
while (obj1.isCmd(";")) {
- obj1.free();
- parser->getObj(&obj1);
+ obj1 = parser->getObj();
}
}
delete file;
diff --git a/poppler/Link.cc b/poppler/Link.cc
index d7bbc331..a927c214 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -455,21 +455,12 @@ LinkLaunch::LinkLaunch(Object *actionObj) {
}
} else {
#ifdef _WIN32
- if (actionObj->dictLookup("Win", &obj1)->isDict()) {
- obj1.dictLookup("F", &obj2);
- if (getFileSpecNameForPlatform (&obj2, &obj3)) {
- fileName = obj3.getString()->copy();
- }
- if (obj1.dictLookup("P", &obj2)->isString()) {
- params = obj2.getString()->copy();
- }
- } else {
- error(errSyntaxWarning, -1, "Bad launch-type link action");
- }
+ obj1 = actionObj->dictLookup("Win");
#else
//~ This hasn't been defined by Adobe yet, so assume it looks
//~ just like the Win dictionary until they say otherwise.
obj1 = actionObj->dictLookup("Unix");
+#endif
if (obj1.isDict()) {
Object obj2 = obj1.dictLookup("F");
Object obj3 = getFileSpecNameForPlatform (&obj2);
@@ -483,7 +474,6 @@ LinkLaunch::LinkLaunch(Object *actionObj) {
} else {
error(errSyntaxWarning, -1, "Bad launch-type link action");
}
-#endif
}
}
}
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 35b3bc01..bc651dda 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -171,7 +171,6 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword,
PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
GooString *userPassword, void *guiDataA) {
OSVERSIONINFO version;
- Object obj;
int i;
init();
@@ -203,8 +202,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
}
// create stream
- obj.initNull();
- str = new FileStream(file, 0, gFalse, file->size(), &obj);
+ str = new FileStream(file, 0, gFalse, file->size(), Object(objNull));
ok = setup(ownerPassword, userPassword);
}
More information about the poppler
mailing list