head 1.24; access; symbols pkgsrc-2025Q4:1.23.0.4 pkgsrc-2025Q4-base:1.23 pkgsrc-2025Q3:1.23.0.2 pkgsrc-2025Q3-base:1.23 pkgsrc-2025Q1:1.21.0.4 pkgsrc-2025Q1-base:1.21 pkgsrc-2024Q4:1.21.0.2 pkgsrc-2024Q4-base:1.21 pkgsrc-2022Q4:1.19.0.4 pkgsrc-2022Q4-base:1.19 pkgsrc-2022Q3:1.19.0.2 pkgsrc-2022Q3-base:1.19 pkgsrc-2022Q2:1.17.0.2 pkgsrc-2022Q2-base:1.17 pkgsrc-2021Q4:1.15.0.2 pkgsrc-2021Q4-base:1.15 pkgsrc-2020Q1:1.13.0.2 pkgsrc-2020Q1-base:1.13 pkgsrc-2019Q4:1.12.0.4 pkgsrc-2019Q4-base:1.12 pkgsrc-2019Q3:1.11.0.4 pkgsrc-2019Q3-base:1.11 pkgsrc-2019Q2:1.11.0.2 pkgsrc-2019Q2-base:1.11 pkgsrc-2019Q1:1.10.0.2 pkgsrc-2019Q1-base:1.10 pkgsrc-2018Q4:1.9.0.2 pkgsrc-2018Q4-base:1.9 pkgsrc-2018Q3:1.8.0.4 pkgsrc-2018Q3-base:1.8 pkgsrc-2018Q2:1.8.0.2 pkgsrc-2018Q2-base:1.8 pkgsrc-2018Q1:1.6.0.8 pkgsrc-2018Q1-base:1.6 pkgsrc-2017Q4:1.6.0.6 pkgsrc-2017Q4-base:1.6 pkgsrc-2017Q3:1.6.0.4 pkgsrc-2017Q3-base:1.6 pkgsrc-2017Q2:1.5.0.20 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.18 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.16 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.14 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.12 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.10 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.8 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.6 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.4 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.2 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.3.0.4 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.2 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.2.0.2 pkgsrc-2014Q2-base:1.2 pkgsrc-2014Q1:1.1.0.12 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.10 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.8 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.6 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.4 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.2 pkgsrc-2012Q4-base:1.1; locks; strict; comment @// @; 1.24 date 2026.02.01.07.09.03; author ryoon; state dead; branches; next 1.23; commitid CHph8d0We4fBUDsG; 1.23 date 2025.07.13.08.17.38; author wiz; state Exp; branches; next 1.22; commitid YgcCHv4yrrRyOy2G; 1.22 date 2025.05.16.23.05.04; author ryoon; state dead; branches; next 1.21; commitid LXahCmDpQYFIAbVF; 1.21 date 2024.10.22.09.00.10; author wiz; state Exp; branches; next 1.20; commitid wokVmup8zQ5hxDuF; 1.20 date 2023.02.02.15.26.55; author tnn; state dead; branches; next 1.19; commitid 5ebBwCMLri2sRXbE; 1.19 date 2022.09.04.07.55.02; author martin; state Exp; branches; next 1.18; commitid OmFfEnsfJPdzdwSD; 1.18 date 2022.07.25.19.42.33; author wiz; state dead; branches; next 1.17; commitid DHsElsnzFJhUrjND; 1.17 date 2022.05.04.21.13.52; author wiz; state Exp; branches; next 1.16; commitid AbfqkhayyjRGAMCD; 1.16 date 2022.03.02.02.28.04; author ryoon; state dead; branches; next 1.15; commitid UaQY9FWg7tZ2oAuD; 1.15 date 2021.11.07.21.28.48; author wiz; state Exp; branches; next 1.14; commitid RNJNt5GI6JxzoUfD; 1.14 date 2020.05.06.01.42.28; author ryoon; state dead; branches; next 1.13; commitid lHDT3lJqQW8Gv77C; 1.13 date 2020.01.11.09.59.06; author martin; state Exp; branches; next 1.12; commitid lygwVa9nlHNbZfSB; 1.12 date 2019.11.23.09.23.22; author martin; state Exp; branches; next 1.11; commitid kCvsydjYP4lAmXLB; 1.11 date 2019.05.13.16.17.51; author adam; state Exp; branches; next 1.10; commitid Dulxr6nnyWckT3nB; 1.10 date 2019.01.06.08.41.01; author markd; state Exp; branches; next 1.9; commitid DBw7oQYE6Tt4qH6B; 1.9 date 2018.12.21.08.46.16; author wiz; state Exp; branches; next 1.8; commitid mMjhVy3HWmnsZD4B; 1.8 date 2018.06.21.10.25.35; author wiz; state Exp; branches; next 1.7; commitid IL8rIaDsbLwfq8HA; 1.7 date 2018.05.01.06.17.11; author wiz; state Exp; branches; next 1.6; commitid gzv1I5HIg2mGGyAA; 1.6 date 2017.09.09.21.48.56; author prlw1; state Exp; branches; next 1.5; commitid Q34tj0I9aDGxmz6A; 1.5 date 2015.02.03.13.55.12; author adam; state Exp; branches; next 1.4; commitid M8b2igoS0yKjfz8y; 1.4 date 2015.01.08.16.34.29; author wiz; state Exp; branches; next 1.3; commitid g7EX7skPU2hQXe5y; 1.3 date 2014.07.29.07.03.27; author adam; state Exp; branches; next 1.2; commitid AhB1pIUYhFmK2fKx; 1.2 date 2014.04.30.06.15.20; author wiz; state Exp; branches; next 1.1; commitid gHO0mb926hfGFFyx; 1.1 date 2012.12.30.10.31.14; author adam; state Exp; branches; next ; desc @@ 1.24 log @graphics/inkscape: Update to 1.4.3 Changelog: 1.4.3: Released on December 26, 2025. Inkscape 1.4.3 is maintenance and bugfix release, which brings you fixes for many critical or irritating bugs, and even a few new features. It is also a bridge release in the sense that it can be used to convert the planned Inkscape 1.5 multipage file format to the pre-1.5 multipage format. Versions lower than Inkscape 1.4.3 will not be able to interpret pages created in Inkscape versions 1.5 and upwards. Opening a document in Inkscape 1.4.3 and saving it will convert it to the current ('old') page format (MR #7608). Background: While the 'old' format of pages in Inkscape is a custom addition that only works in Inkscape, the new format will make use of the svg:view element, which is standardized and can work in other SVG viewers, too. Find more information about this in MR #7525. The most important fixes and changes in this release are: * 24 crash/freeze fixes many of which prevented users from opening certain files or exporting certain objects with Inkscape 1.4.2 * almost 100 bug fixes and small improvements, among them: + JPEG/JPG export works again on Windows. + The problem with user interface text showing up as rectangles ('tofu') instead of letters if certain fonts are installed on macOS is finally resolved. + Ungrouping big groups is faster again. + All pasting options ('on page', 'width'/'height'/'size'/??) are now accessible from the right-click menu on canvas. + The Measure tool snaps again at its end point, so you can make accurate measurements again. + The LPE dialog now offers to convert Line, Polyline or Polygon SVG objects to paths before applying a path effect to them + When resizing the Inkscape window, the buttons in the Commands bar (copy, paste, open, dialog shortcuts) show up one by one instead of waiting for the window to get big enough to show the second half at once. + When converting strokes to paths, patterns and gradients are no longer lost. + Aligning on a circle or arc now works more reliably. + Text on Path now also works with rectangles. + Many improvements have been made to the PDF import. + Results from path operations no longer end up at the bottom of the object stack unexpectedly and the Split Path operation has learnt to better handle nested shapes. + The current layer by default is now the one where you have last selected an object (might need a preferences reset to apply). + Whether the current page is changed when you select an object on it has been made optional. + You can now make small changes to how Inkscape looks without needing to modify the full theme file. + The bug that sometimes made it impossible to make gradients and patterns fully opaque has been prevented from reaching adulthood (it has been around since 2007!). * and 25 updated interface languages as well as 13 updated documentation languages! Read all about Inkscape 1.4.3 in the release notes! Known Issues If you're experiencing a crash when dragging a dialog tab on Linux while using Wayland, you can work around that by starting Inkscape with the command GDK_BACKEND=x11 inkscape. Learn more If certain PDF files crash Inkscape when trying to load them, you can try to workaround the issue by downloading Inkscape 1.4.2 and using that to open and convert them to SVG before working with them. Learn more @ text @$NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.23 2025/07/13 08:17:38 wiz Exp $ Fix build with poppler 25.7.0 https://gitlab.com/inkscape/inkscape/-/commit/ce52c5f96106ae5747171663a46831f21aa52d95 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2025-07-12 23:26:27.013152690 +0000 +++ src/extension/internal/pdfinput/pdf-parser.cpp @@@@ -27,6 +27,7 @@@@ #include #include #include +#include #include // std::call_once() #include #include @@@@ -686,7 +687,6 @@@@ void PdfParser::opSetLineWidth(Object ar void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) { Object obj1, obj2, obj3, obj4, obj5; - Function *funcs[4] = {nullptr, nullptr, nullptr, nullptr}; GfxColor backdropColor; GBool haveBackdropColor = gFalse; GBool alpha = gFalse; @@@@ -744,13 +744,14 @@@@ void PdfParser::opSetExtGState(Object ar state->setLineWidth(obj2.getNum()); } + _POPPLER_DECLARE_TRANSFER_FUNCTION_VECTOR(funcs); + // transfer function if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "TR2").isNull()) { _POPPLER_CALL_ARGS(obj2, obj1.dictLookup, "TR"); } if (obj2.isName(const_cast("Default")) || obj2.isName(const_cast("Identity"))) { - funcs[0] = funcs[1] = funcs[2] = funcs[3] = nullptr; - state->setTransfer(funcs); + state->setTransfer(std::move(funcs)); } else if (obj2.isArray() && obj2.arrayGetLength() == 4) { int pos = 4; for (int i = 0; i < 4; ++i) { @@@@ -763,12 +764,14 @@@@ void PdfParser::opSetExtGState(Object ar } _POPPLER_FREE(obj3); if (pos == 4) { - state->setTransfer(funcs); + state->setTransfer(std::move(funcs)); } } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) { if ((funcs[0] = Function::parse(&obj2))) { - funcs[1] = funcs[2] = funcs[3] = nullptr; - state->setTransfer(funcs); + funcs[1] = nullptr; + funcs[2] = nullptr; + funcs[3] = nullptr; + state->setTransfer(std::move(funcs)); } } else if (!obj2.isNull()) { error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState"); @@@@ -790,8 +793,7 @@@@ void PdfParser::opSetExtGState(Object ar funcs[0] = Function::parse(&obj3); if (funcs[0]->getInputSize() != 1 || funcs[0]->getOutputSize() != 1) { error(errSyntaxError, getPos(), "Invalid transfer function in soft mask in ExtGState"); - delete funcs[0]; - funcs[0] = nullptr; + _POPPLER_DELETE_TRANSFER_FUNCTION(funcs[0]); } } _POPPLER_FREE(obj3); @@@@ -835,9 +837,10 @@@@ void PdfParser::opSetExtGState(Object ar } } } - doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, funcs[0], &backdropColor); + doSoftMask(&obj3, alpha, blendingColorSpace.get(), isolated, knockout, + _POPPLER_GET_TRANSFER_FUNCTION_POINTER(funcs[0]), &backdropColor); if (funcs[0]) { - delete funcs[0]; + _POPPLER_DELETE_TRANSFER_FUNCTION(funcs[0]); } } else { error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); @@@@ -2312,11 +2315,11 @@@@ void PdfParser::doShowText(GooString *s) state->textTransformDelta(originX, originY, &tOriginX, &tOriginY); // In Gfx.cc this is drawChar(...) - builder->addChar(state, state->getCurX() + riseX, state->getCurY() + riseY, + builder->addChar(state, state->_POPPLER_GET_CUR_TEXT_X() + riseX, state->_POPPLER_GET_CUR_TEXT_Y() + riseY, dx, dy, ax, ay, tOriginX, tOriginY, code, n, u, uLen); // Move onto next unicode character. - state->shift(tdx, tdy); + state->_POPPLER_TEXT_SHIFT_WITH_USER_COORDS(tdx, tdy); p += n; len -= n; } @ 1.23 log @*: recursive bump for poppler 25.07.0 inkscape: fix build using upstream patches @ text @d1 1 a1 1 $NetBSD$ @ 1.22 log @graphics/inkscape: Update to 1.4.2 Changelog: 1.4.2: The first minor release since Inkscape 1.4 is here! No worries, you didn't miss 1.4.1! Due to a signficant bug that was only discovered shortly before its planned release, 1.4.1 has been merged with 1.4.2. With lots of fixes, some smaller improvements and even a few new features around file format support, we believe it was well worth the wait. Here's a summary of what to expect from the new release: A new splash screen, providing a visual cue while Inkscape loads in the background Initial support for importing Vectornator / Linearity Curve files A new extension to Clean up Paths Substantially improved Affinity Designer files (.afdesign) import 20 crash/freeze fixes, many of which affected PDF import more than 50 other bug fixes and small improvements, including improvements to Boolean operations, layer selection, minimal window width and restoration of Spray tool buttons' functionality and 15 updated translations! @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.21 2024/10/22 09:00:10 wiz Exp $ d3 2 a4 2 Fix build with poppler 24.10.0. https://github.com/OpenMandrivaAssociation/inkscape/blob/master/inkscape-1.4-poppler-24.10.patch d6 1 a6 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2024-07-28 11:27:55.000000000 +0000 d8 18 a25 66 @@@@ -810,7 +810,7 @@@@ void PdfParser::opSetExtGState(Object ar _POPPLER_FREE(obj3); if (_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "G").isStream()) { if (_POPPLER_CALL_ARGS_DEREF(obj4, obj3.streamGetDict()->lookup, "Group").isDict()) { - GfxColorSpace *blendingColorSpace = nullptr; + std::unique_ptr blendingColorSpace = nullptr; GBool isolated = gFalse; GBool knockout = gFalse; if (!_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "CS").isNull()) { @@@@ -857,7 +857,7 @@@@ void PdfParser::opSetExtGState(Object ar } void PdfParser::doSoftMask(Object *str, GBool alpha, - GfxColorSpace *blendingColorSpace, + std::unique_ptr const &blendingColorSpace, GBool isolated, GBool knockout, Function *transferFunc, GfxColor *backdropColor) { Dict *dict, *resDict; @@@@ -920,9 +920,9 @@@@ void PdfParser::doSoftMask(Object *str, alpha, transferFunc, backdropColor); --formDepth; - if (blendingColorSpace) { - delete blendingColorSpace; - } +// if (blendingColorSpace) { +// delete blendingColorSpace; +// } _POPPLER_FREE(obj1); } @@@@ -936,41 +936,28 @@@@ void PdfParser::opSetRenderingIntent(Obj /** * Get a newly allocated color space instance by CS operation argument. - * - * Maintains a cache for named color spaces to avoid expensive re-parsing. */ -GfxColorSpace *PdfParser::lookupColorSpaceCopy(Object &arg) +std::unique_ptr PdfParser::lookupColorSpaceCopy(Object &arg) { assert(!arg.isNull()); - GfxColorSpace *colorSpace = nullptr; if (char const *name = arg.isName() ? arg.getName() : nullptr) { - auto const cache_name = std::to_string(formDepth) + "-" + name; - if ((colorSpace = colorSpacesCache[cache_name].get())) { - return colorSpace->copy(); - } - Object obj = res->lookupColorSpace(name); if (obj.isNull()) { - colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state); + return GfxColorSpace::parse(res, &arg, nullptr, state); } else { - colorSpace = GfxColorSpace::parse(res, &obj, nullptr, state); - } - - if (colorSpace && colorSpace->getMode() != csPattern) { - colorSpacesCache[cache_name].reset(colorSpace->copy()); + return GfxColorSpace::parse(res, &obj, nullptr, state); } } else { // We were passed in an object directly. - colorSpace = GfxColorSpace::parse(res, &arg, nullptr, state); + return GfxColorSpace::parse(res, &arg, nullptr, state); a26 2 - return colorSpace; } d28 5 a32 96 /** * Look up pattern/gradients from the GfxResource dictionary */ -GfxPattern *PdfParser::lookupPattern(Object *obj, GfxState *state) +std::unique_ptr PdfParser::lookupPattern(Object *obj, GfxState *state) { if (!obj->isName()) return nullptr; @@@@ -983,7 +970,7 @@@@ void PdfParser::opSetFillGray(Object arg GfxColor color; builder->beforeStateChange(state); state->setFillPattern(nullptr); - state->setFillColorSpace(new GfxDeviceGrayColorSpace()); + state->setFillColorSpace(std::unique_ptr(new GfxDeviceGrayColorSpace())); color.c[0] = dblToCol(args[0].getNum()); state->setFillColor(&color); builder->updateStyle(state); @@@@ -995,7 +982,7 @@@@ void PdfParser::opSetStrokeGray(Object a GfxColor color; builder->beforeStateChange(state); state->setStrokePattern(nullptr); - state->setStrokeColorSpace(new GfxDeviceGrayColorSpace()); + state->setStrokeColorSpace(std::unique_ptr(new GfxDeviceGrayColorSpace())); color.c[0] = dblToCol(args[0].getNum()); state->setStrokeColor(&color); builder->updateStyle(state); @@@@ -1008,7 +995,7 @@@@ void PdfParser::opSetFillCMYKColor(Objec int i; builder->beforeStateChange(state); state->setFillPattern(nullptr); - state->setFillColorSpace(new GfxDeviceCMYKColorSpace()); + state->setFillColorSpace(std::unique_ptr(new GfxDeviceCMYKColorSpace())); for (i = 0; i < 4; ++i) { color.c[i] = dblToCol(args[i].getNum()); } @@@@ -1022,7 +1009,7 @@@@ void PdfParser::opSetStrokeCMYKColor(Obj GfxColor color; builder->beforeStateChange(state); state->setStrokePattern(nullptr); - state->setStrokeColorSpace(new GfxDeviceCMYKColorSpace()); + state->setStrokeColorSpace(std::unique_ptr(new GfxDeviceCMYKColorSpace())); for (int i = 0; i < 4; ++i) { color.c[i] = dblToCol(args[i].getNum()); } @@@@ -1036,7 +1023,7 @@@@ void PdfParser::opSetFillRGBColor(Object GfxColor color; builder->beforeStateChange(state); state->setFillPattern(nullptr); - state->setFillColorSpace(new GfxDeviceRGBColorSpace()); + state->setFillColorSpace(std::unique_ptr(new GfxDeviceRGBColorSpace())); for (int i = 0; i < 3; ++i) { color.c[i] = dblToCol(args[i].getNum()); } @@@@ -1049,7 +1036,7 @@@@ void PdfParser::opSetStrokeRGBColor(Obje GfxColor color; builder->beforeStateChange(state); state->setStrokePattern(nullptr); - state->setStrokeColorSpace(new GfxDeviceRGBColorSpace()); + state->setStrokeColorSpace(std::unique_ptr(new GfxDeviceRGBColorSpace())); for (int i = 0; i < 3; ++i) { color.c[i] = dblToCol(args[i].getNum()); } @@@@ -1061,13 +1048,13 @@@@ void PdfParser::opSetStrokeRGBColor(Obje void PdfParser::opSetFillColorSpace(Object args[], int numArgs) { assert(numArgs >= 1); - GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]); + std::unique_ptr colorSpace = lookupColorSpaceCopy(args[0]); builder->beforeStateChange(state); state->setFillPattern(nullptr); if (colorSpace) { GfxColor color; - state->setFillColorSpace(colorSpace); + state->setFillColorSpace(colorSpace->copy()); colorSpace->getDefaultColor(&color); state->setFillColor(&color); builder->updateStyle(state); @@@@ -1082,13 +1069,13 @@@@ void PdfParser::opSetStrokeColorSpace(Ob assert(numArgs >= 1); builder->beforeStateChange(state); - GfxColorSpace *colorSpace = lookupColorSpaceCopy(args[0]); + std::unique_ptr colorSpace = lookupColorSpaceCopy(args[0]); state->setStrokePattern(nullptr); if (colorSpace) { GfxColor color; - state->setStrokeColorSpace(colorSpace); + state->setStrokeColorSpace(colorSpace->copy()); colorSpace->getDefaultColor(&color); state->setStrokeColor(&color); builder->updateStyle(state); @@@@ -1152,7 +1139,7 @@@@ void PdfParser::opSetFillColorN(Object a builder->updateStyle(state); d34 13 a46 79 if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) { - state->setFillPattern(pattern); + state->setFillPattern(pattern->copy()); builder->updateStyle(state); } @@@@ -1195,7 +1182,7 @@@@ void PdfParser::opSetStrokeColorN(Object builder->updateStyle(state); } if (auto pattern = lookupPattern(&(args[numArgs - 1]), state)) { - state->setStrokePattern(pattern); + state->setStrokePattern(pattern->copy()); builder->updateStyle(state); } @@@@ -1572,7 +1559,7 @@@@ void PdfParser::doShadingPatternFillFall // TODO not good that numArgs is ignored but args[] is used: void PdfParser::opShFill(Object args[], int /*numArgs*/) { - GfxShading *shading = nullptr; + std::unique_ptr shading = nullptr; GfxPath *savedPath = nullptr; bool savedState = false; @@@@ -1608,19 +1595,19 @@@@ void PdfParser::opShFill(Object args[], // do shading type-specific operations switch (shading->getType()) { case 1: // Function-based shading - doFunctionShFill(static_cast(shading)); + doFunctionShFill(static_cast(shading.get())); break; case 2: // Axial shading case 3: // Radial shading - builder->addClippedFill(shading, stateToAffine(state)); + builder->addClippedFill(shading.get(), stateToAffine(state)); break; case 4: // Free-form Gouraud-shaded triangle mesh case 5: // Lattice-form Gouraud-shaded triangle mesh - doGouraudTriangleShFill(static_cast(shading)); + doGouraudTriangleShFill(static_cast(shading.get())); break; case 6: // Coons patch mesh case 7: // Tensor-product patch mesh - doPatchMeshShFill(static_cast(shading)); + doPatchMeshShFill(static_cast(shading.get())); break; } @@@@ -1630,7 +1617,6 @@@@ void PdfParser::opShFill(Object args[], state->setPath(savedPath); } - delete shading; } void PdfParser::doFunctionShFill(GfxFunctionShading *shading) { @@@@ -2521,7 +2507,7 @@@@ void PdfParser::doImage(Object * /*ref*/ } else { // get color space and color map - GfxColorSpace *colorSpace; + std::unique_ptr colorSpace; _POPPLER_CALL_ARGS(obj1, dict->lookup, "ColorSpace"); if (obj1.isNull()) { _POPPLER_FREE(obj1); @@@@ -2530,11 +2516,11 @@@@ void PdfParser::doImage(Object * /*ref*/ if (!obj1.isNull()) { colorSpace = lookupColorSpaceCopy(obj1); } else if (csMode == streamCSDeviceGray) { - colorSpace = new GfxDeviceGrayColorSpace(); + colorSpace = std::unique_ptr(new GfxDeviceGrayColorSpace()); } else if (csMode == streamCSDeviceRGB) { - colorSpace = new GfxDeviceRGBColorSpace(); + colorSpace = std::unique_ptr(new GfxDeviceRGBColorSpace()); } else if (csMode == streamCSDeviceCMYK) { - colorSpace = new GfxDeviceCMYKColorSpace(); + colorSpace = std::unique_ptr(new GfxDeviceCMYKColorSpace()); } else { colorSpace = nullptr; d48 8 a55 3 @@@@ -2547,7 +2533,7 @@@@ void PdfParser::doImage(Object * /*ref*/ _POPPLER_FREE(obj1); _POPPLER_CALL_ARGS(obj1, dict->lookup, "D"); d57 10 a66 8 - GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace); + GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace->copy()); _POPPLER_FREE(obj1); if (!colorMap->isOk()) { delete colorMap; @@@@ -2617,7 +2603,7 @@@@ void PdfParser::doImage(Object * /*ref*/ _POPPLER_FREE(obj1); _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "CS"); d68 28 a95 48 - GfxColorSpace *maskColorSpace = lookupColorSpaceCopy(obj1); + std::unique_ptr maskColorSpace = lookupColorSpaceCopy(obj1); _POPPLER_FREE(obj1); if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) { goto err1; @@@@ -2627,7 +2613,7 @@@@ void PdfParser::doImage(Object * /*ref*/ _POPPLER_FREE(obj1); _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "D"); } - maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace); + maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace->copy()); _POPPLER_FREE(obj1); if (!maskColorMap->isOk()) { delete maskColorMap; @@@@ -2739,7 +2725,7 @@@@ void PdfParser::doForm(Object *str, doub { Dict *dict; GBool transpGroup, isolated, knockout; - GfxColorSpace *blendingColorSpace; + std::unique_ptr blendingColorSpace; Object matrixObj, bboxObj; double m[6], bbox[4]; Object resObj; @@@@ -2831,14 +2817,11 @@@@ void PdfParser::doForm(Object *str, doub doForm1(str, resDict, m, bbox, transpGroup, gFalse, blendingColorSpace, isolated, knockout); --formDepth; - if (blendingColorSpace) { - delete blendingColorSpace; - } _POPPLER_FREE(resObj); } void PdfParser::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox, GBool transpGroup, GBool softMask, - GfxColorSpace *blendingColorSpace, GBool isolated, GBool knockout, GBool alpha, + std::unique_ptr const &blendingColorSpace, GBool isolated, GBool knockout, GBool alpha, Function *transferFunc, GfxColor *backdropColor) { Parser *oldParser; @@@@ -2847,7 +2830,7 @@@@ void PdfParser::doForm1(Object *str, Dic pushResources(resDict); // Add a new container group before saving the state - builder->startGroup(state, bbox, blendingColorSpace, isolated, knockout, softMask); + builder->startGroup(state, bbox, blendingColorSpace.get(), isolated, knockout, softMask); // save current graphics state saveState(); @ 1.21 log @inkscape: update to 1.4. Fix build with poppler 24.10.0 using a patch from OpenMandriva. Release highlights Filter Gallery: it has never been so easy to find the best filter for your needs! This new dialog features previews, categories and search. Modular grids & improved axonometric grids: set the grid angle by ratio for isometric designs and use modular grids to plan layouts and make icons! Swatches dialog and palette file handling improved: quick access to dialog layout controls, search for colors, and open different palette file formats! Unified font browser preview: when activated in the preferences, use it to quickly browse through your font collection. Try it out and give your feedback! Customizable handles: Power users with CSS knowledge can now customize the styling and basic shape of all the handles! Fast image clipping with the Shape Builder: raster graphics can now be clipped into multiple sections using the Shape Builder. Affinity Designer File Import Support for internal links in exported PDF files A whole new icon set There's even more: faster extensions, new templates for folding booklets, additional options in Ruler and Taper Stroke LPE, new keyboard shortcuts, changed node deletion behavior, preview in Spray tool, many new command line options, more supported color palette formats (e.g. CIELAB, Adobe Color Book and Adobe Swatch Exchange), updated translations and many bug fixes. @ text @d1 1 a1 1 $NetBSD$ @ 1.20 log @inkscape: update to 1.2.2 Maintenance and bugfix release, which brings 4 crash fixes, over 25 bug fixes, 5 fixes for extension bugs and 13 improved UI translations. @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.19 2022/09/04 07:55:02 martin Exp $ d3 2 a4 1 Adapt to new poppler API d6 185 a190 3 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2022-05-07 15:43:15.000000000 +0200 +++ src/extension/internal/pdfinput/pdf-parser.cpp 2022-09-04 09:43:47.958399506 +0200 @@@@ -685,19 +685,18 @@@@ void PdfParser::opConcat(Object args[], d192 1 a192 1 void PdfParser::opSetDash(Object args[], int /*numArgs*/) d194 28 a221 2 - double *dash = nullptr; + std::vector dash; d223 2 a224 10 Array *a = args[0].getArray(); int length = a->getLength(); if (length != 0) { - dash = (double *)gmallocn(length, sizeof(double)); for (int i = 0; i < length; ++i) { Object obj; - dash[i] = _POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum(); + dash.push_back(_POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum()); _POPPLER_FREE(obj); } d226 73 a298 3 - state->setLineDash(dash, length, args[1].getNum()); + state->setLineDash(std::move(dash), args[1].getNum()); builder->updateStyle(state); d301 15 @ 1.19 log @Adapt to new poppler API @ text @d1 1 a1 1 $NetBSD$ @ 1.18 log @inkscape: update to 1.2.1. Release highlights Inkscape documents can now hold multiple pages, which are managed by the new Page tool Editable markers and dash patterns Layers and objects dialog merged On-canvas alignment snapping and Snap settings redesign New 'Tiling' Live Path Effect Redesigned Export dialog with preview and ability to select objects/layers/pages and even multiple file formats to export to Import SVG images from Open Clipart, Wikimedia Commons and other online sources Selectable object origin for numerical scaling and moving All alignment options in a single dialog Gradient editing in the Fill and Stroke dialog Gradient dithering SVG Font Editor updated Flowing text around shapes and text padding Convenience Boolean operation for splitting paths Configurable Tool bar, continuous icon scaling and many more new customization options Performance gains for many parts of the interface and many different functions Lots of improvements to the user interface Numerous crash & bug fixes in the main Inkscape program and in in the stock extensions and so much more! @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.17 2022/05/04 21:13:52 wiz Exp $ d3 1 a3 2 Fix build with poppler-22.4.0 https://gitlab.com/inkscape/inkscape/-/issues/3387 d5 3 a7 11 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2022-02-05 01:12:19.000000000 +0000 +++ src/extension/internal/pdfinput/pdf-parser.cpp @@@@ -30,6 +30,7 @@@@ #include "Gfx.h" #include "pdf-parser.h" #include "util/units.h" +#include "poppler-transition-api.h" #include "glib/poppler-features.h" #include "goo/gmem.h" @@@@ -2158,7 +2159,7 @@@@ void PdfParser::opSetCharSpacing(Object d9 1 a9 1 void PdfParser::opSetFont(Object args[], int /*numArgs*/) d11 2 a12 2 - GfxFont *font = res->lookupFont(args[0].getName()); + auto font = res->lookupFont(args[0].getName()); d14 10 a23 4 if (!font) { // unsetting the font (drawing no text) is better than using the @@@@ -2179,7 +2180,9 @@@@ void PdfParser::opSetFont(Object args[], fflush(stdout); d25 3 a27 6 +#if !POPPLER_CHECK_VERSION(22, 4, 0) font->incRefCnt(); +#endif state->setFont(font, args[1].getNum()); fontChanged = gTrue; a28 15 @@@@ -2373,7 +2376,6 @@@@ void PdfParser::doShowText(const GooStri #else void PdfParser::doShowText(GooString *s) { #endif - GfxFont *font; int wMode; double riseX, riseY; CharCode code; @@@@ -2392,7 +2394,7 @@@@ void PdfParser::doShowText(GooString *s) #endif int len, n, uLen; - font = state->getFont(); + auto font = state->getFont(); wMode = font->getWMode(); a29 15 builder->beginString(state); @@@@ -2445,10 +2447,10 @@@@ void PdfParser::doShowText(GooString *s) //out->updateCTM(state, 1, 0, 0, 1, 0, 0); if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy, code, u, uLen)) {*/ - _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code); - if ((resDict = ((Gfx8BitFont *)font)->getResources())) { + _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code); + if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) { pushResources(resDict); - } + } if (charProc.isStream()) { //parse(&charProc, gFalse); // TODO: parse into SVG font } else { @ 1.17 log @nkscape: fix build with poppler 22.04.0 Using upstream patches @ text @d1 1 a1 1 $NetBSD$ @ 1.16 log @inkscape: Update to 1.1.2 Changelog: Inkscape 1.1.2 -------------- Released on **2022-02-05** Release highlights ------------------ This is a bugfix release: - Dependencies updated, fixing bitmap exports - Graphic tablet pens erasors switch to the correct tool - Fix lost styling of text converted to path - Fix relative position of clones pasted to a new document - Fix various crashes Full release notes on https://wiki.inkscape.org/wiki/index.php/Release_notes/1.1.2 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.15 2021/11/07 21:28:48 wiz Exp $ d3 2 a4 2 Fix build with poppler-21.11.0 https://gitlab.com/inkscape/inkscape/-/merge_requests/3622/diffs?commit_id=d7fb99ff5708d4fe3cf3526966b73d81da71a7b2 d6 1 a6 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2021-05-25 11:35:00.000000000 +0000 d8 19 a26 1 @@@@ -2169,7 +2169,11 @@@@ void PdfParser::opSetFont(Object args[], d28 3 a30 6 if (printCommands) { printf(" font: tag=%s name='%s' %g\n", +#if POPPLER_CHECK_VERSION(21,11,0) + font->getTag().c_str(), +#else font->getTag()->getCString(), d32 34 a65 3 font->getName() ? font->getName()->getCString() : "???", args[1].getNum()); fflush(stdout); @ 1.15 log @inkscape: fix build with poppler-21.11.0 @ text @d1 1 a1 1 $NetBSD$ @ 1.14 log @inkscape: Update to 1.0 Changelog: Inkscape 1.0 Release highlights Theming support and more new customization options Better HiDPI (high resolution) screen support Native support for macOS with a signed and notarized .dmg file Coordinate origin in top left corner by default Canvas rotation and mirroring On-Canvas alignment of objects Split view and X-Ray modes PowerPencil for drawing editable, variable width strokes with a pressure sensitive graphics tablet New PNG export options Integrated centerline tracing for vectorization of line drawings Searchable Symbols dialog New Live Path Effect (LPE) selection dialog New Corners (Fillet/chamfer) LPE, (lossless) Boolean Operation LPE (experimental), Offset LPE and Measure Segments LPE (and more!) Path operations, deselection of a large number of paths as well as grouping/ungrouping are much faster now Much improved text line-height settings Variable fonts support (only if compiled with pango library version >= 1.41.1) Browser-compatible flowed text Extensions programming interface updated, with many new options Python 3 support for extensions @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.13 2020/01/11 09:59:06 martin Exp $ d3 2 a4 4 Object.h is included in pdf-parser.h -- see patch for pdf-parser.h. Fix building with poppler 0.76.x. Work around constness bugs (addChar should take a const arg). Add some needed const casts for GfxPath objects. d6 3 a8 22 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2020-01-11 10:11:43.316590715 +0100 +++ src/extension/internal/pdfinput/pdf-parser.cpp 2020-01-11 10:22:11.403079322 +0100 @@@@ -41,7 +41,6 @@@@ #include "goo/GooString.h" #include "GlobalParams.h" #include "CharTypes.h" -#include "Object.h" #include "Array.h" #include "Dict.h" #include "Stream.h" @@@@ -342,7 +341,7 @@@@ state->lineTo(cropBox->x1, cropBox->y2); state->closePath(); state->clip(); - clipHistory->setClip(state->getPath(), clipNormal); + clipHistory->setClip(const_cast(state->getPath()), clipNormal); builder->setClipPath(state); state->clearPath(); } @@@@ -426,7 +425,7 @@@@ error(errInternal, -1, "Weird page contents"); return; d10 10 a19 46 - parser = new Parser(xref, new Lexer(xref, obj), gFalse); + parser = new Parser(xref, obj, gFalse); go(topLevel); delete parser; parser = NULL; @@@@ -2143,10 +2142,10 @@@@ if (state->isCurPt() && clip != clipNone) { state->clip(); if (clip == clipNormal) { - clipHistory->setClip(state->getPath(), clipNormal); + clipHistory->setClip(const_cast(state->getPath()), clipNormal); builder->clip(state); } else { - clipHistory->setClip(state->getPath(), clipEO); + clipHistory->setClip(const_cast(state->getPath()), clipEO); builder->clip(state, true); } } @@@@ -2414,7 +2413,7 @@@@ int wMode; double riseX, riseY; CharCode code; - Unicode *u = NULL; + const Unicode *u = NULL; double x, y, dx, dy, tdx, tdy; double originX, originY, tOriginX, tOriginY; double oldCTM[6], newCTM[6]; @@@@ -2537,7 +2536,8 @@@@ originY *= state->getFontSize(); state->textTransformDelta(originX, originY, &tOriginX, &tOriginY); builder->addChar(state, state->getCurX() + riseX, state->getCurY() + riseY, - dx, dy, tOriginX, tOriginY, code, n, u, uLen); + dx, dy, tOriginX, tOriginY, code, n, + const_cast(u), uLen); state->shift(tdx, tdy); p += n; len -= n; @@@@ -3112,7 +3112,7 @@@@ state->lineTo(bbox[0], bbox[3]); state->closePath(); state->clip(); - clipHistory->setClip(state->getPath()); + clipHistory->setClip(const_cast(state->getPath())); builder->clip(state); state->clearPath(); @ 1.13 log @Make the pdf-input extension buildable with gcc 8.3. @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.12 2019/11/23 09:23:22 martin Exp $ @ 1.12 log @Make it buildable with poppler 0.82 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.11 2019/05/13 16:17:51 adam Exp $ d6 1 d8 2 a9 2 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2019-01-15 05:29:27.000000000 +0100 +++ src/extension/internal/pdfinput/pdf-parser.cpp 2019-11-23 10:14:30.693904450 +0100 d18 9 d36 13 d68 9 @ 1.11 log @inkscape: updated to 0.92.4 Inkscape 0.92.4 is a stability and bugfix release. It also brings some notable performance improvements for filter rendering, measure tool, extensions, document saving and moving paths (with a live path effect) and includes a couple of small, but impactful usage improvements. @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.10 2019/01/06 08:41:01 markd Exp $ d5 1 d7 3 a9 3 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2019-01-15 04:29:27.000000000 +0000 +++ src/extension/internal/pdfinput/pdf-parser.cpp @@@@ -41,7 +41,6 @@@@ extern "C" { d17 1 a17 1 @@@@ -426,7 +425,7 @@@@ void PdfParser::parse(Object *obj, GBool d26 19 @ 1.10 log @inkscape: update to 0.92.3 Also post 0.92.3 updates from upstream for poppler-0.72 by way of linuxfromscratch. http://www.linuxfromscratch.org/patches/blfs/svn/inkscape-0.92.3-consolidated_fixes-1.patch Inkscape 0.92.3 is a maintenance release resolving numerous bugs and making this the most stable release of the series. Among the most reported bugs addressed were: * Blank pages being output when attempting to print multiple copies of a document * The inability to cancel during the export of large files * Application crashes caused by attempting to drag a path at a cap or line join * Some issues with keyboard shortcut functionality on non-Latin keyboard layouts A few performance improvements and usability enhancements that made it into the release, include: * New SVG export options from the command line * Support for right-to-left text * Improved ellipse controls * Multi-line text support for the PDF+LaTeX export * New render tile preferences for performance tuning * Better startup performance for many Windows users @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 - Object.h is included in pdf-parser.h -- see patch for pdf-parser.h. - Support for poppler 0.72 from upstream by way of linuxfromscratch d6 1 a6 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2018-03-11 20:38:09.000000000 +0000 d8 2 a9 9 @@@@ -36,12 +36,11 @@@@ extern "C" { #include "pdf-parser.h" #include "util/units.h" +#include "glib/poppler-features.h" #include "goo/gmem.h" -#include "goo/GooTimer.h" -#include "goo/GooHash.h" +#include "goo/GooString.h" d16 3 a18 66 @@@@ -295,8 +294,8 @@@@ PdfParser::PdfParser(XRef *xrefA, int /*pageNum*/, int rotate, Dict *resDict, - PDFRectangle *box, - PDFRectangle *cropBox) : + _POPPLER_CONST PDFRectangle *box, + _POPPLER_CONST PDFRectangle *cropBox) : xref(xrefA), builder(builderA), subPage(gFalse), @@@@ -318,7 +317,7 @@@@ PdfParser::PdfParser(XRef *xrefA, builder->setDocumentSize(Inkscape::Util::Quantity::convert(state->getPageWidth(), "pt", "px"), Inkscape::Util::Quantity::convert(state->getPageHeight(), "pt", "px")); - double *ctm = state->getCTM(); + const double *ctm = state->getCTM(); double scaledCTM[6]; for (int i = 0; i < 6; ++i) { baseMatrix[i] = ctm[i]; @@@@ -353,7 +352,7 @@@@ PdfParser::PdfParser(XRef *xrefA, PdfParser::PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA, Dict *resDict, - PDFRectangle *box) : + _POPPLER_CONST PDFRectangle *box) : xref(xrefA), builder(builderA), subPage(gTrue), @@@@ -572,7 +571,7 @@@@ const char *PdfParser::getPreviousOperat void PdfParser::execOp(Object *cmd, Object args[], int numArgs) { PdfOperator *op; - char *name; + const char *name; Object *argPtr; int i; @@@@ -620,7 +619,7 @@@@ void PdfParser::execOp(Object *cmd, Obje (this->*op->func)(argPtr, numArgs); } -PdfOperator* PdfParser::findOp(char *name) { +PdfOperator* PdfParser::findOp(const char *name) { int a = -1; int b = numOps; int cmp = -1; @@@@ -1752,7 +1751,7 @@@@ void PdfParser::doShadingPatternFillFall GBool stroke, GBool eoFill) { GfxShading *shading; GfxPath *savedPath; - double *ctm, *btm, *ptm; + const double *ctm, *btm, *ptm; double m[6], ictm[6], m1[6]; double xMin, yMin, xMax, yMax; double det; @@@@ -1994,7 +1993,7 @@@@ void PdfParser::doFunctionShFill1(GfxFun GfxColor color0M, color1M, colorM0, colorM1, colorMM; GfxColor colors2[4]; double functionColorDelta = colorDeltas[pdfFunctionShading-1]; - double *matrix; + const double *matrix; double xM, yM; int nComps, i, j; @@@@ -2174,7 +2173,7 @@@@ void PdfParser::doPatchMeshShFill(GfxPat d20 5 a24 98 } -void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) { +void PdfParser::fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth) { GfxPatch patch00 = blankPatch(); GfxPatch patch01 = blankPatch(); GfxPatch patch10 = blankPatch(); @@@@ -2582,7 +2581,11 @@@@ void PdfParser::opShowSpaceText(Object a } } +#if POPPLER_CHECK_VERSION(0,64,0) +void PdfParser::doShowText(const GooString *s) { +#else void PdfParser::doShowText(GooString *s) { +#endif GfxFont *font; int wMode; double riseX, riseY; @@@@ -2591,17 +2594,21 @@@@ void PdfParser::doShowText(GooString *s) double x, y, dx, dy, tdx, tdy; double originX, originY, tOriginX, tOriginY; double oldCTM[6], newCTM[6]; - double *mat; + const double *mat; Object charProc; Dict *resDict; Parser *oldParser; +#if POPPLER_CHECK_VERSION(0,64,0) + const char *p; +#else char *p; +#endif int len, n, uLen; font = state->getFont(); wMode = font->getWMode(); - builder->beginString(state, s); + builder->beginString(state); // handle a Type 3 char if (font->getType() == fontType3 && 0) {//out->interpretType3Chars()) { @@@@ -2732,7 +2739,11 @@@@ void PdfParser::opXObject(Object args[], { Object obj1, obj2, obj3, refObj; +#if POPPLER_CHECK_VERSION(0,64,0) + const char *name = args[0].getName(); +#else char *name = args[0].getName(); +#endif #if defined(POPPLER_NEW_OBJECT_API) if ((obj1 = res->lookupXObject(name)).isNull()) { #else @@@@ -3657,7 +3668,6 @@@@ void PdfParser::opBeginImage(Object /*ar Stream *PdfParser::buildImageStream() { Object dict; Object obj; - char *key; Stream *str; // build dictionary @@@@ -3675,26 +3685,17 @@@@ Stream *PdfParser::buildImageStream() { obj.free(); #endif } else { - key = copyString(obj.getName()); -#if defined(POPPLER_NEW_OBJECT_API) - obj = parser->getObj(); -#else - obj.free(); - parser->getObj(&obj); -#endif - if (obj.isEOF() || obj.isError()) { - gfree(key); + Object obj2; + _POPPLER_CALL(obj2, parser->getObj); + if (obj2.isEOF() || obj2.isError()) { + _POPPLER_FREE(obj); break; } -#if defined(POPPLER_NEW_OBJECT_API) - dict.dictAdd(key, std::move(obj)); - } - obj = parser->getObj(); -#else - dict.dictAdd(key, &obj); + _POPPLER_DICTADD(dict, obj.getName(), obj2); + _POPPLER_FREE(obj); + _POPPLER_FREE(obj2); } - parser->getObj(&obj); -#endif + _POPPLER_CALL(obj, parser->getObj); } if (obj.isEOF()) { error(errSyntaxError, getPos(), "End of file in inline image"); @ 1.9 log @inkscape: get this closer to building with poppler-0.72 More work to do. @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.8 2018/06/21 10:25:35 wiz Exp $ d4 1 a4 3 - Support poppler 0.58 https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0 - Support poppler 0.64 d6 1 a6 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2017-08-06 20:44:00.000000000 +0000 d8 3 a10 1 @@@@ -38,10 +38,9 @@@@ extern "C" { d12 1 d14 1 a14 1 #include "goo/GooTimer.h" d16 1 a19 1 +#define POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API 1 d23 11 d39 1 a39 1 + _POPPLER_CONST double *ctm = state->getCTM(); d43 10 a52 90 @@@@ -414,13 +413,21 @@@@ void PdfParser::parse(Object *obj, GBool if (obj->isArray()) { for (int i = 0; i < obj->arrayGetLength(); ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj->arrayGet(i); +#else obj->arrayGet(i, &obj2); +#endif if (!obj2.isStream()) { error(errInternal, -1, "Weird page contents"); +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif return; } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } } else if (!obj->isStream()) { error(errInternal, -1, "Weird page contents"); @@@@ -439,7 +446,11 @@@@ void PdfParser::go(GBool /*topLevel*/) // scan a sequence of objects int numArgs = 0; +#if defined(POPPLER_NEW_OBJECT_API) + obj = parser->getObj(); +#else parser->getObj(&obj); +#endif while (!obj.isEOF()) { // got a command - execute it @@@@ -457,14 +468,20 @@@@ void PdfParser::go(GBool /*topLevel*/) // Run the operation execOp(&obj, args, numArgs); +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); for (int i = 0; i < numArgs; ++i) args[i].free(); +#endif numArgs = 0; // got an argument - save it } else if (numArgs < maxArgs) { +#if defined(POPPLER_NEW_OBJECT_API) + args[numArgs++] = std::move(obj); +#else args[numArgs++] = obj; +#endif // too many arguments - something is wrong } else { @@@@ -475,13 +492,21 @@@@ void PdfParser::go(GBool /*topLevel*/) printf("\n"); fflush(stdout); } +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); +#endif } // grab the next object +#if defined(POPPLER_NEW_OBJECT_API) + obj = parser->getObj(); +#else parser->getObj(&obj); +#endif } +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); +#endif // args at end with no command if (numArgs > 0) { @@@@ -495,8 +520,10 @@@@ void PdfParser::go(GBool /*topLevel*/) printf("\n"); fflush(stdout); } +#if !defined(POPPLER_NEW_OBJECT_API) for (int i = 0; i < numArgs; ++i) args[i].free(); +#endif } } @@@@ -543,8 +570,8 @@@@ const char *PdfParser::getPreviousOperat } d55 1 a55 1 - PdfOperator *op; d57 1 a57 2 + _POPPLER_CONST PdfOperator *op; + _POPPLER_CONST char *name; d61 2 a62 265 @@@@ -692,9 +719,13 @@@@ void PdfParser::opSetDash(Object args[], if (length != 0) { dash = (double *)gmallocn(length, sizeof(double)); for (int i = 0; i < length; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + dash[i] = a->get(i).getNum(); +#else Object obj; dash[i] = a->get(i, &obj)->getNum(); obj.free(); +#endif } } state->setLineDash(dash, length, args[1].getNum()); @@@@ -744,12 +775,18 @@@@ void PdfParser::opSetExtGState(Object ar GBool haveBackdropColor = gFalse; GBool alpha = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj1 = res->lookupGState(args[0].getName())).isNull()) { +#else if (!res->lookupGState(args[0].getName(), &obj1)) { +#endif return; } if (!obj1.isDict()) { error(errSyntaxError, getPos(), "ExtGState '{0:s}' is wrong type"), args[0].getName(); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif return; } if (printCommands) { @@@@ -759,7 +796,11 @@@@ void PdfParser::opSetExtGState(Object ar } // transparency support: blend mode, fill/stroke opacity +#if defined(POPPLER_NEW_OBJECT_API) + if (!((obj2 = obj1.dictLookup(const_cast("BM"))).isNull())) { +#else if (!obj1.dictLookup(const_cast("BM"), &obj2)->isNull()) { +#endif GfxBlendMode mode = gfxBlendNormal; if (state->parseBlendMode(&obj2, &mode)) { state->setBlendMode(mode); @@@@ -767,40 +808,71 @@@@ void PdfParser::opSetExtGState(Object ar error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState"); } } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj2 = obj1.dictLookup(const_cast("ca"))).isNum()) { +#else obj2.free(); if (obj1.dictLookup(const_cast("ca"), &obj2)->isNum()) { +#endif state->setFillOpacity(obj2.getNum()); } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj2 = obj1.dictLookup(const_cast("CA"))).isNum()) { +#else obj2.free(); if (obj1.dictLookup(const_cast("CA"), &obj2)->isNum()) { +#endif state->setStrokeOpacity(obj2.getNum()); } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif // fill/stroke overprint GBool haveFillOP = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + if ((haveFillOP = (obj2 = obj1.dictLookup(const_cast("op"))).isBool())) { +#else if ((haveFillOP = (obj1.dictLookup(const_cast("op"), &obj2)->isBool()))) { +#endif state->setFillOverprint(obj2.getBool()); } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj2 = obj1.dictLookup(const_cast("OP"))).isBool()) { +#else obj2.free(); if (obj1.dictLookup(const_cast("OP"), &obj2)->isBool()) { +#endif state->setStrokeOverprint(obj2.getBool()); if (!haveFillOP) { state->setFillOverprint(obj2.getBool()); } } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif // stroke adjust +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj2 = obj1.dictLookup(const_cast("SA"))).isBool()) { +#else if (obj1.dictLookup(const_cast("SA"), &obj2)->isBool()) { +#endif state->setStrokeAdjust(obj2.getBool()); } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif // transfer function +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj2 = obj1.dictLookup(const_cast("TR2"))).isNull()) { + obj2 = obj1.dictLookup(const_cast("TR")); +#else if (obj1.dictLookup(const_cast("TR2"), &obj2)->isNull()) { obj2.free(); obj1.dictLookup(const_cast("TR"), &obj2); +#endif } if (obj2.isName(const_cast("Default")) || obj2.isName(const_cast("Identity"))) { @@@@ -809,9 +881,15 @@@@ void PdfParser::opSetExtGState(Object ar } else if (obj2.isArray() && obj2.arrayGetLength() == 4) { int pos = 4; for (int i = 0; i < 4; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj3 = obj2.arrayGet(i); +#else obj2.arrayGet(i, &obj3); +#endif funcs[i] = Function::parse(&obj3); +#if !defined(POPPLER_NEW_OBJECT_API) obj3.free(); +#endif if (!funcs[i]) { pos = i; break; @@@@ -828,21 +906,37 @@@@ void PdfParser::opSetExtGState(Object ar } else if (!obj2.isNull()) { error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif // soft mask +#if defined(POPPLER_NEW_OBJECT_API) + if (!((obj2 = obj1.dictLookup(const_cast("SMask"))).isNull())) { +#else if (!obj1.dictLookup(const_cast("SMask"), &obj2)->isNull()) { +#endif if (obj2.isName(const_cast("None"))) { builder->clearSoftMask(state); } else if (obj2.isDict()) { +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj3 = obj2.dictLookup(const_cast("S"))).isName(const_cast("Alpha"))) { +#else if (obj2.dictLookup(const_cast("S"), &obj3)->isName(const_cast("Alpha"))) { +#endif alpha = gTrue; } else { // "Luminosity" alpha = gFalse; } +#if !defined(POPPLER_NEW_OBJECT_API) obj3.free(); +#endif funcs[0] = NULL; +#if defined(POPPLER_NEW_OBJECT_API) + if (!((obj3 = obj2.dictLookup(const_cast("TR"))).isNull())) { +#else if (!obj2.dictLookup(const_cast("TR"), &obj3)->isNull()) { +#endif funcs[0] = Function::parse(&obj3); if (funcs[0]->getInputSize() != 1 || funcs[0]->getOutputSize() != 1) { @@@@ -851,26 +945,45 @@@@ void PdfParser::opSetExtGState(Object ar funcs[0] = NULL; } } +#if defined(POPPLER_NEW_OBJECT_API) + if ((haveBackdropColor = (obj3 = obj2.dictLookup(const_cast("BC"))).isArray())) { +#else obj3.free(); if ((haveBackdropColor = obj2.dictLookup(const_cast("BC"), &obj3)->isArray())) { +#endif for (int i = 0; i < gfxColorMaxComps; ++i) { backdropColor.c[i] = 0; } for (int i = 0; i < obj3.arrayGetLength() && i < gfxColorMaxComps; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj4 = obj3.arrayGet(i); +#else obj3.arrayGet(i, &obj4); +#endif if (obj4.isNum()) { backdropColor.c[i] = dblToCol(obj4.getNum()); } +#if !defined(POPPLER_NEW_OBJECT_API) obj4.free(); +#endif } } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj3 = obj2.dictLookup(const_cast("G"))).isStream()) { + if ((obj4 = obj3.streamGetDict()->lookup(const_cast("Group"))).isDict()) { +#else obj3.free(); if (obj2.dictLookup(const_cast("G"), &obj3)->isStream()) { if (obj3.streamGetDict()->lookup(const_cast("Group"), &obj4)->isDict()) { +#endif GfxColorSpace *blendingColorSpace = 0; GBool isolated = gFalse; GBool knockout = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + if (!((obj5 = obj4.dictLookup(const_cast("CS"))).isNull())) { +#else if (!obj4.dictLookup(const_cast("CS"), &obj5)->isNull()) { +#endif #if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) blendingColorSpace = GfxColorSpace::parse(NULL, &obj5, NULL, NULL); #elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) @@@@ -879,15 +992,25 @@@@ void PdfParser::opSetExtGState(Object ar blendingColorSpace = GfxColorSpace::parse(&obj5, NULL); #endif } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj5 = obj4.dictLookup(const_cast("I"))).isBool()) { +#else obj5.free(); if (obj4.dictLookup(const_cast("I"), &obj5)->isBool()) { +#endif isolated = obj5.getBool(); } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj5 = obj4.dictLookup(const_cast("K"))).isBool()) { +#else obj5.free(); if (obj4.dictLookup(const_cast("K"), &obj5)->isBool()) { +#endif knockout = obj5.getBool(); } +#if !defined(POPPLER_NEW_OBJECT_API) obj5.free(); +#endif if (!haveBackdropColor) { if (blendingColorSpace) { blendingColorSpace->getDefaultColor(&backdropColor); @@@@ -906,18 +1029,24 @@@@ void PdfParser::opSetExtGState(Object ar } else { error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj4.free(); +#endif } else { error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj3.free(); +#endif } else if (!obj2.isNull()) { error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState"); } } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); obj1.free(); +#endif d65 6 a70 136 void PdfParser::doSoftMask(Object *str, GBool alpha, @@@@ -938,43 +1067,79 @@@@ void PdfParser::doSoftMask(Object *str, dict = str->streamGetDict(); // check form type +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("FormType")); +#else dict->lookup(const_cast("FormType"), &obj1); +#endif if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) { error(errSyntaxError, getPos(), "Unknown form type"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // get bounding box +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("BBox")); +#else dict->lookup(const_cast("BBox"), &obj1); +#endif if (!obj1.isArray()) { +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif error(errSyntaxError, getPos(), "Bad form bounding box"); return; } for (i = 0; i < 4; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj1.arrayGet(i); +#else obj1.arrayGet(i, &obj2); +#endif bbox[i] = obj2.getNum(); +#if defined(POPPLER_NEW_OBJECT_API) + } +#else obj2.free(); } obj1.free(); +#endif // get matrix +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Matrix")); +#else dict->lookup(const_cast("Matrix"), &obj1); +#endif if (obj1.isArray()) { for (i = 0; i < 6; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj1.arrayGet(i); +#else obj1.arrayGet(i, &obj2); +#endif m[i] = obj2.getNum(); +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } } else { m[0] = 1; m[1] = 0; m[2] = 0; m[3] = 1; m[4] = 0; m[5] = 0; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // get resources +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Resources")); +#else dict->lookup(const_cast("Resources"), &obj1); +#endif resDict = obj1.isDict() ? obj1.getDict() : (Dict *)NULL; // draw it @@@@ -987,7 +1152,9 @@@@ void PdfParser::doSoftMask(Object *str, if (blendingColorSpace) { delete blendingColorSpace; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif } void PdfParser::opSetRenderingIntent(Object /*args*/[], int /*numArgs*/) @@@@ -1084,7 +1251,11 @@@@ void PdfParser::opSetFillColorSpace(Obje Object obj; state->setFillPattern(NULL); +#if defined(POPPLER_NEW_OBJECT_API) + obj = res->lookupColorSpace(args[0].getName()); +#else res->lookupColorSpace(args[0].getName(), &obj); +#endif GfxColorSpace *colorSpace = 0; #if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) @@@@ -1106,7 +1277,9 @@@@ void PdfParser::opSetFillColorSpace(Obje colorSpace = GfxColorSpace::parse(&obj, NULL); } #endif +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); +#endif if (colorSpace) { GfxColor color; state->setFillColorSpace(colorSpace); @@@@ -1125,7 +1298,11 @@@@ void PdfParser::opSetStrokeColorSpace(Ob GfxColorSpace *colorSpace = 0; state->setStrokePattern(NULL); +#if defined(POPPLER_NEW_OBJECT_API) + obj = res->lookupColorSpace(args[0].getName()); +#else res->lookupColorSpace(args[0].getName(), &obj); +#endif #if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) if (obj.isNull()) { colorSpace = GfxColorSpace::parse(NULL, &args[0], NULL, NULL); @@@@ -1145,7 +1322,9 @@@@ void PdfParser::opSetStrokeColorSpace(Ob colorSpace = GfxColorSpace::parse(&obj, NULL); } #endif +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); +#endif if (colorSpace) { GfxColor color; state->setStrokeColorSpace(colorSpace); @@@@ -1572,7 +1751,7 @@@@ void PdfParser::doShadingPatternFillFall d75 1 a75 1 + _POPPLER_CONST double *ctm, *btm, *ptm; d79 1 a79 1 @@@@ -1814,7 +1993,7 @@@@ void PdfParser::doFunctionShFill1(GfxFun d84 1 a84 1 + _POPPLER_CONST double *matrix; d88 1 a88 1 @@@@ -1994,7 +2173,7 @@@@ void PdfParser::doPatchMeshShFill(GfxPat d97 1 a97 3 @@@@ -2310,7 +2489,7 @@@@ void PdfParser::opShowText(Object args[] builder->updateFont(state); fontChanged = gFalse; a98 11 - doShowText(args[0].getString()); + doShowText((GooString *)args[0].getString()); } // TODO not good that numArgs is ignored but args[] is used: @@@@ -2331,7 +2510,7 @@@@ void PdfParser::opMoveShowText(Object ar ty = state->getLineY() - state->getLeading(); state->textMoveTo(tx, ty); builder->updateTextPosition(tx, ty); - doShowText(args[0].getString()); + doShowText((GooString *)args[0].getString()); d101 2 a102 16 // TODO not good that numArgs is ignored but args[] is used: @@@@ -2354,7 +2533,7 @@@@ void PdfParser::opMoveSetShowText(Object ty = state->getLineY() - state->getLeading(); state->textMoveTo(tx, ty); builder->updateTextPosition(tx, ty); - doShowText(args[2].getString()); + doShowText((GooString *)args[2].getString()); } // TODO not good that numArgs is ignored but args[] is used: @@@@ -2375,7 +2554,11 @@@@ void PdfParser::opShowSpaceText(Object a wMode = state->getFont()->getWMode(); a = args[0].getArray(); for (int i = 0; i < a->getLength(); ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj = a->get(i); d104 1 a104 16 a->get(i, &obj); +#endif if (obj.isNum()) { // this uses the absolute value of the font size to match // Acrobat's behavior @@@@ -2388,11 +2571,13 @@@@ void PdfParser::opShowSpaceText(Object a } builder->updateTextShift(state, obj.getNum()); } else if (obj.isString()) { - doShowText(obj.getString()); + doShowText((GooString *)obj.getString()); } else { error(errSyntaxError, getPos(), "Element of show/space array must be number or string"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); d106 4 a109 4 } } @@@@ -2405,11 +2590,11 @@@@ void PdfParser::doShowText(GooString *s) d118 5 a122 2 - char *p; + _POPPLER_CONST char *p; d126 8 a133 23 @@@@ -2465,7 +2650,11 @@@@ void PdfParser::doShowText(GooString *s) //out->updateCTM(state, 1, 0, 0, 1, 0, 0); if (0){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy, code, u, uLen)) {*/ +#if defined(POPPLER_NEW_OBJECT_API) + charProc = ((Gfx8BitFont *)font)->getCharProc(code); +#else ((Gfx8BitFont *)font)->getCharProc(code, &charProc); +#endif if ((resDict = ((Gfx8BitFont *)font)->getResources())) { pushResources(resDict); } @@@@ -2478,7 +2667,9 @@@@ void PdfParser::doShowText(GooString *s) if (resDict) { popResources(); } +#if !defined(POPPLER_NEW_OBJECT_API) charProc.free(); +#endif } restoreState(); // GfxState::restore() does *not* restore the current position, @@@@ -2540,24 +2731,44 @@@@ void PdfParser::opXObject(Object args[], d137 2 a138 232 - char *name = args[0].getName(); + char *name = (char *)args[0].getName(); +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj1 = res->lookupXObject(name)).isNull()) { +#else if (!res->lookupXObject(name, &obj1)) { +#endif return; } if (!obj1.isStream()) { error(errSyntaxError, getPos(), "XObject '{0:s}' is wrong type", name); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif return; } +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj1.streamGetDict()->lookup(const_cast("Subtype")); +#else obj1.streamGetDict()->lookup(const_cast("Subtype"), &obj2); +#endif if (obj2.isName(const_cast("Image"))) { +#if defined(POPPLER_NEW_OBJECT_API) + refObj = res->lookupXObjectNF(name); +#else res->lookupXObjectNF(name, &refObj); +#endif doImage(&refObj, obj1.getStream(), gFalse); +#if !defined(POPPLER_NEW_OBJECT_API) refObj.free(); +#endif } else if (obj2.isName(const_cast("Form"))) { doForm(&obj1); } else if (obj2.isName(const_cast("PS"))) { +#if defined(POPPLER_NEW_OBJECT_API) + obj3 = obj1.streamGetDict()->lookup(const_cast("Level1")); +#else obj1.streamGetDict()->lookup(const_cast("Level1"), &obj3); +#endif /* out->psXObject(obj1.getStream(), obj3.isStream() ? obj3.getStream() : (Stream *)NULL);*/ } else if (obj2.isName()) { @@@@ -2565,8 +2776,10 @@@@ void PdfParser::opXObject(Object args[], } else { error(errSyntaxError, getPos(), "XObject subtype is missing or wrong type"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); obj1.free(); +#endif } void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) @@@@ -2593,10 +2806,18 @@@@ void PdfParser::doImage(Object * /*ref*/ dict = str->getDict(); // get size +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Width")); +#else dict->lookup(const_cast("Width"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("W")); +#else obj1.free(); dict->lookup(const_cast("W"), &obj1); +#endif } if (obj1.isInt()){ width = obj1.getInt(); @@@@ -2607,11 +2828,19 @@@@ void PdfParser::doImage(Object * /*ref*/ else { goto err2; } +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Height")); +#else obj1.free(); dict->lookup(const_cast("Height"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("H")); +#else obj1.free(); dict->lookup(const_cast("H"), &obj1); +#endif } if (obj1.isInt()) { height = obj1.getInt(); @@@@ -2622,26 +2851,46 @@@@ void PdfParser::doImage(Object * /*ref*/ else { goto err2; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // image interpolation +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup("Interpolate"); +#else dict->lookup("Interpolate", &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup("I"); +#else obj1.free(); dict->lookup("I", &obj1); +#endif } if (obj1.isBool()) interpolate = obj1.getBool(); else interpolate = gFalse; +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif maskInterpolate = gFalse; // image or mask? +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("ImageMask")); +#else dict->lookup(const_cast("ImageMask"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("IM")); +#else obj1.free(); dict->lookup(const_cast("IM"), &obj1); +#endif } mask = gFalse; if (obj1.isBool()) { @@@@ -2650,14 +2899,24 @@@@ void PdfParser::doImage(Object * /*ref*/ else if (!obj1.isNull()) { goto err2; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // bit depth if (bits == 0) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("BitsPerComponent")); +#else dict->lookup(const_cast("BitsPerComponent"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("BPC")); +#else obj1.free(); dict->lookup(const_cast("BPC"), &obj1); +#endif } if (obj1.isInt()) { bits = obj1.getInt(); @@@@ -2666,7 +2925,9 @@@@ void PdfParser::doImage(Object * /*ref*/ } else { goto err2; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif } // display a mask @@@@ -2676,21 +2937,37 @@@@ void PdfParser::doImage(Object * /*ref*/ goto err1; } invert = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Decode")); +#else dict->lookup(const_cast("Decode"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("D")); +#else obj1.free(); dict->lookup(const_cast("D"), &obj1); +#endif } if (obj1.isArray()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj1.arrayGet(0); +#else obj1.arrayGet(0, &obj2); +#endif if (obj2.isInt() && obj2.getInt() == 1) { invert = gTrue; } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } else if (!obj1.isNull()) { goto err2; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // draw it builder->addImageMask(state, str, width, height, invert, interpolate); @@@@ -2698,18 +2975,36 @@@@ void PdfParser::doImage(Object * /*ref*/ } else { // get color space and color map GfxColorSpace *colorSpace; +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("ColorSpace")); +#else dict->lookup(const_cast("ColorSpace"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("CS")); +#else obj1.free(); dict->lookup(const_cast("CS"), &obj1); +#endif } if (obj1.isName()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = res->lookupColorSpace(obj1.getName()); d140 1 a140 1 res->lookupColorSpace(obj1.getName(), &obj2); d142 2 a143 168 if (!obj2.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = std::move(obj2); +#else obj1.free(); obj1 = obj2; +#endif } else { +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } } if (!obj1.isNull()) { @@@@ -2729,17 +3024,29 @@@@ void PdfParser::doImage(Object * /*ref*/ } else { colorSpace = NULL; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif if (!colorSpace) { goto err1; } +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("Decode")); +#else dict->lookup(const_cast("Decode"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("D")); +#else obj1.free(); dict->lookup(const_cast("D"), &obj1); +#endif } GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif if (!colorMap->isOk()) { delete colorMap; goto err1; @@@@ -2753,8 +3060,13 @@@@ void PdfParser::doImage(Object * /*ref*/ int maskHeight = 0; maskInvert = gFalse; GfxImageColorMap *maskColorMap = NULL; +#if defined(POPPLER_NEW_OBJECT_API) + maskObj = dict->lookup(const_cast("Mask")); + smaskObj = dict->lookup(const_cast("SMask")); +#else dict->lookup(const_cast("Mask"), &maskObj); dict->lookup(const_cast("SMask"), &smaskObj); +#endif Dict* maskDict; if (smaskObj.isStream()) { // soft mask @@@@ -2763,58 +3075,108 @@@@ void PdfParser::doImage(Object * /*ref*/ } maskStr = smaskObj.getStream(); maskDict = smaskObj.streamGetDict(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Width")); +#else maskDict->lookup(const_cast("Width"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("W")); +#else obj1.free(); maskDict->lookup(const_cast("W"), &obj1); +#endif } if (!obj1.isInt()) { goto err2; } maskWidth = obj1.getInt(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Height")); +#else obj1.free(); maskDict->lookup(const_cast("Height"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("H")); +#else obj1.free(); maskDict->lookup(const_cast("H"), &obj1); +#endif } if (!obj1.isInt()) { goto err2; } maskHeight = obj1.getInt(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("BitsPerComponent")); +#else obj1.free(); maskDict->lookup(const_cast("BitsPerComponent"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("BPC")); +#else obj1.free(); maskDict->lookup(const_cast("BPC"), &obj1); +#endif } if (!obj1.isInt()) { goto err2; } int maskBits = obj1.getInt(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Interpolate")); +#else obj1.free(); maskDict->lookup("Interpolate", &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("I")); +#else obj1.free(); maskDict->lookup("I", &obj1); +#endif } if (obj1.isBool()) maskInterpolate = obj1.getBool(); else maskInterpolate = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("ColorSpace")); +#else obj1.free(); maskDict->lookup(const_cast("ColorSpace"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("CS")); +#else obj1.free(); maskDict->lookup(const_cast("CS"), &obj1); +#endif } if (obj1.isName()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = res->lookupColorSpace(obj1.getName()); +#else res->lookupColorSpace(obj1.getName(), &obj2); +#endif if (!obj2.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = std::move(obj2); +#else obj1.free(); obj1 = obj2; +#endif } else { +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } } #if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) @@@@ -2824,17 +3186,29 @@@@ void PdfParser::doImage(Object * /*ref*/ d145 5 a149 317 GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL); #endif +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) { goto err1; } +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Decode")); +#else maskDict->lookup(const_cast("Decode"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("D")); +#else obj1.free(); maskDict->lookup(const_cast("D"), &obj1); +#endif } maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif if (!maskColorMap->isOk()) { delete maskColorMap; goto err1; @@@@ -2845,9 +3219,15 @@@@ void PdfParser::doImage(Object * /*ref*/ // color key mask int i; for (i = 0; i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskObj.arrayGet(i); +#else maskObj.arrayGet(i, &obj1); +#endif maskColors[i] = obj1.getInt(); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif } haveColorKeyMask = gTrue; } else if (maskObj.isStream()) { @@@@ -2857,61 +3237,111 @@@@ void PdfParser::doImage(Object * /*ref*/ } maskStr = maskObj.getStream(); maskDict = maskObj.streamGetDict(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Width")); +#else maskDict->lookup(const_cast("Width"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("W")); +#else obj1.free(); maskDict->lookup(const_cast("W"), &obj1); +#endif } if (!obj1.isInt()) { goto err2; } maskWidth = obj1.getInt(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Height")); +#else obj1.free(); maskDict->lookup(const_cast("Height"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("H")); +#else obj1.free(); maskDict->lookup(const_cast("H"), &obj1); +#endif } if (!obj1.isInt()) { goto err2; } maskHeight = obj1.getInt(); +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("ImageMask")); +#else obj1.free(); maskDict->lookup(const_cast("ImageMask"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("IM")); +#else obj1.free(); maskDict->lookup(const_cast("IM"), &obj1); +#endif } if (!obj1.isBool() || !obj1.getBool()) { goto err2; } +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup("Interpolate"); +#else obj1.free(); maskDict->lookup("Interpolate", &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup("I"); +#else obj1.free(); maskDict->lookup("I", &obj1); +#endif } if (obj1.isBool()) maskInterpolate = obj1.getBool(); else maskInterpolate = gFalse; +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif maskInvert = gFalse; +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("Decode")); +#else maskDict->lookup(const_cast("Decode"), &obj1); +#endif if (obj1.isNull()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = maskDict->lookup(const_cast("D")); +#else obj1.free(); maskDict->lookup(const_cast("D"), &obj1); +#endif } if (obj1.isArray()) { +#if defined(POPPLER_NEW_OBJECT_API) + obj2 = obj1.arrayGet(0); +#else obj1.arrayGet(0, &obj2); +#endif if (obj2.isInt() && obj2.getInt() == 1) { maskInvert = gTrue; } +#if !defined(POPPLER_NEW_OBJECT_API) obj2.free(); +#endif } else if (!obj1.isNull()) { goto err2; } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif haveExplicitMask = gTrue; } @@@@ -2929,14 +3359,18 @@@@ void PdfParser::doImage(Object * /*ref*/ } delete colorMap; +#if !defined(POPPLER_NEW_OBJECT_API) maskObj.free(); smaskObj.free(); +#endif } return; err2: +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif err1: error(errSyntaxError, getPos(), "Bad image parameters"); } @@@@ -2961,52 +3395,97 @@@@ void PdfParser::doForm(Object *str) { dict = str->streamGetDict(); // check form type +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = dict->lookup(const_cast("FormType")); +#else dict->lookup(const_cast("FormType"), &obj1); +#endif if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) { error(errSyntaxError, getPos(), "Unknown form type"); } +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif // get bounding box +#if defined(POPPLER_NEW_OBJECT_API) + bboxObj = dict->lookup(const_cast("BBox")); +#else dict->lookup(const_cast("BBox"), &bboxObj); +#endif if (!bboxObj.isArray()) { +#if !defined(POPPLER_NEW_OBJECT_API) bboxObj.free(); +#endif error(errSyntaxError, getPos(), "Bad form bounding box"); return; } for (i = 0; i < 4; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = bboxObj.arrayGet(i); +#else bboxObj.arrayGet(i, &obj1); +#endif bbox[i] = obj1.getNum(); +#if defined(POPPLER_NEW_OBJECT_API) + } +#else obj1.free(); } bboxObj.free(); +#endif // get matrix +#if defined(POPPLER_NEW_OBJECT_API) + matrixObj = dict->lookup(const_cast("Matrix")); +#else dict->lookup(const_cast("Matrix"), &matrixObj); +#endif if (matrixObj.isArray()) { for (i = 0; i < 6; ++i) { +#if defined(POPPLER_NEW_OBJECT_API) + obj1 = matrixObj.arrayGet(i); +#else matrixObj.arrayGet(i, &obj1); +#endif m[i] = obj1.getNum(); +#if !defined(POPPLER_NEW_OBJECT_API) obj1.free(); +#endif } } else { m[0] = 1; m[1] = 0; m[2] = 0; m[3] = 1; m[4] = 0; m[5] = 0; } +#if !defined(POPPLER_NEW_OBJECT_API) matrixObj.free(); +#endif // get resources +#if defined(POPPLER_NEW_OBJECT_API) + resObj = dict->lookup(const_cast("Resources")); +#else dict->lookup(const_cast("Resources"), &resObj); +#endif resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL; // check for a transparency group transpGroup = isolated = knockout = gFalse; blendingColorSpace = NULL; +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj1 = dict->lookup(const_cast("Group"))).isDict()) { + if ((obj2 = obj1.dictLookup(const_cast("S"))).isName(const_cast("Transparency"))) { +#else if (dict->lookup(const_cast("Group"), &obj1)->isDict()) { if (obj1.dictLookup(const_cast("S"), &obj2)->isName(const_cast("Transparency"))) { +#endif transpGroup = gTrue; +#if defined(POPPLER_NEW_OBJECT_API) + if (!((obj3 = obj1.dictLookup(const_cast("CS"))).isNull())) { +#else if (!obj1.dictLookup(const_cast("CS"), &obj3)->isNull()) { +#endif #if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) blendingColorSpace = GfxColorSpace::parse(NULL, &obj3, NULL, NULL); #elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) @@@@ -3015,19 +3494,32 @@@@ void PdfParser::doForm(Object *str) { blendingColorSpace = GfxColorSpace::parse(&obj3, NULL); #endif } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj3 = obj1.dictLookup(const_cast("I"))).isBool()) { +#else obj3.free(); if (obj1.dictLookup(const_cast("I"), &obj3)->isBool()) { +#endif isolated = obj3.getBool(); } +#if defined(POPPLER_NEW_OBJECT_API) + if ((obj3 = obj1.dictLookup(const_cast("K"))).isBool()) { +#else obj3.free(); if (obj1.dictLookup(const_cast("K"), &obj3)->isBool()) { +#endif knockout = obj3.getBool(); } +#if defined(POPPLER_NEW_OBJECT_API) + } + } +#else obj3.free(); } obj2.free(); } obj1.free(); +#endif // draw it ++formDepth; @@@@ -3038,7 +3530,9 @@@@ void PdfParser::doForm(Object *str) { if (blendingColorSpace) { delete blendingColorSpace; } +#if !defined(POPPLER_NEW_OBJECT_API) resObj.free(); +#endif } void PdfParser::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox, @@@@ -3166,35 +3660,61 @@@@ Stream *PdfParser::buildImageStream() { d153 1 a153 11 +#if defined(POPPLER_NEW_OBJECT_API) + dict = Object(new Dict(xref)); + obj = parser->getObj(); +#else dict.initDict(xref); parser->getObj(&obj); +#endif while (!obj.isCmd(const_cast("ID")) && !obj.isEOF()) { if (!obj.isName()) { error(errSyntaxError, getPos(), "Inline image dictionary key must be a name object"); +#if !defined(POPPLER_NEW_OBJECT_API) d155 1 a155 1 +#endif d157 13 a169 9 key = copyString(obj.getName()); +#if defined(POPPLER_NEW_OBJECT_API) + obj = parser->getObj(); +#else obj.free(); parser->getObj(&obj); +#endif if (obj.isEOF() || obj.isError()) { gfree(key); d172 13 a184 9 +#if defined(POPPLER_NEW_OBJECT_API) + dict.dictAdd(key, std::move(obj)); + } + obj = parser->getObj(); +#else dict.dictAdd(key, &obj); } parser->getObj(&obj); +#endif a187 21 +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); dict.free(); +#endif return NULL; } +#if !defined(POPPLER_NEW_OBJECT_API) obj.free(); +#endif // make stream +#if defined(POPPLER_NEW_OBJECT_API) + str = new EmbedStream(parser->getStream(), dict.copy(), gFalse, 0); + str = str->addFilters(dict.getDict()); +#else str = new EmbedStream(parser->getStream(), &dict, gFalse, 0); str = str->addFilters(&dict); +#endif return str; } @ 1.8 log @inkscape: fix build with poppler-0.65.0 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.7 2018/05/01 06:17:11 wiz Exp $ d22 9 d119 11 d532 27 d613 14 @ 1.7 log @inkscape: fix build with poppler-0.64.0 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.6 2017/09/09 21:48:56 prlw1 Exp $ d10 5 a14 2 @@@@ -41,7 +41,7 @@@@ extern "C" { #include "goo/GooHash.h" d22 1 a22 1 @@@@ -414,13 +414,21 @@@@ void PdfParser::parse(Object *obj, GBool d44 1 a44 1 @@@@ -439,7 +447,11 @@@@ void PdfParser::go(GBool /*topLevel*/) d56 1 a56 1 @@@@ -457,14 +469,20 @@@@ void PdfParser::go(GBool /*topLevel*/) d77 1 a77 1 @@@@ -475,13 +493,21 @@@@ void PdfParser::go(GBool /*topLevel*/) d99 1 a99 1 @@@@ -495,8 +521,10 @@@@ void PdfParser::go(GBool /*topLevel*/) d110 1 a110 1 @@@@ -692,9 +720,13 @@@@ void PdfParser::opSetDash(Object args[], d124 1 a124 1 @@@@ -744,12 +776,18 @@@@ void PdfParser::opSetExtGState(Object ar d143 1 a143 1 @@@@ -759,7 +797,11 @@@@ void PdfParser::opSetExtGState(Object ar d155 1 a155 1 @@@@ -767,40 +809,71 @@@@ void PdfParser::opSetExtGState(Object ar d227 1 a227 1 @@@@ -809,9 +882,15 @@@@ void PdfParser::opSetExtGState(Object ar d243 1 a243 1 @@@@ -828,21 +907,37 @@@@ void PdfParser::opSetExtGState(Object ar d281 1 a281 1 @@@@ -851,26 +946,45 @@@@ void PdfParser::opSetExtGState(Object ar d327 1 a327 1 @@@@ -879,15 +993,25 @@@@ void PdfParser::opSetExtGState(Object ar d353 1 a353 1 @@@@ -906,18 +1030,24 @@@@ void PdfParser::opSetExtGState(Object ar d378 1 a378 1 @@@@ -938,43 +1068,79 @@@@ void PdfParser::doSoftMask(Object *str, d458 1 a458 1 @@@@ -987,7 +1153,9 @@@@ void PdfParser::doSoftMask(Object *str, d468 1 a468 1 @@@@ -1084,7 +1252,11 @@@@ void PdfParser::opSetFillColorSpace(Obje d480 1 a480 1 @@@@ -1106,7 +1278,9 @@@@ void PdfParser::opSetFillColorSpace(Obje d490 1 a490 1 @@@@ -1125,7 +1299,11 @@@@ void PdfParser::opSetStrokeColorSpace(Ob d502 1 a502 1 @@@@ -1145,7 +1323,9 @@@@ void PdfParser::opSetStrokeColorSpace(Ob d512 1 a512 1 @@@@ -2310,7 +2490,7 @@@@ void PdfParser::opShowText(Object args[] d521 1 a521 1 @@@@ -2331,7 +2511,7 @@@@ void PdfParser::opMoveShowText(Object ar d530 1 a530 1 @@@@ -2354,7 +2534,7 @@@@ void PdfParser::opMoveSetShowText(Object d539 1 a539 1 @@@@ -2375,7 +2555,11 @@@@ void PdfParser::opShowSpaceText(Object a d551 1 a551 1 @@@@ -2388,11 +2572,13 @@@@ void PdfParser::opShowSpaceText(Object a d566 1 a566 1 @@@@ -2465,7 +2651,11 @@@@ void PdfParser::doShowText(GooString *s) d578 1 a578 1 @@@@ -2478,7 +2668,9 @@@@ void PdfParser::doShowText(GooString *s) d588 1 a588 1 @@@@ -2540,24 +2732,44 @@@@ void PdfParser::opXObject(Object args[], d634 1 a634 1 @@@@ -2565,8 +2777,10 @@@@ void PdfParser::opXObject(Object args[], d645 1 a645 1 @@@@ -2593,10 +2807,18 @@@@ void PdfParser::doImage(Object * /*ref*/ d664 1 a664 1 @@@@ -2607,11 +2829,19 @@@@ void PdfParser::doImage(Object * /*ref*/ d684 1 a684 1 @@@@ -2622,26 +2852,46 @@@@ void PdfParser::doImage(Object * /*ref*/ d731 1 a731 1 @@@@ -2650,14 +2900,24 @@@@ void PdfParser::doImage(Object * /*ref*/ d756 1 a756 1 @@@@ -2666,7 +2926,9 @@@@ void PdfParser::doImage(Object * /*ref*/ d766 1 a766 1 @@@@ -2676,21 +2938,37 @@@@ void PdfParser::doImage(Object * /*ref*/ d804 1 a804 1 @@@@ -2698,18 +2976,36 @@@@ void PdfParser::doImage(Object * /*ref*/ d841 1 a841 1 @@@@ -2729,17 +3025,29 @@@@ void PdfParser::doImage(Object * /*ref*/ d871 1 a871 1 @@@@ -2753,8 +3061,13 @@@@ void PdfParser::doImage(Object * /*ref*/ d885 1 a885 1 @@@@ -2763,58 +3076,108 @@@@ void PdfParser::doImage(Object * /*ref*/ d994 1 a994 1 @@@@ -2824,17 +3187,29 @@@@ void PdfParser::doImage(Object * /*ref*/ d1024 1 a1024 1 @@@@ -2845,9 +3220,15 @@@@ void PdfParser::doImage(Object * /*ref*/ d1040 1 a1040 1 @@@@ -2857,61 +3238,111 @@@@ void PdfParser::doImage(Object * /*ref*/ d1152 1 a1152 1 @@@@ -2929,14 +3360,18 @@@@ void PdfParser::doImage(Object * /*ref*/ d1171 1 a1171 1 @@@@ -2961,52 +3396,97 @@@@ void PdfParser::doForm(Object *str) { d1269 1 a1269 1 @@@@ -3015,19 +3495,32 @@@@ void PdfParser::doForm(Object *str) { d1302 1 a1302 1 @@@@ -3038,7 +3531,9 @@@@ void PdfParser::doForm(Object *str) { d1312 1 a1312 1 @@@@ -3166,35 +3661,61 @@@@ Stream *PdfParser::buildImageStream() { @ 1.6 log @Support poppler 0.58 https://gitlab.com/inkscape/inkscape/commit/9418824967eb4c53371ef8588243fed4cab496e0 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.5 2015/02/03 13:55:12 adam Exp $ d6 1 d8 1 a8 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2014-06-09 13:24:41.000000000 +0000 d10 1 a10 1 @@@@ -38,7 +38,7 @@@@ extern "C" { d509 27 d548 6 a553 1 @@@@ -2392,7 +2576,9 @@@@ void PdfParser::opShowSpaceText(Object a d585 2 a586 1 @@@@ -2541,23 +2733,43 @@@@ void PdfParser::opXObject(Object args[], d589 2 a590 1 char *name = args[0].getName(); @ 1.5 log @Changes 0.91: Cairo rendering for display and PNG export OpenMP multithreading for all filters C++ code conversion Major improvements in the Text tool Measure tool Type design features Symbol library and support for Visio stencils Cross platform WMF and EMF import and export Improved support for Corel DRAW documents, Visio importer Support for real world document and page size units, e.g. millimeters Numerous usability improvements Native Windows 64-bit build @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.4 2015/01/08 16:34:29 wiz Exp $ d3 3 a5 1 Object.h is included in pdf-parser.h -- see patch for pdf-parser.h. d18 1318 @ 1.4 log @Fix build with poppler-0.29+ based on https://bugs.launchpad.net/inkscape/+bug/1399811 @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.3 2014/07/29 07:03:27 adam Exp $ a4 2 Fix build with poppler-0.29+ based on https://bugs.launchpad.net/inkscape/+bug/1399811 a15 78 @@@@ -860,7 +859,9 @@@@ void PdfParser::opSetExtGState(Object ar blendingColorSpace = NULL; isolated = knockout = gFalse; if (!obj4.dictLookup(const_cast("CS"), &obj5)->isNull()) { -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + blendingColorSpace = GfxColorSpace::parse(NULL, &obj5, NULL, NULL); +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) blendingColorSpace = GfxColorSpace::parse(&obj5, NULL, NULL); #elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) blendingColorSpace = GfxColorSpace::parse(&obj5, NULL); @@@@ -1085,7 +1086,13 @@@@ void PdfParser::opSetFillColorSpace(Obje state->setFillPattern(NULL); res->lookupColorSpace(args[0].getName(), &obj); -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + if (obj.isNull()) { + colorSpace = GfxColorSpace::parse(NULL, &args[0], NULL, NULL); + } else { + colorSpace = GfxColorSpace::parse(NULL, &obj, NULL, NULL); + } +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) if (obj.isNull()) { colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL); } else { @@@@ -1126,7 +1133,13 @@@@ void PdfParser::opSetStrokeColorSpace(Ob state->setStrokePattern(NULL); res->lookupColorSpace(args[0].getName(), &obj); -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + if (obj.isNull()) { + colorSpace = GfxColorSpace::parse(NULL, &args[0], NULL, NULL); + } else { + colorSpace = GfxColorSpace::parse(NULL, &obj, NULL, NULL); + } +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) if (obj.isNull()) { colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL); } else { @@@@ -2756,8 +2769,10 @@@@ void PdfParser::doImage(Object *ref, Str } } if (!obj1.isNull()) { -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) - colorSpace = GfxColorSpace::parse(&obj1, NULL, NULL); +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + colorSpace = GfxColorSpace::parse(NULL, &obj1, NULL, NULL); +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) + colorSpace = GfxColorSpace::parse(&obj1, NULL, NULL); #elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) colorSpace = GfxColorSpace::parse(&obj1, NULL); #else @@@@ -2847,8 +2862,10 @@@@ void PdfParser::doImage(Object *ref, Str obj2.free(); } } -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) - GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL, NULL); +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + GfxColorSpace *maskColorSpace = GfxColorSpace::parse(NULL, &obj1, NULL, NULL); +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) + GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL, NULL); #elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) maskColorSpace = GfxColorSpace::parse(&obj1, NULL); #else @@@@ -3040,7 +3057,9 @@@@ void PdfParser::doForm(Object *str) { if (obj1.dictLookup(const_cast("S"), &obj2)->isName(const_cast("Transparency"))) { transpGroup = gTrue; if (!obj1.dictLookup(const_cast("CS"), &obj3)->isNull()) { -#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) +#if defined(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API) + blendingColorSpace = GfxColorSpace::parse(NULL, &obj3, NULL, NULL); +#elif defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API) blendingColorSpace = GfxColorSpace::parse(&obj3, NULL, NULL); #elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) blendingColorSpace = GfxColorSpace::parse(&obj3, NULL); @ 1.3 log @Changes 0.48.5: Adobe Illustrator SVG files containing entities can be loaded again Support for Poppler 0.26 Support for Boehm-GC 7.4.0 and later Several crash bugs were fixed 64-bit compilation is now possible on Windows @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.2 2014/04/30 06:15:20 wiz Exp $ d5 3 a7 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2012-12-13 17:00:46.000000000 +0000 d9 1 a9 1 @@@@ -38,7 +38,6 @@@@ extern "C" { d14 1 d18 78 @ 1.2 log @Fix build with poppler-0.26.0. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.1 2012/12/30 10:31:14 adam Exp $ a4 2 Fix build with poppler-0.26.0. a14 87 @@@@ -861,7 +860,7 @@@@ void PdfParser::opSetExtGState(Object ar isolated = knockout = gFalse; if (!obj4.dictLookup(const_cast("CS"), &obj5)->isNull()) { #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) - blendingColorSpace = GfxColorSpace::parse(&obj5, NULL); + blendingColorSpace = GfxColorSpace::parse(&obj5, NULL, state); #else blendingColorSpace = GfxColorSpace::parse(&obj5); #endif @@@@ -1085,9 +1084,9 @@@@ void PdfParser::opSetFillColorSpace(Obje res->lookupColorSpace(args[0].getName(), &obj); #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) if (obj.isNull()) { - colorSpace = GfxColorSpace::parse(&args[0], NULL); + colorSpace = GfxColorSpace::parse(&args[0], NULL, state); } else { - colorSpace = GfxColorSpace::parse(&obj, NULL); + colorSpace = GfxColorSpace::parse(&obj, NULL, state); } #else if (obj.isNull()) { @@@@ -1120,9 +1119,9 @@@@ void PdfParser::opSetStrokeColorSpace(Ob res->lookupColorSpace(args[0].getName(), &obj); #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) if (obj.isNull()) { - colorSpace = GfxColorSpace::parse(&args[0], NULL); + colorSpace = GfxColorSpace::parse(&args[0], NULL, state); } else { - colorSpace = GfxColorSpace::parse(&obj, NULL); + colorSpace = GfxColorSpace::parse(&obj, NULL, state); } #else if (obj.isNull()) { @@@@ -1213,7 +1212,7 @@@@ void PdfParser::opSetFillColorN(Object a } #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) if (args[numArgs-1].isName() && - (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) { + (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL, state))) { state->setFillPattern(pattern); builder->updateStyle(state); } @@@@ -1273,7 +1272,7 @@@@ void PdfParser::opSetStrokeColorN(Object } #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) if (args[numArgs-1].isName() && - (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) { + (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL, state))) { state->setStrokePattern(pattern); builder->updateStyle(state); } @@@@ -1711,7 +1710,7 @@@@ void PdfParser::opShFill(Object args[], GBool savedState = gFalse; #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) - if (!(shading = res->lookupShading(args[0].getName(), NULL))) { + if (!(shading = res->lookupShading(args[0].getName(), NULL, state))) { return; } #else @@@@ -2727,7 +2726,7 @@@@ void PdfParser::doImage(Object *ref, Str } if (!obj1.isNull()) { #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) - colorSpace = GfxColorSpace::parse(&obj1, NULL); + colorSpace = GfxColorSpace::parse(&obj1, NULL, state); #else colorSpace = GfxColorSpace::parse(&obj1); #endif @@@@ -2816,7 +2815,7 @@@@ void PdfParser::doImage(Object *ref, Str } } #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) - maskColorSpace = GfxColorSpace::parse(&obj1, NULL); + maskColorSpace = GfxColorSpace::parse(&obj1, NULL, state); #else maskColorSpace = GfxColorSpace::parse(&obj1); #endif @@@@ -3007,7 +3006,7 @@@@ void PdfParser::doForm(Object *str) { transpGroup = gTrue; if (!obj1.dictLookup(const_cast("CS"), &obj3)->isNull()) { #if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI) - blendingColorSpace = GfxColorSpace::parse(&obj3, NULL); + blendingColorSpace = GfxColorSpace::parse(&obj3, NULL, state); #else blendingColorSpace = GfxColorSpace::parse(&obj3); #endif @ 1.1 log @Fix Object.h conflict @ text @d1 1 a1 1 $NetBSD$ d5 3 a7 1 --- src/extension/internal/pdfinput/pdf-parser.cpp.orig 2012-12-30 09:44:48.000000000 +0000 d17 87 @