Commit ba5a3567a262efdfc171decf481b716ea29743d6

Authored by m-holger
1 parent 774d0d55

Remove redundant 'virtual' specifiers

examples/pdf-custom-filter.cc
@@ -49,8 +49,8 @@ class Pl_XOR: public Pipeline @@ -49,8 +49,8 @@ class Pl_XOR: public Pipeline
49 public: 49 public:
50 Pl_XOR(char const* identifier, Pipeline* next, unsigned char key); 50 Pl_XOR(char const* identifier, Pipeline* next, unsigned char key);
51 virtual ~Pl_XOR() = default; 51 virtual ~Pl_XOR() = default;
52 - virtual void write(unsigned char const* data, size_t len) override;  
53 - virtual void finish() override; 52 + void write(unsigned char const* data, size_t len) override;
  53 + void finish() override;
54 54
55 private: 55 private:
56 unsigned char key; 56 unsigned char key;
@@ -92,9 +92,9 @@ class SF_XORDecode: public QPDFStreamFilter @@ -92,9 +92,9 @@ class SF_XORDecode: public QPDFStreamFilter
92 // "uncompress" the stream by default. 92 // "uncompress" the stream by default.
93 public: 93 public:
94 virtual ~SF_XORDecode() = default; 94 virtual ~SF_XORDecode() = default;
95 - virtual bool setDecodeParms(QPDFObjectHandle decode_parms) override;  
96 - virtual Pipeline* getDecodePipeline(Pipeline* next) override;  
97 - virtual bool isSpecializedCompression() override; 95 + bool setDecodeParms(QPDFObjectHandle decode_parms) override;
  96 + Pipeline* getDecodePipeline(Pipeline* next) override;
  97 + bool isSpecializedCompression() override;
