Commit 96333f6d authored by Albert Astals Cid's avatar Albert Astals Cid

Add override markers

parent da490581
......@@ -99,6 +99,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if(CMAKE_COMPILER_IS_GNUCXX)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override" )
endif()
# set the default compile warnings
set(DEFAULT_COMPILE_WARNINGS_NO)
set(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wcast-align -fno-exceptions -fno-check-new -fno-common")
......
......@@ -69,13 +69,13 @@ class MemReader: public Reader {
public:
static MemReader *make(char *bufA, int lenA);
virtual ~MemReader();
virtual int getByte(int pos);
virtual GBool getU16BE(int pos, int *val);
virtual GBool getU32BE(int pos, Guint *val);
virtual GBool getU32LE(int pos, Guint *val);
virtual GBool getUVarBE(int pos, int size, Guint *val);
virtual GBool cmp(int pos, const char *s);
~MemReader();
int getByte(int pos) override;
GBool getU16BE(int pos, int *val) override;
GBool getU32BE(int pos, Guint *val) override;
GBool getU32LE(int pos, Guint *val) override;
GBool getUVarBE(int pos, int size, Guint *val) override;
GBool cmp(int pos, const char *s) override;
private:
......@@ -164,13 +164,13 @@ class FileReader: public Reader {
public:
static FileReader *make(char *fileName);
virtual ~FileReader();
virtual int getByte(int pos);
virtual GBool getU16BE(int pos, int *val);
virtual GBool getU32BE(int pos, Guint *val);
virtual GBool getU32LE(int pos, Guint *val);
virtual GBool getUVarBE(int pos, int size, Guint *val);
virtual GBool cmp(int pos, const char *s);
~FileReader();
int getByte(int pos) override;
GBool getU16BE(int pos, int *val) override;
GBool getU32BE(int pos, Guint *val) override;
GBool getU32LE(int pos, Guint *val) override;
GBool getUVarBE(int pos, int size, Guint *val) override;
GBool cmp(int pos, const char *s) override;
private:
......@@ -287,13 +287,13 @@ class StreamReader: public Reader {
public:
static StreamReader *make(int (*getCharA)(void *data), void *dataA);
virtual ~StreamReader();
virtual int getByte(int pos);
virtual GBool getU16BE(int pos, int *val);
virtual GBool getU32BE(int pos, Guint *val);
virtual GBool getU32LE(int pos, Guint *val);
virtual GBool getUVarBE(int pos, int size, Guint *val);
virtual GBool cmp(int pos, const char *s);
~StreamReader();
int getByte(int pos) override;
GBool getU16BE(int pos, int *val) override;
GBool getU32BE(int pos, Guint *val) override;
GBool getU32LE(int pos, Guint *val) override;
GBool getUVarBE(int pos, int size, Guint *val) override;
GBool cmp(int pos, const char *s) override;
private:
......
......@@ -53,7 +53,7 @@ public:
// Create a FoFiTrueType object from a file on disk.
static FoFiTrueType *load(char *fileName, int faceIndexA=0);
virtual ~FoFiTrueType();
~FoFiTrueType();
// Returns true if this an OpenType font containing CFF data, false
// if it's a TrueType font (or OpenType font with TrueType data).
......
......@@ -29,7 +29,7 @@ public:
// Create a FoFiType1 object from a file on disk.
static FoFiType1 *load(char *fileName);
virtual ~FoFiType1();
~FoFiType1();
// Return the font name.
char *getName();
......
......@@ -28,8 +28,8 @@ class PopplerCachedFileLoader: public CachedFileLoader {
public:
PopplerCachedFileLoader(GInputStream* inputStreamA, GCancellable *cancellableA, goffset lengthA = -1);
~PopplerCachedFileLoader();
size_t init(GooString *url, CachedFile* cachedFile);
int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer);
size_t init(GooString *url, CachedFile* cachedFile) override;
int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) override;
private:
GInputStream *inputStream;
......
......@@ -32,31 +32,31 @@ public:
PopplerInputStream(GInputStream *inputStream, GCancellable *cancellableA,
Goffset startA, GBool limitedA, Goffset lengthA, Object *dictA);
virtual ~PopplerInputStream();
virtual BaseStream *copy();
virtual Stream *makeSubStream(Goffset start, GBool limited,
Goffset lengthA, Object *dictA);
virtual StreamKind getKind() { return strWeird; }
virtual void reset();
virtual void close();
virtual int getChar()
~PopplerInputStream();
BaseStream *copy() override;
Stream *makeSubStream(Goffset start, GBool limited,
Goffset lengthA, Object *dictA) override;
StreamKind getKind() override { return strWeird; }
void reset() override;
void close() override;
int getChar() override
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar()
int lookChar() override
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
virtual Goffset getPos() { return bufPos + (bufPtr - buf); }
virtual void setPos(Goffset pos, int dir = 0);
virtual Goffset getStart() { return start; }
virtual void moveStart(Goffset delta);
Goffset getPos() override { return bufPos + (bufPtr - buf); }
void setPos(Goffset pos, int dir = 0) override;
Goffset getStart() override { return start; }
void moveStart(Goffset delta) override;
virtual int getUnfilteredChar() { return getChar(); }
virtual void unfilteredReset() { reset(); }
int getUnfilteredChar() override { return getChar(); }
void unfilteredReset() override { reset(); }
private:
GBool fillBuf();
virtual GBool hasGetChars() { return true; }
virtual int getChars(int nChars, Guchar *buffer);
GBool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
GInputStream *inputStream;
GCancellable *cancellable;
......
......@@ -39,13 +39,13 @@ public:
JpegWriter(Format format = RGB);
~JpegWriter();
bool init(FILE *f, int width, int height, int hDPI, int vDPI);
bool init(FILE *f, int width, int height, int hDPI, int vDPI) override;
bool writePointers(unsigned char **rowPointers, int rowCount);
bool writeRow(unsigned char **row);
bool writePointers(unsigned char **rowPointers, int rowCount) override;
bool writeRow(unsigned char **row) override;
bool close();
bool supportCMYK();
bool close() override;
bool supportCMYK() override;
private:
JpegWriter(const JpegWriter &other);
......
......@@ -36,12 +36,12 @@ public:
NetPBMWriter(Format formatA = RGB);
~NetPBMWriter() {};
bool init(FILE *f, int width, int height, int hDPI, int vDPI);
bool init(FILE *f, int width, int height, int hDPI, int vDPI) override;
bool writePointers(unsigned char **rowPointers, int rowCount);
bool writeRow(unsigned char **row);
bool writePointers(unsigned char **rowPointers, int rowCount) override;
bool writeRow(unsigned char **row) override;
bool close();
bool close() override;
private:
FILE *file;
......
......@@ -43,12 +43,12 @@ public:
void setSRGBProfile();
bool init(FILE *f, int width, int height, int hDPI, int vDPI);
bool init(FILE *f, int width, int height, int hDPI, int vDPI) override;
bool writePointers(unsigned char **rowPointers, int rowCount);
bool writeRow(unsigned char **row);
bool writePointers(unsigned char **rowPointers, int rowCount) override;
bool writeRow(unsigned char **row) override;
bool close();
bool close() override;
private:
PNGWriter(const PNGWriter &other);
......
......@@ -40,14 +40,14 @@ public:
void setCompressionString(const char *compressionStringArg);
bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI);
bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI) override;
bool writePointers(unsigned char **rowPointers, int rowCount);
bool writeRow(unsigned char **rowData);
bool writePointers(unsigned char **rowPointers, int rowCount) override;
bool writeRow(unsigned char **rowData) override;
bool supportCMYK() { return true; }
bool supportCMYK() override { return true; }
bool close();
bool close() override;
private:
TiffWriter(const TiffWriter &other);
......
......@@ -270,8 +270,8 @@ public:
double getVerticalCorner() const { return verticalCorner; }
private:
virtual AnnotBorderType getType() const { return typeArray; }
virtual void writeToObject(XRef *xref, Object *obj1) const;
AnnotBorderType getType() const override { return typeArray; }
void writeToObject(XRef *xref, Object *obj1) const override;
double horizontalCorner; // (Default 0)
double verticalCorner; // (Default 0)
......@@ -289,8 +289,8 @@ public:
AnnotBorderBS(Dict *dict);
private:
virtual AnnotBorderType getType() const { return typeBS; }
virtual void writeToObject(XRef *xref, Object *obj1) const;
AnnotBorderType getType() const override { return typeBS; }
void writeToObject(XRef *xref, Object *obj1) const override;
const char *getStyleName() const;
......@@ -725,7 +725,7 @@ public:
AnnotMarkup(PDFDoc *docA, PDFRectangle *rect);
AnnotMarkup(PDFDoc *docA, Dict *dict, Object *obj);
virtual ~AnnotMarkup();
~AnnotMarkup();
// getters
GooString *getLabel() const { return label; }
......@@ -745,7 +745,7 @@ public:
void setDate(GooString *new_date);
protected:
virtual void removeReferencedObjects();
void removeReferencedObjects() override;
GooString *label; // T (Default autor)
AnnotPopup *popup; // Popup
......@@ -787,7 +787,7 @@ public:
AnnotText(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotText();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
// getters
GBool getOpen() const { return open; }
......@@ -820,7 +820,7 @@ class AnnotMovie: public Annot {
AnnotMovie(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotMovie();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
GooString* getTitle() { return title; }
Movie* getMovie() { return movie; }
......@@ -878,9 +878,9 @@ public:
AnnotLink(PDFDoc *docA, PDFRectangle *rect);
AnnotLink(PDFDoc *docA, Dict *dict, Object *obj);
virtual ~AnnotLink();
~AnnotLink();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
// getters
LinkAction *getAction() const { return action; }
......@@ -922,9 +922,9 @@ public:
AnnotFreeText(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotFreeText();
virtual void draw(Gfx *gfx, GBool printing);
virtual Object *getAppearanceResDict(Object *dest);
virtual void setContents(GooString *new_content);
void draw(Gfx *gfx, GBool printing) override;
Object *getAppearanceResDict(Object *dest) override;
void setContents(GooString *new_content) override;
void setAppearanceString(GooString *new_string);
void setQuadding(AnnotFreeTextQuadding new_quadding);
......@@ -986,9 +986,9 @@ public:
AnnotLine(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotLine();
virtual void draw(Gfx *gfx, GBool printing);
virtual Object *getAppearanceResDict(Object *dest);
virtual void setContents(GooString *new_content);
void draw(Gfx *gfx, GBool printing) override;
Object *getAppearanceResDict(Object *dest) override;
void setContents(GooString *new_content) override;
void setVertices(double x1, double y1, double x2, double y2);
void setStartEndStyle(AnnotLineEndingStyle start, AnnotLineEndingStyle end);
......@@ -1050,9 +1050,9 @@ public:
AnnotTextMarkup(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
AnnotTextMarkup(PDFDoc *docA, Dict *dict, Object *obj);
virtual ~AnnotTextMarkup();
~AnnotTextMarkup();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
// typeHighlight, typeUnderline, typeSquiggly or typeStrikeOut
void setType(AnnotSubtype new_type);
......@@ -1102,7 +1102,7 @@ public:
AnnotGeometry(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotGeometry();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
void setType(AnnotSubtype new_type); // typeSquare or typeCircle
void setInteriorColor(AnnotColor *new_color);
......@@ -1138,7 +1138,7 @@ public:
AnnotPolygon(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotPolygon();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
void setType(AnnotSubtype new_type); // typePolygon or typePolyLine
void setVertices(AnnotPath *path);
......@@ -1213,7 +1213,7 @@ public:
AnnotInk(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotInk();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
void setInkList(AnnotPath **paths, int n_paths);
......@@ -1248,7 +1248,7 @@ public:
AnnotFileAttachment(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotFileAttachment();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
// getters
Object *getFile() { return &file; }
......@@ -1276,7 +1276,7 @@ public:
AnnotSound(PDFDoc *docA, Dict *dict, Object *obj);
~AnnotSound();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
// getters
Sound *getSound() { return sound; }
......@@ -1309,9 +1309,9 @@ public:
AnnotWidget(PDFDoc *docA, Dict *dict, Object *obj);
AnnotWidget(PDFDoc *docA, Dict *dict, Object *obj, FormField *fieldA);
virtual ~AnnotWidget();
~AnnotWidget();
virtual void draw(Gfx *gfx, GBool printing);
void draw(Gfx *gfx, GBool printing) override;
void drawBorder();
void drawFormFieldButton(GfxResources *resources, GooString *da);
......
......@@ -74,7 +74,7 @@ protected:
class CairoFreeTypeFont : public CairoFont {
public:
static CairoFreeTypeFont *create(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs);
virtual ~CairoFreeTypeFont();
~CairoFreeTypeFont();
private:
CairoFreeTypeFont(Ref ref, cairo_font_face_t *cairo_font_face,
......@@ -88,9 +88,9 @@ public:
static CairoType3Font *create(GfxFont *gfxFont, PDFDoc *doc,
CairoFontEngine *fontEngine,
GBool printing, XRef *xref);
virtual ~CairoType3Font();
~CairoType3Font();
virtual GBool matches(Ref &other, GBool printing);
GBool matches(Ref &other, GBool printing) override;
private:
CairoType3Font(Ref ref, PDFDoc *doc,
......
......@@ -3119,7 +3119,7 @@ public:
return image;
}
void getRow(int row_num, uint32_t *row_data) {
void getRow(int row_num, uint32_t *row_data) override {
int i;
Guchar *pix;
......
This diff is collapsed.
......@@ -65,19 +65,19 @@ class DCTStream: public FilterStream {
public:
DCTStream(Stream *strA, int colorXformA, Object *dict, int recursion);
virtual ~DCTStream();
virtual StreamKind getKind() { return strDCT; }
virtual void reset();
virtual int getChar();
virtual int lookChar();
virtual GooString *getPSFilter(int psLevel, const char *indent);
virtual GBool isBinary(GBool last = gTrue);
~DCTStream();
StreamKind getKind() override { return strDCT; }
void reset() override;
int getChar() override;
int lookChar() override;
GooString *getPSFilter(int psLevel, const char *indent) override;
GBool isBinary(GBool last = gTrue) override;
private:
void init();
virtual GBool hasGetChars() { return true; }
virtual int getChars(int nChars, Guchar *buffer);
GBool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
int colorXform;
JSAMPLE *current;
......
......@@ -105,14 +105,14 @@ public:
BaseCryptStream(Stream *strA, Guchar *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
virtual ~BaseCryptStream();
virtual StreamKind getKind() { return strCrypt; }
virtual void reset();
virtual int getChar();
virtual int lookChar() = 0;
virtual Goffset getPos();
virtual GBool isBinary(GBool last);
virtual Stream *getUndecodedStream() { return this; }
~BaseCryptStream();
StreamKind getKind() override { return strCrypt; }
void reset() override;
int getChar() override;
int lookChar() override = 0;
Goffset getPos() override;
GBool isBinary(GBool last) override;
Stream *getUndecodedStream() override { return this; }
void setAutoDelete(GBool val);
protected:
......@@ -140,8 +140,8 @@ public:
EncryptStream(Stream *strA, Guchar *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
~EncryptStream();
virtual void reset();
virtual int lookChar();
void reset() override;
int lookChar() override;
};
class DecryptStream : public BaseCryptStream {
......@@ -150,8 +150,8 @@ public:
DecryptStream(Stream *strA, Guchar *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
~DecryptStream();
virtual void reset();
virtual int lookChar();
void reset() override;
int lookChar() override;
};
//------------------------------------------------------------------------
......
......@@ -44,16 +44,16 @@ class FlateEncoder: public FilterStream {
public:
FlateEncoder(Stream *strA);
virtual ~FlateEncoder();
virtual StreamKind getKind() { return strWeird; }
virtual void reset();
virtual int getChar()
~FlateEncoder();
StreamKind getKind() override { return strWeird; }
void reset() override;
int getChar() override
{ return (outBufPtr >= outBufEnd && !fillBuf()) ? EOF : (*outBufPtr++ & 0xff); }
virtual int lookChar()
int lookChar() override
{ return (outBufPtr >= outBufEnd && !fillBuf()) ? EOF : (*outBufPtr & 0xff); }
virtual GooString *getPSFilter(int psLevel, const char *indent) { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gTrue; }
virtual GBool isEncoder() { return gTrue; }
GooString *getPSFilter(int psLevel, const char *indent) override { return NULL; }
GBool isBinary(GBool last = gTrue) override { return gTrue; }
GBool isEncoder() override { return gTrue; }
private:
......
......@@ -165,7 +165,7 @@ public:
char* getOnStr();
void setAppearanceState(const char *state);
void updateWidgetAppearance();
void updateWidgetAppearance() override;
protected:
FormFieldButton *parent() const;
......@@ -187,7 +187,7 @@ public:
//except a UTF16BE string
void setContent(GooString* new_content);
void updateWidgetAppearance();
void updateWidgetAppearance() override;
bool isMultiline () const;
bool isPassword () const;
......@@ -228,7 +228,7 @@ public:
GooString* getEditChoice ();
void updateWidgetAppearance();
void updateWidgetAppearance() override;
bool isSelected (int i);
bool isCombo () const;
......@@ -249,7 +249,7 @@ protected:
class FormWidgetSignature: public FormWidget {
public:
FormWidgetSignature(PDFDoc *docA, Object *dict, unsigned num, Ref ref, FormField *p);
void updateWidgetAppearance();
void updateWidgetAppearance() override;
SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation);
};
......@@ -350,7 +350,7 @@ public:
char *getAppearanceState() { return appearanceState.isName() ? appearanceState.getName() : NULL; }
void fillChildrenSiblingsID ();
void fillChildrenSiblingsID () override;
void setNumSiblings (int num);
void setSibling (int i, FormFieldButton *id) { siblings[i] = id; }
......@@ -363,7 +363,7 @@ public:
void print(int indent = 0);
#endif
virtual ~FormFieldButton();
~FormFieldButton();
protected:
void updateState(char *state);
......@@ -389,7 +389,7 @@ public:
GooString* getContent () { return content; }
GooString* getContentCopy ();
void setContentCopy (GooString* new_content);
virtual ~FormFieldText();
~FormFieldText();
bool isMultiline () const { return multiline; }
bool isPassword () const { return password; }
......@@ -424,7 +424,7 @@ class FormFieldChoice: public FormField {
public:
FormFieldChoice(PDFDoc *docA, Object *aobj, const Ref& ref, FormField *parent, std::set<int> *usedParents);
virtual ~FormFieldChoice();
~FormFieldChoice();
int getNumChoices() { return numChoices; }
GooString* getChoice(int i) { return choices ? choices[i].optionName : NULL; }
......@@ -495,7 +495,7 @@ public:
SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation);
virtual ~FormFieldSignature();
~FormFieldSignature();
private:
void parseInfo();
......
......@@ -109,11 +109,11 @@ class IdentityFunction: public Function {
public:
IdentityFunction();
virtual ~IdentityFunction();
virtual Function *copy() { return new IdentityFunction(); }
virtual int getType() { return -1; }
virtual void transform(double *in, double *out);
virtual GBool isOk() { return gTrue; }
~IdentityFunction();
Function *copy() override { return new IdentityFunction(); }
int getType() override { return -1; }
void transform(double *in, double *out) override;
GBool isOk() override { return gTrue; }
private:
};
......@@ -126,12 +126,12 @@ class SampledFunction: public Function {
public:
SampledFunction(Object *funcObj, Dict *dict);
virtual ~SampledFunction();
virtual Function *copy() { return new SampledFunction(this); }
virtual int getType() { return 0; }
virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; }
virtual GBool hasDifferentResultSet(Function *func);
~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]; }
......@@ -170,11 +170,11 @@ class ExponentialFunction: public Function {
public:
ExponentialFunction(Object *funcObj, Dict *dict);
virtual ~ExponentialFunction();
virtual Function *copy() { return new ExponentialFunction(this); }
virtual int getType() { return 2; }
virtual void transform(double *in, double *out);
virtual GBool isOk() { return ok; }
~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; }
double *getC0() { return c0; }
double *getC1() { return c1; }
......@@ -199,11 +199,11 @@ class StitchingFunction: public Function {
public:
StitchingFunction(Object