From 12eeadec8baf8fee9c54c22090527f0d6e190995 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 10 May 2016 08:29:05 +0100 Subject: [PATCH] Added some missing 'override's --- .../components/juce_ModalComponentManager.cpp | 2 +- .../components/juce_ModalComponentManager.h | 28 ++++++++----------- .../juce_gui_basics/menus/juce_PopupMenu.cpp | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp b/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp index cc46ac0b94..73095cc8ff 100644 --- a/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp +++ b/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp @@ -251,7 +251,7 @@ class ModalComponentManager::ReturnValueRetriever : public ModalComponentMan public: ReturnValueRetriever (int& v, bool& done) : value (v), finished (done) {} - void modalStateFinished (int returnValue) + void modalStateFinished (int returnValue) override { finished = true; value = returnValue; diff --git a/modules/juce_gui_basics/components/juce_ModalComponentManager.h b/modules/juce_gui_basics/components/juce_ModalComponentManager.h index b0817518a2..149163b605 100644 --- a/modules/juce_gui_basics/components/juce_ModalComponentManager.h +++ b/modules/juce_gui_basics/components/juce_ModalComponentManager.h @@ -184,7 +184,7 @@ public: static ModalComponentManager::Callback* create (void (*functionToCall) (int, ParamType), ParamType parameterValue) { - return new FunctionCaller1 (functionToCall, parameterValue); + return new FunctionCaller1 (functionToCall, parameterValue); } //============================================================================== @@ -214,7 +214,7 @@ public: ParamType1 parameterValue1, ParamType2 parameterValue2) { - return new FunctionCaller2 (functionToCall, parameterValue1, parameterValue2); + return new FunctionCaller2 (functionToCall, parameterValue1, parameterValue2); } //============================================================================== @@ -244,7 +244,7 @@ public: static ModalComponentManager::Callback* forComponent (void (*functionToCall) (int, ComponentType*), ComponentType* component) { - return new ComponentCaller1 (functionToCall, component); + return new ComponentCaller1 (functionToCall, component); } //============================================================================== @@ -275,21 +275,20 @@ public: ComponentType* component, ParamType param) { - return new ComponentCaller2 (functionToCall, component, param); + return new ComponentCaller2 (functionToCall, component, param); } private: //============================================================================== template - class FunctionCaller1 : public ModalComponentManager::Callback + struct FunctionCaller1 : public ModalComponentManager::Callback { - public: typedef void (*FunctionType) (int, ParamType); FunctionCaller1 (FunctionType& f, ParamType& p1) : function (f), param (p1) {} - void modalStateFinished (int returnValue) { function (returnValue, param); } + void modalStateFinished (int returnValue) override { function (returnValue, param); } private: const FunctionType function; @@ -299,15 +298,14 @@ private: }; template - class FunctionCaller2 : public ModalComponentManager::Callback + struct FunctionCaller2 : public ModalComponentManager::Callback { - public: typedef void (*FunctionType) (int, ParamType1, ParamType2); FunctionCaller2 (FunctionType& f, ParamType1& p1, ParamType2& p2) : function (f), param1 (p1), param2 (p2) {} - void modalStateFinished (int returnValue) { function (returnValue, param1, param2); } + void modalStateFinished (int returnValue) override { function (returnValue, param1, param2); } private: const FunctionType function; @@ -318,15 +316,14 @@ private: }; template - class ComponentCaller1 : public ModalComponentManager::Callback + struct ComponentCaller1 : public ModalComponentManager::Callback { - public: typedef void (*FunctionType) (int, ComponentType*); ComponentCaller1 (FunctionType& f, ComponentType* c) : function (f), comp (c) {} - void modalStateFinished (int returnValue) + void modalStateFinished (int returnValue) override { function (returnValue, static_cast (comp.get())); } @@ -339,15 +336,14 @@ private: }; template - class ComponentCaller2 : public ModalComponentManager::Callback + struct ComponentCaller2 : public ModalComponentManager::Callback { - public: typedef void (*FunctionType) (int, ComponentType*, ParamType1); ComponentCaller2 (FunctionType& f, ComponentType* c, ParamType1 p1) : function (f), comp (c), param1 (p1) {} - void modalStateFinished (int returnValue) + void modalStateFinished (int returnValue) override { function (returnValue, static_cast (comp.get()), param1); } diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 04e437be2e..317ca49be5 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -1506,7 +1506,7 @@ struct PopupMenuCompletionCallback : public ModalComponentManager::Callback PopupMenuSettings::menuWasHiddenBecauseOfAppChange = false; } - void modalStateFinished (int result) + void modalStateFinished (int result) override { if (managerOfChosenCommand != nullptr && result != 0) {