X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ee9d6182c9b7774477e97f4326766ac05cc70c2..cb34a6eeacff2ff63ebca22c27f54a421f726737:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index e21cda1fc9..317dbfbc7f 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -103,7 +103,7 @@ static inline wxString FindExtension(const wxChar *path); // local constants // ---------------------------------------------------------------------------- -static const char *s_MRUEntryFormat = wxT("&%d %s"); +static const wxChar *s_MRUEntryFormat = wxT("&%d %s"); // ============================================================================ // implementation @@ -1309,7 +1309,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, } wxDocTemplate *theTemplate = (wxDocTemplate *)wxGetSingleChoiceData(_("Select a document template"), _("Templates"), n, - strings, (char **)data); + strings, (void **)data); delete[] strings; delete[] data; return theTemplate; @@ -1332,7 +1332,7 @@ wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates, } } wxDocTemplate *theTemplate = (wxDocTemplate *)wxGetSingleChoiceData(_("Select a document view"), _("Views"), n, - strings, (char **)data); + strings, (void **)data); delete[] strings; delete[] data; return theTemplate; @@ -1909,9 +1909,6 @@ void wxFileHistory::RemoveFileFromHistory(int i) { wxMenu* menu = (wxMenu*) node->Data(); - // delete the menu items - menu->Delete(wxID_FILE1 + i); - // delete the element from the array (could use memmove() too...) delete [] m_fileHistory[i]; @@ -1930,7 +1927,17 @@ void wxFileHistory::RemoveFileFromHistory(int i) } node = node->Next(); + + // delete the last menu item which is unused now + menu->Delete(wxID_FILE1 + m_fileHistoryN - 1); + + // unfortunately, we can't delete separator (there is no function to + // delete item by position, only by id - and what if there are several + // separators in this menu?) - so we will be always left with at least + // one and, even worse, we will add another one if this was the last + // file... (FIXME) } + m_fileHistoryN--; }