nullptr safety and a bit of wxT'ing.

This commit is contained in:
Jeff Young 2024-02-09 13:53:22 +00:00
parent 334b414826
commit aef6b2a66e
5 changed files with 9 additions and 8 deletions

View File

@ -428,6 +428,8 @@ void PG_RATIO_EDITOR::UpdateControl( wxPGProperty* aProperty, wxWindow* aCtrl )
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( aCtrl );
wxVariant var = aProperty->GetValue();
wxCHECK_MSG( textCtrl, /*void*/, wxT( "PG_RATIO_EDITOR must be used with a textCtrl!" ) );
if( var.GetType() == wxT( "std::optional<double>" ) )
{
auto* variantData = static_cast<STD_OPTIONAL_DOUBLE_VARIANT_DATA*>( var.GetData() );

View File

@ -2657,7 +2657,7 @@ int CADSTAR_SCH_ARCHIVE_LOADER::getSheetNumber( LAYER_ID aCadstarSheetID )
void CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet( LAYER_ID aCadstarSheetID, SCH_ITEM* aItem )
{
wxCHECK_MSG( aItem, /*void*/, "aItem is null" );
wxCHECK_MSG( aItem, /*void*/, wxT( "aItem is null" ) );
if( aCadstarSheetID == "ALL_SHEETS" )
{
@ -2676,8 +2676,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet( LAYER_ID aCadstarSheetI
}
else if( aCadstarSheetID == "NO_SHEET" )
{
wxASSERT_MSG( false,
"Trying to add an item to NO_SHEET? This might be a documentation symbol." );
wxFAIL_MSG( wxT( "Trying to add an item to NO_SHEET? This might be a documentation symbol." ) );
}
else
{
@ -2688,7 +2687,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadItemOntoKiCadSheet( LAYER_ID aCadstarSheetI
else
{
delete aItem;
wxASSERT_MSG( false, "Unknown Sheet ID." );
wxFAIL_MSG( wxT( "Unknown Sheet ID." ) );
}
}
}

View File

@ -289,7 +289,7 @@ wxString SCH_TEXT::GetShownText( const SCH_SHEET_PATH* aPath, bool aAllowExtraTe
void SCH_TEXT::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
{
wxCHECK_MSG( IsHypertext(), /* void */,
"Calling a hypertext menu on a SCH_TEXT with no hyperlink?" );
wxT( "Calling a hypertext menu on a SCH_TEXT with no hyperlink?" ) );
SCH_NAVIGATE_TOOL* navTool = aFrame->GetToolManager()->GetTool<SCH_NAVIGATE_TOOL>();
navTool->HypertextCommand( m_hyperlink );

View File

@ -354,7 +354,7 @@ bool SCH_TEXTBOX::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy )
void SCH_TEXTBOX::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
{
wxCHECK_MSG( IsHypertext(), /* void */,
"Calling a hypertext menu on a SCH_TEXTBOX with no hyperlink?" );
wxT( "Calling a hypertext menu on a SCH_TEXTBOX with no hyperlink?" ) );
SCH_NAVIGATE_TOOL* navTool = aFrame->GetToolManager()->GetTool<SCH_NAVIGATE_TOOL>();
navTool->HypertextCommand( m_hyperlink );

View File

@ -363,8 +363,8 @@ public:
*/
virtual void SetLayerDepth( double aLayerDepth )
{
wxCHECK_MSG( aLayerDepth <= m_depthRange.y, /* void */, "SetLayerDepth: below minimum" );
wxCHECK_MSG( aLayerDepth >= m_depthRange.x, /* void */, "SetLayerDepth: above maximum" );
wxCHECK_MSG( aLayerDepth <= m_depthRange.y, /*void*/, wxT( "SetLayerDepth: below minimum" ) );
wxCHECK_MSG( aLayerDepth >= m_depthRange.x, /*void*/, wxT( "SetLayerDepth: above maximum" ) );
m_layerDepth = aLayerDepth;
}