Browse Source

Don't rely on dynamic_cast across DLLs

See https://gitlab.com/kicad/code/kicad/-/issues/16998
newinvert
Jon Evans 2 years ago
parent
commit
e9456201a7
  1. 1
      common/pgm_base.cpp
  2. 4
      common/widgets/properties_panel.cpp
  3. 2
      include/pgm_base.h

1
common/pgm_base.cpp

@ -134,6 +134,7 @@ PGM_BASE::PGM_BASE()
m_argcUtf8 = 0;
m_argvUtf8 = nullptr;
m_splash = nullptr;
m_PropertyGridInitialized = false;
setLanguageId( wxLANGUAGE_DEFAULT );

4
common/widgets/properties_panel.cpp

@ -24,6 +24,7 @@
#include <eda_base_frame.h>
#include <eda_item.h>
#include <import_export.h>
#include <pgm_base.h>
#include <properties/pg_cell_renderer.h>
#include <algorithm>
@ -65,10 +66,11 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
wxPGEditor_DatePickerCtrl = nullptr;
}
if( !dynamic_cast<PG_CELL_RENDERER*>( wxPGGlobalVars->m_defaultRenderer ) )
if( !Pgm().m_PropertyGridInitialized )
{
delete wxPGGlobalVars->m_defaultRenderer;
wxPGGlobalVars->m_defaultRenderer = new PG_CELL_RENDERER();
Pgm().m_PropertyGridInitialized = true;
}
m_caption = new wxStaticText( this, wxID_ANY, _( "No objects selected" ) );

2
include/pgm_base.h

@ -377,6 +377,8 @@ public:
bool m_Quitting;
bool m_PropertyGridInitialized;
protected:
/// Loads internal settings from COMMON_SETTINGS
void loadCommonSettings();

Loading…
Cancel
Save