1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 00:29:41 +02:00

Third argument of EnableUsingFlags was always all-ones; eliminate it

This commit is contained in:
Paul Licameli 2019-06-13 16:55:01 -04:00
parent a34f1cbba5
commit 64650b9a55
3 changed files with 6 additions and 8 deletions

View File

@ -868,8 +868,7 @@ void MenuManager::UpdateMenus( bool checkActive )
// 0 is grey out, 1 is Autoselect, 2 is Give warnings.
commandManager.EnableUsingFlags(
flags2, // the "lax" flags
(mWhatIfNoSelection == 0 ? flags2 : flags), // the "strict" flags
NoFlagsSpecified
(mWhatIfNoSelection == 0 ? flags2 : flags) // the "strict" flags
);
MenuManager::ModifyToolbarMenus(project);

View File

@ -957,7 +957,7 @@ void CommandManager::Enable(const wxString &name, bool enabled)
}
void CommandManager::EnableUsingFlags(
CommandFlag flags, CommandFlag strictFlags, CommandMask mask)
CommandFlag flags, CommandFlag strictFlags)
{
// strictFlags are a subset of flags. strictFlags represent the real
// conditions now, but flags are the conditions that could be made true.
@ -973,10 +973,9 @@ void CommandManager::EnableUsingFlags(
auto useFlags = entry->useStrictFlags ? strictFlags : flags;
auto combinedMask = (mask & entry->mask);
if (combinedMask.any()) {
bool enable = ((useFlags & combinedMask) ==
(entry->flags & combinedMask));
if (entry->mask.any()) {
bool enable = ((useFlags & entry->mask) ==
(entry->flags & entry->mask));
Enable(entry.get(), enable);
}
}

View File

@ -223,7 +223,7 @@ class AUDACITY_DLL_API CommandManager final
//
void EnableUsingFlags(
CommandFlag flags, CommandFlag strictFlags, CommandMask mask);
CommandFlag flags, CommandFlag strictFlags);
void Enable(const wxString &name, bool enabled);
void Check(const CommandID &name, bool checked);
void Modify(const wxString &name, const wxString &newLabel);