|
|
f96855 |
--- inkscape-0.92.3/src/extension/internal/pdfinput/pdf-input.cpp
|
|
|
f96855 |
+++ inkscape-0.92.3/src/extension/internal/pdfinput/pdf-input.cpp
|
|
|
f96855 |
@@ -319,7 +319,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc
|
|
|
f96855 |
_render_thumb = true;
|
|
|
f96855 |
|
|
|
f96855 |
// Create PopplerDocument
|
|
|
f96855 |
- Glib::ustring filename = _pdf_doc->getFileName()->getCString();
|
|
|
f96855 |
+ Glib::ustring filename = _pdf_doc->getFileName()->c_str();
|
|
|
f96855 |
if (!Glib::path_is_absolute(filename)) {
|
|
|
f96855 |
filename = Glib::build_filename(Glib::get_current_dir(),filename);
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -694,7 +694,7 @@ PdfInput::open(::Inkscape::Extension::In
|
|
|
f96855 |
globalParams = new GlobalParams();
|
|
|
f96855 |
}
|
|
|
f96855 |
#else
|
|
|
f96855 |
- globalParams = new GlobalParams();
|
|
|
f96855 |
+ globalParams.reset(new GlobalParams());
|
|
|
f96855 |
#endif // ENABLE_OSX_APP_LOCATIONS
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
@@ -793,7 +793,7 @@ PdfInput::open(::Inkscape::Extension::In
|
|
|
f96855 |
dlg->getImportSettings(prefs);
|
|
|
f96855 |
|
|
|
f96855 |
// Apply crop settings
|
|
|
f96855 |
- PDFRectangle *clipToBox = NULL;
|
|
|
f96855 |
+ const PDFRectangle *clipToBox = NULL;
|
|
|
f96855 |
double crop_setting;
|
|
|
f96855 |
sp_repr_get_double(prefs, "cropTo", &crop_setting);
|
|
|
f96855 |
|
|
|
f96855 |
--- inkscape-0.92.3/src/extension/internal/pdfinput/pdf-parser.cpp
|
|
|
f96855 |
+++ inkscape-0.92.3/src/extension/internal/pdfinput/pdf-parser.cpp
|
|
|
f96855 |
@@ -270,8 +270,8 @@ public:
|
|
|
f96855 |
// Manipulate clip path stack
|
|
|
f96855 |
ClipHistoryEntry *save();
|
|
|
f96855 |
ClipHistoryEntry *restore();
|
|
|
f96855 |
- GBool hasSaves() { return saved != NULL; }
|
|
|
f96855 |
- void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
|
|
|
f96855 |
+ bool hasSaves() { return saved != NULL; }
|
|
|
f96855 |
+ void setClip(const GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
|
|
|
f96855 |
GfxPath *getClipPath() { return clipPath; }
|
|
|
f96855 |
GfxClipType getClipType() { return clipType; }
|
|
|
f96855 |
|
|
|
f96855 |
@@ -294,15 +294,15 @@ PdfParser::PdfParser(XRef *xrefA,
|
|
|
f96855 |
int /*pageNum*/,
|
|
|
f96855 |
int rotate,
|
|
|
f96855 |
Dict *resDict,
|
|
|
f96855 |
- PDFRectangle *box,
|
|
|
f96855 |
- PDFRectangle *cropBox) :
|
|
|
f96855 |
+ const PDFRectangle *box,
|
|
|
f96855 |
+ const PDFRectangle *cropBox) :
|
|
|
f96855 |
xref(xrefA),
|
|
|
f96855 |
builder(builderA),
|
|
|
f96855 |
- subPage(gFalse),
|
|
|
f96855 |
+ subPage(false),
|
|
|
f96855 |
printCommands(false),
|
|
|
f96855 |
res(new GfxResources(xref, resDict, NULL)), // start the resource stack
|
|
|
f96855 |
- state(new GfxState(72.0, 72.0, box, rotate, gTrue)),
|
|
|
f96855 |
- fontChanged(gFalse),
|
|
|
f96855 |
+ state(new GfxState(72.0, 72.0, box, rotate, true)),
|
|
|
f96855 |
+ fontChanged(false),
|
|
|
f96855 |
clip(clipNone),
|
|
|
f96855 |
ignoreUndef(0),
|
|
|
f96855 |
baseMatrix(),
|
|
|
f96855 |
@@ -317,7 +317,7 @@ PdfParser::PdfParser(XRef *xrefA,
|
|
|
f96855 |
builder->setDocumentSize(Inkscape::Util::Quantity::convert(state->getPageWidth(), "pt", "px"),
|
|
|
f96855 |
Inkscape::Util::Quantity::convert(state->getPageHeight(), "pt", "px"));
|
|
|
f96855 |
|
|
|
f96855 |
- double *ctm = state->getCTM();
|
|
|
f96855 |
+ const double *ctm = state->getCTM();
|
|
|
f96855 |
double scaledCTM[6];
|
|
|
f96855 |
for (int i = 0; i < 6; ++i) {
|
|
|
f96855 |
baseMatrix[i] = ctm[i];
|
|
|
f96855 |
@@ -352,14 +352,14 @@ PdfParser::PdfParser(XRef *xrefA,
|
|
|
f96855 |
PdfParser::PdfParser(XRef *xrefA,
|
|
|
f96855 |
Inkscape::Extension::Internal::SvgBuilder *builderA,
|
|
|
f96855 |
Dict *resDict,
|
|
|
f96855 |
- PDFRectangle *box) :
|
|
|
f96855 |
+ const PDFRectangle *box) :
|
|
|
f96855 |
xref(xrefA),
|
|
|
f96855 |
builder(builderA),
|
|
|
f96855 |
- subPage(gTrue),
|
|
|
f96855 |
+ subPage(true),
|
|
|
f96855 |
printCommands(false),
|
|
|
f96855 |
res(new GfxResources(xref, resDict, NULL)), // start the resource stack
|
|
|
f96855 |
- state(new GfxState(72, 72, box, 0, gFalse)),
|
|
|
f96855 |
- fontChanged(gFalse),
|
|
|
f96855 |
+ state(new GfxState(72, 72, box, 0, false)),
|
|
|
f96855 |
+ fontChanged(false),
|
|
|
f96855 |
clip(clipNone),
|
|
|
f96855 |
ignoreUndef(0),
|
|
|
f96855 |
baseMatrix(),
|
|
|
f96855 |
@@ -408,7 +408,7 @@ PdfParser::~PdfParser() {
|
|
|
f96855 |
}
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::parse(Object *obj, GBool topLevel) {
|
|
|
f96855 |
+void PdfParser::parse(Object *obj, bool topLevel) {
|
|
|
f96855 |
Object obj2;
|
|
|
f96855 |
|
|
|
f96855 |
if (obj->isArray()) {
|
|
|
f96855 |
@@ -433,13 +433,13 @@ void PdfParser::parse(Object *obj, GBool
|
|
|
f96855 |
error(errInternal, -1, "Weird page contents");
|
|
|
f96855 |
return;
|
|
|
f96855 |
}
|
|
|
f96855 |
- parser = new Parser(xref, new Lexer(xref, obj), gFalse);
|
|
|
f96855 |
+ parser = new Parser(xref, obj, false);
|
|
|
f96855 |
go(topLevel);
|
|
|
f96855 |
delete parser;
|
|
|
f96855 |
parser = NULL;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::go(GBool /*topLevel*/)
|
|
|
f96855 |
+void PdfParser::go(bool /*topLevel*/)
|
|
|
f96855 |
{
|
|
|
f96855 |
Object obj;
|
|
|
f96855 |
Object args[maxArgs];
|
|
|
f96855 |
@@ -571,7 +571,7 @@ const char *PdfParser::getPreviousOperat
|
|
|
f96855 |
|
|
|
f96855 |
void PdfParser::execOp(Object *cmd, Object args[], int numArgs) {
|
|
|
f96855 |
PdfOperator *op;
|
|
|
f96855 |
- char *name;
|
|
|
f96855 |
+ const char *name;
|
|
|
f96855 |
Object *argPtr;
|
|
|
f96855 |
int i;
|
|
|
f96855 |
|
|
|
f96855 |
@@ -619,7 +619,7 @@ void PdfParser::execOp(Object *cmd, Obje
|
|
|
f96855 |
(this->*op->func)(argPtr, numArgs);
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-PdfOperator* PdfParser::findOp(char *name) {
|
|
|
f96855 |
+PdfOperator* PdfParser::findOp(const char *name) {
|
|
|
f96855 |
int a = -1;
|
|
|
f96855 |
int b = numOps;
|
|
|
f96855 |
int cmp = -1;
|
|
|
f96855 |
@@ -639,7 +639,7 @@ PdfOperator* PdfParser::findOp(char *nam
|
|
|
f96855 |
return &opTab[a];
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-GBool PdfParser::checkArg(Object *arg, TchkType type) {
|
|
|
f96855 |
+bool PdfParser::checkArg(Object *arg, TchkType type) {
|
|
|
f96855 |
switch (type) {
|
|
|
f96855 |
case tchkBool: return arg->isBool();
|
|
|
f96855 |
case tchkInt: return arg->isInt();
|
|
|
f96855 |
@@ -649,9 +649,9 @@ GBool PdfParser::checkArg(Object *arg, T
|
|
|
f96855 |
case tchkArray: return arg->isArray();
|
|
|
f96855 |
case tchkProps: return arg->isDict() || arg->isName();
|
|
|
f96855 |
case tchkSCN: return arg->isNum() || arg->isName();
|
|
|
f96855 |
- case tchkNone: return gFalse;
|
|
|
f96855 |
+ case tchkNone: return false;
|
|
|
f96855 |
}
|
|
|
f96855 |
- return gFalse;
|
|
|
f96855 |
+ return false;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
int PdfParser::getPos() {
|
|
|
f96855 |
@@ -706,7 +706,7 @@ void PdfParser::opConcat(Object args[],
|
|
|
f96855 |
builder->pushGroup();
|
|
|
f96855 |
builder->setTransform(a0, a1, a2, a3, a4, a5);
|
|
|
f96855 |
}
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
// TODO not good that numArgs is ignored but args[] is used:
|
|
|
f96855 |
@@ -772,8 +772,8 @@ void PdfParser::opSetExtGState(Object ar
|
|
|
f96855 |
Object obj1, obj2, obj3, obj4, obj5;
|
|
|
f96855 |
Function *funcs[4] = {0, 0, 0, 0};
|
|
|
f96855 |
GfxColor backdropColor;
|
|
|
f96855 |
- GBool haveBackdropColor = gFalse;
|
|
|
f96855 |
- GBool alpha = gFalse;
|
|
|
f96855 |
+ bool haveBackdropColor = false;
|
|
|
f96855 |
+ bool alpha = false;
|
|
|
f96855 |
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
if ((obj1 = res->lookupGState(args[0].getName())).isNull()) {
|
|
|
f96855 |
@@ -829,7 +829,7 @@ void PdfParser::opSetExtGState(Object ar
|
|
|
f96855 |
#endif
|
|
|
f96855 |
|
|
|
f96855 |
// fill/stroke overprint
|
|
|
f96855 |
- GBool haveFillOP = gFalse;
|
|
|
f96855 |
+ bool haveFillOP = false;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
if ((haveFillOP = (obj2 = obj1.dictLookup(const_cast<char*>("op"))).isBool())) {
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -924,9 +924,9 @@ void PdfParser::opSetExtGState(Object ar
|
|
|
f96855 |
#else
|
|
|
f96855 |
if (obj2.dictLookup(const_cast<char*>("S"), &obj3)->isName(const_cast<char*>("Alpha"))) {
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- alpha = gTrue;
|
|
|
f96855 |
+ alpha = true;
|
|
|
f96855 |
} else { // "Luminosity"
|
|
|
f96855 |
- alpha = gFalse;
|
|
|
f96855 |
+ alpha = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj3.free();
|
|
|
f96855 |
@@ -977,8 +977,8 @@ void PdfParser::opSetExtGState(Object ar
|
|
|
f96855 |
if (obj3.streamGetDict()->lookup(const_cast<char*>("Group"), &obj4)->isDict()) {
|
|
|
f96855 |
#endif
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace = 0;
|
|
|
f96855 |
- GBool isolated = gFalse;
|
|
|
f96855 |
- GBool knockout = gFalse;
|
|
|
f96855 |
+ bool isolated = false;
|
|
|
f96855 |
+ bool knockout = false;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
if (!((obj5 = obj4.dictLookup(const_cast<char*>("CS"))).isNull())) {
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -1049,9 +1049,9 @@ void PdfParser::opSetExtGState(Object ar
|
|
|
f96855 |
#endif
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::doSoftMask(Object *str, GBool alpha,
|
|
|
f96855 |
+void PdfParser::doSoftMask(Object *str, bool alpha,
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace,
|
|
|
f96855 |
- GBool isolated, GBool knockout,
|
|
|
f96855 |
+ bool isolated, bool knockout,
|
|
|
f96855 |
Function *transferFunc, GfxColor *backdropColor) {
|
|
|
f96855 |
Dict *dict, *resDict;
|
|
|
f96855 |
double m[6], bbox[4];
|
|
|
f96855 |
@@ -1144,7 +1144,7 @@ void PdfParser::doSoftMask(Object *str,
|
|
|
f96855 |
|
|
|
f96855 |
// draw it
|
|
|
f96855 |
++formDepth;
|
|
|
f96855 |
- doForm1(str, resDict, m, bbox, gTrue, gTrue,
|
|
|
f96855 |
+ doForm1(str, resDict, m, bbox, true, true,
|
|
|
f96855 |
blendingColorSpace, isolated, knockout,
|
|
|
f96855 |
alpha, transferFunc, backdropColor);
|
|
|
f96855 |
--formDepth;
|
|
|
f96855 |
@@ -1614,7 +1614,7 @@ void PdfParser::opFill(Object /*args*/[]
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
if (state->getFillColorSpace()->getMode() == csPattern &&
|
|
|
f96855 |
!builder->isPatternTypeSupported(state->getFillPattern())) {
|
|
|
f96855 |
- doPatternFillFallback(gFalse);
|
|
|
f96855 |
+ doPatternFillFallback(false);
|
|
|
f96855 |
} else {
|
|
|
f96855 |
builder->addPath(state, true, false);
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1631,7 +1631,7 @@ void PdfParser::opEOFill(Object /*args*/
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
if (state->getFillColorSpace()->getMode() == csPattern &&
|
|
|
f96855 |
!builder->isPatternTypeSupported(state->getFillPattern())) {
|
|
|
f96855 |
- doPatternFillFallback(gTrue);
|
|
|
f96855 |
+ doPatternFillFallback(true);
|
|
|
f96855 |
} else {
|
|
|
f96855 |
builder->addPath(state, true, false, true);
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1646,7 +1646,7 @@ void PdfParser::opFillStroke(Object /*ar
|
|
|
f96855 |
return;
|
|
|
f96855 |
}
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
- doFillAndStroke(gFalse);
|
|
|
f96855 |
+ doFillAndStroke(false);
|
|
|
f96855 |
} else {
|
|
|
f96855 |
builder->addPath(state, true, true);
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1661,7 +1661,7 @@ void PdfParser::opCloseFillStroke(Object
|
|
|
f96855 |
}
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
state->closePath();
|
|
|
f96855 |
- doFillAndStroke(gFalse);
|
|
|
f96855 |
+ doFillAndStroke(false);
|
|
|
f96855 |
}
|
|
|
f96855 |
doEndPath();
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1673,7 +1673,7 @@ void PdfParser::opEOFillStroke(Object /*
|
|
|
f96855 |
return;
|
|
|
f96855 |
}
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
- doFillAndStroke(gTrue);
|
|
|
f96855 |
+ doFillAndStroke(true);
|
|
|
f96855 |
}
|
|
|
f96855 |
doEndPath();
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1686,20 +1686,20 @@ void PdfParser::opCloseEOFillStroke(Obje
|
|
|
f96855 |
}
|
|
|
f96855 |
if (state->isPath()) {
|
|
|
f96855 |
state->closePath();
|
|
|
f96855 |
- doFillAndStroke(gTrue);
|
|
|
f96855 |
+ doFillAndStroke(true);
|
|
|
f96855 |
}
|
|
|
f96855 |
doEndPath();
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::doFillAndStroke(GBool eoFill) {
|
|
|
f96855 |
- GBool fillOk = gTrue, strokeOk = gTrue;
|
|
|
f96855 |
+void PdfParser::doFillAndStroke(bool eoFill) {
|
|
|
f96855 |
+ bool fillOk = true, strokeOk = true;
|
|
|
f96855 |
if (state->getFillColorSpace()->getMode() == csPattern &&
|
|
|
f96855 |
!builder->isPatternTypeSupported(state->getFillPattern())) {
|
|
|
f96855 |
- fillOk = gFalse;
|
|
|
f96855 |
+ fillOk = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
if (state->getStrokeColorSpace()->getMode() == csPattern &&
|
|
|
f96855 |
!builder->isPatternTypeSupported(state->getStrokePattern())) {
|
|
|
f96855 |
- strokeOk = gFalse;
|
|
|
f96855 |
+ strokeOk = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
if (fillOk && strokeOk) {
|
|
|
f96855 |
builder->addPath(state, true, true, eoFill);
|
|
|
f96855 |
@@ -1709,7 +1709,7 @@ void PdfParser::doFillAndStroke(GBool eo
|
|
|
f96855 |
}
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::doPatternFillFallback(GBool eoFill) {
|
|
|
f96855 |
+void PdfParser::doPatternFillFallback(bool eoFill) {
|
|
|
f96855 |
GfxPattern *pattern;
|
|
|
f96855 |
|
|
|
f96855 |
if (!(pattern = state->getFillPattern())) {
|
|
|
f96855 |
@@ -1719,7 +1719,7 @@ void PdfParser::doPatternFillFallback(GB
|
|
|
f96855 |
case 1:
|
|
|
f96855 |
break;
|
|
|
f96855 |
case 2:
|
|
|
f96855 |
- doShadingPatternFillFallback(static_cast<GfxShadingPattern *>(pattern), gFalse, eoFill);
|
|
|
f96855 |
+ doShadingPatternFillFallback(static_cast<GfxShadingPattern *>(pattern), false, eoFill);
|
|
|
f96855 |
break;
|
|
|
f96855 |
default:
|
|
|
f96855 |
error(errUnimplemented, getPos(), "Unimplemented pattern type (%d) in fill",
|
|
|
f96855 |
@@ -1738,7 +1738,7 @@ void PdfParser::doPatternStrokeFallback(
|
|
|
f96855 |
case 1:
|
|
|
f96855 |
break;
|
|
|
f96855 |
case 2:
|
|
|
f96855 |
- doShadingPatternFillFallback(static_cast<GfxShadingPattern *>(pattern), gTrue, gFalse);
|
|
|
f96855 |
+ doShadingPatternFillFallback(static_cast<GfxShadingPattern *>(pattern), true, false);
|
|
|
f96855 |
break;
|
|
|
f96855 |
default:
|
|
|
f96855 |
error(errUnimplemented, getPos(), "Unimplemented pattern type ({0:d}) in stroke",
|
|
|
f96855 |
@@ -1748,10 +1748,10 @@ void PdfParser::doPatternStrokeFallback(
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
void PdfParser::doShadingPatternFillFallback(GfxShadingPattern *sPat,
|
|
|
f96855 |
- GBool stroke, GBool eoFill) {
|
|
|
f96855 |
+ bool stroke, bool eoFill) {
|
|
|
f96855 |
GfxShading *shading;
|
|
|
f96855 |
GfxPath *savedPath;
|
|
|
f96855 |
- double *ctm, *btm, *ptm;
|
|
|
f96855 |
+ const double *ctm, *btm, *ptm;
|
|
|
f96855 |
double m[6], ictm[6], m1[6];
|
|
|
f96855 |
double xMin, yMin, xMax, yMax;
|
|
|
f96855 |
double det;
|
|
|
f96855 |
@@ -1862,7 +1862,7 @@ void PdfParser::opShFill(Object args[],
|
|
|
f96855 |
double xTemp, yTemp;
|
|
|
f96855 |
double gradientTransform[6];
|
|
|
f96855 |
double *matrix = NULL;
|
|
|
f96855 |
- GBool savedState = gFalse;
|
|
|
f96855 |
+ bool savedState = false;
|
|
|
f96855 |
|
|
|
f96855 |
#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
|
|
|
f96855 |
if (!(shading = res->lookupShading(args[0].getName(), NULL, NULL))) {
|
|
|
f96855 |
@@ -1878,13 +1878,13 @@ void PdfParser::opShFill(Object args[],
|
|
|
f96855 |
if (shading->getType() != 2 && shading->getType() != 3) {
|
|
|
f96855 |
savedPath = state->getPath()->copy();
|
|
|
f96855 |
saveState();
|
|
|
f96855 |
- savedState = gTrue;
|
|
|
f96855 |
+ savedState = true;
|
|
|
f96855 |
} else { // get gradient transform if possible
|
|
|
f96855 |
// check proper operator sequence
|
|
|
f96855 |
// first there should be one W(*) and then one 'cm' somewhere before 'sh'
|
|
|
f96855 |
- GBool seenClip, seenConcat;
|
|
|
f96855 |
+ bool seenClip, seenConcat;
|
|
|
f96855 |
seenClip = (clipHistory->getClipPath() != NULL);
|
|
|
f96855 |
- seenConcat = gFalse;
|
|
|
f96855 |
+ seenConcat = false;
|
|
|
f96855 |
int i = 1;
|
|
|
f96855 |
while (i <= maxOperatorHistoryDepth) {
|
|
|
f96855 |
const char *opName = getPreviousOperator(i);
|
|
|
f96855 |
@@ -1892,7 +1892,7 @@ void PdfParser::opShFill(Object args[],
|
|
|
f96855 |
if (seenConcat) { // more than one 'cm'
|
|
|
f96855 |
break;
|
|
|
f96855 |
} else {
|
|
|
f96855 |
- seenConcat = gTrue;
|
|
|
f96855 |
+ seenConcat = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
}
|
|
|
f96855 |
i++;
|
|
|
f96855 |
@@ -1993,7 +1993,7 @@ void PdfParser::doFunctionShFill1(GfxFun
|
|
|
f96855 |
GfxColor color0M, color1M, colorM0, colorM1, colorMM;
|
|
|
f96855 |
GfxColor colors2[4];
|
|
|
f96855 |
double functionColorDelta = colorDeltas[pdfFunctionShading-1];
|
|
|
f96855 |
- double *matrix;
|
|
|
f96855 |
+ const double *matrix;
|
|
|
f96855 |
double xM, yM;
|
|
|
f96855 |
int nComps, i, j;
|
|
|
f96855 |
|
|
|
f96855 |
@@ -2173,7 +2173,7 @@ void PdfParser::doPatchMeshShFill(GfxPat
|
|
|
f96855 |
}
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::fillPatch(GfxPatch *patch, int nComps, int depth) {
|
|
|
f96855 |
+void PdfParser::fillPatch(const GfxPatch *patch, int nComps, int depth) {
|
|
|
f96855 |
GfxPatch patch00 = blankPatch();
|
|
|
f96855 |
GfxPatch patch01 = blankPatch();
|
|
|
f96855 |
GfxPatch patch10 = blankPatch();
|
|
|
f96855 |
@@ -2347,7 +2347,7 @@ void PdfParser::opBeginText(Object /*arg
|
|
|
f96855 |
state->setTextMat(1, 0, 0, 1, 0, 0);
|
|
|
f96855 |
state->textMoveTo(0, 0);
|
|
|
f96855 |
builder->updateTextPosition(0.0, 0.0);
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
builder->beginTextObject(state);
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
@@ -2375,20 +2375,20 @@ void PdfParser::opSetFont(Object args[],
|
|
|
f96855 |
// unsetting the font (drawing no text) is better than using the
|
|
|
f96855 |
// previous one and drawing random glyphs from it
|
|
|
f96855 |
state->setFont(NULL, args[1].getNum());
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
return;
|
|
|
f96855 |
}
|
|
|
f96855 |
if (printCommands) {
|
|
|
f96855 |
printf(" font: tag=%s name='%s' %g\n",
|
|
|
f96855 |
- font->getTag()->getCString(),
|
|
|
f96855 |
- font->getName() ? font->getName()->getCString() : "???",
|
|
|
f96855 |
+ font->getTag()->c_str(),
|
|
|
f96855 |
+ font->getName() ? font->getName()->c_str() : "???",
|
|
|
f96855 |
args[1].getNum());
|
|
|
f96855 |
fflush(stdout);
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
font->incRefCnt();
|
|
|
f96855 |
state->setFont(font, args[1].getNum());
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
// TODO not good that numArgs is ignored but args[] is used:
|
|
|
f96855 |
@@ -2421,7 +2421,7 @@ void PdfParser::opSetHorizScaling(Object
|
|
|
f96855 |
{
|
|
|
f96855 |
state->setHorizScaling(args[0].getNum());
|
|
|
f96855 |
builder->updateTextMatrix(state);
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
//------------------------------------------------------------------------
|
|
|
f96855 |
@@ -2461,7 +2461,7 @@ void PdfParser::opSetTextMatrix(Object a
|
|
|
f96855 |
state->textMoveTo(0, 0);
|
|
|
f96855 |
builder->updateTextMatrix(state);
|
|
|
f96855 |
builder->updateTextPosition(0.0, 0.0);
|
|
|
f96855 |
- fontChanged = gTrue;
|
|
|
f96855 |
+ fontChanged = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
void PdfParser::opTextNextLine(Object /*args*/[], int /*numArgs*/)
|
|
|
f96855 |
@@ -2487,7 +2487,7 @@ void PdfParser::opShowText(Object args[]
|
|
|
f96855 |
}
|
|
|
f96855 |
if (fontChanged) {
|
|
|
f96855 |
builder->updateFont(state);
|
|
|
f96855 |
- fontChanged = gFalse;
|
|
|
f96855 |
+ fontChanged = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
doShowText(args[0].getString());
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -2504,7 +2504,7 @@ void PdfParser::opMoveShowText(Object ar
|
|
|
f96855 |
}
|
|
|
f96855 |
if (fontChanged) {
|
|
|
f96855 |
builder->updateFont(state);
|
|
|
f96855 |
- fontChanged = gFalse;
|
|
|
f96855 |
+ fontChanged = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
tx = state->getLineX();
|
|
|
f96855 |
ty = state->getLineY() - state->getLeading();
|
|
|
f96855 |
@@ -2525,7 +2525,7 @@ void PdfParser::opMoveSetShowText(Object
|
|
|
f96855 |
}
|
|
|
f96855 |
if (fontChanged) {
|
|
|
f96855 |
builder->updateFont(state);
|
|
|
f96855 |
- fontChanged = gFalse;
|
|
|
f96855 |
+ fontChanged = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
state->setWordSpace(args[0].getNum());
|
|
|
f96855 |
state->setCharSpace(args[1].getNum());
|
|
|
f96855 |
@@ -2549,7 +2549,7 @@ void PdfParser::opShowSpaceText(Object a
|
|
|
f96855 |
}
|
|
|
f96855 |
if (fontChanged) {
|
|
|
f96855 |
builder->updateFont(state);
|
|
|
f96855 |
- fontChanged = gFalse;
|
|
|
f96855 |
+ fontChanged = false;
|
|
|
f96855 |
}
|
|
|
f96855 |
wMode = state->getFont()->getWMode();
|
|
|
f96855 |
a = args[0].getArray();
|
|
|
f96855 |
@@ -2586,11 +2586,11 @@ void PdfParser::doShowText(const GooStri
|
|
|
f96855 |
int wMode;
|
|
|
f96855 |
double riseX, riseY;
|
|
|
f96855 |
CharCode code;
|
|
|
f96855 |
- Unicode *u = NULL;
|
|
|
f96855 |
+ Unicode const *u = NULL;
|
|
|
f96855 |
double x, y, dx, dy, tdx, tdy;
|
|
|
f96855 |
double originX, originY, tOriginX, tOriginY;
|
|
|
f96855 |
double oldCTM[6], newCTM[6];
|
|
|
f96855 |
- double *mat;
|
|
|
f96855 |
+ const double *mat;
|
|
|
f96855 |
Object charProc;
|
|
|
f96855 |
Dict *resDict;
|
|
|
f96855 |
Parser *oldParser;
|
|
|
f96855 |
@@ -2630,7 +2630,7 @@ void PdfParser::doShowText(const GooStri
|
|
|
f96855 |
double lineX = state->getLineX();
|
|
|
f96855 |
double lineY = state->getLineY();
|
|
|
f96855 |
oldParser = parser;
|
|
|
f96855 |
- p = g_strdup(s->getCString());
|
|
|
f96855 |
+ p = g_strdup(s->c_str());
|
|
|
f96855 |
len = s->getLength();
|
|
|
f96855 |
while (len > 0) {
|
|
|
f96855 |
n = font->getNextChar(p, len, &code,
|
|
|
f96855 |
@@ -2659,7 +2659,7 @@ void PdfParser::doShowText(const GooStri
|
|
|
f96855 |
pushResources(resDict);
|
|
|
f96855 |
}
|
|
|
f96855 |
if (charProc.isStream()) {
|
|
|
f96855 |
- //parse(&charProc, gFalse); // TODO: parse into SVG font
|
|
|
f96855 |
+ //parse(&charProc, false); // TODO: parse into SVG font
|
|
|
f96855 |
} else {
|
|
|
f96855 |
error(errSyntaxError, getPos(), "Missing or bad Type3 CharProc entry");
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -2685,7 +2685,7 @@ void PdfParser::doShowText(const GooStri
|
|
|
f96855 |
|
|
|
f96855 |
} else {
|
|
|
f96855 |
state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
|
|
|
f96855 |
- p = g_strdup(s->getCString());
|
|
|
f96855 |
+ p = g_strdup(s->c_str());
|
|
|
f96855 |
len = s->getLength();
|
|
|
f96855 |
while (len > 0) {
|
|
|
f96855 |
n = font->getNextChar(p, len, &code,
|
|
|
f96855 |
@@ -2757,7 +2757,7 @@ void PdfParser::opXObject(Object args[],
|
|
|
f96855 |
#else
|
|
|
f96855 |
res->lookupXObjectNF(name, &refObj);
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- doImage(&refObj, obj1.getStream(), gFalse);
|
|
|
f96855 |
+ doImage(&refObj, obj1.getStream(), false);
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
refObj.free();
|
|
|
f96855 |
#endif
|
|
|
f96855 |
@@ -2782,19 +2782,19 @@ void PdfParser::opXObject(Object args[],
|
|
|
f96855 |
#endif
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg)
|
|
|
f96855 |
+void PdfParser::doImage(Object * /*ref*/, Stream *str, bool inlineImg)
|
|
|
f96855 |
{
|
|
|
f96855 |
Dict *dict;
|
|
|
f96855 |
int width, height;
|
|
|
f96855 |
int bits;
|
|
|
f96855 |
- GBool interpolate;
|
|
|
f96855 |
+ bool interpolate;
|
|
|
f96855 |
StreamColorSpaceMode csMode;
|
|
|
f96855 |
- GBool mask;
|
|
|
f96855 |
- GBool invert;
|
|
|
f96855 |
+ bool mask;
|
|
|
f96855 |
+ bool invert;
|
|
|
f96855 |
Object maskObj, smaskObj;
|
|
|
f96855 |
- GBool haveColorKeyMask, haveExplicitMask, haveSoftMask;
|
|
|
f96855 |
- GBool maskInvert;
|
|
|
f96855 |
- GBool maskInterpolate;
|
|
|
f96855 |
+ bool haveColorKeyMask, haveExplicitMask, haveSoftMask;
|
|
|
f96855 |
+ bool maskInvert;
|
|
|
f96855 |
+ bool maskInterpolate;
|
|
|
f96855 |
Object obj1, obj2;
|
|
|
f96855 |
|
|
|
f96855 |
// get info from the stream
|
|
|
f96855 |
@@ -2872,11 +2872,11 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
if (obj1.isBool())
|
|
|
f96855 |
interpolate = obj1.getBool();
|
|
|
f96855 |
else
|
|
|
f96855 |
- interpolate = gFalse;
|
|
|
f96855 |
+ interpolate = false;
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1.free();
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- maskInterpolate = gFalse;
|
|
|
f96855 |
+ maskInterpolate = false;
|
|
|
f96855 |
|
|
|
f96855 |
// image or mask?
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
@@ -2892,7 +2892,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
dict->lookup(const_cast<char*>("IM"), &obj1);
|
|
|
f96855 |
#endif
|
|
|
f96855 |
}
|
|
|
f96855 |
- mask = gFalse;
|
|
|
f96855 |
+ mask = false;
|
|
|
f96855 |
if (obj1.isBool()) {
|
|
|
f96855 |
mask = obj1.getBool();
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -2936,7 +2936,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
if (bits != 1) {
|
|
|
f96855 |
goto err1;
|
|
|
f96855 |
}
|
|
|
f96855 |
- invert = gFalse;
|
|
|
f96855 |
+ invert = false;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1 = dict->lookup(const_cast<char*>("Decode"));
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -2957,7 +2957,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
obj1.arrayGet(0, &obj2);
|
|
|
f96855 |
#endif
|
|
|
f96855 |
if (obj2.isInt() && obj2.getInt() == 1) {
|
|
|
f96855 |
- invert = gTrue;
|
|
|
f96855 |
+ invert = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj2.free();
|
|
|
f96855 |
@@ -3054,11 +3054,11 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
|
|
|
f96855 |
// get the mask
|
|
|
f96855 |
int maskColors[2*gfxColorMaxComps];
|
|
|
f96855 |
- haveColorKeyMask = haveExplicitMask = haveSoftMask = gFalse;
|
|
|
f96855 |
+ haveColorKeyMask = haveExplicitMask = haveSoftMask = false;
|
|
|
f96855 |
Stream *maskStr = NULL;
|
|
|
f96855 |
int maskWidth = 0;
|
|
|
f96855 |
int maskHeight = 0;
|
|
|
f96855 |
- maskInvert = gFalse;
|
|
|
f96855 |
+ maskInvert = false;
|
|
|
f96855 |
GfxImageColorMap *maskColorMap = NULL;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
maskObj = dict->lookup(const_cast<char*>("Mask"));
|
|
|
f96855 |
@@ -3145,7 +3145,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
if (obj1.isBool())
|
|
|
f96855 |
maskInterpolate = obj1.getBool();
|
|
|
f96855 |
else
|
|
|
f96855 |
- maskInterpolate = gFalse;
|
|
|
f96855 |
+ maskInterpolate = false;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1 = maskDict->lookup(const_cast<char*>("ColorSpace"));
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -3214,7 +3214,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
goto err1;
|
|
|
f96855 |
}
|
|
|
f96855 |
//~ handle the Matte entry
|
|
|
f96855 |
- haveSoftMask = gTrue;
|
|
|
f96855 |
+ haveSoftMask = true;
|
|
|
f96855 |
} else if (maskObj.isArray()) {
|
|
|
f96855 |
// color key mask
|
|
|
f96855 |
int i;
|
|
|
f96855 |
@@ -3229,7 +3229,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
obj1.free();
|
|
|
f96855 |
#endif
|
|
|
f96855 |
}
|
|
|
f96855 |
- haveColorKeyMask = gTrue;
|
|
|
f96855 |
+ haveColorKeyMask = true;
|
|
|
f96855 |
} else if (maskObj.isStream()) {
|
|
|
f96855 |
// explicit mask
|
|
|
f96855 |
if (inlineImg) {
|
|
|
f96855 |
@@ -3306,11 +3306,11 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
if (obj1.isBool())
|
|
|
f96855 |
maskInterpolate = obj1.getBool();
|
|
|
f96855 |
else
|
|
|
f96855 |
- maskInterpolate = gFalse;
|
|
|
f96855 |
+ maskInterpolate = false;
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1.free();
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- maskInvert = gFalse;
|
|
|
f96855 |
+ maskInvert = false;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1 = maskDict->lookup(const_cast<char*>("Decode"));
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -3331,7 +3331,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
obj1.arrayGet(0, &obj2);
|
|
|
f96855 |
#endif
|
|
|
f96855 |
if (obj2.isInt() && obj2.getInt() == 1) {
|
|
|
f96855 |
- maskInvert = gTrue;
|
|
|
f96855 |
+ maskInvert = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj2.free();
|
|
|
f96855 |
@@ -3342,7 +3342,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
#if !defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
obj1.free();
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- haveExplicitMask = gTrue;
|
|
|
f96855 |
+ haveExplicitMask = true;
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
// draw it
|
|
|
f96855 |
@@ -3377,7 +3377,7 @@ void PdfParser::doImage(Object * /*ref*/
|
|
|
f96855 |
|
|
|
f96855 |
void PdfParser::doForm(Object *str) {
|
|
|
f96855 |
Dict *dict;
|
|
|
f96855 |
- GBool transpGroup, isolated, knockout;
|
|
|
f96855 |
+ bool transpGroup, isolated, knockout;
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace;
|
|
|
f96855 |
Object matrixObj, bboxObj;
|
|
|
f96855 |
double m[6], bbox[4];
|
|
|
f96855 |
@@ -3471,7 +3471,7 @@ void PdfParser::doForm(Object *str) {
|
|
|
f96855 |
resDict = resObj.isDict() ? resObj.getDict() : (Dict *)NULL;
|
|
|
f96855 |
|
|
|
f96855 |
// check for a transparency group
|
|
|
f96855 |
- transpGroup = isolated = knockout = gFalse;
|
|
|
f96855 |
+ transpGroup = isolated = knockout = false;
|
|
|
f96855 |
blendingColorSpace = NULL;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
if ((obj1 = dict->lookup(const_cast<char*>("Group"))).isDict()) {
|
|
|
f96855 |
@@ -3480,7 +3480,7 @@ void PdfParser::doForm(Object *str) {
|
|
|
f96855 |
if (dict->lookup(const_cast<char*>("Group"), &obj1)->isDict()) {
|
|
|
f96855 |
if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
|
|
|
f96855 |
#endif
|
|
|
f96855 |
- transpGroup = gTrue;
|
|
|
f96855 |
+ transpGroup = true;
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
if (!((obj3 = obj1.dictLookup(const_cast<char*>("CS"))).isNull())) {
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -3524,7 +3524,7 @@ void PdfParser::doForm(Object *str) {
|
|
|
f96855 |
// draw it
|
|
|
f96855 |
++formDepth;
|
|
|
f96855 |
doForm1(str, resDict, m, bbox,
|
|
|
f96855 |
- transpGroup, gFalse, blendingColorSpace, isolated, knockout);
|
|
|
f96855 |
+ transpGroup, false, blendingColorSpace, isolated, knockout);
|
|
|
f96855 |
--formDepth;
|
|
|
f96855 |
|
|
|
f96855 |
if (blendingColorSpace) {
|
|
|
f96855 |
@@ -3536,10 +3536,10 @@ void PdfParser::doForm(Object *str) {
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
void PdfParser::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox,
|
|
|
f96855 |
- GBool transpGroup, GBool softMask,
|
|
|
f96855 |
+ bool transpGroup, bool softMask,
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace,
|
|
|
f96855 |
- GBool isolated, GBool knockout,
|
|
|
f96855 |
- GBool alpha, Function *transferFunc,
|
|
|
f96855 |
+ bool isolated, bool knockout,
|
|
|
f96855 |
+ bool alpha, Function *transferFunc,
|
|
|
f96855 |
GfxColor *backdropColor) {
|
|
|
f96855 |
Parser *oldParser;
|
|
|
f96855 |
double oldBaseMatrix[6];
|
|
|
f96855 |
@@ -3600,7 +3600,7 @@ void PdfParser::doForm1(Object *str, Dic
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
// draw the form
|
|
|
f96855 |
- parse(str, gFalse);
|
|
|
f96855 |
+ parse(str, false);
|
|
|
f96855 |
|
|
|
f96855 |
// restore base matrix
|
|
|
f96855 |
for (i = 0; i < 6; ++i) {
|
|
|
f96855 |
@@ -3640,7 +3640,7 @@ void PdfParser::opBeginImage(Object /*ar
|
|
|
f96855 |
|
|
|
f96855 |
// display the image
|
|
|
f96855 |
if (str) {
|
|
|
f96855 |
- doImage(NULL, str, gTrue);
|
|
|
f96855 |
+ doImage(NULL, str, true);
|
|
|
f96855 |
|
|
|
f96855 |
// skip 'EI' tag
|
|
|
f96855 |
int c1 = str->getUndecodedStream()->getChar();
|
|
|
f96855 |
@@ -3686,7 +3686,7 @@ Stream *PdfParser::buildImageStream() {
|
|
|
f96855 |
break;
|
|
|
f96855 |
}
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
- dict.dictAdd(key, std::move(obj));
|
|
|
f96855 |
+ dict.dictAdd((const char *) key, std::move(obj));
|
|
|
f96855 |
}
|
|
|
f96855 |
obj = parser->getObj();
|
|
|
f96855 |
#else
|
|
|
f96855 |
@@ -3709,10 +3709,10 @@ Stream *PdfParser::buildImageStream() {
|
|
|
f96855 |
|
|
|
f96855 |
// make stream
|
|
|
f96855 |
#if defined(POPPLER_NEW_OBJECT_API)
|
|
|
f96855 |
- str = new EmbedStream(parser->getStream(), dict.copy(), gFalse, 0);
|
|
|
f96855 |
+ str = new EmbedStream(parser->getStream(), dict.copy(), false, 0);
|
|
|
f96855 |
str = str->addFilters(dict.getDict());
|
|
|
f96855 |
#else
|
|
|
f96855 |
- str = new EmbedStream(parser->getStream(), &dict, gFalse, 0);
|
|
|
f96855 |
+ str = new EmbedStream(parser->getStream(), &dict, false, 0);
|
|
|
f96855 |
str = str->addFilters(&dict);
|
|
|
f96855 |
#endif
|
|
|
f96855 |
|
|
|
f96855 |
@@ -3875,7 +3875,7 @@ ClipHistoryEntry::~ClipHistoryEntry()
|
|
|
f96855 |
}
|
|
|
f96855 |
}
|
|
|
f96855 |
|
|
|
f96855 |
-void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
|
|
|
f96855 |
+void ClipHistoryEntry::setClip(const GfxPath *clipPathA, GfxClipType clipTypeA) {
|
|
|
f96855 |
// Free previous clip path
|
|
|
f96855 |
if (clipPath) {
|
|
|
f96855 |
delete clipPath;
|
|
|
f96855 |
--- inkscape-0.92.3/src/extension/internal/pdfinput/pdf-parser.h
|
|
|
f96855 |
+++ inkscape-0.92.3/src/extension/internal/pdfinput/pdf-parser.h
|
|
|
f96855 |
@@ -25,7 +25,7 @@ namespace Inkscape {
|
|
|
f96855 |
// TODO clean up and remove using:
|
|
|
f96855 |
using Inkscape::Extension::Internal::SvgBuilder;
|
|
|
f96855 |
|
|
|
f96855 |
-#include "goo/gtypes.h"
|
|
|
f96855 |
+/*#include "goo/gtypes.h"*/
|
|
|
f96855 |
#include "Object.h"
|
|
|
f96855 |
|
|
|
f96855 |
class GooString;
|
|
|
f96855 |
@@ -96,7 +96,7 @@ struct PdfOperator {
|
|
|
f96855 |
struct OpHistoryEntry {
|
|
|
f96855 |
const char *name; // operator's name
|
|
|
f96855 |
GfxState *state; // saved state, NULL if none
|
|
|
f96855 |
- GBool executed; // whether the operator has been executed
|
|
|
f96855 |
+ bool executed; // whether the operator has been executed
|
|
|
f96855 |
|
|
|
f96855 |
OpHistoryEntry *next; // next entry on stack
|
|
|
f96855 |
unsigned depth; // total number of entries descending from this
|
|
|
f96855 |
@@ -127,16 +127,16 @@ public:
|
|
|
f96855 |
|
|
|
f96855 |
// Constructor for regular output.
|
|
|
f96855 |
PdfParser(XRef *xrefA, SvgBuilder *builderA, int pageNum, int rotate,
|
|
|
f96855 |
- Dict *resDict, PDFRectangle *box, PDFRectangle *cropBox);
|
|
|
f96855 |
+ Dict *resDict, const PDFRectangle *box, const PDFRectangle *cropBox);
|
|
|
f96855 |
|
|
|
f96855 |
// Constructor for a sub-page object.
|
|
|
f96855 |
PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA,
|
|
|
f96855 |
- Dict *resDict, PDFRectangle *box);
|
|
|
f96855 |
+ Dict *resDict, const PDFRectangle *box);
|
|
|
f96855 |
|
|
|
f96855 |
virtual ~PdfParser();
|
|
|
f96855 |
|
|
|
f96855 |
// Interpret a stream or array of streams.
|
|
|
f96855 |
- void parse(Object *obj, GBool topLevel = gTrue);
|
|
|
f96855 |
+ void parse(Object *obj, bool topLevel = true);
|
|
|
f96855 |
|
|
|
f96855 |
// Save graphics state.
|
|
|
f96855 |
void saveState();
|
|
|
f96855 |
@@ -154,12 +154,12 @@ private:
|
|
|
f96855 |
|
|
|
f96855 |
XRef *xref; // the xref table for this PDF file
|
|
|
f96855 |
SvgBuilder *builder; // SVG generator
|
|
|
f96855 |
- GBool subPage; // is this a sub-page object?
|
|
|
f96855 |
- GBool printCommands; // print the drawing commands (for debugging)
|
|
|
f96855 |
+ bool subPage; // is this a sub-page object?
|
|
|
f96855 |
+ bool printCommands; // print the drawing commands (for debugging)
|
|
|
f96855 |
GfxResources *res; // resource stack
|
|
|
f96855 |
|
|
|
f96855 |
GfxState *state; // current graphics state
|
|
|
f96855 |
- GBool fontChanged; // set if font or text matrix has changed
|
|
|
f96855 |
+ bool fontChanged; // set if font or text matrix has changed
|
|
|
f96855 |
GfxClipType clip; // do a clip?
|
|
|
f96855 |
int ignoreUndef; // current BX/EX nesting level
|
|
|
f96855 |
double baseMatrix[6]; // default matrix for most recent
|
|
|
f96855 |
@@ -183,10 +183,10 @@ private:
|
|
|
f96855 |
OpHistoryEntry *popOperator();
|
|
|
f96855 |
const char *getPreviousOperator(unsigned int look_back=1); // returns the nth previous operator's name
|
|
|
f96855 |
|
|
|
f96855 |
- void go(GBool topLevel);
|
|
|
f96855 |
+ void go(bool topLevel);
|
|
|
f96855 |
void execOp(Object *cmd, Object args[], int numArgs);
|
|
|
f96855 |
- PdfOperator *findOp(char *name);
|
|
|
f96855 |
- GBool checkArg(Object *arg, TchkType type);
|
|
|
f96855 |
+ PdfOperator *findOp(const char *name);
|
|
|
f96855 |
+ bool checkArg(Object *arg, TchkType type);
|
|
|
f96855 |
int getPos();
|
|
|
f96855 |
|
|
|
f96855 |
// graphics state operators
|
|
|
f96855 |
@@ -200,9 +200,9 @@ private:
|
|
|
f96855 |
void opSetMiterLimit(Object args[], int numArgs);
|
|
|
f96855 |
void opSetLineWidth(Object args[], int numArgs);
|
|
|
f96855 |
void opSetExtGState(Object args[], int numArgs);
|
|
|
f96855 |
- void doSoftMask(Object *str, GBool alpha,
|
|
|
f96855 |
+ void doSoftMask(Object *str, bool alpha,
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace,
|
|
|
f96855 |
- GBool isolated, GBool knockout,
|
|
|
f96855 |
+ bool isolated, bool knockout,
|
|
|
f96855 |
Function *transferFunc, GfxColor *backdropColor);
|
|
|
f96855 |
void opSetRenderingIntent(Object args[], int numArgs);
|
|
|
f96855 |
|
|
|
f96855 |
@@ -239,11 +239,11 @@ private:
|
|
|
f96855 |
void opCloseFillStroke(Object args[], int numArgs);
|
|
|
f96855 |
void opEOFillStroke(Object args[], int numArgs);
|
|
|
f96855 |
void opCloseEOFillStroke(Object args[], int numArgs);
|
|
|
f96855 |
- void doFillAndStroke(GBool eoFill);
|
|
|
f96855 |
- void doPatternFillFallback(GBool eoFill);
|
|
|
f96855 |
+ void doFillAndStroke(bool eoFill);
|
|
|
f96855 |
+ void doPatternFillFallback(bool eoFill);
|
|
|
f96855 |
void doPatternStrokeFallback();
|
|
|
f96855 |
void doShadingPatternFillFallback(GfxShadingPattern *sPat,
|
|
|
f96855 |
- GBool stroke, GBool eoFill);
|
|
|
f96855 |
+ bool stroke, bool eoFill);
|
|
|
f96855 |
void opShFill(Object args[], int numArgs);
|
|
|
f96855 |
void doFunctionShFill(GfxFunctionShading *shading);
|
|
|
f96855 |
void doFunctionShFill1(GfxFunctionShading *shading,
|
|
|
f96855 |
@@ -256,7 +256,7 @@ private:
|
|
|
f96855 |
double x2, double y2, GfxColor *color2,
|
|
|
f96855 |
int nComps, int depth);
|
|
|
f96855 |
void doPatchMeshShFill(GfxPatchMeshShading *shading);
|
|
|
f96855 |
- void fillPatch(GfxPatch *patch, int nComps, int depth);
|
|
|
f96855 |
+ void fillPatch(const GfxPatch *patch, int nComps, int depth);
|
|
|
f96855 |
void doEndPath();
|
|
|
f96855 |
|
|
|
f96855 |
// path clipping operators
|
|
|
f96855 |
@@ -291,13 +291,13 @@ private:
|
|
|
f96855 |
|
|
|
f96855 |
// XObject operators
|
|
|
f96855 |
void opXObject(Object args[], int numArgs);
|
|
|
f96855 |
- void doImage(Object *ref, Stream *str, GBool inlineImg);
|
|
|
f96855 |
+ void doImage(Object *ref, Stream *str, bool inlineImg);
|
|
|
f96855 |
void doForm(Object *str);
|
|
|
f96855 |
void doForm1(Object *str, Dict *resDict, double *matrix, double *bbox,
|
|
|
f96855 |
- GBool transpGroup = gFalse, GBool softMask = gFalse,
|
|
|
f96855 |
+ bool transpGroup = false, bool softMask = false,
|
|
|
f96855 |
GfxColorSpace *blendingColorSpace = NULL,
|
|
|
f96855 |
- GBool isolated = gFalse, GBool knockout = gFalse,
|
|
|
f96855 |
- GBool alpha = gFalse, Function *transferFunc = NULL,
|
|
|
f96855 |
+ bool isolated = false, bool knockout = false,
|
|
|
f96855 |
+ bool alpha = false, Function *transferFunc = NULL,
|
|
|
f96855 |
GfxColor *backdropColor = NULL);
|
|
|
f96855 |
|
|
|
f96855 |
// in-line image operators
|
|
|
f96855 |
--- inkscape-0.92.3/src/extension/internal/pdfinput/svg-builder.cpp
|
|
|
f96855 |
+++ inkscape-0.92.3/src/extension/internal/pdfinput/svg-builder.cpp
|
|
|
f96855 |
@@ -264,10 +264,10 @@ static void svgSetTransform(Inkscape::XM
|
|
|
f96855 |
/**
|
|
|
f96855 |
* \brief Generates a SVG path string from poppler's data structure
|
|
|
f96855 |
*/
|
|
|
f96855 |
-static gchar *svgInterpretPath(GfxPath *path) {
|
|
|
f96855 |
+static gchar *svgInterpretPath(const GfxPath *path) {
|
|
|
f96855 |
Inkscape::SVG::PathString pathString;
|
|
|
f96855 |
for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
|
|
|
f96855 |
- GfxSubpath *subpath = path->getSubpath(i);
|
|
|
f96855 |
+ const GfxSubpath *subpath = path->getSubpath(i);
|
|
|
f96855 |
if (subpath->getNumPoints() > 0) {
|
|
|
f96855 |
pathString.moveTo(subpath->getX(0), subpath->getY(0));
|
|
|
f96855 |
int j = 1;
|
|
|
f96855 |
@@ -625,7 +625,7 @@ gchar *SvgBuilder::_createPattern(GfxPat
|
|
|
f96855 |
if ( pattern != NULL ) {
|
|
|
f96855 |
if ( pattern->getType() == 2 ) { // Shading pattern
|
|
|
f96855 |
GfxShadingPattern *shading_pattern = static_cast<GfxShadingPattern *>(pattern);
|
|
|
f96855 |
- double *ptm;
|
|
|
f96855 |
+ const double *ptm;
|
|
|
f96855 |
double m[6] = {1, 0, 0, 1, 0, 0};
|
|
|
f96855 |
double det;
|
|
|
f96855 |
|
|
|
f96855 |
@@ -672,7 +672,7 @@ gchar *SvgBuilder::_createTilingPattern(
|
|
|
f96855 |
|
|
|
f96855 |
Inkscape::XML::Node *pattern_node = _xml_doc->createElement("svg:pattern");
|
|
|
f96855 |
// Set pattern transform matrix
|
|
|
f96855 |
- double *p2u = tiling_pattern->getMatrix();
|
|
|
f96855 |
+ const double *p2u = tiling_pattern->getMatrix();
|
|
|
f96855 |
double m[6] = {1, 0, 0, 1, 0, 0};
|
|
|
f96855 |
double det;
|
|
|
f96855 |
det = _ttm[0] * _ttm[3] - _ttm[1] * _ttm[2]; // see LP Bug 1168908
|
|
|
f96855 |
@@ -698,7 +698,7 @@ gchar *SvgBuilder::_createTilingPattern(
|
|
|
f96855 |
pattern_node->setAttribute("patternUnits", "userSpaceOnUse");
|
|
|
f96855 |
// Set pattern tiling
|
|
|
f96855 |
// FIXME: don't ignore XStep and YStep
|
|
|
f96855 |
- double *bbox = tiling_pattern->getBBox();
|
|
|
f96855 |
+ const double *bbox = tiling_pattern->getBBox();
|
|
|
f96855 |
sp_repr_set_svg_double(pattern_node, "x", 0.0);
|
|
|
f96855 |
sp_repr_set_svg_double(pattern_node, "y", 0.0);
|
|
|
f96855 |
sp_repr_set_svg_double(pattern_node, "width", bbox[2] - bbox[0]);
|
|
|
f96855 |
@@ -751,7 +751,7 @@ gchar *SvgBuilder::_createTilingPattern(
|
|
|
f96855 |
*/
|
|
|
f96855 |
gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool for_shading) {
|
|
|
f96855 |
Inkscape::XML::Node *gradient;
|
|
|
f96855 |
- Function *func;
|
|
|
f96855 |
+ const Function *func;
|
|
|
f96855 |
int num_funcs;
|
|
|
f96855 |
bool extend0, extend1;
|
|
|
f96855 |
|
|
|
f96855 |
@@ -865,7 +865,7 @@ static bool svgGetShadingColorRGB(GfxSha
|
|
|
f96855 |
|
|
|
f96855 |
#define INT_EPSILON 8
|
|
|
f96855 |
bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
|
|
|
f96855 |
- Function *func) {
|
|
|
f96855 |
+ const Function *func) {
|
|
|
f96855 |
int type = func->getType();
|
|
|
f96855 |
if ( type == 0 || type == 2 ) { // Sampled or exponential function
|
|
|
f96855 |
GfxRGB stop1, stop2;
|
|
|
f96855 |
@@ -877,9 +877,9 @@ bool SvgBuilder::_addGradientStops(Inksc
|
|
|
f96855 |
_addStopToGradient(gradient, 1.0, &stop2, 1.0);
|
|
|
f96855 |
}
|
|
|
f96855 |
} else if ( type == 3 ) { // Stitching
|
|
|
f96855 |
- StitchingFunction *stitchingFunc = static_cast<StitchingFunction*>(func);
|
|
|
f96855 |
- double *bounds = stitchingFunc->getBounds();
|
|
|
f96855 |
- double *encode = stitchingFunc->getEncode();
|
|
|
f96855 |
+ auto stitchingFunc = static_cast<const StitchingFunction*>(func);
|
|
|
f96855 |
+ const double *bounds = stitchingFunc->getBounds();
|
|
|
f96855 |
+ const double *encode = stitchingFunc->getEncode();
|
|
|
f96855 |
int num_funcs = stitchingFunc->getNumFuncs();
|
|
|
f96855 |
|
|
|
f96855 |
// Add stops from all the stitched functions
|
|
|
f96855 |
@@ -890,7 +890,7 @@ bool SvgBuilder::_addGradientStops(Inksc
|
|
|
f96855 |
svgGetShadingColorRGB(shading, bounds[i + 1], &color;;
|
|
|
f96855 |
// Add stops
|
|
|
f96855 |
if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn
|
|
|
f96855 |
- double expE = (static_cast<ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
|
|
|
f96855 |
+ double expE = (static_cast<const ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
|
|
|
f96855 |
if (expE > 1.0) {
|
|
|
f96855 |
expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1
|
|
|
f96855 |
if (encode[2*i] == 0) { // normal sequence
|
|
|
f96855 |
@@ -1020,7 +1020,7 @@ void SvgBuilder::updateFont(GfxState *st
|
|
|
f96855 |
GfxFont *font = state->getFont();
|
|
|
f96855 |
// Store original name
|
|
|
f96855 |
if (font->getName()) {
|
|
|
f96855 |
- _font_specification = g_strdup(font->getName()->getCString());
|
|
|
f96855 |
+ _font_specification = g_strdup(font->getName()->c_str());
|
|
|
f96855 |
} else {
|
|
|
f96855 |
_font_specification = (char*) "Arial";
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1047,7 +1047,7 @@ void SvgBuilder::updateFont(GfxState *st
|
|
|
f96855 |
|
|
|
f96855 |
// Font family
|
|
|
f96855 |
if (font->getFamily()) { // if font family is explicitly given use it.
|
|
|
f96855 |
- sp_repr_css_set_property(_font_style, "font-family", font->getFamily()->getCString());
|
|
|
f96855 |
+ sp_repr_css_set_property(_font_style, "font-family", font->getFamily()->c_str());
|
|
|
f96855 |
} else {
|
|
|
f96855 |
int attr_value = 1;
|
|
|
f96855 |
sp_repr_get_int(_preferences, "localFonts", &attr_value);
|
|
|
f96855 |
@@ -1148,7 +1148,7 @@ void SvgBuilder::updateFont(GfxState *st
|
|
|
f96855 |
Inkscape::CSSOStringStream os_font_size;
|
|
|
f96855 |
double css_font_size = _font_scaling * state->getFontSize();
|
|
|
f96855 |
if ( font->getType() == fontType3 ) {
|
|
|
f96855 |
- double *font_matrix = font->getFontMatrix();
|
|
|
f96855 |
+ const double *font_matrix = font->getFontMatrix();
|
|
|
f96855 |
if ( font_matrix[0] != 0.0 ) {
|
|
|
f96855 |
css_font_size *= font_matrix[3] / font_matrix[0];
|
|
|
f96855 |
}
|
|
|
f96855 |
@@ -1193,7 +1193,7 @@ void SvgBuilder::updateTextPosition(doub
|
|
|
f96855 |
void SvgBuilder::updateTextMatrix(GfxState *state) {
|
|
|
f96855 |
_flushText();
|
|
|
f96855 |
// Update text matrix
|
|
|
f96855 |
- double *text_matrix = state->getTextMat();
|
|
|
f96855 |
+ const double *text_matrix = state->getTextMat();
|
|
|
f96855 |
double w_scale = sqrt( text_matrix[0] * text_matrix[0] + text_matrix[2] * text_matrix[2] );
|
|
|
f96855 |
double h_scale = sqrt( text_matrix[1] * text_matrix[1] + text_matrix[3] * text_matrix[3] );
|
|
|
f96855 |
double max_scale;
|
|
|
f96855 |
@@ -1379,7 +1379,7 @@ void SvgBuilder::beginString(GfxState *s
|
|
|
f96855 |
void SvgBuilder::addChar(GfxState *state, double x, double y,
|
|
|
f96855 |
double dx, double dy,
|
|
|
f96855 |
double originX, double originY,
|
|
|
f96855 |
- CharCode /*code*/, int /*nBytes*/, Unicode *u, int uLen) {
|
|
|
f96855 |
+ CharCode /*code*/, int /*nBytes*/, Unicode const *u, int uLen) {
|
|
|
f96855 |
|
|
|
f96855 |
|
|
|
f96855 |
bool is_space = ( uLen == 1 && u[0] == 32 );
|
|
|
f96855 |
--- inkscape-0.92.3/src/extension/internal/pdfinput/svg-builder.h
|
|
|
f96855 |
+++ inkscape-0.92.3/src/extension/internal/pdfinput/svg-builder.h
|
|
|
f96855 |
@@ -140,7 +140,7 @@ public:
|
|
|
f96855 |
void addChar(GfxState *state, double x, double y,
|
|
|
f96855 |
double dx, double dy,
|
|
|
f96855 |
double originX, double originY,
|
|
|
f96855 |
- CharCode code, int nBytes, Unicode *u, int uLen);
|
|
|
f96855 |
+ CharCode code, int nBytes, Unicode const *u, int uLen);
|
|
|
f96855 |
void beginTextObject(GfxState *state);
|
|
|
f96855 |
void endTextObject(GfxState *state);
|
|
|
f96855 |
|
|
|
f96855 |
@@ -174,7 +174,7 @@ private:
|
|
|
f96855 |
void _addStopToGradient(Inkscape::XML::Node *gradient, double offset,
|
|
|
f96855 |
GfxRGB *color, double opacity);
|
|
|
f96855 |
bool _addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
|
|
|
f96855 |
- Function *func);
|
|
|
f96855 |
+ const Function *func);
|
|
|
f96855 |
gchar *_createTilingPattern(GfxTilingPattern *tiling_pattern, GfxState *state,
|
|
|
f96855 |
bool is_stroke=false);
|
|
|
f96855 |
// Image/mask creation
|