2012-06-23 17:22:26 +00:00
|
|
|
diff -up inkscape-0.48.2/configure.ac.poppler_020 inkscape-0.48.2/configure.ac
|
|
|
|
--- inkscape-0.48.2/configure.ac.poppler_020 2011-07-08 14:23:16.270623076 -0500
|
|
|
|
+++ inkscape-0.48.2/configure.ac 2012-06-23 12:01:38.918678539 -0500
|
|
|
|
@@ -623,6 +623,12 @@ if test "x$popplernew" = "xyes"; then
|
|
|
|
AC_DEFINE(POPPLER_NEW_GFXFONT, 1, [Use GfxFont from Poppler >= 0.8.3])
|
|
|
|
fi
|
|
|
|
|
|
|
|
+PKG_CHECK_MODULES(POPPLER_NEWERRORAPI, poppler >= 0.20.0, popplernewerror=yes, popplernewerror=no)
|
|
|
|
+if test "x$popplernewerror" = "xyes"; then
|
|
|
|
+ AC_DEFINE(POPPLER_NEW_ERRORAPI, 1, [Use new error API from Poppler >= 0.20.0])
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+
|
|
|
|
ink_svd_CPPFLAGS=$CPPFLAGS
|
|
|
|
ink_svd_LIBS=$LIBS
|
|
|
|
CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
|
|
|
|
diff -up inkscape-0.48.2/src/extension/internal/pdfinput/pdf-parser.cpp.poppler_020 inkscape-0.48.2/src/extension/internal/pdfinput/pdf-parser.cpp
|
|
|
|
--- inkscape-0.48.2/src/extension/internal/pdfinput/pdf-parser.cpp.poppler_020 2011-07-08 13:25:09.468790000 -0500
|
|
|
|
+++ inkscape-0.48.2/src/extension/internal/pdfinput/pdf-parser.cpp 2012-06-23 12:08:49.285298266 -0500
|
|
|
|
@@ -367,15 +367,23 @@ void PdfParser::parse(Object *obj, GBool
|
2012-06-23 15:42:39 +00:00
|
|
|
for (i = 0; i < obj->arrayGetLength(); ++i) {
|
|
|
|
obj->arrayGet(i, &obj2);
|
|
|
|
if (!obj2.isStream()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errInternal, -1, "Weird page contents");
|
|
|
|
+#else
|
|
|
|
error(-1, const_cast<char*>("Weird page contents"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
obj2.free();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
obj2.free();
|
|
|
|
}
|
|
|
|
} else if (!obj->isStream()) {
|
|
|
|
- error(-1, const_cast<char*>("Weird page contents"));
|
2012-06-23 17:22:26 +00:00
|
|
|
- return;
|
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errInternal, -1, "Weird page contents");
|
|
|
|
+#else
|
|
|
|
+ error(-1, const_cast<char*>("Weird page contents"));
|
|
|
|
+#endif
|
|
|
|
+ return;
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
parser = new Parser(xref, new Lexer(xref, obj), gFalse);
|
2012-06-23 17:22:26 +00:00
|
|
|
go(topLevel);
|
|
|
|
@@ -419,7 +427,11 @@ void PdfParser::go(GBool topLevel) {
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
// too many arguments - something is wrong
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Too many args in content stream");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Too many args in content stream"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
if (printCommands) {
|
|
|
|
printf("throwing away arg: ");
|
|
|
|
obj.print(stdout);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -436,7 +448,11 @@ void PdfParser::go(GBool topLevel) {
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
// args at end with no command
|
|
|
|
if (numArgs > 0) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Leftover args in content stream");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Leftover args in content stream"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
if (printCommands) {
|
|
|
|
printf("%d leftovers:", numArgs);
|
|
|
|
for (i = 0; i < numArgs; ++i) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -502,7 +518,11 @@ void PdfParser::execOp(Object *cmd, Obje
|
2012-06-23 15:42:39 +00:00
|
|
|
name = cmd->getCmd();
|
|
|
|
if (!(op = findOp(name))) {
|
|
|
|
if (ignoreUndef == 0)
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Unknown operator '{0:s}'", name);
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unknown operator '%s'"), name);
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -510,26 +530,42 @@ void PdfParser::execOp(Object *cmd, Obje
|
2012-06-23 15:42:39 +00:00
|
|
|
argPtr = args;
|
|
|
|
if (op->numArgs >= 0) {
|
|
|
|
if (numArgs < op->numArgs) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Too few ({0:d}) args to '{1:d}' operator", numArgs, name);
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Too few (%d) args to '%s' operator"), numArgs, name);
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (numArgs > op->numArgs) {
|
|
|
|
#if 0
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Too many ({0:d}) args to '{1:s}' operator", numArgs, name);
|
|
|
|
+#else
|
|
|
|
error(getPos(), "Too many (%d) args to '%s' operator", numArgs, name);
|
2012-06-23 15:42:39 +00:00
|
|
|
#endif
|
2012-06-23 17:22:26 +00:00
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
argPtr += numArgs - op->numArgs;
|
|
|
|
numArgs = op->numArgs;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (numArgs > -op->numArgs) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Too many ({0:d}) args to '{1:s}' operator",
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Too many (%d) args to '%s' operator"),
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
numArgs, name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = 0; i < numArgs; ++i) {
|
|
|
|
if (!checkArg(&argPtr[i], op->tchk[i])) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Arg #{0:d} to '{1:s}' operator is wrong type ({2:s})",
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Arg #%d to '%s' operator is wrong type (%s)"),
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
i, name, argPtr[i].getTypeName());
|
|
|
|
return;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -690,7 +726,11 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!obj1.isDict()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "ExtGState '{0:s}' is wrong type"), args[0].getName();
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("ExtGState '%s' is wrong type"), args[0].getName());
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
obj1.free();
|
|
|
|
return;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -705,7 +745,11 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
if (state->parseBlendMode(&obj2, &mode)) {
|
|
|
|
state->setBlendMode(mode);
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Invalid blend mode in ExtGState"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
obj2.free();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -764,7 +808,11 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
state->setTransfer(funcs);
|
|
|
|
}
|
|
|
|
} else if (!obj2.isNull()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Invalid transfer function in ExtGState"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj2.free();
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -784,8 +832,11 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
funcs[0] = Function::parse(&obj3);
|
|
|
|
if (funcs[0]->getInputSize() != 1 ||
|
|
|
|
funcs[0]->getOutputSize() != 1) {
|
|
|
|
- error(getPos(),
|
2012-06-23 17:22:26 +00:00
|
|
|
- const_cast<char*>("Invalid transfer function in soft mask in ExtGState"));
|
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid transfer function in soft mask in ExtGState");
|
|
|
|
+#else
|
|
|
|
+ error(getPos(), const_cast<char*>("Invalid transfer function in soft mask in ExtGState"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
delete funcs[0];
|
|
|
|
funcs[0] = NULL;
|
2012-06-23 17:22:26 +00:00
|
|
|
}
|
|
|
|
@@ -809,7 +860,7 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
blendingColorSpace = NULL;
|
|
|
|
isolated = knockout = gFalse;
|
|
|
|
if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
#else
|
|
|
|
blendingColorSpace = GfxColorSpace::parse(&obj5);
|
|
|
|
@@ -840,15 +891,27 @@ void PdfParser::opSetExtGState(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
delete funcs[0];
|
|
|
|
}
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj4.free();
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj3.free();
|
|
|
|
} else if (!obj2.isNull()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
obj2.free();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -876,7 +939,11 @@ void PdfParser::doSoftMask(Object *str,
|
2012-06-23 15:42:39 +00:00
|
|
|
// check form type
|
|
|
|
dict->lookup(const_cast<char*>("FormType"), &obj1);
|
|
|
|
if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Unknown form type");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unknown form type"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj1.free();
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -884,7 +951,11 @@ void PdfParser::doSoftMask(Object *str,
|
2012-06-23 15:42:39 +00:00
|
|
|
dict->lookup(const_cast<char*>("BBox"), &obj1);
|
|
|
|
if (!obj1.isArray()) {
|
|
|
|
obj1.free();
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Bad form bounding box");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Bad form bounding box"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (i = 0; i < 4; ++i) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1012,7 +1083,7 @@ void PdfParser::opSetFillColorSpace(Obje
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
state->setFillPattern(NULL);
|
|
|
|
res->lookupColorSpace(args[0].getName(), &obj);
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (obj.isNull()) {
|
|
|
|
colorSpace = GfxColorSpace::parse(&args[0], NULL);
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1032,7 +1103,11 @@ void PdfParser::opSetFillColorSpace(Obje
|
2012-06-23 15:42:39 +00:00
|
|
|
state->setFillColor(&color);
|
|
|
|
builder->updateStyle(state);
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Bad color space (fill)");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Bad color space (fill)"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1043,7 +1118,7 @@ void PdfParser::opSetStrokeColorSpace(Ob
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
state->setStrokePattern(NULL);
|
|
|
|
res->lookupColorSpace(args[0].getName(), &obj);
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (obj.isNull()) {
|
|
|
|
colorSpace = GfxColorSpace::parse(&args[0], NULL);
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1063,7 +1138,11 @@ void PdfParser::opSetStrokeColorSpace(Ob
|
2012-06-23 15:42:39 +00:00
|
|
|
state->setStrokeColor(&color);
|
|
|
|
builder->updateStyle(state);
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Bad color space (stroke)");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Bad color space (stroke)"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1072,7 +1151,11 @@ void PdfParser::opSetFillColor(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (numArgs != state->getFillColorSpace()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'sc' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'sc' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->setFillPattern(NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1088,7 +1171,11 @@ void PdfParser::opSetStrokeColor(Object
|
2012-06-23 15:42:39 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (numArgs != state->getStrokeColorSpace()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'SC' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SC' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->setStrokePattern(NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1109,7 +1196,11 @@ void PdfParser::opSetFillColorN(Object a
|
2012-06-23 15:42:39 +00:00
|
|
|
if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
|
|
|
|
numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
|
|
|
|
->getUnder()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'scn' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1120,7 +1211,7 @@ void PdfParser::opSetFillColorN(Object a
|
2012-06-23 15:42:39 +00:00
|
|
|
state->setFillColor(&color);
|
|
|
|
builder->updateStyle(state);
|
|
|
|
}
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (args[numArgs-1].isName() &&
|
|
|
|
(pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
|
|
|
|
state->setFillPattern(pattern);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1136,7 +1227,11 @@ void PdfParser::opSetFillColorN(Object a
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
if (numArgs != state->getFillColorSpace()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'scn' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->setFillPattern(NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1161,7 +1256,11 @@ void PdfParser::opSetStrokeColorN(Object
|
2012-06-23 15:42:39 +00:00
|
|
|
->getUnder() ||
|
|
|
|
numArgs - 1 != ((GfxPatternColorSpace *)state->getStrokeColorSpace())
|
|
|
|
->getUnder()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'SCN' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1172,7 +1271,7 @@ void PdfParser::opSetStrokeColorN(Object
|
2012-06-23 15:42:39 +00:00
|
|
|
state->setStrokeColor(&color);
|
|
|
|
builder->updateStyle(state);
|
|
|
|
}
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (args[numArgs-1].isName() &&
|
|
|
|
(pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
|
|
|
|
state->setStrokePattern(pattern);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1188,7 +1287,11 @@ void PdfParser::opSetStrokeColorN(Object
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
if (numArgs != state->getStrokeColorSpace()->getNComps()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Incorrect number of arguments in 'SCN' command");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->setStrokePattern(NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1212,7 +1315,11 @@ void PdfParser::opMoveTo(Object args[],
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
void PdfParser::opLineTo(Object args[], int numArgs) {
|
|
|
|
if (!state->isCurPt()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No current point in lineto");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No current point in lineto"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->lineTo(args[0].getNum(), args[1].getNum());
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1222,7 +1329,11 @@ void PdfParser::opCurveTo(Object args[],
|
2012-06-23 15:42:39 +00:00
|
|
|
double x1, y1, x2, y2, x3, y3;
|
|
|
|
|
|
|
|
if (!state->isCurPt()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No current point in curveto");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No current point in curveto"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
x1 = args[0].getNum();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1238,7 +1349,11 @@ void PdfParser::opCurveTo1(Object args[]
|
2012-06-23 15:42:39 +00:00
|
|
|
double x1, y1, x2, y2, x3, y3;
|
|
|
|
|
|
|
|
if (!state->isCurPt()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No current point in curveto1");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No current point in curveto1"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
x1 = state->getCurX();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1254,7 +1369,11 @@ void PdfParser::opCurveTo2(Object args[]
|
2012-06-23 15:42:39 +00:00
|
|
|
double x1, y1, x2, y2, x3, y3;
|
|
|
|
|
|
|
|
if (!state->isCurPt()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No current point in curveto2");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No current point in curveto2"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
x1 = args[0].getNum();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1282,7 +1401,11 @@ void PdfParser::opRectangle(Object args[
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
void PdfParser::opClosePath(Object args[], int numArgs) {
|
|
|
|
if (!state->isCurPt()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No current point in closepath");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No current point in closepath"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
state->closePath();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1440,7 +1563,11 @@ void PdfParser::doPatternFillFallback(GB
|
2012-06-23 15:42:39 +00:00
|
|
|
doShadingPatternFillFallback((GfxShadingPattern *)pattern, gFalse, eoFill);
|
|
|
|
break;
|
|
|
|
default:
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errUnimplemented, getPos(), "Unimplemented pattern type (%d) in fill",
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in fill"),
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
pattern->getType());
|
|
|
|
break;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1459,7 +1586,11 @@ void PdfParser::doPatternStrokeFallback(
|
2012-06-23 15:42:39 +00:00
|
|
|
doShadingPatternFillFallback((GfxShadingPattern *)pattern, gTrue, gFalse);
|
|
|
|
break;
|
|
|
|
default:
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errUnimplemented, getPos(), "Unimplemented pattern type ({0:d}) in stroke",
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in stroke"),
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
pattern->getType());
|
|
|
|
break;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -1579,7 +1710,7 @@ void PdfParser::opShFill(Object args[],
|
2012-06-23 15:42:39 +00:00
|
|
|
double *matrix = NULL;
|
|
|
|
GBool savedState = gFalse;
|
|
|
|
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (!(shading = res->lookupShading(args[0].getName(), NULL))) {
|
|
|
|
return;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2156,7 +2287,11 @@ void PdfParser::opTextNextLine(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
|
|
|
|
void PdfParser::opShowText(Object args[], int numArgs) {
|
|
|
|
if (!state->getFont()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No font in show");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No font in show"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (fontChanged) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2170,7 +2305,11 @@ void PdfParser::opMoveShowText(Object ar
|
2012-06-23 15:42:39 +00:00
|
|
|
double tx, ty;
|
|
|
|
|
|
|
|
if (!state->getFont()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No font in move/show");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No font in move/show"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (fontChanged) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2188,7 +2327,11 @@ void PdfParser::opMoveSetShowText(Object
|
2012-06-23 15:42:39 +00:00
|
|
|
double tx, ty;
|
|
|
|
|
|
|
|
if (!state->getFont()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No font in move/set/show");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No font in move/set/show"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (fontChanged) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2211,7 +2354,11 @@ void PdfParser::opShowSpaceText(Object a
|
2012-06-23 15:42:39 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!state->getFont()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "No font in show/space");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("No font in show/space"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (fontChanged) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2236,7 +2383,11 @@ void PdfParser::opShowSpaceText(Object a
|
2012-06-23 15:42:39 +00:00
|
|
|
} else if (obj.isString()) {
|
|
|
|
doShowText(obj.getString());
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Element of show/space array must be number or string");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Element of show/space array must be number or string"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj.free();
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2334,7 +2485,11 @@ void PdfParser::doShowText(GooString *s)
|
2012-06-23 15:42:39 +00:00
|
|
|
if (charProc.isStream()) {
|
|
|
|
//parse(&charProc, gFalse); // TODO: parse into SVG font
|
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Missing or bad Type3 CharProc entry");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Missing or bad Type3 CharProc entry"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
//out->endType3Char(state);
|
|
|
|
if (resDict) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2410,7 +2565,11 @@ void PdfParser::opXObject(Object args[],
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!obj1.isStream()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "XObject '{0:s}' is wrong type", name);
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("XObject '%s' is wrong type"), name);
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
obj1.free();
|
|
|
|
return;
|
|
|
|
}
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2426,9 +2585,17 @@ void PdfParser::opXObject(Object args[],
|
2012-06-23 15:42:39 +00:00
|
|
|
/* out->psXObject(obj1.getStream(),
|
|
|
|
obj3.isStream() ? obj3.getStream() : (Stream *)NULL);*/
|
|
|
|
} else if (obj2.isName()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Unknown XObject subtype '{0:s}'", obj2.getName());
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unknown XObject subtype '%s'"), obj2.getName());
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
} else {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "XObject subtype is missing or wrong type");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("XObject subtype is missing or wrong type"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj2.free();
|
|
|
|
obj1.free();
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2559,7 +2726,7 @@ void PdfParser::doImage(Object *ref, Str
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!obj1.isNull()) {
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
colorSpace = GfxColorSpace::parse(&obj1, NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
#else
|
|
|
|
colorSpace = GfxColorSpace::parse(&obj1);
|
|
|
|
@@ -2648,7 +2815,7 @@ void PdfParser::doImage(Object *ref, Str
|
2012-06-23 15:42:39 +00:00
|
|
|
obj2.free();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
#else
|
|
|
|
maskColorSpace = GfxColorSpace::parse(&obj1);
|
|
|
|
@@ -2758,7 +2925,11 @@ void PdfParser::doImage(Object *ref, Str
|
2012-06-23 15:42:39 +00:00
|
|
|
err2:
|
|
|
|
obj1.free();
|
|
|
|
err1:
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Bad image parameters");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Bad image parameters"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PdfParser::doForm(Object *str) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2783,7 +2954,11 @@ void PdfParser::doForm(Object *str) {
|
2012-06-23 15:42:39 +00:00
|
|
|
// check form type
|
|
|
|
dict->lookup(const_cast<char*>("FormType"), &obj1);
|
|
|
|
if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Unknown form type");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Unknown form type"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
obj1.free();
|
|
|
|
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2791,7 +2966,11 @@ void PdfParser::doForm(Object *str) {
|
2012-06-23 15:42:39 +00:00
|
|
|
dict->lookup(const_cast<char*>("BBox"), &bboxObj);
|
|
|
|
if (!bboxObj.isArray()) {
|
|
|
|
bboxObj.free();
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Bad form bounding box");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Bad form bounding box"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (i = 0; i < 4; ++i) {
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -2827,7 +3006,7 @@ void PdfParser::doForm(Object *str) {
|
2012-06-23 15:42:39 +00:00
|
|
|
if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
|
|
|
|
transpGroup = gTrue;
|
|
|
|
if (!obj1.dictLookup(const_cast<char*>("CS"), &obj3)->isNull()) {
|
|
|
|
-#ifdef POPPLER_NEW_COLOR_SPACE_API
|
2012-06-23 17:22:26 +00:00
|
|
|
+#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
|
2012-06-23 15:42:39 +00:00
|
|
|
blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);
|
2012-06-23 17:22:26 +00:00
|
|
|
#else
|
|
|
|
blendingColorSpace = GfxColorSpace::parse(&obj3);
|
|
|
|
@@ -2990,7 +3169,11 @@ Stream *PdfParser::buildImageStream() {
|
2012-06-23 15:42:39 +00:00
|
|
|
parser->getObj(&obj);
|
|
|
|
while (!obj.isCmd(const_cast<char*>("ID")) && !obj.isEOF()) {
|
|
|
|
if (!obj.isName()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "Inline image dictionary key must be a name object");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Inline image dictionary key must be a name object"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
obj.free();
|
|
|
|
} else {
|
|
|
|
key = copyString(obj.getName());
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -3005,7 +3188,11 @@ Stream *PdfParser::buildImageStream() {
|
2012-06-23 15:42:39 +00:00
|
|
|
parser->getObj(&obj);
|
|
|
|
}
|
|
|
|
if (obj.isEOF()) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errSyntaxError, getPos(), "End of file in inline image");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("End of file in inline image"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
obj.free();
|
|
|
|
dict.free();
|
|
|
|
return NULL;
|
2012-06-23 17:22:26 +00:00
|
|
|
@@ -3020,11 +3207,19 @@ Stream *PdfParser::buildImageStream() {
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PdfParser::opImageData(Object args[], int numArgs) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errInternal, getPos(), "Internal: got 'ID' operator");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Internal: got 'ID' operator"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PdfParser::opEndImage(Object args[], int numArgs) {
|
2012-06-23 17:22:26 +00:00
|
|
|
+#ifdef POPPLER_NEW_ERRORAPI
|
|
|
|
+ error(errInternal, getPos(), "Internal: got 'EI' operator");
|
|
|
|
+#else
|
|
|
|
error(getPos(), const_cast<char*>("Internal: got 'EI' operator"));
|
|
|
|
+#endif
|
2012-06-23 15:42:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
2012-06-23 17:22:26 +00:00
|
|
|
diff -up inkscape-0.48.2/src/extension/internal/pdfinput/svg-builder.cpp.poppler_020 inkscape-0.48.2/src/extension/internal/pdfinput/svg-builder.cpp
|
|
|
|
--- inkscape-0.48.2/src/extension/internal/pdfinput/svg-builder.cpp.poppler_020 2012-06-23 12:01:38.912678613 -0500
|
|
|
|
+++ inkscape-0.48.2/src/extension/internal/pdfinput/svg-builder.cpp 2012-06-23 12:01:38.920678513 -0500
|
|
|
|
@@ -961,9 +961,7 @@ void SvgBuilder::updateFont(GfxState *st
|
2012-06-23 15:42:39 +00:00
|
|
|
_font_style = sp_repr_css_attr_new();
|
|
|
|
GfxFont *font = state->getFont();
|
|
|
|
// Store original name
|
|
|
|
- if (font->getOrigName()) {
|
|
|
|
- _font_specification = font->getOrigName()->getCString();
|
|
|
|
- } else if (font->getName()) {
|
|
|
|
+ if (font->getName()) {
|
|
|
|
_font_specification = font->getName()->getCString();
|
|
|
|
} else {
|
|
|
|
_font_specification = (char*) "Arial";
|