]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmdproc.cpp
fix for temp file creation under Windows
[wxWidgets.git] / src / common / cmdproc.cpp
index c2d44c895b52398a62e21a931fc50e6b39d7dfee..f6d7eb8dd594b3c3933bcfea240760ced947bfcf 100644 (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)
         {