From a104022931420a383fb7274b1267807e6d490bf1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 May 2010 23:38:26 +0000 Subject: [PATCH] Fix assert during separator items creation introduced by r64226. Add separators with correct kind, setting m_kind doesn't work any more because it's overwritten below. Also add a comment explaining why is overriding the user-specified kind the right thing to do here. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/menucmn.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 5625dd8f63..6f2a843599 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -67,7 +67,12 @@ wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu, case wxID_SEPARATOR: m_id = wxID_SEPARATOR; - m_kind = wxITEM_SEPARATOR; + + // there is a lot of existing code just doing Append(wxID_SEPARATOR) + // and it makes sense to omit the following optional parameters, + // including the kind one which doesn't default to wxITEM_SEPARATOR, + // of course, so override it here + kind = wxITEM_SEPARATOR; break; default: -- 2.45.2