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
+2 -2
View File
@@ -69,7 +69,7 @@ class DataViewer : public SetView {
void setCard(const CardP& card, bool refresh = false);
/// Clear data
virtual void onChangeSet();
void onChangeSet() override;
// --------------------------------------------------- : The viewers
private:
@@ -88,7 +88,7 @@ protected:
virtual ValueViewerP makeViewer(const StyleP&);
/// Update the viewers and forward actions
virtual void onAction(const Action&, bool undone);
void onAction(const Action&, bool undone) override;
/// Notification that the total image has changed
virtual void onChange() {}
+9 -9
View File
@@ -62,9 +62,9 @@ public:
inline SolidFillSymbolFilter(const Color& fill_color, const Color& border_color)
: fill_color(fill_color), border_color(border_color)
{}
virtual Color color(double x, double y, SymbolSet point) const;
virtual String fillType() const;
virtual bool operator == (const SymbolFilter& that) const;
Color color(double x, double y, SymbolSet point) const override;
String fillType() const override;
bool operator == (const SymbolFilter& that) const override;
private:
Color fill_color, border_color;
DECLARE_REFLECTION_OVERRIDE();
@@ -95,9 +95,9 @@ public:
LinearGradientSymbolFilter(const Color& fill_color_1, const Color& border_color_1, const Color& fill_color_2, const Color& border_color_2
,double center_x, double center_y, double end_x, double end_y);
virtual Color color(double x, double y, SymbolSet point) const;
virtual String fillType() const;
virtual bool operator == (const SymbolFilter& that) const;
Color color(double x, double y, SymbolSet point) const override;
String fillType() const override;
bool operator == (const SymbolFilter& that) const override;
/// return time on the gradient, used by GradientSymbolFilter::color
inline double t(double x, double y) const;
@@ -117,9 +117,9 @@ public:
: GradientSymbolFilter(fill_color_1, border_color_1, fill_color_2, border_color_2)
{}
virtual Color color(double x, double y, SymbolSet point) const;
virtual String fillType() const;
virtual bool operator == (const SymbolFilter& that) const;
Color color(double x, double y, SymbolSet point) const override;
String fillType() const override;
bool operator == (const SymbolFilter& that) const override;
/// return time on the gradient, used by GradientSymbolFilter::color
inline double t(double x, double y) const;
+1 -1
View File
@@ -58,7 +58,7 @@ public:
void drawEditingHints(DC& dc);
void onAction(const Action&, bool) {}
void onAction(const Action&, bool) override {}
private:
+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: