]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix assert during separator items creation introduced by r64226.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 May 2010 23:38:26 +0000 (23:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 May 2010 23:38:26 +0000 (23:38 +0000)
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

index 5625dd8f6331f13c86e560a2764c9c5b53e02ab3..6f2a8435998b12bab3858783bd99a0210c4eb0de 100644 (file)
@@ -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: