X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..da55d0644f1cc11b5c55de4fc18d039f69666e86:/src/common/cmdproc.cpp diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index 104bebb063..0bfe20d3f5 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -6,7 +6,7 @@ // Created: 05.11.00 // RCS-ID: $Id$ // Copyright: (c) wxWidgets team -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -53,10 +53,6 @@ wxCommand::wxCommand(bool canUndoIt, const wxString& name) m_commandName = name; } -wxCommand::~wxCommand() -{ -} - // ---------------------------------------------------------------------------- // Command processor // ---------------------------------------------------------------------------- @@ -91,23 +87,25 @@ bool wxCommandProcessor::UndoCommand(wxCommand& cmd) // Pass a command to the processor. The processor calls Do(); // if successful, is appended to the command history unless -// storeIt is FALSE. +// storeIt is false. bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt) { - wxCHECK_MSG( command, FALSE, _T("no command in wxCommandProcessor::Submit") ); + wxCHECK_MSG( command, false, _T("no command in wxCommandProcessor::Submit") ); if ( !DoCommand(*command) ) { // the user code expects the command to be deleted anyhow delete command; - return FALSE; + return false; } if ( storeIt ) Store(command); + else + delete command; - return TRUE; + return true; } void wxCommandProcessor::Store(wxCommand *command) @@ -152,11 +150,11 @@ bool wxCommandProcessor::Undo() { m_currentCommand = m_currentCommand->GetPrevious(); SetMenuStrings(); - return TRUE; + return true; } } - return FALSE; + return false; } bool wxCommandProcessor::Redo() @@ -193,10 +191,10 @@ bool wxCommandProcessor::Redo() { m_currentCommand = redoNode; SetMenuStrings(); - return TRUE; + return true; } } - return FALSE; + return false; } bool wxCommandProcessor::CanUndo() const @@ -209,15 +207,15 @@ bool wxCommandProcessor::CanUndo() const bool wxCommandProcessor::CanRedo() const { if (m_currentCommand && !m_currentCommand->GetNext()) - return FALSE; + return false; if (m_currentCommand && m_currentCommand->GetNext()) - return TRUE; + return true; if (!m_currentCommand && (m_commands.GetCount() > 0)) - return TRUE; + return true; - return FALSE; + return false; } void wxCommandProcessor::Initialize() @@ -233,7 +231,7 @@ void wxCommandProcessor::SetMenuStrings() { wxString undoLabel = GetUndoMenuLabel(); wxString redoLabel = GetRedoMenuLabel(); - + m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel); m_commandEditMenu->Enable(wxID_UNDO, CanUndo()); @@ -262,7 +260,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const { buf = _("&Undo") + m_undoAccelerator; } - + return buf; }