Quiet Coverity.

This commit is contained in:
Jeff Young 2021-08-04 13:51:38 +01:00
parent 46bdce2747
commit ae99e627bd
2 changed files with 14 additions and 7 deletions

View File

@ -216,7 +216,11 @@ COLOR_SETTINGS* SETTINGS_MANAGER::loadColorSettingsByName( const wxString& aName
auto cs = static_cast<COLOR_SETTINGS*>( RegisterSettings( new COLOR_SETTINGS( aName ) ) );
if( cs->GetFilename() != aName.ToStdString() )
{
// wxLogTrace is actually a macro so these braces are needed to keep Coverity from
// worrying about dangline else clauses....
wxLogTrace( traceSettings, "Warning: stored filename is actually %s, ", cs->GetFilename() );
}
m_color_settings[aName] = cs;

View File

@ -100,7 +100,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
PICKED_ITEMS_LIST undoList;
KIGFX::VIEW* view = m_toolMgr->GetView();
BOARD* board = (BOARD*) m_toolMgr->GetModel();
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) m_toolMgr->GetToolHolder();
PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( m_toolMgr->GetToolHolder() );
auto connectivity = board->GetConnectivity();
std::set<EDA_ITEM*> savedModules;
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
@ -138,7 +138,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
wxASSERT( ent.m_item->Type() == PCB_FOOTPRINT_T );
wxASSERT( ent.m_copy->Type() == PCB_FOOTPRINT_T );
if( aCreateUndoEntry )
if( aCreateUndoEntry && frame )
{
ITEM_PICKER itemWrapper( nullptr, ent.m_item, UNDO_REDO::CHANGED );
itemWrapper.SetLink( ent.m_copy );
@ -409,7 +409,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
}
}
if( !m_isFootprintEditor && aCreateUndoEntry )
if( !m_isFootprintEditor && aCreateUndoEntry && frame )
frame->SaveCopyInUndoList( undoList, UNDO_REDO::UNSPECIFIED );
m_toolMgr->PostEvent( { TC_MESSAGE, TA_MODEL_CHANGE, AS_GLOBAL } );
@ -417,10 +417,13 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
if( itemsDeselected )
m_toolMgr->PostEvent( EVENTS::UnselectedEvent );
if( aSetDirtyBit )
frame->OnModify();
else if( frame )
frame->Update3DView( true, frame->GetDisplayOptions().m_Live3DRefresh );
if( frame )
{
if( aSetDirtyBit )
frame->OnModify();
else
frame->Update3DView( true, frame->GetDisplayOptions().m_Live3DRefresh );
}
clear();
}