Applied wxFileHistory menu separator patch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-01-24 12:20:51 +00:00
parent e910c00040
commit c8c5c7f62e

View File

@@ -1,4 +1,4 @@
///////////////////////////////////////////////////////////////////////////// `/////////////////////////////////////////////////////////////////////////////
// Name: src/common/docview.cpp // Name: src/common/docview.cpp
// Purpose: Document/view classes // Purpose: Document/view classes
// Author: Julian Smart // Author: Julian Smart
@@ -1954,8 +1954,10 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->GetData(); wxMenu* menu = (wxMenu*) node->GetData();
if (m_fileHistoryN == 0) if ( m_fileHistoryN == 0 && menu->GetMenuItemCount() )
{
menu->AppendSeparator(); menu->AppendSeparator();
}
menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]")); menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
node = node->GetNext(); node = node->GetNext();
} }
@@ -2121,7 +2123,11 @@ void wxFileHistory::AddFilesToMenu()
while (node) while (node)
{ {
wxMenu* menu = (wxMenu*) node->GetData(); wxMenu* menu = (wxMenu*) node->GetData();
menu->AppendSeparator(); if (menu->GetMenuItemCount())
{
menu->AppendSeparator();
}
int i; int i;
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistoryN; i++)
{ {
@@ -2141,7 +2147,11 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu)
{ {
if (m_fileHistoryN > 0) if (m_fileHistoryN > 0)
{ {
menu->AppendSeparator(); if (menu->GetMenuItemCount())
{
menu->AppendSeparator();
}
int i; int i;
for (i = 0; i < m_fileHistoryN; i++) for (i = 0; i < m_fileHistoryN; i++)
{ {