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