98 98
99 private: 99 private:
100 unsigned char key; 100 unsigned char key;
@@ -200,7 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider @@ -200,7 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider
200 public: 200 public:
201 StreamReplacer(QPDF* pdf); 201 StreamReplacer(QPDF* pdf);
202 virtual ~StreamReplacer() = default; 202 virtual ~StreamReplacer() = default;
203 - virtual void 203 + void
204 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; 204 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
205 205
206 void registerStream( 206 void registerStream(
examples/pdf-invert-images.cc
@@ -34,7 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider @@ -34,7 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider
34 { 34 {
35 public: 35 public:
36 virtual ~ImageInverter() = default; 36 virtual ~ImageInverter() = default;
37 - virtual void 37 + void
38 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; 38 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
39 39
40 void registerImage( 40 void registerImage(
include/qpdf/QPDFWriter.hh
@@ -102,7 +102,7 @@ class QPDFWriter @@ -102,7 +102,7 @@ class QPDFWriter
102 QPDF_DLL 102 QPDF_DLL
103 virtual ~FunctionProgressReporter(); 103 virtual ~FunctionProgressReporter();
104 QPDF_DLL 104 QPDF_DLL
105 - virtual void reportProgress(int) override; 105 + void reportProgress(int) override;
106 106
107 private: 107 private:
108 std::function<void(int)> handler; 108 std::function<void(int)> handler;
libqpdf/QPDF.cc
@@ -61,41 +61,41 @@ namespace @@ -61,41 +61,41 @@ namespace
61 { 61 {
62 public: 62 public:
63 virtual ~InvalidInputSource() = default; 63 virtual ~InvalidInputSource() = default;
64 - virtual qpdf_offset_t 64 + qpdf_offset_t
65 findAndSkipNextEOL() override 65 findAndSkipNextEOL() override
66 { 66 {
67 throwException(); 67 throwException();
68 return 0; 68 return 0;
69 } 69 }
70 - virtual std::string const& 70 + std::string const&
71 getName() const override 71 getName() const override
72 { 72 {
73 static std::string name("closed input source"); 73 static std::string name("closed input source");
74 return name; 74 return name;
75 } 75 }
76 - virtual qpdf_offset_t 76 + qpdf_offset_t
77 tell() override 77 tell() override
78 { 78 {
79 throwException(); 79 throwException();
80 return 0; 80 return 0;
81 } 81 }
82 - virtual void 82 + void
83 seek(qpdf_offset_t offset, int whence) override 83 seek(qpdf_offset_t offset, int whence) override
84 { 84 {
85 throwException(); 85 throwException();
86 } 86 }
87 - virtual void 87 + void
88 rewind() override 88 rewind() override
89 { 89 {
90 throwException(); 90 throwException();
91 } 91 }
92 - virtual size_t 92 + size_t
93 read(char* buffer, size_t length) override 93 read(char* buffer, size_t length) override
94 { 94 {
95 throwException(); 95 throwException();
96 return 0; 96 return 0;
97 } 97 }
98 - virtual void 98 + void
99 unreadCh(char ch) override 99 unreadCh(char ch) override
100 { 100 {
101 throwException(); 101 throwException();
libqpdf/QPDFLogger.cc
@@ -17,14 +17,14 @@ namespace @@ -17,14 +17,14 @@ namespace
17 { 17 {
18 } 18 }
19 19
20 - virtual void 20 + void
21 write(unsigned char const* data, size_t len) override 21 write(unsigned char const* data, size_t len) override
22 { 22 {
23 this->used = true; 23 this->used = true;
24 getNext()->write(data, len); 24 getNext()->write(data, len);
25 } 25 }
26 26
27 - virtual void 27 + void
28 finish() override 28 finish() override
29 { 29 {
30 getNext()->finish(); 30 getNext()->finish();
libqpdf/QPDFNameTreeObjectHelper.cc
@@ -7,18 +7,18 @@ namespace @@ -7,18 +7,18 @@ namespace
7 class NameTreeDetails: public NNTreeDetails 7 class NameTreeDetails: public NNTreeDetails
8 { 8 {
9 public: 9 public:
10 - virtual std::string const& 10 + std::string const&
11 itemsKey() const override 11 itemsKey() const override
12 { 12 {
13 static std::string k("/Names"); 13 static std::string k("/Names");
14 return k; 14 return k;
15 } 15 }
16 - virtual bool 16 + bool
17 keyValid(QPDFObjectHandle oh) const override 17 keyValid(QPDFObjectHandle oh) const override
18 { 18 {
19 return oh.isString(); 19 return oh.isString();
20 } 20 }
21 - virtual int 21 + int
22 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override 22 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override
23 { 23 {
24 if (!(keyValid(a) && keyValid(b))) { 24 if (!(keyValid(a) && keyValid(b))) {
libqpdf/QPDFNumberTreeObjectHelper.cc
@@ -8,18 +8,18 @@ namespace @@ -8,18 +8,18 @@ namespace
8 class NumberTreeDetails: public NNTreeDetails 8 class NumberTreeDetails: public NNTreeDetails
9 { 9 {
10 public: 10 public:
11 - virtual std::string const& 11 + std::string const&
12 itemsKey() const override 12 itemsKey() const override
13 { 13 {
14 static std::string k("/Nums"); 14 static std::string k("/Nums");
15 return k; 15 return k;
16 } 16 }
17 - virtual bool 17 + bool
18 keyValid(QPDFObjectHandle oh) const override 18 keyValid(QPDFObjectHandle oh) const override
19 { 19 {
20 return oh.isInteger(); 20 return oh.isInteger();
21 } 21 }
22 - virtual int 22 + int
23 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override 23 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override
24 { 24 {
25 if (!(keyValid(a) && keyValid(b))) { 25 if (!(keyValid(a) && keyValid(b))) {
libqpdf/QPDFObjectHandle.cc
@@ -1446,13 +1446,13 @@ namespace @@ -1446,13 +1446,13 @@ namespace
1446 { 1446 {
1447 } 1447 }
1448 1448
1449 - virtual void 1449 + void
1450 provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override 1450 provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override
1451 { 1451 {
1452 p1(pipeline); 1452 p1(pipeline);
1453 } 1453 }
1454 1454
1455 - virtual bool 1455 + bool
1456 provideStreamData( 1456 provideStreamData(
1457 QPDFObjGen const&, 1457 QPDFObjGen const&,
1458 Pipeline* pipeline, 1458 Pipeline* pipeline,
libqpdf/QPDF_json.cc
@@ -242,13 +242,13 @@ class QPDF::JSONReactor: public JSON::Reactor @@ -242,13 +242,13 @@ class QPDF::JSONReactor: public JSON::Reactor
242 } 242 }
243 } 243 }
244 virtual ~JSONReactor() = default; 244 virtual ~JSONReactor() = default;
245 - virtual void dictionaryStart() override;  
246 - virtual void arrayStart() override;  
247 - virtual void containerEnd(JSON const& value) override;  
248 - virtual void topLevelScalar() override;  
249 - virtual bool 245 + void dictionaryStart() override;
  246 + void arrayStart() override;
  247 + void containerEnd(JSON const& value) override;
  248 + void topLevelScalar() override;
  249 + bool
250 dictionaryItem(std::string const& key, JSON const& value) override; 250 dictionaryItem(std::string const& key, JSON const& value) override;
251 - virtual bool arrayItem(JSON const& value) override; 251 + bool arrayItem(JSON const& value) override;
252 252
253 bool anyErrors() const; 253 bool anyErrors() const;
254 254
libqpdf/qpdf/Pl_Base64.hh
@@ -9,8 +9,8 @@ class Pl_Base64: public Pipeline @@ -9,8 +9,8 @@ class Pl_Base64: public Pipeline
9 enum action_e { a_encode, a_decode }; 9 enum action_e { a_encode, a_decode };
10 Pl_Base64(char const* identifier, Pipeline* next, action_e); 10 Pl_Base64(char const* identifier, Pipeline* next, action_e);
11 virtual ~Pl_Base64() = default; 11 virtual ~Pl_Base64() = default;
12 - virtual void write(unsigned char const* buf, size_t len) override;  
13 - virtual void finish() override; 12 + void write(unsigned char const* buf, size_t len) override;
  13 + void finish() override;
14 14
15 private: 15 private:
16 void decode(unsigned char const* buf, size_t len); 16 void decode(unsigned char const* buf, size_t len);
libqpdf/qpdf/ResourceFinder.hh
@@ -8,8 +8,8 @@ class ResourceFinder: public QPDFObjectHandle::ParserCallbacks @@ -8,8 +8,8 @@ class ResourceFinder: public QPDFObjectHandle::ParserCallbacks
8 public: 8 public:
9 ResourceFinder(); 9 ResourceFinder();
10 virtual ~ResourceFinder() = default; 10 virtual ~ResourceFinder() = default;
11 - virtual void handleObject(QPDFObjectHandle, size_t, size_t) override;  
12 - virtual void handleEOF() override; 11 + void handleObject(QPDFObjectHandle, size_t, size_t) override;
  12 + void handleEOF() override;
13 std::set<std::string> const& getNames() const; 13 std::set<std::string> const& getNames() const;
14 std::map<std::string, std::map<std::string, std::set<size_t>>> const& 14 std::map<std::string, std::map<std::string, std::set<size_t>>> const&
15 getNamesByResourceType() const; 15 getNamesByResourceType() const;
libqpdf/qpdf/SF_ASCII85Decode.hh
@@ -11,7 +11,7 @@ class SF_ASCII85Decode: public QPDFStreamFilter @@ -11,7 +11,7 @@ class SF_ASCII85Decode: public QPDFStreamFilter
11 SF_ASCII85Decode() = default; 11 SF_ASCII85Decode() = default;
12 virtual ~SF_ASCII85Decode() = default; 12 virtual ~SF_ASCII85Decode() = default;
13 13
14 - virtual Pipeline* 14 + Pipeline*
15 getDecodePipeline(Pipeline* next) override 15 getDecodePipeline(Pipeline* next) override
16 { 16 {
17 this->pipeline = 17 this->pipeline =
libqpdf/qpdf/SF_ASCIIHexDecode.hh
@@ -11,7 +11,7 @@ class SF_ASCIIHexDecode: public QPDFStreamFilter @@ -11,7 +11,7 @@ class SF_ASCIIHexDecode: public QPDFStreamFilter
11 SF_ASCIIHexDecode() = default; 11 SF_ASCIIHexDecode() = default;
12 virtual ~SF_ASCIIHexDecode() = default; 12 virtual ~SF_ASCIIHexDecode() = default;
13 13
14 - virtual Pipeline* 14 + Pipeline*
15 getDecodePipeline(Pipeline* next) override 15 getDecodePipeline(Pipeline* next) override
16 { 16 {
17 this->pipeline = 17 this->pipeline =
libqpdf/qpdf/SF_DCTDecode.hh
@@ -11,7 +11,7 @@ class SF_DCTDecode: public QPDFStreamFilter @@ -11,7 +11,7 @@ class SF_DCTDecode: public QPDFStreamFilter
11 SF_DCTDecode() = default; 11 SF_DCTDecode() = default;
12 virtual ~SF_DCTDecode() = default; 12 virtual ~SF_DCTDecode() = default;
13 13
14 - virtual Pipeline* 14 + Pipeline*
15 getDecodePipeline(Pipeline* next) override 15 getDecodePipeline(Pipeline* next) override
16 { 16 {
17 this->pipeline = std::make_shared<Pl_DCT>("DCT decode", next); 17 this->pipeline = std::make_shared<Pl_DCT>("DCT decode", next);
@@ -24,13 +24,13 @@ class SF_DCTDecode: public QPDFStreamFilter @@ -24,13 +24,13 @@ class SF_DCTDecode: public QPDFStreamFilter
24 return std::make_shared<SF_DCTDecode>(); 24 return std::make_shared<SF_DCTDecode>();
25 } 25 }
26 26
27 - virtual bool 27 + bool
28 isSpecializedCompression() override 28 isSpecializedCompression() override
29 { 29 {
30 return true; 30 return true;
31 } 31 }
32 32
33 - virtual bool 33 + bool
34 isLossyCompression() override 34 isLossyCompression() override
35 { 35 {
36 return true; 36 return true;
libqpdf/qpdf/SF_RunLengthDecode.hh
@@ -11,7 +11,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter @@ -11,7 +11,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter
11 SF_RunLengthDecode() = default; 11 SF_RunLengthDecode() = default;
12 virtual ~SF_RunLengthDecode() = default; 12 virtual ~SF_RunLengthDecode() = default;
13 13
14 - virtual Pipeline* 14 + Pipeline*
15 getDecodePipeline(Pipeline* next) override 15 getDecodePipeline(Pipeline* next) override
16 { 16 {
17 this->pipeline = std::make_shared<Pl_RunLength>( 17 this->pipeline = std::make_shared<Pl_RunLength>(
@@ -25,7 +25,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter @@ -25,7 +25,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter
25 return std::make_shared<SF_RunLengthDecode>(); 25 return std::make_shared<SF_RunLengthDecode>();
26 } 26 }
27 27
28 - virtual bool 28 + bool
29 isSpecializedCompression() override 29 isSpecializedCompression() override
30 { 30 {
31 return true; 31 return true;
libtests/json_parse.cc
@@ -11,13 +11,13 @@ namespace @@ -11,13 +11,13 @@ namespace
11 { 11 {
12 public: 12 public:
13 virtual ~Reactor() = default; 13 virtual ~Reactor() = default;
14 - virtual void dictionaryStart() override;  
15 - virtual void arrayStart() override;  
16 - virtual void containerEnd(JSON const& value) override;  
17 - virtual void topLevelScalar() override;  
18 - virtual bool 14 + void dictionaryStart() override;
  15 + void arrayStart() override;
  16 + void containerEnd(JSON const& value) override;
  17 + void topLevelScalar() override;
  18 + bool
19 dictionaryItem(std::string const& key, JSON const& value) override; 19 dictionaryItem(std::string const& key, JSON const& value) override;
20 - virtual bool arrayItem(JSON const& value) override; 20 + bool arrayItem(JSON const& value) override;
21 21
22 private: 22 private:
23 void printItem(JSON const&); 23 void printItem(JSON const&);