[PATCH] Add override specifier

Yuriy Skalko yuriy.skalko at gmail.com
Sat Oct 3 12:45:56 UTC 2020


> And now clang++ 10 complains a lot...
> 
> JMarc

This should fix it. I assume there will be more places...

Yuriy
-------------- next part --------------
From dd855c31bcb983ab533d1002ab7515b74ab4b290 Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Sat, 3 Oct 2020 15:42:14 +0300
Subject: [PATCH] Amend efc0877f

---
 src/frontends/qt/CustomizedWidgets.h | 2 +-
 src/frontends/qt/DialogView.h        | 4 ++--
 src/frontends/qt/DockView.h          | 2 +-
 src/frontends/qt/FancyLineEdit.h     | 2 +-
 src/frontends/qt/GuiCitation.h       | 4 ++--
 src/frontends/qt/GuiCommandEdit.h    | 2 +-
 src/frontends/qt/GuiCompare.h        | 2 +-
 src/frontends/qt/GuiDialog.h         | 2 +-
 src/frontends/qt/GuiDocument.h       | 2 +-
 src/frontends/qt/GuiErrorList.h      | 2 +-
 src/frontends/qt/GuiProgressView.h   | 4 ++--
 src/frontends/qt/GuiRef.h            | 2 +-
 src/frontends/qt/GuiSearch.h         | 2 +-
 src/frontends/qt/GuiToc.h            | 2 +-
 src/frontends/qt/GuiToolbar.h        | 2 +-
 src/frontends/qt/GuiView.h           | 4 ++--
 src/frontends/qt/GuiWorkArea.h       | 6 +++---
 src/frontends/qt/IconPalette.h       | 4 ++--
 src/frontends/qt/PanelStack.h        | 2 +-
 src/insets/InsetTabular.h            | 4 ++--
 src/mathed/InsetMathBig.h            | 2 +-
 src/mathed/InsetMathCancelto.h       | 2 +-
 src/mathed/InsetMathDecoration.h     | 2 +-
 src/mathed/InsetMathDelim.h          | 2 +-
 src/mathed/InsetMathExInt.h          | 2 +-
 src/mathed/InsetMathKern.h           | 2 +-
 src/mathed/InsetMathMacroArgument.h  | 2 +-
 src/mathed/InsetMathNumber.h         | 2 +-
 src/mathed/InsetMathOverset.h        | 2 +-
 src/mathed/InsetMathRoot.h           | 4 ++--
 src/mathed/InsetMathScript.h         | 2 +-
 src/mathed/InsetMathSize.h           | 2 +-
 src/mathed/InsetMathSqrt.h           | 2 +-
 src/mathed/InsetMathStackrel.h       | 2 +-
 src/mathed/InsetMathSymbol.h         | 4 ++--
 35 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/frontends/qt/CustomizedWidgets.h b/src/frontends/qt/CustomizedWidgets.h
index 3409679556..69373c21c1 100644
--- a/src/frontends/qt/CustomizedWidgets.h
+++ b/src/frontends/qt/CustomizedWidgets.h
@@ -36,7 +36,7 @@ public:
 	void removeFromSequence();
 protected Q_SLOTS:
 	bool event(QEvent* e);
-	void keyPressEvent(QKeyEvent * e);
+	void keyPressEvent(QKeyEvent * e) override;
 private:
 	void appendToSequence(QKeyEvent * e);
 	KeySequence keysequence_;
diff --git a/src/frontends/qt/DialogView.h b/src/frontends/qt/DialogView.h
index b99cdebfb8..bb90ab84fd 100644
--- a/src/frontends/qt/DialogView.h
+++ b/src/frontends/qt/DialogView.h
@@ -44,9 +44,9 @@ protected:
 	bool needBufferOpen() const override { return isBufferDependent(); }
 	//@}
 	/// Any dialog that overrides this method should make sure to call it.
-	void closeEvent(QCloseEvent * ev);
+	void closeEvent(QCloseEvent * ev) override;
 	/// Any dialog that overrides this method should make sure to call it.
-	void hideEvent(QHideEvent * ev);
+	void hideEvent(QHideEvent * ev) override;
 
 protected Q_SLOTS:
 	void onBufferViewChanged() override {};
diff --git a/src/frontends/qt/DockView.h b/src/frontends/qt/DockView.h
index 897fb392ff..60a7afe9f1 100644
--- a/src/frontends/qt/DockView.h
+++ b/src/frontends/qt/DockView.h
@@ -48,7 +48,7 @@ public:
 	/// We don't want to restore geometry session for dock widgets.
 	void restoreSession() override {}
 
