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:
Paul Cornett
2019-08-25 18:11:01 -07:00
parent cf4f3a92c5
commit 3b54720b3a
2 changed files with 16 additions and 14 deletions

View File

@@ -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 )