Package: inkscape
Version: 0.48.3.1-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch

Dear Maintainer,

We are using this patch in Ubuntu to handle the changes in libpoppler's
API version 19 to version 25/26.  Please consider for Debian.

  * Follow ABI changes for libpoppler25 (poppler 0.20.0-0ubuntu1).
    (LP: #1005565)

Thanks for considering the patch.

-apw

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 
'precise-proposed'), (500, 'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-26-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u inkscape-0.48.3.1/debian/changelog inkscape-0.48.3.1/debian/changelog
diff -u inkscape-0.48.3.1/debian/patches/series inkscape-0.48.3.1/debian/patches/series
--- inkscape-0.48.3.1/debian/patches/series
+++ inkscape-0.48.3.1/debian/patches/series
@@ -3,0 +4,2 @@
+03_track_libpoppler25_abi_changes.patch
+04_track_libpoppler25_abi_changes_colorspace.patch
only in patch2:
unchanged:
--- inkscape-0.48.3.1.orig/debian/patches/03_track_libpoppler25_abi_changes.patch
+++ inkscape-0.48.3.1/debian/patches/03_track_libpoppler25_abi_changes.patch
@@ -0,0 +1,438 @@
+Description: follow changes to libpoppler25 API
+ Following change to the libpoppler25 API:
+ .
+ error() now takes an additional ErrorCategory arguement.
+ getOrigName() is now gone getName() returns the original name now.
+Author: Andy Whitcroft <a...@ubuntu.com>
+Last-Update: 2012-06-11
+Index: inkscape-0.48.3.1/src/extension/internal/pdfinput/pdf-parser.cpp
+===================================================================
+--- inkscape-0.48.3.1.orig/src/extension/internal/pdfinput/pdf-parser.cpp	2012-06-11 11:39:28.108316853 +0100
++++ inkscape-0.48.3.1/src/extension/internal/pdfinput/pdf-parser.cpp	2012-06-11 11:59:56.558408413 +0100
+@@ -367,14 +367,14 @@
+     for (i = 0; i < obj->arrayGetLength(); ++i) {
+       obj->arrayGet(i, &obj2);
+       if (!obj2.isStream()) {
+-	error(-1, const_cast<char*>("Weird page contents"));
++	error(errUnimplemented, -1, const_cast<char*>("Weird page contents"));
+ 	obj2.free();
+ 	return;
+       }
+       obj2.free();
+     }
+   } else if (!obj->isStream()) {
+-    error(-1, const_cast<char*>("Weird page contents"));
++    error(errUnimplemented, -1, const_cast<char*>("Weird page contents"));
+     return;
+   }
+   parser = new Parser(xref, new Lexer(xref, obj), gFalse);
+@@ -419,7 +419,7 @@
+ 
+     // too many arguments - something is wrong
+     } else {
+-      error(getPos(), const_cast<char*>("Too many args in content stream"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Too many args in content stream"));
+       if (printCommands) {
+ 	printf("throwing away arg: ");
+ 	obj.print(stdout);
+@@ -436,7 +436,7 @@
+ 
+   // args at end with no command
+   if (numArgs > 0) {
+-    error(getPos(), const_cast<char*>("Leftover args in content stream"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Leftover args in content stream"));
+     if (printCommands) {
+       printf("%d leftovers:", numArgs);
+       for (i = 0; i < numArgs; ++i) {
+@@ -502,7 +502,7 @@
+   name = cmd->getCmd();
+   if (!(op = findOp(name))) {
+     if (ignoreUndef == 0)
+-      error(getPos(), const_cast<char*>("Unknown operator '%s'"), name);
++      error(errSyntaxError, getPos(), const_cast<char*>("Unknown operator '%s'"), name);
+     return;
+   }
+ 
+@@ -510,7 +510,7 @@
+   argPtr = args;
+   if (op->numArgs >= 0) {
+     if (numArgs < op->numArgs) {
+-      error(getPos(), const_cast<char*>("Too few (%d) args to '%s' operator"), numArgs, name);
++      error(errSyntaxError, getPos(), const_cast<char*>("Too few (%d) args to '%s' operator"), numArgs, name);
+       return;
+     }
+     if (numArgs > op->numArgs) {
+@@ -522,14 +522,14 @@
+     }
+   } else {
+     if (numArgs > -op->numArgs) {
+-      error(getPos(), const_cast<char*>("Too many (%d) args to '%s' operator"),
++      error(errSyntaxError, getPos(), const_cast<char*>("Too many (%d) args to '%s' operator"),
+ 	    numArgs, name);
+       return;
+     }
+   }
+   for (i = 0; i < numArgs; ++i) {
+     if (!checkArg(&argPtr[i], op->tchk[i])) {
+-      error(getPos(), const_cast<char*>("Arg #%d to '%s' operator is wrong type (%s)"),
++      error(errSyntaxError, getPos(), const_cast<char*>("Arg #%d to '%s' operator is wrong type (%s)"),
+ 	    i, name, argPtr[i].getTypeName());
+       return;
+     }
+@@ -690,7 +690,7 @@
+     return;
+   }
+   if (!obj1.isDict()) {
+-    error(getPos(), const_cast<char*>("ExtGState '%s' is wrong type"), args[0].getName());
++    error(errSyntaxError, getPos(), const_cast<char*>("ExtGState '%s' is wrong type"), args[0].getName());
+     obj1.free();
+     return;
+   }
+@@ -705,7 +705,7 @@
+     if (state->parseBlendMode(&obj2, &mode)) {
+       state->setBlendMode(mode);
+     } else {
+-      error(getPos(), const_cast<char*>("Invalid blend mode in ExtGState"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Invalid blend mode in ExtGState"));
+     }
+   }
+   obj2.free();
+@@ -764,7 +764,7 @@
+       state->setTransfer(funcs);
+     }
+   } else if (!obj2.isNull()) {
+-    error(getPos(), const_cast<char*>("Invalid transfer function in ExtGState"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Invalid transfer function in ExtGState"));
+   }
+   obj2.free();
+ 
+@@ -784,7 +784,7 @@
+ 	funcs[0] = Function::parse(&obj3);
+ 	if (funcs[0]->getInputSize() != 1 ||
+ 	    funcs[0]->getOutputSize() != 1) {
+-	  error(getPos(),
++	  error(errSyntaxError, getPos(),
+ 		const_cast<char*>("Invalid transfer function in soft mask in ExtGState"));
+ 	  delete funcs[0];
+ 	  funcs[0] = NULL;
+@@ -840,15 +840,15 @@
+ 	    delete funcs[0];
+ 	  }
+ 	} else {
+-	  error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
++	  error(errSyntaxError, getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
+ 	}
+ 	obj4.free();
+       } else {
+-	error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
++	error(errSyntaxError, getPos(), const_cast<char*>("Invalid soft mask in ExtGState - missing group"));
+       }
+       obj3.free();
+     } else if (!obj2.isNull()) {
+-      error(getPos(), const_cast<char*>("Invalid soft mask in ExtGState"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Invalid soft mask in ExtGState"));
+     }
+   }
+   obj2.free();
+@@ -876,7 +876,7 @@
+   // check form type
+   dict->lookup(const_cast<char*>("FormType"), &obj1);
+   if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
+-    error(getPos(), const_cast<char*>("Unknown form type"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Unknown form type"));
+   }
+   obj1.free();
+ 
+@@ -884,7 +884,7 @@
+   dict->lookup(const_cast<char*>("BBox"), &obj1);
+   if (!obj1.isArray()) {
+     obj1.free();
+-    error(getPos(), const_cast<char*>("Bad form bounding box"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Bad form bounding box"));
+     return;
+   }
+   for (i = 0; i < 4; ++i) {
+@@ -1032,7 +1032,7 @@
+     state->setFillColor(&color);
+     builder->updateStyle(state);
+   } else {
+-    error(getPos(), const_cast<char*>("Bad color space (fill)"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Bad color space (fill)"));
+   }
+ }
+ 
+@@ -1063,7 +1063,7 @@
+     state->setStrokeColor(&color);
+     builder->updateStyle(state);
+   } else {
+-    error(getPos(), const_cast<char*>("Bad color space (stroke)"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Bad color space (stroke)"));
+   }
+ }
+ 
+@@ -1072,7 +1072,7 @@
+   int i;
+ 
+   if (numArgs != state->getFillColorSpace()->getNComps()) {
+-    error(getPos(), const_cast<char*>("Incorrect number of arguments in 'sc' command"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'sc' command"));
+     return;
+   }
+   state->setFillPattern(NULL);
+@@ -1088,7 +1088,7 @@
+   int i;
+ 
+   if (numArgs != state->getStrokeColorSpace()->getNComps()) {
+-    error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SC' command"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'SC' command"));
+     return;
+   }
+   state->setStrokePattern(NULL);
+@@ -1109,7 +1109,7 @@
+       if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
+ 	  numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
+ 	                     ->getUnder()->getNComps()) {
+-	error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
++	error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
+ 	return;
+       }
+       for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
+@@ -1136,7 +1136,7 @@
+ 
+   } else {
+     if (numArgs != state->getFillColorSpace()->getNComps()) {
+-      error(getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'scn' command"));
+       return;
+     }
+     state->setFillPattern(NULL);
+@@ -1161,7 +1161,7 @@
+ 	       ->getUnder() ||
+ 	  numArgs - 1 != ((GfxPatternColorSpace *)state->getStrokeColorSpace())
+ 	                     ->getUnder()->getNComps()) {
+-	error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
++	error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
+ 	return;
+       }
+       for (i = 0; i < numArgs - 1 && i < gfxColorMaxComps; ++i) {
+@@ -1188,7 +1188,7 @@
+ 
+   } else {
+     if (numArgs != state->getStrokeColorSpace()->getNComps()) {
+-      error(getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Incorrect number of arguments in 'SCN' command"));
+       return;
+     }
+     state->setStrokePattern(NULL);
+@@ -1212,7 +1212,7 @@
+ 
+ void PdfParser::opLineTo(Object args[], int numArgs) {
+   if (!state->isCurPt()) {
+-    error(getPos(), const_cast<char*>("No current point in lineto"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No current point in lineto"));
+     return;
+   }
+   state->lineTo(args[0].getNum(), args[1].getNum());
+@@ -1222,7 +1222,7 @@
+   double x1, y1, x2, y2, x3, y3;
+ 
+   if (!state->isCurPt()) {
+-    error(getPos(), const_cast<char*>("No current point in curveto"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No current point in curveto"));
+     return;
+   }
+   x1 = args[0].getNum();
+@@ -1238,7 +1238,7 @@
+   double x1, y1, x2, y2, x3, y3;
+ 
+   if (!state->isCurPt()) {
+-    error(getPos(), const_cast<char*>("No current point in curveto1"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No current point in curveto1"));
+     return;
+   }
+   x1 = state->getCurX();
+@@ -1254,7 +1254,7 @@
+   double x1, y1, x2, y2, x3, y3;
+ 
+   if (!state->isCurPt()) {
+-    error(getPos(), const_cast<char*>("No current point in curveto2"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No current point in curveto2"));
+     return;
+   }
+   x1 = args[0].getNum();
+@@ -1282,7 +1282,7 @@
+ 
+ void PdfParser::opClosePath(Object args[], int numArgs) {
+   if (!state->isCurPt()) {
+-    error(getPos(), const_cast<char*>("No current point in closepath"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No current point in closepath"));
+     return;
+   }
+   state->closePath();
+@@ -1440,7 +1440,7 @@
+     doShadingPatternFillFallback((GfxShadingPattern *)pattern, gFalse, eoFill);
+     break;
+   default:
+-    error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in fill"),
++    error(errUnimplemented, getPos(), const_cast<char*>("Unimplemented pattern type (%d) in fill"),
+ 	  pattern->getType());
+     break;
+   }
+@@ -1459,7 +1459,7 @@
+     doShadingPatternFillFallback((GfxShadingPattern *)pattern, gTrue, gFalse);
+     break;
+   default:
+-    error(getPos(), const_cast<char*>("Unimplemented pattern type (%d) in stroke"),
++    error(errUnimplemented, getPos(), const_cast<char*>("Unimplemented pattern type (%d) in stroke"),
+ 	  pattern->getType());
+     break;
+   }
+@@ -2156,7 +2156,7 @@
+ 
+ void PdfParser::opShowText(Object args[], int numArgs) {
+   if (!state->getFont()) {
+-    error(getPos(), const_cast<char*>("No font in show"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No font in show"));
+     return;
+   }
+   if (fontChanged) {
+@@ -2170,7 +2170,7 @@
+   double tx, ty;
+ 
+   if (!state->getFont()) {
+-    error(getPos(), const_cast<char*>("No font in move/show"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No font in move/show"));
+     return;
+   }
+   if (fontChanged) {
+@@ -2188,7 +2188,7 @@
+   double tx, ty;
+ 
+   if (!state->getFont()) {
+-    error(getPos(), const_cast<char*>("No font in move/set/show"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No font in move/set/show"));
+     return;
+   }
+   if (fontChanged) {
+@@ -2211,7 +2211,7 @@
+   int i;
+ 
+   if (!state->getFont()) {
+-    error(getPos(), const_cast<char*>("No font in show/space"));
++    error(errSyntaxError, getPos(), const_cast<char*>("No font in show/space"));
+     return;
+   }
+   if (fontChanged) {
+@@ -2236,7 +2236,7 @@
+     } else if (obj.isString()) {
+       doShowText(obj.getString());
+     } else {
+-      error(getPos(), const_cast<char*>("Element of show/space array must be number or string"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Element of show/space array must be number or string"));
+     }
+     obj.free();
+   }
+@@ -2334,7 +2334,7 @@
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+-	  error(getPos(), const_cast<char*>("Missing or bad Type3 CharProc entry"));
++	  error(errSyntaxError, getPos(), const_cast<char*>("Missing or bad Type3 CharProc entry"));
+ 	}
+ 	//out->endType3Char(state);
+ 	if (resDict) {
+@@ -2410,7 +2410,7 @@
+     return;
+   }
+   if (!obj1.isStream()) {
+-    error(getPos(), const_cast<char*>("XObject '%s' is wrong type"), name);
++    error(errSyntaxError, getPos(), const_cast<char*>("XObject '%s' is wrong type"), name);
+     obj1.free();
+     return;
+   }
+@@ -2426,9 +2426,9 @@
+ /*    out->psXObject(obj1.getStream(),
+     		   obj3.isStream() ? obj3.getStream() : (Stream *)NULL);*/
+   } else if (obj2.isName()) {
+-    error(getPos(), const_cast<char*>("Unknown XObject subtype '%s'"), obj2.getName());
++    error(errSyntaxError, getPos(), const_cast<char*>("Unknown XObject subtype '%s'"), obj2.getName());
+   } else {
+-    error(getPos(), const_cast<char*>("XObject subtype is missing or wrong type"));
++    error(errSyntaxError, getPos(), const_cast<char*>("XObject subtype is missing or wrong type"));
+   }
+   obj2.free();
+   obj1.free();
+@@ -2758,7 +2758,7 @@
+  err2:
+   obj1.free();
+  err1:
+-  error(getPos(), const_cast<char*>("Bad image parameters"));
++  error(errSyntaxError, getPos(), const_cast<char*>("Bad image parameters"));
+ }
+ 
+ void PdfParser::doForm(Object *str) {
+@@ -2783,7 +2783,7 @@
+   // check form type
+   dict->lookup(const_cast<char*>("FormType"), &obj1);
+   if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) {
+-    error(getPos(), const_cast<char*>("Unknown form type"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Unknown form type"));
+   }
+   obj1.free();
+ 
+@@ -2791,7 +2791,7 @@
+   dict->lookup(const_cast<char*>("BBox"), &bboxObj);
+   if (!bboxObj.isArray()) {
+     bboxObj.free();
+-    error(getPos(), const_cast<char*>("Bad form bounding box"));
++    error(errSyntaxError, getPos(), const_cast<char*>("Bad form bounding box"));
+     return;
+   }
+   for (i = 0; i < 4; ++i) {
+@@ -2990,7 +2990,7 @@
+   parser->getObj(&obj);
+   while (!obj.isCmd(const_cast<char*>("ID")) && !obj.isEOF()) {
+     if (!obj.isName()) {
+-      error(getPos(), const_cast<char*>("Inline image dictionary key must be a name object"));
++      error(errSyntaxError, getPos(), const_cast<char*>("Inline image dictionary key must be a name object"));
+       obj.free();
+     } else {
+       key = copyString(obj.getName());
+@@ -3005,7 +3005,7 @@
+     parser->getObj(&obj);
+   }
+   if (obj.isEOF()) {
+-    error(getPos(), const_cast<char*>("End of file in inline image"));
++    error(errSyntaxError, getPos(), const_cast<char*>("End of file in inline image"));
+     obj.free();
+     dict.free();
+     return NULL;
+@@ -3020,11 +3020,11 @@
+ }
+ 
+ void PdfParser::opImageData(Object args[], int numArgs) {
+-  error(getPos(), const_cast<char*>("Internal: got 'ID' operator"));
++  error(errInternal, getPos(), const_cast<char*>("Internal: got 'ID' operator"));
+ }
+ 
+ void PdfParser::opEndImage(Object args[], int numArgs) {
+-  error(getPos(), const_cast<char*>("Internal: got 'EI' operator"));
++  error(errInternal, getPos(), const_cast<char*>("Internal: got 'EI' operator"));
+ }
+ 
+ //------------------------------------------------------------------------
+Index: inkscape-0.48.3.1/src/extension/internal/pdfinput/svg-builder.cpp
+===================================================================
+--- inkscape-0.48.3.1.orig/src/extension/internal/pdfinput/svg-builder.cpp	2011-07-08 19:25:09.468790000 +0100
++++ inkscape-0.48.3.1/src/extension/internal/pdfinput/svg-builder.cpp	2012-06-11 12:04:06.503647821 +0100
+@@ -961,9 +961,7 @@
+     _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";
only in patch2:
unchanged:
--- inkscape-0.48.3.1.orig/debian/patches/04_track_libpoppler25_abi_changes_colorspace.patch
+++ inkscape-0.48.3.1/debian/patches/04_track_libpoppler25_abi_changes_colorspace.patch
@@ -0,0 +1,165 @@
+Description: follow changes to libpoppler25 internal API
+ Following change to the libpoppler25 internal API:
+ .
+ GfxColorSpace::parse now takes a recursion counter.
+ .
+ NOTE: that upstream likely has to carry all three versions of this interface
+ waiting on upstream discussions on this to bottom out.
+Author: Andy Whitcroft <a...@ubuntu.com>
+Last-Update: 2012-06-11
+Index: inkscape-0.48.3.1/src/extension/internal/pdfinput/pdf-parser.cpp
+===================================================================
+--- inkscape-0.48.3.1.orig/src/extension/internal/pdfinput/pdf-parser.cpp	2012-06-11 12:58:22.691794385 +0100
++++ inkscape-0.48.3.1/src/extension/internal/pdfinput/pdf-parser.cpp	2012-06-11 19:18:25.952869656 +0100
+@@ -809,11 +809,7 @@
+ 	  blendingColorSpace = NULL;
+ 	  isolated = knockout = gFalse;
+ 	  if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+-	    blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
+-#else
+-	    blendingColorSpace = GfxColorSpace::parse(&obj5);
+-#endif
++	    blendingColorSpace = GfxColorSpace::parse(&obj5, NULL, 1);
+ 	  }
+ 	  obj5.free();
+ 	  if (obj4.dictLookup(const_cast<char*>("I"), &obj5)->isBool()) {
+@@ -1012,19 +1008,11 @@
+ 
+   state->setFillPattern(NULL);
+   res->lookupColorSpace(args[0].getName(), &obj);
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+   if (obj.isNull()) {
+-    colorSpace = GfxColorSpace::parse(&args[0], NULL);
++    colorSpace = GfxColorSpace::parse(&args[0], NULL, 1);
+   } else {
+-    colorSpace = GfxColorSpace::parse(&obj, NULL);
++    colorSpace = GfxColorSpace::parse(&obj, NULL, 1);
+   }
+-#else
+-  if (obj.isNull()) {
+-    colorSpace = GfxColorSpace::parse(&args[0]);
+-  } else {
+-    colorSpace = GfxColorSpace::parse(&obj);
+-  }
+-#endif
+   obj.free();
+   if (colorSpace) {
+     state->setFillColorSpace(colorSpace);
+@@ -1043,19 +1031,11 @@
+ 
+   state->setStrokePattern(NULL);
+   res->lookupColorSpace(args[0].getName(), &obj);
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+   if (obj.isNull()) {
+-    colorSpace = GfxColorSpace::parse(&args[0], NULL);
++    colorSpace = GfxColorSpace::parse(&args[0], NULL, 1);
+   } else {
+-    colorSpace = GfxColorSpace::parse(&obj, NULL);
++    colorSpace = GfxColorSpace::parse(&obj, NULL, 1);
+   }
+-#else
+-  if (obj.isNull()) {
+-    colorSpace = GfxColorSpace::parse(&args[0]);
+-  } else {
+-    colorSpace = GfxColorSpace::parse(&obj);
+-  }
+-#endif
+   obj.free();
+   if (colorSpace) {
+     state->setStrokeColorSpace(colorSpace);
+@@ -1120,19 +1100,11 @@
+       state->setFillColor(&color);
+       builder->updateStyle(state);
+     }
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+     if (args[numArgs-1].isName() &&
+ 	(pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
+       state->setFillPattern(pattern);
+       builder->updateStyle(state);
+     }
+-#else
+-    if (args[numArgs-1].isName() &&
+-	(pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+-      state->setFillPattern(pattern);
+-      builder->updateStyle(state);
+-    }
+-#endif
+ 
+   } else {
+     if (numArgs != state->getFillColorSpace()->getNComps()) {
+@@ -1172,19 +1144,11 @@
+       state->setStrokeColor(&color);
+       builder->updateStyle(state);
+     }
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+     if (args[numArgs-1].isName() &&
+ 	(pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
+       state->setStrokePattern(pattern);
+       builder->updateStyle(state);
+     }
+-#else
+-    if (args[numArgs-1].isName() &&
+-	(pattern = res->lookupPattern(args[numArgs-1].getName()))) {
+-      state->setStrokePattern(pattern);
+-      builder->updateStyle(state);
+-    }
+-#endif
+ 
+   } else {
+     if (numArgs != state->getStrokeColorSpace()->getNComps()) {
+@@ -1579,15 +1543,9 @@
+   double *matrix = NULL;
+   GBool savedState = gFalse;
+ 
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+   if (!(shading = res->lookupShading(args[0].getName(), NULL))) {
+     return;
+   }
+-#else
+-  if (!(shading = res->lookupShading(args[0].getName()))) {
+-    return;
+-  }
+-#endif
+ 
+   // save current graphics state
+   if (shading->getType() != 2 && shading->getType() != 3) {
+@@ -2559,11 +2517,7 @@
+       }
+     }
+     if (!obj1.isNull()) {
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+-      colorSpace = GfxColorSpace::parse(&obj1, NULL);
+-#else
+-      colorSpace = GfxColorSpace::parse(&obj1);
+-#endif
++      colorSpace = GfxColorSpace::parse(&obj1, NULL, 1);
+     } else if (csMode == streamCSDeviceGray) {
+       colorSpace = new GfxDeviceGrayColorSpace();
+     } else if (csMode == streamCSDeviceRGB) {
+@@ -2648,11 +2602,7 @@
+ 	  obj2.free();
+ 	}
+       }
+-#ifdef POPPLER_NEW_COLOR_SPACE_API
+-      maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
+-#else
+-      maskColorSpace = GfxColorSpace::parse(&obj1);
+-#endif
++      maskColorSpace = GfxColorSpace::parse(&obj1, NULL, 1);
+       obj1.free();
+       if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
+ 	goto err1;
+@@ -2827,11 +2777,7 @@
+     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
+-	blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);
+-#else
+-	blendingColorSpace = GfxColorSpace::parse(&obj3);
+-#endif
++	blendingColorSpace = GfxColorSpace::parse(&obj3, NULL, 1);
+       }
+       obj3.free();
+       if (obj1.dictLookup(const_cast<char*>("I"), &obj3)->isBool()) {

Reply via email to