diff --git a/src/Project.cpp b/src/Project.cpp index 9492224e3..6cd3a2560 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -285,7 +285,8 @@ public: { } - bool IsSupportedFormat(const wxDataFormat & format, Direction WXUNUSED(dir = Get)) const override + bool IsSupportedFormat(const wxDataFormat & format, Direction WXUNUSED(dir = Get)) const + // PRL: This function does NOT override any inherited virtual! What does it do? { if (format.GetType() == wxDF_FILENAME) { return true; diff --git a/src/commands/CommandFunctors.h b/src/commands/CommandFunctors.h index 5df2b27a2..f6d6ec79d 100644 --- a/src/commands/CommandFunctors.h +++ b/src/commands/CommandFunctors.h @@ -29,62 +29,62 @@ using CommandFunctorPointer = std::shared_ptr ; // Define functor subclasses that dispatch to the correct call sequence on // member functions of AudacityProject (or other class!) -template -using audCommandFunction = void (THIS::*)(); +template +using audCommandFunction = void (OBJ::*)(); -template +template class VoidFunctor final : public CommandFunctor { public: - explicit VoidFunctor(THIS *This, audCommandFunction pfn) + explicit VoidFunctor(OBJ *This, audCommandFunction pfn) : mThis{ This }, mCommandFunction{ pfn } {} void operator () (int, const wxEvent *) override { (mThis->*mCommandFunction) (); } private: - THIS *const mThis; - const audCommandFunction mCommandFunction; + OBJ *const mThis; + const audCommandFunction mCommandFunction; }; -template -using audCommandKeyFunction = void (THIS::*)(const wxEvent *); +template +using audCommandKeyFunction = void (OBJ::*)(const wxEvent *); -template +template class KeyFunctor final : public CommandFunctor { public: - explicit KeyFunctor(THIS *This, audCommandKeyFunction pfn) + explicit KeyFunctor(OBJ *This, audCommandKeyFunction pfn) : mThis{ This }, mCommandKeyFunction{ pfn } {} void operator () (int, const wxEvent *evt) override { (mThis->*mCommandKeyFunction) (evt); } private: - THIS *const mThis; - const audCommandKeyFunction mCommandKeyFunction; + OBJ *const mThis; + const audCommandKeyFunction mCommandKeyFunction; }; -template -using audCommandListFunction = void (THIS::*)(int); +template +using audCommandListFunction = void (OBJ::*)(int); -template +template class ListFunctor final : public CommandFunctor { public: - explicit ListFunctor(THIS *This, audCommandListFunction pfn) + explicit ListFunctor(OBJ *This, audCommandListFunction pfn) : mThis{ This }, mCommandListFunction{ pfn } {} void operator () (int index, const wxEvent *) override { (mThis->*mCommandListFunction)(index); } private: - THIS *const mThis; - const audCommandListFunction mCommandListFunction; + OBJ *const mThis; + const audCommandListFunction mCommandListFunction; }; -template -using audCommandPluginFunction = bool (THIS::*)(const PluginID &, int); +template +using audCommandPluginFunction = bool (OBJ::*)(const PluginID &, int); -template +template class PluginFunctor final : public CommandFunctor { public: - explicit PluginFunctor(THIS *This, const PluginID &id, audCommandPluginFunction pfn) + explicit PluginFunctor(OBJ *This, const PluginID &id, audCommandPluginFunction pfn) : mPluginID{ id }, mThis{ This }, mCommandPluginFunction{ pfn } {} void operator () (int, const wxEvent *) override { (mThis->*mCommandPluginFunction) @@ -93,34 +93,34 @@ public: ); } private: const PluginID mPluginID; - THIS *const mThis; - const audCommandPluginFunction mCommandPluginFunction; + OBJ *const mThis; + const audCommandPluginFunction mCommandPluginFunction; }; // Now define an overloaded factory function -template -inline CommandFunctorPointer MakeFunctor(THIS *This, - audCommandFunction pfn) -{ return CommandFunctorPointer{ safenew VoidFunctor{ This, pfn } }; } +template +inline CommandFunctorPointer MakeFunctor(OBJ *This, + audCommandFunction pfn) +{ return CommandFunctorPointer{ safenew VoidFunctor{ This, pfn } }; } -template -inline CommandFunctorPointer MakeFunctor(THIS *This, - audCommandKeyFunction pfn) -{ return CommandFunctorPointer{ safenew KeyFunctor{ This, pfn } }; } +template +inline CommandFunctorPointer MakeFunctor(OBJ *This, + audCommandKeyFunction pfn) +{ return CommandFunctorPointer{ safenew KeyFunctor{ This, pfn } }; } -template -inline CommandFunctorPointer MakeFunctor(THIS *This, - audCommandListFunction pfn) -{ return CommandFunctorPointer{ safenew ListFunctor{ This, pfn } }; } +template +inline CommandFunctorPointer MakeFunctor(OBJ *This, + audCommandListFunction pfn) +{ return CommandFunctorPointer{ safenew ListFunctor{ This, pfn } }; } -template -inline CommandFunctorPointer MakeFunctor(THIS *This, const PluginID &id, - audCommandPluginFunction pfn) -{ return CommandFunctorPointer{ safenew PluginFunctor{ This, id, pfn } }; } +template +inline CommandFunctorPointer MakeFunctor(OBJ *This, const PluginID &id, + audCommandPluginFunction pfn) +{ return CommandFunctorPointer{ safenew PluginFunctor{ This, id, pfn } }; } // Now define the macro abbreviations that call the factory -#define FNT(THIS, This, X) (MakeFunctor(This, X )) -#define FNTS(THIS, This, X, S) (MakeFunctor(This, (S), X )) +#define FNT(OBJ, This, X) (MakeFunctor(This, X )) +#define FNTS(OBJ, This, X, S) (MakeFunctor(This, (S), X )) #define FN(X) FNT(AudacityProject, this, & AudacityProject :: X) #define FNS(X, S) FNTS(AudacityProject, this, & AudacityProject :: X, S)