Cleanup: use override specifier everywhere, and enable gcc warning to check for it.

This commit is contained in:
Twan van Laarhoven
2020-05-16 00:23:18 +02:00
parent a7c47729c1
commit 5deaeeeb3e
113 changed files with 710 additions and 714 deletions
+3 -3
View File
@@ -19,9 +19,9 @@ class ChoiceValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Choice) : ValueViewer(parent,style) {}
virtual bool prepare(RotatedDC& dc);
virtual void draw(RotatedDC& dc);
virtual void onStyleChange(int);
bool prepare(RotatedDC& dc) override;
void draw(RotatedDC& dc) override;
void onStyleChange(int) override;
};
bool prepare_choice_viewer(RotatedDC& dc, ValueViewer& viewer, ChoiceStyle& style, const String& value);
+2 -2
View File
@@ -21,7 +21,7 @@ class ColorValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Color) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc);
virtual bool containsPoint(const RealPoint& p) const;
void draw(RotatedDC& dc) override;
bool containsPoint(const RealPoint& p) const override;
};
+3 -3
View File
@@ -21,9 +21,9 @@ class ImageValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Image) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc);
virtual void onValueChange();
virtual void onStyleChange(int);
void draw(RotatedDC& dc) override;
void onValueChange() override;
void onStyleChange(int) override;
private:
Bitmap bitmap; ///< Cached bitmap
+1 -1
View File
@@ -19,7 +19,7 @@ class InfoValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Info) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc);
void draw(RotatedDC& dc) override;
};
+3 -3
View File
@@ -19,9 +19,9 @@ class MultipleChoiceValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(MultipleChoice) : ValueViewer(parent,style), item_height(0) {}
virtual bool prepare(RotatedDC& dc);
virtual void draw(RotatedDC& dc);
virtual void onStyleChange(int);
bool prepare(RotatedDC& dc) override;
void draw(RotatedDC& dc) override;
void onStyleChange(int) override;
protected:
double item_height; ///< Height of a single item, or 0 if non uniform
private:
+1 -1
View File
@@ -19,7 +19,7 @@ class PackageChoiceValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(PackageChoice) : ValueViewer(parent,style) { initItems(); }
virtual void draw(RotatedDC& dc);
void draw(RotatedDC& dc) override;
struct Item{
String package_name;
+2 -2
View File
@@ -19,8 +19,8 @@ class SymbolValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Symbol) : ValueViewer(parent,style) {}
virtual void draw(RotatedDC& dc);
void onValueChange();
void draw(RotatedDC& dc) override;
void onValueChange() override;
protected:
vector<Bitmap> symbols; ///< Cached images
+6 -6
View File
@@ -20,12 +20,12 @@ class TextValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Text) : ValueViewer(parent,style) {}
virtual bool prepare(RotatedDC& dc);
virtual void draw(RotatedDC& dc);
virtual void onValueChange();
virtual void onStyleChange(int);
virtual void onAction(const Action&, bool undone);
virtual double getStretch() const;
bool prepare(RotatedDC& dc) override;
void draw(RotatedDC& dc) override;
void onValueChange() override;
void onStyleChange(int) override;
void onAction(const Action&, bool undone) override;
double getStretch() const override;
protected:
TextViewer v;
+2 -2
View File
@@ -63,12 +63,12 @@ public:
virtual void onValueChange() {}
/// Called when a (scripted) property of the associated style has changed
/** Default: redraws the viewer if needed */
virtual void onStyleChange(int changes);
void onStyleChange(int changes) override;
/// Called when an action is performed on the associated value
virtual void onAction(const Action&, bool undone) { onValueChange(); }
/// Convert this viewer to an editor, if possible
virtual ValueEditor* getEditor() { return 0; }
virtual ValueEditor* getEditor() { return nullptr; }
DataViewer& viewer; ///< Our parent object
protected: