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
@@ -33,7 +33,7 @@ class BooleanStyle : public ChoiceStyle {
public:
BooleanStyle(const ChoiceFieldP& field);
DECLARE_HAS_FIELD(Boolean); // not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
virtual StyleP clone() const;
StyleP clone() const override;
// no extra data
@@ -48,7 +48,7 @@ class BooleanValue : public ChoiceValue {
public:
inline BooleanValue(const ChoiceFieldP& field) : ChoiceValue(field) {}
DECLARE_HAS_FIELD(Boolean);
virtual ValueP clone() const;
ValueP clone() const override;
// no extra data
+7 -7
View File
@@ -41,8 +41,8 @@ public:
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
map<String,Color> choice_colors_cardlist; ///< Colors for the various choices, for in the card list
virtual void initDependencies(Context&, const Dependency&) const;
virtual void after_reading(Version ver);
void initDependencies(Context&, const Dependency&) const override;
void after_reading(Version ver) override;
};
@@ -174,10 +174,10 @@ public:
/// Initialize image from choice_images
void initImage();
virtual int update(Context&);
virtual void initDependencies(Context&, const Dependency&) const;
virtual void checkContentDependencies(Context&, const Dependency&) const;
virtual void invalidate();
int update(Context&) override;
void initDependencies(Context&, const Dependency&) const override;
void checkContentDependencies(Context&, const Dependency&) const override;
void invalidate() override;
};
// ----------------------------------------------------------------------------- : ChoiceValue
@@ -194,6 +194,6 @@ public:
ValueType value; /// The name of the selected choice
virtual bool update(Context&);
bool update(Context&) override;
};
+3 -3
View File
@@ -36,7 +36,7 @@ public:
Defaultable<Color> initial; ///< Initial choice of a new value, if not set the first choice is used
String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const;
void initDependencies(Context&, const Dependency&) const override;
};
/// A color that can be chosen for this field
@@ -63,7 +63,7 @@ public:
double bottom_width; ///< Width of the colored region on the bottom side
ImageCombine combine; ///< How to combine image with the background
virtual int update(Context&);
int update(Context&) override;
};
// ----------------------------------------------------------------------------- : ColorValue
@@ -76,7 +76,7 @@ public:
ValueType value; ///< The value
virtual bool update(Context&);
bool update(Context&) override;
};
+1 -1
View File
@@ -37,7 +37,7 @@ public:
ScriptableImage default_image; ///< Placeholder
virtual int update(Context&);
int update(Context&) override;
};
// ----------------------------------------------------------------------------- : ImageValue
+8 -8
View File
@@ -28,9 +28,9 @@ public:
InfoField() { editable = false; }
DECLARE_FIELD_TYPE(Text);
OptionalScript script; ///< Script to apply to all values
OptionalScript script; ///< Script to apply to all values
virtual void initDependencies(Context&, const Dependency&) const;
void initDependencies(Context&, const Dependency&) const override;
};
// ----------------------------------------------------------------------------- : InfoStyle
@@ -41,14 +41,14 @@ public:
InfoStyle(const InfoFieldP&);
DECLARE_STYLE_TYPE(Info);
Font font; ///< Font to use for the text
Alignment alignment; ///< Alignment inside the box
double padding_left, padding_right; ///< Padding
Font font; ///< Font to use for the text
Alignment alignment; ///< Alignment inside the box
double padding_left, padding_right; ///< Padding
double padding_top, padding_bottom;
Color background_color;
virtual int update(Context&);
virtual void initDependencies(Context&, const Dependency&) const;
int update(Context&) override;
void initDependencies(Context&, const Dependency&) const override;
};
// ----------------------------------------------------------------------------- : InfoValue
@@ -61,6 +61,6 @@ public:
ValueType value;
virtual bool update(Context&);
bool update(Context&) override;
};
+3 -3
View File
@@ -38,7 +38,7 @@ public:
Scriptable<Direction> direction; ///< In what direction are choices layed out?
Scriptable<double> spacing; ///< Spacing between choices (images) in pixels
virtual int update(Context&);
int update(Context&) override;
};
// ----------------------------------------------------------------------------- : MultipleChoiceValue
@@ -51,7 +51,7 @@ class MultipleChoiceValue : public ChoiceValue {
public:
inline MultipleChoiceValue(const MultipleChoiceFieldP& field) : ChoiceValue(field, false) {}
DECLARE_HAS_FIELD(MultipleChoice);
virtual ValueP clone() const;
ValueP clone() const override;
String last_change; ///< Which of the choices was selected/deselected last?
@@ -64,7 +64,7 @@ public:
/// Splits the value, stores the selected choices in the out parameter
void get(vector<String>& out) const;
virtual bool update(Context&);
bool update(Context&) override;
private:
DECLARE_REFLECTION();
+7 -7
View File
@@ -28,12 +28,12 @@ public:
DECLARE_FIELD_TYPE(PackageChoice);
OptionalScript script; ///< Script to apply to all values
String match; ///< Package filenames to match
String initial; ///< Initial value
String match; ///< Package filenames to match
String initial; ///< Initial value
bool required; ///< Is selecting a package required?
String empty_name; ///< Displayed name for the empty value (if !required)
String empty_name; ///< Displayed name for the empty value (if !required)
virtual void initDependencies(Context&, const Dependency&) const;
void initDependencies(Context&, const Dependency&) const override;
};
// ----------------------------------------------------------------------------- : PackageChoiceStyle
@@ -46,7 +46,7 @@ public:
Font font; ///< Font to use for the text
virtual int update(Context&);
int update(Context&) override;
};
// ----------------------------------------------------------------------------- : PackageChoiceValue
@@ -59,9 +59,9 @@ public:
ValueType package_name; ///< The selected package
/// Get the package (if it is set)
/// Get the package (if it is set), otherwise return nullptr
PackagedP getPackage() const;
virtual bool update(Context&);
bool update(Context&) override;
};
+10 -10
View File
@@ -34,14 +34,14 @@ public:
TextField();
DECLARE_FIELD_TYPE(Text);
OptionalScript script; ///< Script to apply to all values
OptionalScript script; ///< Script to apply to all values
OptionalScript default_script; ///< Script that generates the default value
//%OptionalScript view_script; ///< Script to apply before viewing
//%OptionalScript unview_script; ///< Script to apply after changes to the view
bool multi_line; ///< Are newlines allowed in the text?
String default_name; ///< Name of "default" value
bool multi_line; ///< Are newlines allowed in the text?
String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const;
void initDependencies(Context&, const Dependency&) const override;
};
// ----------------------------------------------------------------------------- : TextStyle
@@ -95,9 +95,9 @@ public:
double content_width, content_height; ///< Size of the rendered text
int content_lines; ///< Number of rendered lines
virtual int update(Context&);
virtual void initDependencies(Context&, const Dependency&) const;
virtual void checkContentDependencies(Context&, const Dependency&) const;
int update(Context&) override;
void initDependencies(Context&, const Dependency&) const override;
void checkContentDependencies(Context&, const Dependency&) const override;
/// Stretch factor to use
double getStretch() const;
@@ -114,7 +114,7 @@ public:
ValueType value; ///< The text of this value
Age last_update; ///< When was the text last changed?
virtual bool update(Context&);
bool update(Context&) override;
};
// ----------------------------------------------------------------------------- : TextValue
@@ -139,8 +139,8 @@ public:
virtual void retrieve();
/// Update underlying data
virtual void onAction(Action& a, bool undone);
void onAction(Action& a, bool undone) override;
/// Editing the same underlying value?
virtual bool equals(const Value* that);
bool equals(const Value* that) override;
};