fixed bug with redoing the command when there was nothing to redo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-11-13 14:27:00 +00:00
parent 0d1ace8697
commit 17271c793e

View File

@ -154,12 +154,17 @@ bool wxCommandProcessor::Redo()
{
wxCommand *redoCommand = (wxCommand *) NULL;
wxNode *redoNode = (wxNode *) NULL;
if (m_currentCommand && m_currentCommand->Next())
if ( m_currentCommand )
{
redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
redoNode = m_currentCommand->Next();
// is there anything to redo?
if ( m_currentCommand->Next() )
{
redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
redoNode = m_currentCommand->Next();
}
}
else
else // no current command, redo the first one
{
if (m_commands.Number() > 0)
{