Move wxKeyEvent assignment operator out of header
It causes a warning with MSVC code analysis: "warning C26437: Do not slice (es.63)" It's unclear if this function even needs to exist, but at least move it out of line so the warning does not occur for user code.
This commit is contained in:
@@ -790,6 +790,21 @@ wxKeyEvent::wxKeyEvent(wxEventType eventType, const wxKeyEvent& evt)
|
||||
InitPropagation();
|
||||
}
|
||||
|
||||
wxKeyEvent& wxKeyEvent::operator=(const wxKeyEvent& evt)
|
||||
{
|
||||
if ( &evt != this )
|
||||
{
|
||||
wxEvent::operator=(evt);
|
||||
|
||||
// Borland C++ 5.82 doesn't compile an explicit call to an
|
||||
// implicitly defined operator=() so need to do it this way:
|
||||
*static_cast<wxKeyboardState *>(this) = evt;
|
||||
|
||||
DoAssignMembers(evt);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxKeyEvent::InitPositionIfNecessary() const
|
||||
{
|
||||
if ( m_hasPosition )
|
||||
|
Reference in New Issue
Block a user