Applied patch [ 667149 ] wxFileHistory: Only adds a menu separator when necessary

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-01-24 12:19:39 +00:00
parent edf3c8adcd
commit 9370c6ba12

View File

@@ -1948,8 +1948,10 @@ void wxFileHistory::AddFileToHistory(const wxString& file)
while (node)
{
wxMenu* menu = (wxMenu*) node->Data();
if (m_fileHistoryN == 0)
if ( m_fileHistoryN == 0 && menu->GetMenuItemCount() )
{
menu->AppendSeparator();
}
menu->Append(wxID_FILE1+m_fileHistoryN, _("[EMPTY]"));
node = node->Next();
}
@@ -2115,7 +2117,10 @@ void wxFileHistory::AddFilesToMenu()
while (node)
{
wxMenu* menu = (wxMenu*) node->Data();
menu->AppendSeparator();
if (menu->GetMenuItemCount())
{
menu->AppendSeparator();
}
int i;
for (i = 0; i < m_fileHistoryN; i++)
{
@@ -2135,7 +2140,10 @@ 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++)
{