1 diff -Naur old/src/extension/internal/pdfinput/pdf-parser.cpp new/src/extension/internal/pdfinput/pdf-parser.cpp
2 --- old/src/extension/internal/pdfinput/pdf-parser.cpp 2011-07-08 20:25:09.468790000 +0200
3 +++ new/src/extension/internal/pdfinput/pdf-parser.cpp 2012-05-13 21:07:11.334781215 +0200
4 @@ -367,14 +367,14 @@
5 for (i = 0; i < obj->arrayGetLength(); ++i) {
6 obj->arrayGet(i, &obj2);
7 if (!obj2.isStream()) {
8 - error(-1, const_cast<char*>("Weird page contents"));
9 + error(errInternal, -1, const_cast<char*>("Weird page contents"));
10 obj2.free();
11 return;
12 }
13 obj2.free();
14 }
15 } else if (!obj->isStream()) {
16 - error(-1, const_cast<char*>("Weird page contents"));
17 + error(errInternal, -1, const_cast<char*>("Weird page contents"));
18 return;
19 }
20 parser = new Parser(xref, new Lexer(xref, obj), gFalse);
21 @@ -419,7 +419,7 @@
22
23 // too many arguments - something is wrong
24 } else {
25 - error(getPos(), const_cast<char*>("Too many args in content stream"));
26 + error(errInternal, getPos(), const_cast<char*>("Too many args in content stream"));
27 if (printCommands) {
28 printf("throwing away arg: ");
29 obj.print(stdout);
30 @@ -436,7 +436,7 @@
31
32 // args at end with no command
33 if (numArgs > 0) {
34 - error(getPos(), const_cast<char*>("Leftover args in content stream"));
35 + error(errInternal, getPos(), const_cast<char*>("Leftover args in content stream"));
36 if (printCommands) {
37 printf("%d leftovers:", numArgs);
38 for (i = 0; i < numArgs; ++i) {
39 @@ -502,7 +502,7 @@
40 name = cmd->getCmd();
41 if (!(op = findOp(name))) {
42 if (ignoreUndef == 0)
43 - error(getPos(), const_cast<char*>("Unknown operator '%s'"), name);
44 + error(errInternal, getPos(), const_cast<char*>("Unknown operator '%s'"), name);
45 return;
46 }
47
48 @@ -510,26 +510,26 @@
49 argPtr = args;
50 if (op->numArgs >= 0) {
51 if (numArgs < op->numArgs) {
52 - error(getPos(), const_cast<char*>("Too few (%d) args to '%s' operator"), numArgs, name);
53 + error(errInternal, getPos(), const_cast<char*>("Too few (%d) args to '%s' operator"), numArgs, name);
54 return;
55 }
56 if (numArgs > op->numArgs) {
57 #if 0
58 - error(getPos(), "Too many (%d) args to '%s' operator", numArgs, name);
59 + error(errInternal, getPos(), "Too many (%d) args to '%s' operator", numArgs, name);
60 #endif
61 argPtr += numArgs - op->numArgs;
62 numArgs = op->numArgs;
63 }
64 } else {
65 if (numArgs > -op->numArgs) {
66 - error(getPos(), const_cast<char*>("Too many (%d) args to '%s' operator"),
67 + error(errInternal, getPos(), const_cast<char*>("Too many (%d) args to '%s' operator"),
68 numArgs, name);
69 return;
70 }
71 }
72 for (i = 0; i < numArgs; ++i) {
73 if (!checkArg(&argPtr[i], op->tchk[i])) {
74 - error(getPos(), const_cast<char*>("Arg #%d to '%s' operator is wrong type (%s)"),
75 + error(errInternal, getPos(), const_cast<char*>("Arg #%d to '%s' operator is wrong type (%s)"),
76 i, name, argPtr[i].getTypeName());
77 return;
78 }
79 @@ -690,7 +690,7 @@
80 return;
81 }
82 if (!obj1.isDict()) {
83 - error(getPos(), const_cast<char*>("ExtGState '%s' is wrong type"), args[0].getName());
84 + error(errInternal, getPos(), const_cast<char*>("ExtGState '%s' is wrong type"), args[0].getName());
85 obj1.free();
86 return;
87 }
88 @@ -705,7 +705,7 @@
89 if (state->parseBlendMode(&obj2, &mode)) {
90 state->setBlendMode(mode);
91 } else {
92 - error(getPos(), const_cast<char*>("Invalid blend mode in ExtGState"));
93 + error(errInternal, getPos(), const_cast<char*>("Invalid blend mode in ExtGState"));
94 }
95 }
96 obj2.free();
97 @@ -764,7 +764,7 @@
98 state->setTransfer(funcs);
99 }
100 } else if (!obj2.isNull()) {
101 - error(getPos(), const_cast<char*>("Invalid transfer function in ExtGState"));
102 + error(errInternal, getPos(), const_cast<char*>("Invalid transfer function in ExtGState"));
103 }
104 obj2.free();
105
106 @@ -784,7 +784,7 @@
107 funcs[0] = Function::parse(&obj3);
108 if (funcs[0]->getInputSize() != 1 ||
109 funcs[0]->getOutputSize() != 1) {
110 - error(getPos(),
111 + error(errInternal, getPos(),
112 const_cast<char*>("Invalid transfer function in soft mask in ExtGState"));
113 delete funcs[0];
114 funcs[0] = NULL;
115 @@ -809,11 +809,7 @@
116 blendingColorSpace = NULL;
117 isolated = knockout = gFalse;
118 if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
119 -#ifdef POPPLER_NEW_COLOR_SPACE_API
120 blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
121 -#else
122 - blendingColorSpace = GfxColorSpace::parse(&obj5);
123 -#endif
124 }
125 obj5.free();
126 if (obj4.dictLookup(const_cast<char*>("I"), &obj5)->isBool()) {
127 @@ -840,15 +836,15 @@
128 delete funcs[0];
129 }
130 } else {
131 - error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
132 + error(errInternal, getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
133 }
134 obj4.free();
135 } else {
136 - error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
137 + error(errInternal, getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
138 }
139 obj3.free();
140 } else if (!obj2.isNull()) {
141 - error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState"));
142 + error(errInternal, getPos(), const_cast<char*>("Invalid soft mask in ExtGState"));
143 }
144 }
145 obj2.free();
146 @@ -876,7 +872,7 @@
147 // check form type
148 dict->lookup(const_cast<char*>("FormType"), &obj1);
149 if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
150 - error(getPos(), const_cast<char*>("Unknown form type"));
151 + error(errInternal, getPos(), const_cast<char*>("Unknown form type"));
152 }
153 obj1.free();
154
155 @@ -884,7 +880,7 @@
156 dict->lookup(const_cast<char*>("BBox"), &obj1);
157 if (!obj1.isArray()) {
158 obj1.free();
159 - error(getPos(), const_cast<char*>("Bad form bounding box"));
160 + error(errInternal, getPos(), const_cast<char*>("Bad form bounding box"));
161 return;
162 }
163 for (i = 0; i < 4; ++i) {
164 @@ -1012,19 +1008,11 @@
165
166 state->setFillPattern(NULL);
167 res->lookupColorSpace(args[0].getName(), &obj);
168 -#ifdef POPPLER_NEW_COLOR_SPACE_API
169 if (obj.isNull()) {
170 colorSpace = GfxColorSpace::parse(&args[0], NULL);
171 } else {
172 colorSpace = GfxColorSpace::parse(&obj, NULL);
173 }
174 -#else
175 - if (obj.isNull()) {
176 - colorSpace = GfxColorSpace::parse(&args[0]);
177 - } else {
178 - colorSpace = GfxColorSpace::parse(&obj);
179 - }
180 -#endif
181 obj.free();
182 if (colorSpace) {
183 state->setFillColorSpace(colorSpace);
184 @@ -1032,7 +1020,7 @@
185 state->setFillColor(&color);
186 builder->updateStyle(state);
187 } else {
188 - error(getPos(), const_cast<char*>("Bad color space (fill)"));
189 + error(errInternal, getPos(), const_cast<char*>("Bad color space (fill)"));
190 }
191 }
192
193 @@ -1043,19 +1031,11 @@
194
195 state->setStrokePattern(NULL);
196 res->lookupColorSpace(args[0].getName(), &obj);
197 -#ifdef POPPLER_NEW_COLOR_SPACE_API
198 if (obj.isNull()) {
199 colorSpace = GfxColorSpace::parse(&args[0], NULL);
200 } else {
201 colorSpace = GfxColorSpace::parse(&obj, NULL);
202 }
203 -#else
204 - if (obj.isNull()) {
205 - colorSpace = GfxColorSpace::parse(&args[0]);
206 - } else {
207 - colorSpace = GfxColorSpace::parse(&obj);
208 - }
209 -#endif
210 obj.free();
211 if (colorSpace) {
212 state->setStrokeColorSpace(colorSpace);
213 @@ -1063,7 +1043,7 @@
214 state->setStrokeColor(&color);
215 builder->updateStyle(state);
216 } else {
217 - error(getPos(), const_cast<char*>("Bad color space (stroke)"));
218 + error(errInternal, getPos(), const_cast<char*>("Bad color space (stroke)"));
219 }
220 }
221
222 @@ -1072,7 +1052,7 @@
223 int i;
224
225 if (numArgs != state->getFillColorSpace()->getNComps()) {
226 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'sc' command"));
227 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'sc' command"));
228 return;
229 }
230 state->setFillPattern(NULL);
231 @@ -1088,7 +1068,7 @@
232 int i;
233
234 if (numArgs != state->getStrokeColorSpace()->getNComps()) {
235 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SC' command"));
236 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'SC' command"));
237 return;
238 }
239 state->setStrokePattern(NULL);
240 @@ -1109,7 +1089,7 @@
241 if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
242 numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
243 ->getUnder()->getNComps()) {
244 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
245 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
246 return;
247 }
248 for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
249 @@ -1120,23 +1100,15 @@
250 state->setFillColor(&color);
251 builder->updateStyle(state);
252 }
253 -#ifdef POPPLER_NEW_COLOR_SPACE_API
254 if (args[numArgs-1].isName() &&
255 (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
256 state->setFillPattern(pattern);
257 builder->updateStyle(state);
258 }
259 -#else
260 - if (args[numArgs-1].isName() &&
261 - (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
262 - state->setFillPattern(pattern);
263 - builder->updateStyle(state);
264 - }
265 -#endif
266
267 } else {
268 if (numArgs != state->getFillColorSpace()->getNComps()) {
269 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
270 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
271 return;
272 }
273 state->setFillPattern(NULL);
274 @@ -1161,7 +1133,7 @@
275 ->getUnder() ||
276 numArgs - 1 != ((GfxPatternColorSpace *)state->getStrokeColorSpace())
277 ->getUnder()->getNComps()) {
278 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
279 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
280 return;
281 }
282 for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
283 @@ -1172,23 +1144,15 @@
284 state->setStrokeColor(&color);
285 builder->updateStyle(state);
286 }
287 -#ifdef POPPLER_NEW_COLOR_SPACE_API
288 if (args[numArgs-1].isName() &&
289 (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
290 state->setStrokePattern(pattern);
291 builder->updateStyle(state);
292 }
293 -#else
294 - if (args[numArgs-1].isName() &&
295 - (pattern = res->lookupPattern(args[numArgs-1].getName()))) {
296 - state->setStrokePattern(pattern);
297 - builder->updateStyle(state);
298 - }
299 -#endif
300
301 } else {
302 if (numArgs != state->getStrokeColorSpace()->getNComps()) {
303 - error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
304 + error(errInternal, getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
305 return;
306 }
307 state->setStrokePattern(NULL);
308 @@ -1212,7 +1176,7 @@
309
310 void PdfParser::opLineTo(Object args[], int numArgs) {
311 if (!state->isCurPt()) {
312 - error(getPos(), const_cast<char*>("No current point in lineto"));
313 + error(errInternal, getPos(), const_cast<char*>("No current point in lineto"));
314 return;
315 }
316 state->lineTo(args[0].getNum(), args[1].getNum());
317 @@ -1222,7 +1186,7 @@
318 double x1, y1, x2, y2, x3, y3;
319
320 if (!state->isCurPt()) {
321 - error(getPos(), const_cast<char*>("No current point in curveto"));
322 + error(errInternal, getPos(), const_cast<char*>("No current point in curveto"));
323 return;
324 }
325 x1 = args[0].getNum();
326 @@ -1238,7 +1202,7 @@
327 double x1, y1, x2, y2, x3, y3;
328
329 if (!state->isCurPt()) {
330 - error(getPos(), const_cast<char*>("No current point in curveto1"));
331 + error(errInternal, getPos(), const_cast<char*>("No current point in curveto1"));
332 return;
333 }
334 x1 = state->getCurX();
335 @@ -1254,7 +1218,7 @@
336 double x1, y1, x2, y2, x3, y3;
337
338 if (!state->isCurPt()) {
339 - error(getPos(), const_cast<char*>("No current point in curveto2"));
340 + error(errInternal, getPos(), const_cast<char*>("No current point in curveto2"));
341 return;
342 }
343 x1 = args[0].getNum();
344 @@ -1282,7 +1246,7 @@
345
346 void PdfParser::opClosePath(Object args[], int numArgs) {
347 if (!state->isCurPt()) {
348 - error(getPos(), const_cast<char*>("No current point in closepath"));
349 + error(errInternal, getPos(), const_cast<char*>("No current point in closepath"));
350 return;
351 }
352 state->closePath();
353 @@ -1298,7 +1262,7 @@
354
355 void PdfParser::opStroke(Object args[], int numArgs) {
356 if (!state->isCurPt()) {
357 - //error(getPos(), const_cast<char*>("No path in stroke"));
358 + //error(errInternal, getPos(), const_cast<char*>("No path in stroke"));
359 return;
360 }
361 if (state->isPath()) {
362 @@ -1314,7 +1278,7 @@
363
364 void PdfParser::opCloseStroke(Object * /*args[]*/, int /*numArgs*/) {
365 if (!state->isCurPt()) {
366 - //error(getPos(), const_cast<char*>("No path in closepath/stroke"));
367 + //error(errInternal, getPos(), const_cast<char*>("No path in closepath/stroke"));
368 return;
369 }
370 state->closePath();
371 @@ -1331,7 +1295,7 @@
372
373 void PdfParser::opFill(Object args[], int numArgs) {
374 if (!state->isCurPt()) {
375 - //error(getPos(), const_cast<char*>("No path in fill"));
376 + //error(errInternal, getPos(), const_cast<char*>("No path in fill"));
377 return;
378 }
379 if (state->isPath()) {
380 @@ -1347,7 +1311,7 @@
381
382 void PdfParser::opEOFill(Object args[], int numArgs) {
383 if (!state->isCurPt()) {
384 - //error(getPos(), const_cast<char*>("No path in eofill"));
385 + //error(errInternal, getPos(), const_cast<char*>("No path in eofill"));
386 return;
387 }
388 if (state->isPath()) {
389 @@ -1363,7 +1327,7 @@
390
391 void PdfParser::opFillStroke(Object args[], int numArgs) {
392 if (!state->isCurPt()) {
393 - //error(getPos(), const_cast<char*>("No path in fill/stroke"));
394 + //error(errInternal, getPos(), const_cast<char*>("No path in fill/stroke"));
395 return;
396 }
397 if (state->isPath()) {
398 @@ -1376,7 +1340,7 @@
399
400 void PdfParser::opCloseFillStroke(Object args[], int numArgs) {
401 if (!state->isCurPt()) {
402 - //error(getPos(), const_cast<char*>("No path in closepath/fill/stroke"));
403 + //error(errInternal, getPos(), const_cast<char*>("No path in closepath/fill/stroke"));
404 return;
405 }
406 if (state->isPath()) {
407 @@ -1388,7 +1352,7 @@
408
409 void PdfParser::opEOFillStroke(Object args[], int numArgs) {
410 if (!state->isCurPt()) {
411 - //error(getPos(), const_cast<char*>("No path in eofill/stroke"));
412 + //error(errInternal, getPos(), const_cast<char*>("No path in eofill/stroke"));
413 return;
414 }
415 if (state->isPath()) {
416 @@ -1399,7 +1363,7 @@
417
418 void PdfParser::opCloseEOFillStroke(Object args[], int numArgs) {
419 if (!state->isCurPt()) {
420 - //error(getPos(), const_cast<char*>("No path in closepath/eofill/stroke"));
421 + //error(errInternal, getPos(), const_cast<char*>("No path in closepath/eofill/stroke"));
422 return;
423 }
424 if (state->isPath()) {
425 @@ -1440,7 +1404,7 @@
426 doShadingPatternFillFallback((GfxShadingPattern *)pattern, gFalse, eoFill);
427 break;
428 default:
429 - error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in fill"),
430 + error(errInternal, getPos(), const_cast<char*>("Unimplemented pattern type (%d) in fill"),
431 pattern->getType());
432 break;
433 }
434 @@ -1459,7 +1423,7 @@
435 doShadingPatternFillFallback((GfxShadingPattern *)pattern, gTrue, gFalse);
436 break;
437 default:
438 - error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in stroke"),
439 + error(errInternal, getPos(), const_cast<char*>("Unimplemented pattern type (%d) in stroke"),
440 pattern->getType());
441 break;
442 }
443 @@ -1579,15 +1543,9 @@
444 double *matrix = NULL;
445 GBool savedState = gFalse;
446
447 -#ifdef POPPLER_NEW_COLOR_SPACE_API
448 if (!(shading = res->lookupShading(args[0].getName(), NULL))) {
449 return;
450 }
451 -#else
452 - if (!(shading = res->lookupShading(args[0].getName()))) {
453 - return;
454 - }
455 -#endif
456
457 // save current graphics state
458 if (shading->getType() != 2 && shading->getType() != 3) {
459 @@ -2156,7 +2114,7 @@
460
461 void PdfParser::opShowText(Object args[], int numArgs) {
462 if (!state->getFont()) {
463 - error(getPos(), const_cast<char*>("No font in show"));
464 + error(errInternal, getPos(), const_cast<char*>("No font in show"));
465 return;
466 }
467 if (fontChanged) {
468 @@ -2170,7 +2128,7 @@
469 double tx, ty;
470
471 if (!state->getFont()) {
472 - error(getPos(), const_cast<char*>("No font in move/show"));
473 + error(errInternal, getPos(), const_cast<char*>("No font in move/show"));
474 return;
475 }
476 if (fontChanged) {
477 @@ -2188,7 +2146,7 @@
478 double tx, ty;
479
480 if (!state->getFont()) {
481 - error(getPos(), const_cast<char*>("No font in move/set/show"));
482 + error(errInternal, getPos(), const_cast<char*>("No font in move/set/show"));
483 return;
484 }
485 if (fontChanged) {
486 @@ -2211,7 +2169,7 @@
487 int i;
488
489 if (!state->getFont()) {
490 - error(getPos(), const_cast<char*>("No font in show/space"));
491 + error(errInternal, getPos(), const_cast<char*>("No font in show/space"));
492 return;
493 }
494 if (fontChanged) {
495 @@ -2236,7 +2194,7 @@
496 } else if (obj.isString()) {
497 doShowText(obj.getString());
498 } else {
499 - error(getPos(), const_cast<char*>("Element of show/space array must be number or string"));
500 + error(errInternal, getPos(), const_cast<char*>("Element of show/space array must be number or string"));
501 }
502 obj.free();
503 }
504 @@ -2334,7 +2292,7 @@
505 if (charProc.isStream()) {
506 //parse(&charProc, gFalse); // TODO: parse into SVG font
507 } else {
508 - error(getPos(), const_cast<char*>("Missing or bad Type3 CharProc entry"));
509 + error(errInternal, getPos(), const_cast<char*>("Missing or bad Type3 CharProc entry"));
510 }
511 //out->endType3Char(state);
512 if (resDict) {
513 @@ -2410,7 +2368,7 @@
514 return;
515 }
516 if (!obj1.isStream()) {
517 - error(getPos(), const_cast<char*>("XObject '%s' is wrong type"), name);
518 + error(errInternal, getPos(), const_cast<char*>("XObject '%s' is wrong type"), name);
519 obj1.free();
520 return;
521 }
522 @@ -2426,9 +2384,9 @@
523 /* out->psXObject(obj1.getStream(),
524 obj3.isStream() ? obj3.getStream() : (Stream *)NULL);*/
525 } else if (obj2.isName()) {
526 - error(getPos(), const_cast<char*>("Unknown XObject subtype '%s'"), obj2.getName());
527 + error(errInternal, getPos(), const_cast<char*>("Unknown XObject subtype '%s'"), obj2.getName());
528 } else {
529 - error(getPos(), const_cast<char*>("XObject subtype is missing or wrong type"));
530 + error(errInternal, getPos(), const_cast<char*>("XObject subtype is missing or wrong type"));
531 }
532 obj2.free();
533 obj1.free();
534 @@ -2559,11 +2517,7 @@
535 }
536 }
537 if (!obj1.isNull()) {
538 -#ifdef POPPLER_NEW_COLOR_SPACE_API
539 colorSpace = GfxColorSpace::parse(&obj1, NULL);
540 -#else
541 - colorSpace = GfxColorSpace::parse(&obj1);
542 -#endif
543 } else if (csMode == streamCSDeviceGray) {
544 colorSpace = new GfxDeviceGrayColorSpace();
545 } else if (csMode == streamCSDeviceRGB) {
546 @@ -2648,11 +2602,7 @@
547 obj2.free();
548 }
549 }
550 -#ifdef POPPLER_NEW_COLOR_SPACE_API
551 maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
552 -#else
553 - maskColorSpace = GfxColorSpace::parse(&obj1);
554 -#endif
555 obj1.free();
556 if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
557 goto err1;
558 @@ -2758,7 +2708,7 @@
559 err2:
560 obj1.free();
561 err1:
562 - error(getPos(), const_cast<char*>("Bad image parameters"));
563 + error(errInternal, getPos(), const_cast<char*>("Bad image parameters"));
564 }
565
566 void PdfParser::doForm(Object *str) {
567 @@ -2783,7 +2733,7 @@
568 // check form type
569 dict->lookup(const_cast<char*>("FormType"), &obj1);
570 if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
571 - error(getPos(), const_cast<char*>("Unknown form type"));
572 + error(errInternal, getPos(), const_cast<char*>("Unknown form type"));
573 }
574 obj1.free();
575
576 @@ -2791,7 +2741,7 @@
577 dict->lookup(const_cast<char*>("BBox"), &bboxObj);
578 if (!bboxObj.isArray()) {
579 bboxObj.free();
580 - error(getPos(), const_cast<char*>("Bad form bounding box"));
581 + error(errInternal, getPos(), const_cast<char*>("Bad form bounding box"));
582 return;
583 }
584 for (i = 0; i < 4; ++i) {
585 @@ -2827,11 +2777,7 @@
586 if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
587 transpGroup = gTrue;
588 if (!obj1.dictLookup(const_cast<char*>("CS"), &obj3)->isNull()) {
589 -#ifdef POPPLER_NEW_COLOR_SPACE_API
590 blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);
591 -#else
592 - blendingColorSpace = GfxColorSpace::parse(&obj3);
593 -#endif
594 }
595 obj3.free();
596 if (obj1.dictLookup(const_cast<char*>("I"), &obj3)->isBool()) {
597 @@ -2990,7 +2936,7 @@
598 parser->getObj(&obj);
599 while (!obj.isCmd(const_cast<char*>("ID")) && !obj.isEOF()) {
600 if (!obj.isName()) {
601 - error(getPos(), const_cast<char*>("Inline image dictionary key must be a name object"));
602 + error(errInternal, getPos(), const_cast<char*>("Inline image dictionary key must be a name object"));
603 obj.free();
604 } else {
605 key = copyString(obj.getName());
606 @@ -3005,7 +2951,7 @@
607 parser->getObj(&obj);
608 }
609 if (obj.isEOF()) {
610 - error(getPos(), const_cast<char*>("End of file in inline image"));
611 + error(errInternal, getPos(), const_cast<char*>("End of file in inline image"));
612 obj.free();
613 dict.free();
614 return NULL;
615 @@ -3020,11 +2966,11 @@
616 }
617
618 void PdfParser::opImageData(Object args[], int numArgs) {
619 - error(getPos(), const_cast<char*>("Internal: got 'ID' operator"));
620 + error(errInternal, getPos(), const_cast<char*>("Internal: got 'ID' operator"));
621 }
622
623 void PdfParser::opEndImage(Object args[], int numArgs) {
624 - error(getPos(), const_cast<char*>("Internal: got 'EI' operator"));
625 + error(errInternal, getPos(), const_cast<char*>("Internal: got 'EI' operator"));
626 }
627
628 //------------------------------------------------------------------------
629 diff -Naur old/src/extension/internal/pdfinput/svg-builder.cpp new/src/extension/internal/pdfinput/svg-builder.cpp
630 --- old/src/extension/internal/pdfinput/svg-builder.cpp 2011-07-08 20:25:09.468790000 +0200
631 +++ new/src/extension/internal/pdfinput/svg-builder.cpp 2012-05-13 20:45:22.303804308 +0200
632 @@ -961,9 +961,7 @@
633 _font_style = sp_repr_css_attr_new();
634 GfxFont *font = state->getFont();
635 // Store original name
636 - if (font->getOrigName()) {
637 - _font_specification = font->getOrigName()->getCString();
638 - } else if (font->getName()) {
639 + if (font->getName()) {
640 _font_specification = font->getName()->getCString();
641 } else {
642 _font_specification = (char*) "Arial";
|