]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmdproc.cpp
Set solid colour for whole control, not pages
[wxWidgets.git] / src / common / cmdproc.cpp
index beb3bd77b5b4563e9e8e07538d8309a208f0338c..df71ab8148c954b101825b7cbbb632e88f32f86d 100644 (file)
@@ -53,10 +53,6 @@ wxCommand::wxCommand(bool canUndoIt, const wxString& name)
     m_commandName = name;
 }
 
-wxCommand::~wxCommand()
-{
-}
-
 // ----------------------------------------------------------------------------
 // Command processor
 // ----------------------------------------------------------------------------
@@ -106,6 +102,8 @@ bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt)
 
     if ( storeIt )
         Store(command);
+    else
+        delete command;
 
     return true;
 }
@@ -251,7 +249,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const
     {
         wxCommand *command = (wxCommand *)m_currentCommand->GetData();
         wxString commandName(command->GetName());
-        if (commandName == wxT("")) commandName = _("Unnamed command");
+        if (commandName.empty()) commandName = _("Unnamed command");
         bool canUndo = command->CanUndo();
         if (canUndo)
             buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator;
@@ -277,7 +275,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
         {
             wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData();
             wxString redoCommandName(redoCommand->GetName());
-            if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
+            if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
             buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
         }
         else
@@ -297,7 +295,7 @@ wxString wxCommandProcessor::GetRedoMenuLabel() const
             // we've undone to the start of the list, but can redo the first.
             wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData();
             wxString redoCommandName(redoCommand->GetName());
-            if (redoCommandName == wxT("")) redoCommandName = _("Unnamed command");
+            if (redoCommandName.empty()) redoCommandName = _("Unnamed command");
             buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator;
         }
     }