1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Simplify the FN macros in src/menus/*.cpp...

... Eliminate repetitious passing of the finder function into each of the
calls to Command and CommandGroup.
This commit is contained in:
Paul Licameli
2019-01-06 11:31:52 -05:00
parent 702b8b1e9d
commit 512c27d422
18 changed files with 233 additions and 123 deletions

View File

@@ -418,8 +418,7 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &) {
// Menu definitions
#define FN(X) findCommandHandler, \
static_cast<CommandFunctorPointer>(& HelpActions::Handler :: X)
#define FN(X) (& HelpActions::Handler :: X)
MenuTable::BaseItemPtr HelpMenu( AudacityProject & )
{
@@ -429,7 +428,8 @@ MenuTable::BaseItemPtr HelpMenu( AudacityProject & )
using namespace MenuTable;
return Menu( XO("&Help"),
return FinderScope( findCommandHandler ).Eval(
Menu( XO("&Help"),
// QuickFix menu item not in Audacity 2.3.1 whilst we discuss further.
#ifdef EXPERIMENTAL_DA
// DA: Has QuickFix menu item.
@@ -480,7 +480,7 @@ MenuTable::BaseItemPtr HelpMenu( AudacityProject & )
#endif
Command( wxT("About"), XXO("&About Audacity..."), FN(OnAbout),
AlwaysEnabledFlag )
);
) );
}
#undef FN