-	void keyPressEvent(QKeyEvent * ev);
+	void keyPressEvent(QKeyEvent * ev) override;
 
 	/// Dialog inherited methods
 	//@{
diff --git a/src/frontends/qt/FancyLineEdit.h b/src/frontends/qt/FancyLineEdit.h
index 5a2a542861..470173effa 100644
--- a/src/frontends/qt/FancyLineEdit.h
+++ b/src/frontends/qt/FancyLineEdit.h
@@ -97,7 +97,7 @@ private Q_SLOTS:
 
 protected:
 	virtual void resizeEvent(QResizeEvent *e);
-	virtual void keyPressEvent(QKeyEvent *e);
+	virtual void keyPressEvent(QKeyEvent *e) override;
 
 private:
 	void updateMargins();
diff --git a/src/frontends/qt/GuiCitation.h b/src/frontends/qt/GuiCitation.h
index a4784b20ec..db7ac31249 100644
--- a/src/frontends/qt/GuiCitation.h
+++ b/src/frontends/qt/GuiCitation.h
@@ -87,9 +87,9 @@ private:
 	//@}
 
 	///
-	void showEvent(QShowEvent * e);
+	void showEvent(QShowEvent * e) override;
 	///
-	void closeEvent(QCloseEvent * e);
+	void closeEvent(QCloseEvent * e) override;
 	/// prepares a call to GuiCitation::searchKeys when we
 	/// are ready to search the BibTeX entries
 	void findText(QString const & text, bool reset = false);
diff --git a/src/frontends/qt/GuiCommandEdit.h b/src/frontends/qt/GuiCommandEdit.h
index 76833115cd..82a546a3dd 100644
--- a/src/frontends/qt/GuiCommandEdit.h
+++ b/src/frontends/qt/GuiCommandEdit.h
@@ -40,7 +40,7 @@ protected:
 	///
 	virtual bool event(QEvent * e);
 	///
-	virtual void keyPressEvent(QKeyEvent * e);
+	virtual void keyPressEvent(QKeyEvent * e) override;
 };
 
 } // namespace frontend
diff --git a/src/frontends/qt/GuiCompare.h b/src/frontends/qt/GuiCompare.h
index 82afcd2071..6d608876d3 100644
--- a/src/frontends/qt/GuiCompare.h
+++ b/src/frontends/qt/GuiCompare.h
@@ -32,7 +32,7 @@ public:
 	GuiCompare(GuiView & lv);
 	~GuiCompare();
 
-	void closeEvent(QCloseEvent *);
+	void closeEvent(QCloseEvent *) override;
 
 private Q_SLOTS:
 	///
diff --git a/src/frontends/qt/GuiDialog.h b/src/frontends/qt/GuiDialog.h
index b48f0aafe3..572ff536cd 100644
--- a/src/frontends/qt/GuiDialog.h
+++ b/src/frontends/qt/GuiDialog.h
@@ -62,7 +62,7 @@ public Q_SLOTS:
 	// A collectiong slot for QDialogButtonBox
 	void slotButtonBox(QAbstractButton *);
 	///
-	void closeEvent(QCloseEvent * e);
+	void closeEvent(QCloseEvent * e) override;
 
 protected Q_SLOTS:
 	void onBufferViewChanged() override {}
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index e4446b4220..2ef9d250f9 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -364,7 +364,7 @@ Q_SIGNALS:
 	void changed();
 
 private:
-	void closeEvent(QCloseEvent *);
+	void closeEvent(QCloseEvent *) override;
 	void on_preambleTE_textChanged() { changed(); }
 
 	typedef std::map<BufferId, std::pair<int,int> > Coords;
diff --git a/src/frontends/qt/GuiErrorList.h b/src/frontends/qt/GuiErrorList.h
index 6a560eedf9..30d9e44350 100644
--- a/src/frontends/qt/GuiErrorList.h
+++ b/src/frontends/qt/GuiErrorList.h
@@ -38,7 +38,7 @@ public Q_SLOTS:
 
 private:
 	///
-	void showEvent(QShowEvent *);
+	void showEvent(QShowEvent *) override;
 	///
 	void paramsToDialog();
 	///
diff --git a/src/frontends/qt/GuiProgressView.h b/src/frontends/qt/GuiProgressView.h
index 2c7322072f..4ea4efc504 100644
--- a/src/frontends/qt/GuiProgressView.h
+++ b/src/frontends/qt/GuiProgressView.h
@@ -77,8 +77,8 @@ private:
 	bool eol_last_;
 
 	void levelChanged();
