From c8c5c7f62e94fb11556497f6797dacbc00914c28 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 24 Jan 2003 12:20:51 +0000 Subject: [PATCH] Applied wxFileHistory menu separator patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docview.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 40e21501fe..d94cc78cda 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1,4 +1,4 @@ -///////////////////////////////////////////////////////////////////////////// +`///////////////////////////////////////////////////////////////////////////// // Name: src/common/docview.cpp // Purpose: Document/view classes // Author: Julian Smart @@ -1954,8 +1954,10 @@ void wxFileHistory::AddFileToHistory(const wxString& file) while (node) { wxMenu* menu = (wxMenu*) node->GetData(); - if (m_fileHistoryN == 0) + if ( m_fileHistoryN == 0 && menu->GetMenuItemCount() ) + { menu->AppendSeparator(); + } menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]")); node = node->GetNext(); } @@ -2121,7 +2123,11 @@ void wxFileHistory::AddFilesToMenu() while (node) { wxMenu* menu = (wxMenu*) node->GetData(); - menu->AppendSeparator(); + if (menu->GetMenuItemCount()) + { + menu->AppendSeparator(); + } + int i; for (i = 0; i < m_fileHistoryN; i++) { @@ -2141,7 +2147,11 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu) { if (m_fileHistoryN > 0) { - menu->AppendSeparator(); + if (menu->GetMenuItemCount()) + { + menu->AppendSeparator(); + } + int i; for (i = 0; i < m_fileHistoryN; i++) {