Simplify lib shape properties dialog code

Since 34e706bcbc it is assumed that the
shape passed in exists, so testing for a null pointer is pointless
(it will always be non-null). Also hardcode the assumption the shape is
non-null in the constructor using an assert.
This commit is contained in:
Ian McInerney 2022-09-25 02:10:21 +01:00
parent 3a297093e6
commit b363e0f300
1 changed files with 7 additions and 5 deletions

View File

@ -38,6 +38,8 @@ DIALOG_LIB_SHAPE_PROPERTIES::DIALOG_LIB_SHAPE_PROPERTIES( SYMBOL_EDIT_FRAME* aPa
m_shape( aShape ), m_shape( aShape ),
m_borderWidth( aParent, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits, true ) m_borderWidth( aParent, m_borderWidthLabel, m_borderWidthCtrl, m_borderWidthUnits, true )
{ {
wxASSERT( aShape );
SetTitle( m_shape->GetTypeName() + wxT( " " ) + GetTitle() ); SetTitle( m_shape->GetTypeName() + wxT( " " ) + GetTitle() );
m_helpLabel->SetFont( KIUI::GetInfoFont( this ).Italic() ); m_helpLabel->SetFont( KIUI::GetInfoFont( this ).Italic() );
@ -132,11 +134,11 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow()
m_checkApplyToAllConversions->Enable( enblConvOptStyle ); m_checkApplyToAllConversions->Enable( enblConvOptStyle );
m_rbFillNone->Enable( m_shape != nullptr ); m_rbFillNone->Enable( true );
m_rbFillOutline->Enable( m_shape != nullptr ); m_rbFillOutline->Enable( true );
m_rbFillBackground->Enable( m_shape != nullptr ); m_rbFillBackground->Enable( true );
m_rbFillCustom->Enable( m_shape != nullptr ); m_rbFillCustom->Enable( true );
m_fillColorSwatch->Enable( m_shape != nullptr ); m_fillColorSwatch->Enable( true );
if( m_shape->GetFillMode() == FILL_T::FILLED_SHAPE ) if( m_shape->GetFillMode() == FILL_T::FILLED_SHAPE )
{ {