-	void showEvent(QShowEvent*);
-	void hideEvent(QHideEvent*);
+	void showEvent(QShowEvent*) override;
+	void hideEvent(QHideEvent*) override;
 };
 
 
diff --git a/src/frontends/qt/GuiRef.h b/src/frontends/qt/GuiRef.h
index 2dcd63e368..46e99ea96d 100644
--- a/src/frontends/qt/GuiRef.h
+++ b/src/frontends/qt/GuiRef.h
@@ -63,7 +63,7 @@ private:
 	///
 	void gotoBookmark();
 	///
-	void closeEvent(QCloseEvent * e);
+	void closeEvent(QCloseEvent * e) override;
 	///
 	bool isValid() override;
 	/// apply changes
diff --git a/src/frontends/qt/GuiSearch.h b/src/frontends/qt/GuiSearch.h
index f61707704e..2901110385 100644
--- a/src/frontends/qt/GuiSearch.h
+++ b/src/frontends/qt/GuiSearch.h
@@ -33,7 +33,7 @@ private Q_SLOTS:
 	void replaceallClicked();
 
 private:
-	void showEvent(QShowEvent * e);
+	void showEvent(QShowEvent * e) override;
 	///
 	bool initialiseParams(std::string const &) override { return true; }
 	void clearParams() override {}
diff --git a/src/frontends/qt/GuiToc.h b/src/frontends/qt/GuiToc.h
index c8826f7e09..7e6df1db1b 100644
--- a/src/frontends/qt/GuiToc.h
+++ b/src/frontends/qt/GuiToc.h
@@ -39,7 +39,7 @@ public:
 	void updateView() override;
 	void enableView(bool enable) override;
 	bool wantInitialFocus() const override { return false; }
-	void closeEvent(QCloseEvent * event);
+	void closeEvent(QCloseEvent * event) override;
 	bool isClosing() const override { return is_closing_; }
 
 public:
diff --git a/src/frontends/qt/GuiToolbar.h b/src/frontends/qt/GuiToolbar.h
index eccd05a6fb..668b3f04d3 100644
--- a/src/frontends/qt/GuiToolbar.h
+++ b/src/frontends/qt/GuiToolbar.h
@@ -176,7 +176,7 @@ private:
 	///
 	void fill();
 	///
-	void showEvent(QShowEvent *);
+	void showEvent(QShowEvent *) override;
 
 	///
 	QList<Action *> actions_;
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index d611b39e0f..4ec639d71d 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -286,9 +286,9 @@ private:
 	///
 	void dropEvent(QDropEvent * ev);
 	/// make sure we quit cleanly
-	void closeEvent(QCloseEvent * e);
+	void closeEvent(QCloseEvent * e) override;
 	///
-	void showEvent(QShowEvent *);
+	void showEvent(QShowEvent *) override;
 
 	/// in order to catch Tab key press.
 	bool event(QEvent * e);
diff --git a/src/frontends/qt/GuiWorkArea.h b/src/frontends/qt/GuiWorkArea.h
index 0a50ea8b57..1d5696c17c 100644
--- a/src/frontends/qt/GuiWorkArea.h
+++ b/src/frontends/qt/GuiWorkArea.h
@@ -145,7 +145,7 @@ private:
 	void wheelEvent(QWheelEvent * ev);
 	/// key press event. It also knows how to handle ShortcutOverride events to
 	/// avoid code duplication.
-	void keyPressEvent(QKeyEvent * ev);
+	void keyPressEvent(QKeyEvent * ev) override;
 	/// IM events
 	void inputMethodEvent(QInputMethodEvent * ev);
 	/// IM query
@@ -195,9 +195,9 @@ public:
 
 protected:
 	///
-	void closeEvent(QCloseEvent * ev);
+	void closeEvent(QCloseEvent * ev) override;
 	///
-	void hideEvent(QHideEvent *ev);
+	void hideEvent(QHideEvent *ev) override;
 
 private:
 	/// Embedded Buffer.
diff --git a/src/frontends/qt/IconPalette.h b/src/frontends/qt/IconPalette.h
index f63e68d5ce..b65c7218d6 100644
--- a/src/frontends/qt/IconPalette.h
+++ b/src/frontends/qt/IconPalette.h
@@ -53,8 +53,8 @@ Q_SIGNALS:
 	void visible(bool);
 
 protected:
