Minor nullptr fixes

This commit is contained in:
Roberto Fernandez Bautista 2022-05-05 19:48:58 +01:00 committed by Jon Evans
parent f5597238fb
commit f5a75a4001
3 changed files with 11 additions and 4 deletions

View File

@ -20,6 +20,7 @@
#include <pg_properties.h>
#include <property_mgr.h>
#include <wx/dc.h>
#include <wx/propgrid/propgrid.h>
#include <wx/regex.h>

View File

@ -107,9 +107,15 @@ void PCB_PROPERTIES_PANEL::updateLists( const BOARD* aBoard )
for( LSEQ layerSeq = aBoard->GetEnabledLayers().UIOrder(); layerSeq; ++layerSeq )
layersAll.Add( LSET::Name( *layerSeq ), *layerSeq );
m_propMgr.GetProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) )->SetChoices( layersAll );
m_propMgr.GetProperty( TYPE_HASH( PCB_SHAPE ), _HKI( "Layer" ) )->SetChoices( layersAll );
m_propMgr.GetProperty( TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ) )->SetChoices( layersAll );
if( m_propMgr.GetProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) ) )
m_propMgr.GetProperty( TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) )->SetChoices( layersAll );
if( m_propMgr.GetProperty( TYPE_HASH( PCB_SHAPE ), _HKI( "Layer" ) ) )
m_propMgr.GetProperty( TYPE_HASH( PCB_SHAPE ), _HKI( "Layer" ) )->SetChoices( layersAll );
if( m_propMgr.GetProperty( TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ) ) )
m_propMgr.GetProperty( TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ) )
->SetChoices( layersAll );
// Regenerate nets
for( const auto& netinfo : aBoard->GetNetInfo().NetsByNetcode() )

View File

@ -291,7 +291,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( "PropertiesManager" )
.Left().Layer( 2 )
.Left().Layer( 5 )
.Caption( _( "Properties" ) ).PaneBorder( false )
.MinSize( 240, -1 ).BestSize( 300, -1 ) );