]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Added return NULL; for __WXCOCOA__
[wxWidgets.git] / src / common / docview.cpp
index e3d0f5ab88718fd02314b28e983c6c2c4406ef4f..17fcf475041ea83ba542781220fd37c50c8ceb4e 100644 (file)
@@ -964,22 +964,26 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
 #endif // wxUSE_PRINTING_ARCHITECTURE
 }
 
-void wxDocManager::OnUndo(wxCommandEvent& WXUNUSED(event))
+void wxDocManager::OnUndo(wxCommandEvent& event)
 {
     wxDocument *doc = GetCurrentDocument();
     if (!doc)
         return;
     if (doc->GetCommandProcessor())
         doc->GetCommandProcessor()->Undo();
+    else
+        event.Skip();
 }
 
-void wxDocManager::OnRedo(wxCommandEvent& WXUNUSED(event))
+void wxDocManager::OnRedo(wxCommandEvent& event)
 {
     wxDocument *doc = GetCurrentDocument();
     if (!doc)
         return;
     if (doc->GetCommandProcessor())
         doc->GetCommandProcessor()->Redo();
+    else
+        event.Skip();
 }
 
 // Handlers for UI update commands
@@ -1021,17 +1025,29 @@ void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event)
 void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event)
 {
     wxDocument *doc = GetCurrentDocument();
-    event.Enable( (doc && doc->GetCommandProcessor() && doc->GetCommandProcessor()->CanUndo()) );
-    if (doc && doc->GetCommandProcessor())
+    if (!doc)
+        event.Enable(FALSE);
+    else if (!doc->GetCommandProcessor())
+        event.Skip();
+    else
+    {
+        event.Enable( doc->GetCommandProcessor()->CanUndo() );
         doc->GetCommandProcessor()->SetMenuStrings();
+    }
 }
 
 void wxDocManager::OnUpdateRedo(wxUpdateUIEvent& event)
 {
     wxDocument *doc = GetCurrentDocument();
-    event.Enable( (doc && doc->GetCommandProcessor() && doc->GetCommandProcessor()->CanRedo()) );
-    if (doc && doc->GetCommandProcessor())
+    if (!doc)
+        event.Enable(FALSE);
+    else if (!doc->GetCommandProcessor())
+        event.Skip();
+    else
+    {
+        event.Enable( doc->GetCommandProcessor()->CanRedo() );
         doc->GetCommandProcessor()->SetMenuStrings();
+    }
 }
 
 void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event)
@@ -1374,12 +1390,9 @@ void wxDocManager::FileHistoryAddFilesToMenu()
         m_fileHistory->AddFilesToMenu();
 }
 
-size_t wxDocManager::GetNoHistoryFiles() const
+size_t wxDocManager::GetHistoryFilesCount() const
 {
-    if (m_fileHistory)
-        return m_fileHistory->GetNoHistoryFiles();
-    else
-        return 0;
+    return m_fileHistory ? m_fileHistory->GetCount() : 0;
 }