-	void showEvent(QShowEvent * event);
-	void hideEvent(QHideEvent * event);
+	void showEvent(QShowEvent * event) override;
+	void hideEvent(QHideEvent * event) override;
 	void paintEvent(QPaintEvent * event);
 
 private Q_SLOTS:
diff --git a/src/frontends/qt/PanelStack.h b/src/frontends/qt/PanelStack.h
index e0d03a189f..47d9906026 100644
--- a/src/frontends/qt/PanelStack.h
+++ b/src/frontends/qt/PanelStack.h
@@ -66,7 +66,7 @@ public Q_SLOTS:
 
 protected:
 	/// widget hidden
-	void hideEvent(QHideEvent * event);
+	void hideEvent(QHideEvent * event) override;
 
 private:
 	///
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index ef9735632d..9786900fd9 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -1032,9 +1032,9 @@ public:
 	// this should return true if we have a "normal" cell, otherwise false.
 	// "normal" means without width set!
 	/// should all paragraphs be output with "Standard" layout?
-	virtual bool allowParagraphCustomization(idx_type cell = 0) const;
+	virtual bool allowParagraphCustomization(idx_type cell = 0) const override;
 	///
-	virtual bool forcePlainLayout(idx_type cell = 0) const;
+	virtual bool forcePlainLayout(idx_type cell = 0) const override;
 	///
 	void addPreview(DocIterator const & inset_pos,
 		graphics::PreviewLoader &) const override;
diff --git a/src/mathed/InsetMathBig.h b/src/mathed/InsetMathBig.h
index f479ed2f03..ed1c773b6b 100644
--- a/src/mathed/InsetMathBig.h
+++ b/src/mathed/InsetMathBig.h
@@ -39,7 +39,7 @@ public:
 	///
 	void htmlize(HtmlStream &) const override;
 	///
-	void infoize2(odocstream & os) const;
+	void infoize2(odocstream & os) const override;
 	///
 	static bool isBigInsetDelim(docstring const &);
 	///
diff --git a/src/mathed/InsetMathCancelto.h b/src/mathed/InsetMathCancelto.h
index d6da89043d..4c81c4cdf3 100644
--- a/src/mathed/InsetMathCancelto.h
+++ b/src/mathed/InsetMathCancelto.h
@@ -22,7 +22,7 @@ public:
 	///
 	explicit InsetMathCancelto(Buffer * buf);
 	///
-	bool idxUpDown(Cursor & cur, bool up) const;
+	bool idxUpDown(Cursor & cur, bool up) const override;
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
diff --git a/src/mathed/InsetMathDecoration.h b/src/mathed/InsetMathDecoration.h
index 3f3a54df9d..78f01a8207 100644
--- a/src/mathed/InsetMathDecoration.h
+++ b/src/mathed/InsetMathDecoration.h
@@ -28,7 +28,7 @@ public:
 	///
 	mode_type currentMode() const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 	///
 	void write(WriteStream & os) const override;
 	///
diff --git a/src/mathed/InsetMathDelim.h b/src/mathed/InsetMathDelim.h
index f575ee0b4b..d45ecc7174 100644
--- a/src/mathed/InsetMathDelim.h
+++ b/src/mathed/InsetMathDelim.h
@@ -43,7 +43,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 
 	///
 	void validate(LaTeXFeatures & features) const override;
diff --git a/src/mathed/InsetMathExInt.h b/src/mathed/InsetMathExInt.h
index 3205048af9..4a8c97a837 100644
--- a/src/mathed/InsetMathExInt.h
+++ b/src/mathed/InsetMathExInt.h
@@ -41,7 +41,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 
 	///
 	void normalize(NormalStream &) const override;
diff --git a/src/mathed/InsetMathKern.h b/src/mathed/InsetMathKern.h
index efb83e244f..1cf938b2bd 100644
--- a/src/mathed/InsetMathKern.h
+++ b/src/mathed/InsetMathKern.h
@@ -44,7 +44,7 @@ public:
 	///
 	void htmlize(HtmlStream &) const override { }
 	///
-	void infoize2(odocstream & os) const;
+	void infoize2(odocstream & os) const override;
 	///
 	InsetCode lyxCode() const override { return MATH_KERN_CODE; }
 
diff --git a/src/mathed/InsetMathMacroArgument.h b/src/mathed/InsetMathMacroArgument.h
index 4fe0de435b..c0839c0464 100644
--- a/src/mathed/InsetMathMacroArgument.h
+++ b/src/mathed/InsetMathMacroArgument.h
@@ -28,7 +28,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 	///
 	void normalize(NormalStream &) const override;
 	///
