- wxCommand *command = (wxCommand *)m_currentCommand->Data();
- wxString commandName(command->GetName());
- if (commandName == wxT("")) commandName = _("Unnamed command");
- bool canUndo = command->CanUndo();
- if (canUndo)
- buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
- else
- buf = wxString(_("Can't &Undo ")) + commandName + m_undoAccelerator;
-
- m_commandEditMenu->SetLabel(wxID_UNDO, buf);
- m_commandEditMenu->Enable(wxID_UNDO, canUndo);
-
- // We can redo, if we're not at the end of the history.
- if (m_currentCommand->Next())
- {
- wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
- wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
- buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
- m_commandEditMenu->SetLabel(wxID_REDO, buf);
- m_commandEditMenu->Enable(wxID_REDO, TRUE);
- }
- else
- {
- m_commandEditMenu->SetLabel(wxID_REDO, _("&Redo") + m_redoAccelerator);
- m_commandEditMenu->Enable(wxID_REDO, FALSE);
- }
+ wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
+ wxString redoCommandName(redoCommand->GetName());
+ if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
+ buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;