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

Fix some -Wshadow warnings

More to come, -Wshadow is interesting but if we enable it we still get too many warnings for it to be useful
parent 8cfe91ae
/*
* Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
* Copyright (C) 2017, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2017, 2018, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2017, Jason Alan Palmer <jalanpalmer@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
......@@ -271,7 +271,7 @@ static void print_embedded_files(poppler::document *doc)
std::vector<poppler::embedded_file *> ef = doc->embedded_files();
if (!ef.empty()) {
std::vector<poppler::embedded_file *>::const_iterator it = ef.begin(), it_end = ef.end();
const std::ios_base::fmtflags f = std::cout.flags();
const std::ios_base::fmtflags flags = std::cout.flags();
std::left(std::cout);
for (; it != it_end; ++it) {
poppler::embedded_file *f = *it;
......@@ -293,7 +293,7 @@ static void print_embedded_files(poppler::document *doc)
<< " " << (f->mime_type().empty() ? std::string("<no mime type>") : f->mime_type())
<< std::endl;
}
std::cout.flags(f);
std::cout.flags(flags);
} else {
std::cout << "<no embedded files>" << std::endl;
}
......
......@@ -6,7 +6,7 @@
//
// Copyright 2009 Stefan Thomas <thomas@eload24.com>
// Copyright 2010, 2011 Hib Eris <hib@hiberis.nl>
// Copyright 2010 Albert Astals Cid <aacid@kde.org>
// Copyright 2010, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2013 Julien Nabet <serval2412@yahoo.fr>
//
//========================================================================
......@@ -172,12 +172,12 @@ size_t CachedFile::read(void *ptr, size_t unitsize, size_t count)
return bytes;
}
int CachedFile::cache(size_t offset, size_t length)
int CachedFile::cache(size_t rangeOffset, size_t rangeLength)
{
std::vector<ByteRange> r;
ByteRange range;
range.offset = offset;
range.length = length;
range.offset = rangeOffset;
range.length = rangeLength;
r.push_back(range);
return cache(r);
}
......
......@@ -17,7 +17,7 @@
// Copyright (C) 2005-2007 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006, 2007, 2010, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
// Copyright (C) 2008, 2009 Chris Wilson <chris@chris-wilson.co.uk>
......@@ -70,17 +70,17 @@
// CairoFont
//------------------------------------------------------------------------
CairoFont::CairoFont(Ref ref,
cairo_font_face_t *cairo_font_face,
int *codeToGID,
Guint codeToGIDLen,
GBool substitute,
GBool printing) : ref(ref),
cairo_font_face(cairo_font_face),
codeToGID(codeToGID),
codeToGIDLen(codeToGIDLen),
substitute(substitute),
printing(printing) { }
CairoFont::CairoFont(Ref refA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
GBool substituteA,
GBool printingA) : ref(refA),
cairo_font_face(cairo_font_faceA),
codeToGID(codeToGIDA),
codeToGIDLen(codeToGIDLenA),
substitute(substituteA),
printing(printingA) { }
CairoFont::~CairoFont() {
cairo_font_face_destroy (cairo_font_face);
......@@ -379,15 +379,15 @@ _ft_new_face (FT_Library lib,
#define _ft_new_face _ft_new_face_uncached
#endif
CairoFreeTypeFont::CairoFreeTypeFont(Ref ref,
cairo_font_face_t *cairo_font_face,
int *codeToGID,
Guint codeToGIDLen,
GBool substitute) : CairoFont(ref,
cairo_font_face,
codeToGID,
codeToGIDLen,
substitute,
CairoFreeTypeFont::CairoFreeTypeFont(Ref refA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
GBool substituteA) : CairoFont(refA,
cairo_font_faceA,
codeToGIDA,
codeToGIDLenA,
substituteA,
gTrue) { }
CairoFreeTypeFont::~CairoFreeTypeFont() { }
......@@ -777,18 +777,18 @@ CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc,
return new CairoType3Font(ref, doc, font_face, codeToGID, codeToGIDLen, printing, xref);
}
CairoType3Font::CairoType3Font(Ref ref,
PDFDoc *doc,
cairo_font_face_t *cairo_font_face,
int *codeToGID,
Guint codeToGIDLen,
GBool printing, XRef *xref) : CairoFont(ref,
cairo_font_face,
codeToGID,
codeToGIDLen,
CairoType3Font::CairoType3Font(Ref refA,
PDFDoc *docA,
cairo_font_face_t *cairo_font_faceA,
int *codeToGIDA,
Guint codeToGIDLenA,
GBool printingA, XRef *xref) : CairoFont(refA,
cairo_font_faceA,
codeToGIDA,
codeToGIDLenA,
gFalse,
printing),
doc(doc) { }
printingA),
doc(docA) { }
CairoType3Font::~CairoType3Font() { }
......
......@@ -16,7 +16,7 @@
//
// Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2005, 2009, 2012, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005, 2009, 2012, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
// Copyright (C) 2006-2011, 2013, 2014, 2017 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2008 Carl Worth <cworth@cworth.org>
......@@ -3193,7 +3193,6 @@ public:
}
void getRow(int row_num, uint32_t *row_data) override {
int i;
Guchar *pix;
if (row_num <= current_row)
......@@ -3214,7 +3213,7 @@ public:
Guchar *p = pix;
GfxRGB rgb;
for (i = 0; i < width; i++) {
for (int i = 0; i < width; i++) {
rgb = lookup[*p];
row_data[i] =
((int) colToByte(rgb.r) << 16) |
......
......@@ -269,10 +269,10 @@ public:
void setCairo (cairo_t *cr);
void setTextPage (TextPage *text);
void setPrinting (GBool printing) { this->printing = printing; needFontUpdate = gTrue; }
void setPrinting (GBool printingA) { printing = printingA; needFontUpdate = gTrue; }
void setAntialias(cairo_antialias_t antialias);
void setInType3Char(GBool inType3Char) { this->inType3Char = inType3Char; }
void setInType3Char(GBool inType3CharA) { inType3Char = inType3CharA; }
void getType3GlyphWidth (double *wx, double *wy) { *wx = t3_glyph_wx; *wy = t3_glyph_wy; }
GBool hasType3GlyphBBox () { return t3_glyph_has_bbox; }
double *getType3GlyphBBox () { return t3_glyph_bbox; }
......
......@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2008 Julien Rebetez <julien@fhtagn.net>
// Copyright (C) 2008, 2010, 2016, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008, 2010, 2016-2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Matthias Franz <matthias@ktug.or.kr>
// Copyright (C) 2009 David Benjamin <davidben@mit.edu>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
......@@ -1454,7 +1454,7 @@ static void sha256(Guchar *msg, int msgLen, Guchar *hash) {
// SHA-512 hash (see FIPS 180-4)
//------------------------------------------------------------------------
// SHA 384 and SHA 512 use the same sequence of eighty constant 64 bit words.
static const uint64_t K[80] = {
static const uint64_t shaK[80] = {
0x428a2f98d728ae22ull, 0x7137449123ef65cdull, 0xb5c0fbcfec4d3b2full, 0xe9b5dba58189dbbcull, 0x3956c25bf348b538ull,
0x59f111f1b605d019ull, 0x923f82a4af194f9bull, 0xab1c5ed5da6d8118ull, 0xd807aa98a3030242ull, 0x12835b0145706fbeull,
0x243185be4ee4b28cull, 0x550c7dc3d5ffb4e2ull, 0x72be5d74f27b896full, 0x80deb1fe3b1696b1ull, 0x9bdc06a725c71235ull,
......@@ -1531,7 +1531,7 @@ static void sha512HashBlock(Guchar *blk, uint64_t *H) {
// 3.
for (t = 0; t < 80; ++t) {
T1 = h + sha512Sigma1(e) + sha512Ch(e,f,g) + K[t] + W[t];
T1 = h + sha512Sigma1(e) + sha512Ch(e,f,g) + shaK[t] + W[t];
T2 = sha512Sigma0(a) + sha512Maj(a,b,c);
h = g;
g = f;
......
......@@ -3,7 +3,7 @@
// FontInfo.cc
//
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2005-2008, 2010, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005-2008, 2010, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
// Copyright (C) 2006 Kouhei Sutou <kou@cozmixng.org>
// Copyright (C) 2009 Pino Toscano <pino@kde.org>
......@@ -92,7 +92,6 @@ GooList *FontInfoScanner::scan(int nPages) {
}
void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, GooList *fontsList) {
Ref r;
GfxFontDict *gfxFontDict;
GfxFont *font;
......@@ -102,7 +101,7 @@ void FontInfoScanner::scanFonts(XRef *xrefA, Dict *resDict, GooList *fontsList)
if (obj1.isRef()) {
Object obj2 = obj1.fetch(xrefA);
if (obj2.isDict()) {
r = obj1.getRef();
Ref r = obj1.getRef();
gfxFontDict = new GfxFontDict(xrefA, &r, obj2.getDict());
}
} else if (obj1.isDict()) {
......
......@@ -5108,7 +5108,7 @@ void Gfx::opMarkPoint(Object args[], int numArgs) {
//------------------------------------------------------------------------
struct GfxStackStateSaver {
GfxStackStateSaver(Gfx *gfx) : gfx(gfx) {
GfxStackStateSaver(Gfx *gfxA) : gfx(gfxA) {
gfx->saveState();
}
......
......@@ -1748,7 +1748,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
CharCode c;
Unicode *uBuf;
int c1, c2;
int excepsSize, i, j, k, n;
int excepsSize, j, k, n;
refCnt = 1;
ascent = 0.95;
......@@ -1876,7 +1876,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
obj1 = desFontDict->lookup("CIDToGIDMap");
if (obj1.isStream()) {
cidToGIDLen = 0;
i = 64;
int i = 64;
cidToGID = (int *)gmallocn(i, sizeof(int));
obj1.streamReset();
while ((c1 = obj1.streamGetChar()) != EOF &&
......@@ -1904,7 +1904,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
obj1 = desFontDict->lookup("W");
if (obj1.isArray()) {
excepsSize = 0;
i = 0;
int i = 0;
while (i + 1 < obj1.arrayGetLength()) {
obj2 = obj1.arrayGet(i);
obj3 = obj1.arrayGet(i + 1);
......@@ -1973,7 +1973,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
obj1 = desFontDict->lookup("W2");
if (obj1.isArray()) {
excepsSize = 0;
i = 0;
int i = 0;
while (i + 1 < obj1.arrayGetLength()) {
obj2 = obj1.arrayGet(i);
obj3 = obj1.arrayGet(i+ 1);
......@@ -2055,7 +2055,7 @@ int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
Unicode **u, int *uLen,
double *dx, double *dy, double *ox, double *oy) {
CID cid;
CharCode c;
CharCode dummy;
double w, h, vx, vy;
int n, a, b, m;
......@@ -2066,7 +2066,7 @@ int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
return 1;
}
*code = (CharCode)(cid = cMap->getCID(s, len, &c, &n));
*code = (CharCode)(cid = cMap->getCID(s, len, &dummy, &n));
if (ctu) {
if (hasToUnicode) {
int i = 0, c = 0;
......
......@@ -1628,7 +1628,6 @@ void GfxLabColorSpace::getXYZ(GfxColor *color,
void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
double X, Y, Z;
double r, g, b;
getXYZ(color, &X, &Y, &Z);
#ifdef USE_CMS
......@@ -1672,9 +1671,9 @@ void GfxLabColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
Y *= whiteY;
Z *= whiteZ;
// convert XYZ to RGB, including gamut mapping and gamma correction
r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
const double r = xyzrgb[0][0] * X + xyzrgb[0][1] * Y + xyzrgb[0][2] * Z;
const double g = xyzrgb[1][0] * X + xyzrgb[1][1] * Y + xyzrgb[1][2] * Z;
const double b = xyzrgb[2][0] * X + xyzrgb[2][1] * Y + xyzrgb[2][2] * Z;
rgb->r = dblToCol(sqrt(clip01(r * kr)));
rgb->g = dblToCol(sqrt(clip01(g * kg)));
rgb->b = dblToCol(sqrt(clip01(b * kb)));
......@@ -3888,7 +3887,6 @@ GfxUnivariateShading::~GfxUnivariateShading() {
void GfxUnivariateShading::getColor(double t, GfxColor *color) {
double out[gfxColorMaxComps];
int i;
// NB: there can be one function with n outputs or n functions with
// one output each (where n = number of color components)
......@@ -3918,14 +3916,14 @@ void GfxUnivariateShading::getColor(double t, GfxColor *color) {
u = cacheValues + lastMatch * nComps;
l = u - nComps;
for (i = 0; i < nComps; ++i) {
for (int i = 0; i < nComps; ++i) {
out[i] = ix * l[i] + x * u[i];
}
} else {
for (i = 0; i < nComps; ++i) {
for (int i = 0; i < nComps; ++i) {
out[i] = 0;
}
for (i = 0; i < nFuncs; ++i) {
for (int i = 0; i < nFuncs; ++i) {
if (funcs[i]->getInputSize() != 1) {
error(errSyntaxWarning, -1, "Invalid shading function (input != 1)");
break;
......@@ -3934,7 +3932,7 @@ void GfxUnivariateShading::getColor(double t, GfxColor *color) {
}
}
for (i = 0; i < nComps; ++i) {
for (int i = 0; i < nComps; ++i) {
color->c[i] = dblToCol(out[i]);
}
}
......@@ -6111,14 +6109,13 @@ void GfxImageColorMap::getCMYKLine(Guchar *in, Guchar *out, int length) {
}
void GfxImageColorMap::getDeviceNLine(Guchar *in, Guchar *out, int length) {
int i, j;
Guchar *inp, *tmp_line;
if (!useDeviceNLine()) {
GfxColor deviceN;
inp = in;
for (i = 0; i < length; i++) {
for (int i = 0; i < length; i++) {
getDeviceN (inp, &deviceN);
for (int j = 0; j < SPOT_NCOMPS+4; j++)
*out++ = deviceN.c[j];
......@@ -6131,8 +6128,8 @@ void GfxImageColorMap::getDeviceNLine(Guchar *in, Guchar *out, int length) {
case csIndexed:
case csSeparation:
tmp_line = (Guchar *) gmallocn (length, nComps2);
for (i = 0; i < length; i++) {
for (j = 0; j < nComps2; j++) {
for (int i = 0; i < length; i++) {
for (int j = 0; j < nComps2; j++) {
tmp_line[i * nComps2 + j] = byte_lookup[in[i] * nComps2 + j];
}
}
......@@ -6142,8 +6139,8 @@ void GfxImageColorMap::getDeviceNLine(Guchar *in, Guchar *out, int length) {
default:
inp = in;
for (j = 0; j < length; j++)
for (i = 0; i < nComps; i++) {
for (int j = 0; j < length; j++)
for (int i = 0; i < nComps; i++) {
*inp = byte_lookup[*inp * nComps + i];
inp++;
}
......@@ -6396,8 +6393,8 @@ void GfxPath::offset(double dx, double dy) {
//------------------------------------------------------------------------
//
//------------------------------------------------------------------------
GfxState::ReusablePathIterator::ReusablePathIterator(GfxPath *path)
: path(path),
GfxState::ReusablePathIterator::ReusablePathIterator(GfxPath *pathA)
: path(pathA),
subPathOff(0),
coordOff(0),
numCoords(0),
......
......@@ -1337,7 +1337,6 @@ void JBIG2Stream::readSegments() {
Guint *refSegs;
Goffset segDataPos;
int c1, c2, c3;
Guint i;
while (readULong(&segNum)) {
......@@ -1360,7 +1359,7 @@ void JBIG2Stream::readSegments() {
}
refFlags = (refFlags << 24) | (c1 << 16) | (c2 << 8) | c3;
nRefSegs = refFlags & 0x1fffffff;
for (i = 0; i < (nRefSegs + 9) >> 3; ++i) {
for (Guint i = 0; i < (nRefSegs + 9) >> 3; ++i) {
if ((c1 = curStr->getChar()) == EOF) {
goto eofError1;
}
......@@ -1370,19 +1369,19 @@ void JBIG2Stream::readSegments() {
// referred-to segment numbers
refSegs = (Guint *)gmallocn(nRefSegs, sizeof(Guint));
if (segNum <= 256) {
for (i = 0; i < nRefSegs; ++i) {
for (Guint i = 0; i < nRefSegs; ++i) {
if (!readUByte(&refSegs[i])) {
goto eofError2;
}
}
} else if (segNum <= 65536) {
for (i = 0; i < nRefSegs; ++i) {
for (Guint i = 0; i < nRefSegs; ++i) {
if (!readUWord(&refSegs[i])) {
goto eofError2;
}
}
} else {
for (i = 0; i < nRefSegs; ++i) {
for (Guint i = 0; i < nRefSegs; ++i) {
if (!readULong(&refSegs[i])) {
goto eofError2;
}
......@@ -1484,7 +1483,7 @@ void JBIG2Stream::readSegments() {
break;
default:
error(errSyntaxError, curStr->getPos(), "Unknown segment type in JBIG2 stream");
for (i = 0; i < segLength; ++i) {
for (Guint i = 0; i < segLength; ++i) {
if ((c1 = curStr->getChar()) == EOF) {
goto eofError2;
}
......
......@@ -1697,8 +1697,8 @@ GBool PDFDoc::markAnnotations(Object *annotsObj, XRef *xRef, XRef *countRef, Gui
} else {
Object page = getXRef()->fetch(obj2.getRef().num, obj2.getRef().gen);
if (page.isDict()) {
Dict *dict = page.getDict();
Object pagetype = dict->lookup("Type");
Dict *pageDict = page.getDict();
Object pagetype = pageDict->lookup("Type");
if (!pagetype.isName() || strcmp(pagetype.getName(), "Page") != 0) {
continue;
}
......
......@@ -6,7 +6,7 @@
//
// Copyright 2013, 2014 Igalia S.L.
// Copyright 2014 Luigi Scarso <luigi.scarso@gmail.com>
// Copyright 2014, 2017 Albert Astals Cid <aacid@kde.org>
// Copyright 2014, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright 2015 Dmytro Morgun <lztoad@gmail.com>
//
//========================================================================
......@@ -674,8 +674,8 @@ Attribute::Attribute(const char *nameA, int nameLenA, Object *valueA):
value = valueA->copy();
}
Attribute::Attribute(Type type, Object *valueA):
type(type),
Attribute::Attribute(Type typeA, Object *valueA):
type(typeA),
owner(UserProperties), // TODO: Determine corresponding owner from Type
revision(0),
name(),
......
......@@ -7,7 +7,7 @@
// Copyright 2013, 2014 Igalia S.L.
// Copyright 2014 Fabio D'Urso <fabiodurso@hotmail.it>
// Copyright 2017 Jan-Erik S <janerik234678@gmail.com>
// Copyright 2017 Albert Astals Cid <aacid@kde.org>
// Copyright 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright 2017 Adrian Johnson <ajohnson@redneon.com>
//
//========================================================================
......@@ -53,9 +53,9 @@ void StructTreeRoot::parse(Dict *root)
// corresponsing structure element. Here only the references are
// loaded into the array, the pointers to the StructElements will
// be filled-in later when parsing them.
Object obj = root->lookup("ParentTree");
if (obj.isDict()) {
parseNumberTreeNode(obj.getDict());
const Object parentTreeObj = root->lookup("ParentTree");
if (parentTreeObj.isDict()) {
parseNumberTreeNode(parentTreeObj.getDict());
}
std::set<int> seenElements;
......
......@@ -524,8 +524,8 @@ private:
class TextWordSelection {
public:
TextWordSelection(TextWord *word, int begin, int end)
: word(word), begin(begin), end(end)
TextWordSelection(TextWord *wordA, int beginA, int endA)
: word(wordA), begin(beginA), end(endA)
{
}
......
......@@ -558,7 +558,7 @@ GBool XRef::readXRefTable(Parser *parser, Goffset *pos, std::vector<Goffset> *fo
GBool more;
Object obj, obj2;
Goffset pos2;
int first, n, i;
int first, n;
while (1) {
obj = parser->getObj(gTrue);
......@@ -583,7 +583,7 @@ GBool XRef::readXRefTable(Parser *parser, Goffset *pos, std::vector<Goffset> *fo
goto err0;
}
}
for (i = first; i < first + n; ++i) {
for (int i = first; i < first + n; ++i) {
obj = parser->getObj(gTrue);
if (obj.isInt()) {
entry.offset = obj.getInt();
......
......@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
// Copyright (C) 2005-2009, 2011, 2012, 2014, 2015 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005-2009, 2011, 2012, 2014, 2015, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008, 2010 Pino Toscano <pino@kde.org>
// Copyright (C) 2009, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
......@@ -122,7 +122,7 @@ void ArthurOutputDev::startDoc(XRef *xrefA) {
#endif
}
void ArthurOutputDev::startPage(int pageNum, GfxState *state, XRef *xref)
void ArthurOutputDev::startPage(int pageNum, GfxState *state, XRef *)
{
// fill page with white background.
int w = static_cast<int>(state->getPageWidth());
......
......@@ -306,7 +306,7 @@ QRectF AnnotationPrivate::fromPdfRectangle(const PDFRectangle &r) const
// the transformation produced by fillTransformationMTX, but we can't use
// fillTransformationMTX here because it relies on the native annotation
// object's boundary rect to be already set up.
PDFRectangle AnnotationPrivate::boundaryToPdfRectangle(const QRectF &r, int flags) const
PDFRectangle AnnotationPrivate::boundaryToPdfRectangle(const QRectF &r, int rFlags) const
{
Q_ASSERT ( pdfPage );
......@@ -333,7 +333,7 @@ PDFRectangle AnnotationPrivate::boundaryToPdfRectangle(const QRectF &r, int flag
br_y = swp;
}
const int rotationFixUp = ( flags & Annotation::FixedRotation ) ? pageRotate : 0;
const int rotationFixUp = ( rFlags & Annotation::FixedRotation ) ? pageRotate : 0;
const double width = br_x - tl_x;
const double height = br_y - tl_y;
......@@ -391,13 +391,13 @@ QList<Annotation*> AnnotationPrivate::findAnnotations(::Page *pdfPage, DocumentD
// Create Annotation objects and tie to their native Annot
QList<Annotation*> res;
for ( uint j = 0; j < numAnnotations; j++ )
for ( uint k = 0; k < numAnnotations; k++ )
{
// get the j-th annotation
Annot * ann = annots->getAnnot( j );
Annot * ann = annots->getAnnot( k );
if ( !ann )
{
error(errInternal, -1, "Annot {0:ud} is null", j);
error(errInternal, -1, "Annot {0:ud} is null", k);
continue;
}
......@@ -3465,7 +3465,7 @@ class InkAnnotationPrivate : public AnnotationPrivate
QList< QLinkedList<QPointF> > inkPaths;
// helper
AnnotPath **toAnnotPaths(const QList< QLinkedList<QPointF> > &inkPaths);
AnnotPath **toAnnotPaths(const QList< QLinkedList<QPointF> > &paths);
};
InkAnnotationPrivate::InkAnnotationPrivate()
......@@ -3479,12 +3479,12 @@ Annotation * InkAnnotationPrivate::makeAlias()
}
// Note: Caller is required to delete array elements and the array itself after use
AnnotPath **InkAnnotationPrivate::toAnnotPaths(const QList< QLinkedList<QPointF> > &inkPaths)
AnnotPath **InkAnnotationPrivate::toAnnotPaths(const QList< QLinkedList<QPointF> > &paths)
{
const int pathsNumber = inkPaths.size();
const int pathsNumber = paths.size();
AnnotPath **res = new AnnotPath*[pathsNumber];
for (int i = 0; i < pathsNumber; ++i)
res[i] = toAnnotPath( inkPaths[i] );
res[i] = toAnnotPath( paths[i] );
return res;
}
......
......@@ -34,8 +34,8 @@ class MediaRenditionPrivate
{
public:
MediaRenditionPrivate(::MediaRendition *rendition)
: rendition(rendition)
MediaRenditionPrivate(::MediaRendition *renditionA)
: rendition(renditionA)
{
}
......
/* poppler-page.cc: qt interface to poppler
* Copyright (C) 2005, Net Integration Technologies, Inc.
* Copyright (C) 2005, Brad Hards <bradh@frogmouth.net>
* Copyright (C) 2005-2017, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2005-2018, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2005, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de>
* Copyright (C) 2006-2011, Pino Toscano <pino@kde.org>
* Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
......@@ -103,11 +103,11 @@ public:
class Qt5SplashOutputDev : public SplashOutputDev, public OutputDevCallbackHelper
{
public:
Qt5SplashOutputDev(SplashColorMode colorMode, int bitmapRowPad,
GBool reverseVideo, bool ignorePaperColorA, SplashColorPtr paperColor,
GBool bitmapTopDown, SplashThinLineMode thinLineMode,
GBool overprintPreview)
: SplashOutputDev(colorMode, bitmapRowPad, reverseVideo, paperColor, bitmapTopDown, thinLineMode, overprintPreview)
Qt5SplashOutputDev(SplashColorMode colorModeA, int bitmapRowPadA,
GBool reverseVideoA, bool ignorePaperColorA, SplashColorPtr paperColorA,
GBool bitmapTopDownA, SplashThinLineMode thinLineMode,
GBool overprintPreviewA)
: SplashOutputDev(colorModeA, bitmapRowPadA, reverseVideoA, paperColorA, bitmapTopDownA, thinLineMode, overprintPreviewA)
, ignorePaperColor(ignorePaperColorA)
{
}
......@@ -121,11 +121,11 @@ public:
QImage getXBGRImage(bool takeImageData)
{
SplashBitmap *bitmap = getBitmap();
SplashBitmap *b = getBitmap();
const int bw = bitmap->getWidth();
const int bh = bitmap->getHeight();
const int brs = bitmap->getRowSize();
const int bw = b->getWidth();
const int bh = b->getHeight();
const int brs = b->getRowSize();
// If we use DeviceN8, convert to XBGR8.
// If requested, also transfer Splash's internal alpha channel.
......@@ -137,8 +137,8 @@ public:
? QImage::Format_ARGB32_Premultiplied
: QImage::Format_RGB32;
if (bitmap->convertToXBGR(mode)) {
SplashColorPtr data = takeImageData ? bitmap->takeData() : bitmap->getDataPtr();
if (b->convertToXBGR(mode)) {
SplashColorPtr data = takeImageData ? b->takeData() : b->getDataPtr();
if (QSysInfo::ByteOrder == QSysInfo::BigEndian) {
// Convert byte order from RGBX to XBGR.
......
......@@ -204,11 +204,13 @@ int main( int argc, char **argv )
return 0;
}
Poppler::Page *page = doc->page(0);
if (page)
{
qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
delete page;
Poppler::Page *page = doc->page(0);
if (page)
{
qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
delete page;
}
}
if (argc == 2 || (argc == 3 && strcmp(argv[2], "-arthur") == 0) || (argc == 3 && strcmp(argv[2], "-textRects") == 0))
......
......@@ -14,6 +14,7 @@
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2014, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2017 Oliver Sander <oliver.sander@tu-dresden.de>
// Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
......@@ -112,11 +113,11 @@ SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA,
SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA,
SplashFontFileID *idA,
SplashFontSrc *src,
SplashFontSrc *srcA,
FT_Face faceA,
int *codeToGIDA, int codeToGIDLenA,
GBool trueTypeA, GBool type1A):
SplashFontFile(idA, src)
SplashFontFile(idA, srcA)
{
engine = engineA;
face = faceA;
......