diff --git a/src/mathed/InsetMathNumber.h b/src/mathed/InsetMathNumber.h
index e7481bb21f..ce5803c186 100644
--- a/src/mathed/InsetMathNumber.h
+++ b/src/mathed/InsetMathNumber.h
@@ -28,7 +28,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 	///
 	docstring str() const { return str_; }
 	///
diff --git a/src/mathed/InsetMathOverset.h b/src/mathed/InsetMathOverset.h
index 095e0f590a..36b548ffc4 100644
--- a/src/mathed/InsetMathOverset.h
+++ b/src/mathed/InsetMathOverset.h
@@ -28,7 +28,7 @@ public:
 	///
 	void draw(PainterInfo & pi, int x, int y) const override;
 	///
-	bool idxUpDown(Cursor & cur, bool up) const;
+	bool idxUpDown(Cursor & cur, bool up) const override;
 	///
 	bool idxFirst(Cursor &) const override;
 	///
diff --git a/src/mathed/InsetMathRoot.h b/src/mathed/InsetMathRoot.h
index a91e89b3b3..5fb9d59b72 100644
--- a/src/mathed/InsetMathRoot.h
+++ b/src/mathed/InsetMathRoot.h
@@ -25,11 +25,11 @@ public:
 	///
 	explicit InsetMathRoot(Buffer * buf);
 	///
-	bool idxUpDown(Cursor & cur, bool up) const;
+	bool idxUpDown(Cursor & cur, bool up) const override;
 	///
 	bool idxForward(Cursor & cur) const;
 	///
-	bool idxBackward(Cursor & cur) const;
+	bool idxBackward(Cursor & cur) const override;
 	///
 	bool idxFirst(Cursor &) const override;
 	///
diff --git a/src/mathed/InsetMathScript.h b/src/mathed/InsetMathScript.h
index 737d7c3ab2..37fc593372 100644
--- a/src/mathed/InsetMathScript.h
+++ b/src/mathed/InsetMathScript.h
@@ -50,7 +50,7 @@ public:
 	/// move cursor up or down
 	bool idxUpDown(Cursor & cur, bool up) const override;
 	/// The index of the cell entered while moving backward
-	size_type lastIdx() const { return 0; }
+	size_type lastIdx() const override { return 0; }
 
 	/// write LaTeX and Lyx code
 	void write(WriteStream & os) const override;
diff --git a/src/mathed/InsetMathSize.h b/src/mathed/InsetMathSize.h
index cf299013bc..6d0f52f80a 100644
--- a/src/mathed/InsetMathSize.h
+++ b/src/mathed/InsetMathSize.h
@@ -31,7 +31,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 
 	///
 	void write(WriteStream & os) const override;
diff --git a/src/mathed/InsetMathSqrt.h b/src/mathed/InsetMathSqrt.h
index 829d5e209a..dba72eed70 100644
--- a/src/mathed/InsetMathSqrt.h
+++ b/src/mathed/InsetMathSqrt.h
@@ -25,7 +25,7 @@ public:
 	///
 	explicit InsetMathSqrt(Buffer * buf);
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
diff --git a/src/mathed/InsetMathStackrel.h b/src/mathed/InsetMathStackrel.h
index 5fa4361625..0e5514fd38 100644
--- a/src/mathed/InsetMathStackrel.h
+++ b/src/mathed/InsetMathStackrel.h
@@ -22,7 +22,7 @@ public:
 	///
 	InsetMathStackrel(Buffer * buf, bool sub);
 	///
-	bool idxUpDown(Cursor &, bool up) const;
+	bool idxUpDown(Cursor &, bool up) const override;
 	///
 	bool idxFirst(Cursor &) const override;
 	///
diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h
index 972fc53844..a04a237075 100644
--- a/src/mathed/InsetMathSymbol.h
+++ b/src/mathed/InsetMathSymbol.h
@@ -31,7 +31,7 @@ public:
 	///
 	void metrics(MetricsInfo & mi, Dimension & dim) const override;
 	///
-	void draw(PainterInfo &, int x, int y) const;
+	void draw(PainterInfo &, int x, int y) const override;
 	///
 	int kerning(BufferView const *) const override { return kerning_; }
 
@@ -74,7 +74,7 @@ public:
 	///
 	void write(WriteStream & os) const override;
 	///
-	void infoize2(odocstream & os) const;
+	void infoize2(odocstream & os) const override;
 	///
 	InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; }
 
-- 
2.28.0.windows.1



More information about the lyx-devel mailing list