From c1cd3339fa8f5981c54a3760b0ab30fc29c28cf4 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 19 Aug 2019 14:24:26 +0100 Subject: [PATCH] Fix assertion in new Duplicate Hotkey warning message. --- common/widgets/widget_hotkey_list.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index 400857af8e..2cf6ab6230 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -599,12 +599,10 @@ void WIDGET_HOTKEY_LIST::initializeElements() // Add the bitmap image for invalid hotkey warning // bitmap size is not know (depending on it is built). So get it: - wxSize iconsize; - wxBitmap bm_invalid = KiBitmap( cancel_xpm ); - iconsize.x = bm_invalid.GetWidth(); - iconsize.y = bm_invalid.GetHeight(); - m_imgList = new wxImageList( iconsize.x, iconsize.y, true, 1); - m_imgList->Add( bm_invalid ); + wxIcon icon; + icon.CopyFromBitmap( KiBitmap( cancel_xpm ) ); + m_imgList = new wxImageList( icon.GetSize().x, icon.GetSize().y, true, 1 ); + m_imgList->Add( icon ); AssignImageList( m_imgList ); if( !m_readOnly )