Commit b8b82412 authored by Albert Astals Cid's avatar Albert Astals Cid

More const

Marked some caches as mutable

Fixed an actual bug in page::text that was swapping the page cropbox in
each call
parent d5d6dd93
Pipeline #4878 failed with stage
in 8 minutes and 32 seconds
......@@ -131,7 +131,7 @@ double page::duration() const
*/
rectf page::page_rect(page_box_enum box) const
{
PDFRectangle *r = nullptr;
const PDFRectangle *r = nullptr;
switch (box) {
case media_box:
r = d->page->getMediaBox();
......@@ -277,13 +277,13 @@ ustring page::text(const rectf &r, text_layout_enum layout_mode) const
TextOutputDev td(nullptr, gFalse, 0, use_raw_order, gFalse);
d->doc->doc->displayPage(&td, d->index + 1, 72, 72, 0, false, true, false);
if (r.is_empty()) {
PDFRectangle *rect = d->page->getCropBox();
PDFRectangle rect = *d->page->getCropBox();
const int rotate = d->page->getRotate();
if (rotate == 90 || rotate == 270) {
std::swap(rect->x1, rect->y1);
std::swap(rect->x2, rect->y2);
std::swap(rect.x1, rect.y1);
std::swap(rect.x2, rect.y2);
}
s.reset(td.getText(rect->x1, rect->y1, rect->x2, rect->y2));
s.reset(td.getText(rect.x1, rect.y1, rect.x2, rect.y2));
} else {
s.reset(td.getText(r.left(), r.top(), r.right(), r.bottom()));
}
......
......@@ -2099,7 +2099,7 @@ poppler_annot_mapping_free (PopplerAnnotMapping *mapping)
void
poppler_page_get_crop_box (PopplerPage *page, PopplerRectangle *rect)
{
PDFRectangle* cropBox = page->page->getCropBox ();
const PDFRectangle* cropBox = page->page->getCropBox ();
rect->x1 = cropBox->x1;
rect->x2 = cropBox->x2;
......
......@@ -367,7 +367,7 @@ void CairoOutputDev::updateAll(GfxState *state) {
text->updateFont(state);
}
void CairoOutputDev::setDefaultCTM(double *ctm) {
void CairoOutputDev::setDefaultCTM(const double *ctm) {
cairo_matrix_t matrix;
matrix.xx = ctm[0];
matrix.yx = ctm[1];
......@@ -683,7 +683,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
cairo_surface_has_show_text_glyphs (cairo_get_target (cairo));
double fontSize = state->getFontSize();
double *m = state->getTextMat();
const double *m = state->getTextMat();
/* NOTE: adjusting by a constant is hack. The correct solution
* is probably to use user-fonts and compute the scale on a per
* glyph basis instead of for the entire font */
......@@ -897,8 +897,8 @@ void CairoOutputDev::eoFill(GfxState *state) {
}
GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat, Object *str,
double *pmat, int paintType, int /*tilingType*/, Dict *resDict,
double *mat, double *bbox,
const double *pmat, int paintType, int /*tilingType*/, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep)
{
......@@ -1012,10 +1012,9 @@ GBool CairoOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *sh
double y_step;
GfxColor color;
GfxRGB rgb;
double *matrix;
cairo_matrix_t mat;
matrix = shading->getMatrix();
const double *matrix = shading->getMatrix();
mat.xx = matrix[0];
mat.yx = matrix[1];
mat.xy = matrix[2];
......@@ -1238,7 +1237,7 @@ GBool CairoOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *
fill_pattern = cairo_pattern_create_mesh ();
for (i = 0; i < shading->getNPatches(); i++) {
GfxPatch *patch = shading->getPatch(i);
const GfxPatch *patch = shading->getPatch(i);
GfxColor color;
GfxRGB rgb;
......@@ -1524,10 +1523,9 @@ GBool CairoOutputDev::beginType3Char(GfxState *state, double x, double y,
CharCode code, Unicode *u, int uLen) {
cairo_save (cairo);
double *ctm;
cairo_matrix_t matrix;
ctm = state->getCTM();
const double *ctm = state->getCTM();
matrix.xx = ctm[0];
matrix.yx = ctm[1];
matrix.xy = ctm[2];
......@@ -1629,7 +1627,7 @@ cairo_surface_t *cairo_surface_create_similar_clip (cairo_t *cairo, cairo_conten
void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * blendingColorSpace,
GBool /*isolated*/, GBool knockout,
GBool forSoftMask) {
......@@ -1692,7 +1690,7 @@ void CairoOutputDev::endTransparencyGroup(GfxState * /*state*/) {
}
}
void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) {
void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) {
LOG(printf ("paint transparency group\n"));
cairo_save (cairo);
......@@ -1758,7 +1756,7 @@ static int luminocity(uint32_t x)
/* XXX: do we need to deal with shape here? */
void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha,
void CairoOutputDev::setSoftMask(GfxState * state, const double * bbox, GBool alpha,
Function * transferFunc, GfxColor * backdropColor) {
cairo_pattern_destroy(mask);
......@@ -3383,7 +3381,7 @@ void CairoImageOutputDev::saveImage(CairoImage *image)
void CairoImageOutputDev::getBBox(GfxState *state, int width, int height,
double *x1, double *y1, double *x2, double *y2)
{
double *ctm = state->getCTM();
const double *ctm = state->getCTM();
cairo_matrix_t matrix;
cairo_matrix_init(&matrix,
ctm[0], ctm[1],
......
......@@ -146,7 +146,7 @@ public:
//----- update graphics state
void updateAll(GfxState *state) override;
void setDefaultCTM(double *ctm) override;
void setDefaultCTM(const double *ctm) override;
void updateCTM(GfxState *state, double m11, double m12,
double m21, double m22, double m31, double m32) override;
void updateLineDash(GfxState *state) override;
......@@ -171,8 +171,8 @@ public:
void eoFill(GfxState *state) override;
void clipToStrokePath(GfxState *state) override;
GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
double *pmat, int paintType, int tilingType, Dict *resDict,
double *mat, double *bbox,
const double *pmat, int paintType, int tilingType, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) override;
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
......@@ -245,14 +245,14 @@ public:
GBool maskInvert, GBool maskInterpolate) override;
//----- transparency groups and soft masks
void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
GBool /*isolated*/, GBool /*knockout*/,
GBool /*forSoftMask*/) override;
void endTransparencyGroup(GfxState * /*state*/) override;
void popTransparencyGroup();
void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) override;
void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) override;
void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) override;
void clearSoftMask(GfxState * /*state*/) override;
......@@ -429,7 +429,7 @@ public:
//----- update graphics state
void updateAll(GfxState *state) override { }
void setDefaultCTM(double *ctm) override { }
void setDefaultCTM(const double *ctm) override { }
void updateCTM(GfxState *state, double m11, double m12,
double m21, double m22, double m31, double m32) override { }
void updateLineDash(GfxState *state) override { }
......@@ -453,8 +453,8 @@ public:
void eoFill(GfxState *state) override { }
void clipToStrokePath(GfxState *state) override { }
GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
double *pmat, int paintType, int tilingType, Dict *resDict,
double *mat, double *bbox,
const double *pmat, int paintType, int tilingType, Dict *resDict,
const double *mat, const double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) override { return gTrue; }
GBool axialShadedFill(GfxState *state,
......@@ -497,13 +497,13 @@ public:
//----- transparency groups and soft masks
void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
GBool /*isolated*/, GBool /*knockout*/,
GBool /*forSoftMask*/) override {}
void endTransparencyGroup(GfxState * /*state*/) override {}
void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) override {}
void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) override {}
void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) override {}
void clearSoftMask(GfxState * /*state*/) override {}
......
......@@ -199,7 +199,7 @@ IdentityFunction::IdentityFunction() {
IdentityFunction::~IdentityFunction() {
}
void IdentityFunction::transform(double *in, double *out) {
void IdentityFunction::transform(const double *in, double *out) const {
int i;
for (i = 0; i < funcMaxOutputs; ++i) {
......@@ -440,7 +440,7 @@ SampledFunction::SampledFunction(const SampledFunction *func) : Function(func) {
ok = func->ok;
}
void SampledFunction::transform(double *in, double *out) {
void SampledFunction::transform(const double *in, double *out) const {
double x;
int e[funcMaxInputs];
double efrac0[funcMaxInputs];
......@@ -522,12 +522,12 @@ void SampledFunction::transform(double *in, double *out) {
}
}
GBool SampledFunction::hasDifferentResultSet(Function *func) {
GBool SampledFunction::hasDifferentResultSet(const Function *func) const {
if (func->getType() == 0) {
SampledFunction *compTo = (SampledFunction *) func;
if (compTo->getSampleNumber() != nSamples)
return gTrue;
double *compSamples = compTo->getSamples();
const double *compSamples = compTo->getSamples();
for (int i = 0; i < nSamples; i++) {
if (samples[i] != compSamples[i])
return gTrue;
......@@ -630,7 +630,7 @@ ExponentialFunction::ExponentialFunction(const ExponentialFunction *func) : Func
ok = func->ok;
}
void ExponentialFunction::transform(double *in, double *out) {
void ExponentialFunction::transform(const double *in, double *out) const {
double x;
int i;
......@@ -798,7 +798,7 @@ StitchingFunction::~StitchingFunction() {
gfree(scale);
}
void StitchingFunction::transform(double *in, double *out) {
void StitchingFunction::transform(const double *in, double *out) const {
double x;
int i;
......@@ -1215,7 +1215,7 @@ PostScriptFunction::~PostScriptFunction() {
delete codeString;
}
void PostScriptFunction::transform(double *in, double *out) {
void PostScriptFunction::transform(const double *in, double *out) const {
PSStack stack;
int i;
......@@ -1441,7 +1441,7 @@ void PostScriptFunction::resizeCode(int newSize) {
}
}
void PostScriptFunction::exec(PSStack *stack, int codePtr) {
void PostScriptFunction::exec(PSStack *stack, int codePtr) const {
int i1, i2;
double r1, r2, result;
GBool b1, b2;
......
......@@ -65,7 +65,7 @@ public:
// Initialize the entries common to all function types.
GBool init(Dict *dict);
virtual Function *copy() = 0;
virtual Function *copy() const = 0;
// Return the function type:
// -1 : identity
......@@ -73,23 +73,23 @@ public:
// 2 : exponential
// 3 : stitching
// 4 : PostScript
virtual int getType() = 0;
virtual int getType() const = 0;
// Return size of input and output tuples.
int getInputSize() { return m; }
int getOutputSize() { return n; }
int getInputSize() const { return m; }
int getOutputSize() const { return n; }
double getDomainMin(int i) { return domain[i][0]; }
double getDomainMax(int i) { return domain[i][1]; }
double getRangeMin(int i) { return range[i][0]; }
double getRangeMax(int i) { return range[i][1]; }
GBool getHasRange() { return hasRange; }
virtual GBool hasDifferentResultSet(Function *func) { return gFalse; }
double getDomainMin(int i) const { return domain[i][0]; }
double getDomainMax(int i) const { return domain[i][1]; }
double getRangeMin(int i) const { return range[i][0]; }
double getRangeMax(int i) const { return range[i][1]; }
GBool getHasRange() const { return hasRange; }
virtual GBool hasDifferentResultSet(const Function *func) const { return gFalse; }
// Transform an input tuple into an output tuple.
virtual void transform(double *in, double *out) = 0;
virtual void transform(const double *in, double *out) const = 0;
virtual GBool isOk() = 0;
virtual GBool isOk() const = 0;
protected:
static Function *parse(Object *funcObj, std::set<int> *usedParents);
......@@ -113,10 +113,10 @@ public:
IdentityFunction();
~IdentityFunction();
Function *copy() override { return new IdentityFunction(); }
int getType() override { return -1; }
void transform(double *in, double *out) override;
GBool isOk() override { return gTrue; }
Function *copy() const override { return new IdentityFunction(); }
int getType() const override { return -1; }
void transform(const double *in, double *out) const override;
GBool isOk() const override { return gTrue; }
private:
};
......@@ -130,19 +130,19 @@ public:
SampledFunction(Object *funcObj, Dict *dict);
~SampledFunction();
Function *copy() override { return new SampledFunction(this); }
int getType() override { return 0; }
void transform(double *in, double *out) override;
GBool isOk() override { return ok; }
GBool hasDifferentResultSet(Function *func) override;
int getSampleSize(int i) { return sampleSize[i]; }
double getEncodeMin(int i) { return encode[i][0]; }
double getEncodeMax(int i) { return encode[i][1]; }
double getDecodeMin(int i) { return decode[i][0]; }
double getDecodeMax(int i) { return decode[i][1]; }
double *getSamples() { return samples; }
int getSampleNumber() { return nSamples; }
Function *copy() const override { return new SampledFunction(this); }
int getType() const override { return 0; }
void transform(const double *in, double *out) const override;
GBool isOk() const override { return ok; }
GBool hasDifferentResultSet(const Function *func) const override;
int getSampleSize(int i) const { return sampleSize[i]; }
double getEncodeMin(int i) const { return encode[i][0]; }
double getEncodeMax(int i) const { return encode[i][1]; }
double getDecodeMin(int i) const { return decode[i][0]; }
double getDecodeMax(int i) const { return decode[i][1]; }
const double *getSamples() const { return samples; }
int getSampleNumber() const { return nSamples; }
private:
......@@ -160,8 +160,8 @@ private:
double *samples; // the samples
int nSamples; // size of the samples array
double *sBuf; // buffer for the transform function
double cacheIn[funcMaxInputs];
double cacheOut[funcMaxOutputs];
mutable double cacheIn[funcMaxInputs];
mutable double cacheOut[funcMaxOutputs];
GBool ok;
};
......@@ -174,14 +174,14 @@ public:
ExponentialFunction(Object *funcObj, Dict *dict);
~ExponentialFunction();
Function *copy() override { return new ExponentialFunction(this); }
int getType() override { return 2; }
void transform(double *in, double *out) override;
GBool isOk() override { return ok; }
Function *copy() const override { return new ExponentialFunction(this); }
int getType() const override { return 2; }
void transform(const double *in, double *out) const override;
GBool isOk() const override { return ok; }
double *getC0() { return c0; }
double *getC1() { return c1; }
double getE() { return e; }
const double *getC0() const { return c0; }
const double *getC1() const { return c1; }
double getE() const { return e; }
private:
......@@ -203,16 +203,16 @@ public:
StitchingFunction(Object *funcObj, Dict *dict, std::set<int> *usedParents);
~StitchingFunction();
Function *copy() override { return new StitchingFunction(this); }
int getType() override { return 3; }
void transform(double *in, double *out) override;
GBool isOk() override { return ok; }
Function *copy() const override { return new StitchingFunction(this); }
int getType() const override { return 3; }
void transform(const double *in, double *out) const override;
GBool isOk() const override { return ok; }
int getNumFuncs() { return k; }
Function *getFunc(int i) { return funcs[i]; }
double *getBounds() { return bounds; }
double *getEncode() { return encode; }
double *getScale() { return scale; }
int getNumFuncs() const { return k; }
const Function *getFunc(int i) const { return funcs[i]; }
const double *getBounds() const { return bounds; }
const double *getEncode() const { return encode; }
const double *getScale() const { return scale; }
private:
......@@ -235,10 +235,10 @@ public:
PostScriptFunction(Object *funcObj, Dict *dict);
~PostScriptFunction();
Function *copy() override { return new PostScriptFunction(this); }
int getType() override { return 4; }
void transform(double *in, double *out) override;
GBool isOk() override { return ok; }
Function *copy() const override { return new PostScriptFunction(this); }
int getType() const override { return 4; }
void transform(const double *in, double *out) const override;
GBool isOk() const override { return ok; }
const GooString *getCodeString() const { return codeString; }
......@@ -248,13 +248,13 @@ private:
GBool parseCode(Stream *str, int *codePtr);
GooString *getToken(Stream *str);
void resizeCode(int newSize);
void exec(PSStack *stack, int codePtr);
void exec(PSStack *stack, int codePtr) const;
GooString *codeString;
PSObject *code;
int codeSize;
double cacheIn[funcMaxInputs];
double cacheOut[funcMaxOutputs];
mutable double cacheIn[funcMaxInputs];
mutable double cacheOut[funcMaxOutputs];
GBool ok;
};
......
......@@ -532,8 +532,8 @@ Object GfxResources::lookupGStateNF(const char *name) {
//------------------------------------------------------------------------
Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
double hDPI, double vDPI, PDFRectangle *box,
PDFRectangle *cropBox, int rotate,
double hDPI, double vDPI, const PDFRectangle *box,
const PDFRectangle *cropBox, int rotate,
GBool (*abortCheckCbkA)(void *data),
void *abortCheckCbkDataA, XRef *xrefA)
{
......@@ -588,7 +588,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
}
Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
PDFRectangle *box, PDFRectangle *cropBox,
const PDFRectangle *box, const PDFRectangle *cropBox,
GBool (*abortCheckCbkA)(void *data),
void *abortCheckCbkDataA, Gfx *gfxA)
{
......@@ -2033,7 +2033,7 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat,
double xMin, yMin, xMax, yMax, x, y, x1, y1;
double cxMin, cyMin, cxMax, cyMax;
int xi0, yi0, xi1, yi1, xi, yi;
double *ctm, *btm, *ptm;
const double *ctm, *btm, *ptm;
double m[6], ictm[6], m1[6], imb[6];
double det;
double xstep, ystep;
......@@ -2255,7 +2255,7 @@ void Gfx::doShadingPatternFill(GfxShadingPattern *sPat,
GBool stroke, GBool eoFill, GBool text) {
GfxShading *shading;
GfxState *savedState;
double *ctm, *btm, *ptm;
const double *ctm, *btm, *ptm;
double m[6], ictm[6], m1[6];
double xMin, yMin, xMax, yMax;
double det;
......@@ -2482,12 +2482,11 @@ void Gfx::doFunctionShFill1(GfxFunctionShading *shading,
GfxColor fillColor;
GfxColor color0M, color1M, colorM0, colorM1, colorMM;
GfxColor colors2[4];
double *matrix;
double xM, yM;
int nComps, i, j;
nComps = shading->getColorSpace()->getNComps();
matrix = shading->getMatrix();
const double *matrix = shading->getMatrix();
// compare the four corner colors
for (i = 0; i < 4; ++i) {
......@@ -2916,7 +2915,6 @@ void Gfx::doRadialShFill(GfxRadialShading *shading) {
double sz, xz, yz, sMin, sMax;
GBool enclosed;
int ia, ib, k, n;
double *ctm;
double theta, alpha, angle, t;
GBool needExtend = gTrue;
......@@ -3029,7 +3027,7 @@ void Gfx::doRadialShFill(GfxRadialShading *shading) {
// achieve a curve flatness of 0.1 pixel in device space for the
// largest circle (note that "device space" is 72 dpi when generating
// PostScript, hence the relatively small 0.1 pixel accuracy)
ctm = state->getCTM();
const double *ctm = state->getCTM();
t = fabs(ctm[0]);
if (fabs(ctm[1]) > t) {
t = fabs(ctm[1]);
......@@ -3478,7 +3476,7 @@ void Gfx::doPatchMeshShFill(GfxPatchMeshShading *shading) {
}
void Gfx::fillPatch(GfxPatch *patch, int colorComps, int patchColorComps, double refineColorThreshold, int depth, GfxPatchMeshShading *shading) {
void Gfx::fillPatch(const GfxPatch *patch, int colorComps, int patchColorComps, double refineColorThreshold, int depth, const GfxPatchMeshShading *shading) {
GfxPatch patch00, patch01, patch10, patch11;
double xx[4][8], yy[4][8];
double xxm, yym;
......@@ -4773,7 +4771,7 @@ void Gfx::doForm(Object *str) {
ocState = ocSaved;
}
void Gfx::drawForm(Object *str, Dict *resDict, double *matrix, double *bbox,
void Gfx::drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox,
GBool transpGroup, GBool softMask,
GfxColorSpace *blendingColorSpace,
GBool isolated, GBool knockout,
......
......@@ -152,14 +152,14 @@ public:
// Constructor for regular output.
Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict,
double hDPI, double vDPI, PDFRectangle *box,
PDFRectangle *cropBox, int rotate,
double hDPI, double vDPI, const PDFRectangle *box,
const PDFRectangle *cropBox, int rotate,
GBool (*abortCheckCbkA)(void *data) = NULL,
void *abortCheckCbkDataA = NULL, XRef *xrefA = NULL);
// Constructor for a sub-page object.
Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
PDFRectangle *box, PDFRectangle *cropBox,
const PDFRectangle *box, const PDFRectangle *cropBox,
GBool (*abortCheckCbkA)(void *data) = NULL,
void *abortCheckCbkDataA = NULL, Gfx *gfxA = NULL);
#ifdef USE_CMS
......@@ -197,7 +197,7 @@ public:
GBool checkTransparencyGroup(Dict *resDict);
void drawForm(Object *str, Dict *resDict, double *matrix, double *bbox,
void drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox,
GBool transpGroup = gFalse, GBool softMask = gFalse,
GfxColorSpace *blendingColorSpace = NULL,
GBool isolated = gFalse, GBool knockout = gFalse,
......@@ -330,7 +330,7 @@ private:
double x2, double y2, double color2,
double refineColorThreshold, int depth, GfxGouraudTriangleShading *shading, GfxState::ReusablePathIterator *path);
void doPatchMeshShFill(GfxPatchMeshShading *shading);
void fillPatch(GfxPatch *patch, int colorComps, int patchColorComps, double refineColorThreshold, int depth, GfxPatchMeshShading *shading);
void fillPatch(const GfxPatch *patch, int colorComps, int patchColorComps, double refineColorThreshold, int depth, const GfxPatchMeshShading *shading);
void doEndPath();
// path clipping operators
......
This diff is collapsed.
This diff is collapsed.
......@@ -96,7 +96,7 @@ void MarkedContentOutputDev::endMarkedContent(GfxState *state)
}
bool MarkedContentOutputDev::needFontChange(GfxFont* font) const
bool MarkedContentOutputDev::needFontChange(const GfxFont* font) const
{
if (currentFont == font)
return gFalse;
......
......@@ -118,7 +118,7 @@ private:
void endSpan();
bool inMarkedContent() const { return mcidStack.size() > 0; }
bool needFontChange(GfxFont* font) const;
bool needFontChange(const GfxFont* font) const;
GfxFont *currentFont;
GooString *currentText;
......
......@@ -42,7 +42,7 @@
// OutputDev
//------------------------------------------------------------------------
void OutputDev::setDefaultCTM(double *ctm) {
void OutputDev::setDefaultCTM(const double *ctm) {
int i;
double det;
......
......@@ -132,7 +132,7 @@ public:
//----- initialization and control
// Set default transform matrix.
virtual void setDefaultCTM(double *ctm);
virtual void setDefaultCTM(const double *ctm);
// Check to see if a page slice should be displayed. If this
// returns false, the page display is aborted. Typically, an
......@@ -163,8 +163,8 @@ public:
virtual void cvtDevToUser(double dx, double dy, double *ux, double *uy);
virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
double *getDefCTM() { return defCTM; }
double *getDefICTM() { return defICTM; }
const double *getDefCTM() const { return defCTM; }
const double *getDefICTM() const { return defICTM; }
//----- save/restore graphics state
virtual void saveState(GfxState * /*state*/) {}
......@@ -222,8 +222,8 @@ public:
virtual void fill(GfxState * /*state*/) {}
virtual void eoFill(GfxState * /*state*/) {}
virtual GBool tilingPatternFill(GfxState * /*state*/, Gfx * /*gfx*/, Catalog * /*cat*/, Object * /*str*/,
double * /*pmat*/, int /*paintType*/, int /*tilingType*/, Dict * /*resDict*/,
double * /*mat*/, double * /*bbox*/,
const double * /*pmat*/, int /*paintType*/, int /*tilingType*/, Dict * /*resDict*/,
const double * /*mat*/, const double * /*bbox*/,
int /*x0*/, int /*y0*/, int /*x1*/, int /*y1*/,
double /*xStep*/, double /*yStep*/)
{ return gFalse; }
......@@ -354,13 +354,13 @@ public:
//----- transparency groups and soft masks
virtual GBool checkTransparencyGroup(GfxState * /*state*/, GBool /*knockout*/) { return gTrue; }
virtual void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
virtual void beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/,
GfxColorSpace * /*blendingColorSpace*/,
GBool /*isolated*/, GBool /*knockout*/,
GBool /*forSoftMask*/) {}
virtual void endTransparencyGroup(GfxState * /*state*/) {}
virtual void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) {}
virtual void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
virtual void paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/) {}
virtual void setSoftMask(GfxState * /*state*/, const double * /*bbox*/, GBool /*alpha*/,
Function * /*transferFunc*/, GfxColor * /*backdropColor*/) {}
virtual void clearSoftMask(GfxState * /*state*/) {}
......
......@@ -889,7 +889,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo)
error(errInternal, -1, "Illegal pageNo: {0:d}({1:d})", pageNo, getNumPages() );
return errOpenFile;
}
PDFRectangle *cropBox = nullptr;
const PDFRectangle *cropBox = nullptr;
if (getCatalog()->getPage(pageNo)->isCropped()) {
cropBox = getCatalog()->getPage(pageNo)->getCropBox();
}
......@@ -1742,8 +1742,8 @@ void PDFDoc::markObject (Object* obj, XRef *xRef, XRef *countRef, Guint numOffse
}
void PDFDoc::replacePageDict(int pageNo, int rotate,
PDFRectangle *mediaBox,
PDFRectangle *cropBox)
const PDFRectangle *mediaBox,
const PDFRectangle *cropBox)
{
Ref *refPage = getCatalog()->getPageRef(pageNo);
Object page = getXRef()->fetch(refPage->num, refPage->gen);
......
......@@ -334,7 +334,7 @@ public:
void *getGUIData() { return guiData; }
// rewrite pageDict with MediaBox, CropBox and new page CTM
void replacePageDict(int pageNo, int rotate, PDFRectangle *mediaBox, PDFRectangle *cropBox);
void replacePageDict(int pageNo, int rotate, const PDFRectangle *mediaBox, const PDFRectangle *cropBox);
void markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, Guint numOffset, int oldRefNum, int newRefNum, std::set<Dict*> *alreadyMarkedDicts = nullptr);
GBool markAnnotations(Object *annots, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum, std::set<Dict*> *alreadyMarkedDicts = nullptr);
void markAcroForm(Object *acrpForm, XRef *xRef, XRef *countRef, Guint numOffset, int oldPageNum, int newPageNum);
......