Fix dangerous static_cast-ing to wrong type.
This commit is contained in:
parent
1f6a5c92d7
commit
bb96255a03
|
@ -63,7 +63,9 @@ static DRILL_PRECISION precisionListForMetric( 3, 3 );
|
|||
*/
|
||||
int PCB_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_GENDRILL dlg( frame(), frame() );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_GENDRILL dlg( editFrame, editFrame );
|
||||
|
||||
dlg.ShowModal();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,9 @@ DIALOG_GLOBAL_DELETION::DIALOG_GLOBAL_DELETION( PCB_EDIT_FRAME* parent ) :
|
|||
|
||||
int GLOBAL_EDIT_TOOL::GlobalDeletions( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_GLOBAL_DELETION dlg( frame() );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_GLOBAL_DELETION dlg( editFrame );
|
||||
|
||||
dlg.SetCurrentLayer( frame()->GetActiveLayer() );
|
||||
dlg.ShowModal();
|
||||
return 0;
|
||||
|
|
|
@ -410,9 +410,10 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
|||
|
||||
int GLOBAL_EDIT_TOOL::EditTextAndGraphics( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS dlg( frame() );
|
||||
dlg.ShowModal();
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS dlg( editFrame );
|
||||
|
||||
dlg.ShowModal();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -371,9 +371,10 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnSizeNetclassGrid( wxSizeEvent& event
|
|||
|
||||
int GLOBAL_EDIT_TOOL::EditTracksAndVias( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS dlg( frame() );
|
||||
dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS dlg( editFrame );
|
||||
|
||||
dlg.ShowQuasiModal(); // QuasiModal required for NET_SELECTOR
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcb_base_edit_frame.h>
|
||||
#include <grid_layer_box_helpers.h>
|
||||
#include <class_drawsegment.h>
|
||||
#include <class_track.h>
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS( PCB_EDIT_FRAME* aParent, PCB_LAYER_ID* aArray ) :
|
||||
DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS( PCB_BASE_EDIT_FRAME* aParent, PCB_LAYER_ID* aArray ) :
|
||||
DIALOG_SWAP_LAYERS_BASE( aParent ),
|
||||
m_parent( aParent ),
|
||||
m_layerDestinations( aArray )
|
||||
|
|
|
@ -33,13 +33,13 @@ class LAYER_GRID_TABLE;
|
|||
class DIALOG_SWAP_LAYERS : public DIALOG_SWAP_LAYERS_BASE
|
||||
{
|
||||
private:
|
||||
PCB_EDIT_FRAME* m_parent;
|
||||
PCB_BASE_EDIT_FRAME* m_parent;
|
||||
PCB_LAYER_ID* m_layerDestinations;
|
||||
|
||||
LAYER_GRID_TABLE* m_gridTable;
|
||||
|
||||
public:
|
||||
DIALOG_SWAP_LAYERS( PCB_EDIT_FRAME* aParent, PCB_LAYER_ID* aArray );
|
||||
DIALOG_SWAP_LAYERS( PCB_BASE_EDIT_FRAME* aParent, PCB_LAYER_ID* aArray );
|
||||
~DIALOG_SWAP_LAYERS() override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -407,7 +407,9 @@ static bool HasNonSMDPins( MODULE* aModule )
|
|||
|
||||
int PCB_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_GEN_FOOTPRINT_POSITION dlg( frame() );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_GEN_FOOTPRINT_POSITION dlg( editFrame );
|
||||
|
||||
dlg.ShowModal();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -757,10 +757,12 @@ bool ROUTER_TOOL::prepareInteractive()
|
|||
return false;
|
||||
}
|
||||
|
||||
frame()->SetActiveLayer( ToLAYER_ID( routingLayer ) );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
|
||||
editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) );
|
||||
|
||||
// Force layer visible
|
||||
frame()->GetLayerManager()->SetLayerVisible( routingLayer, true );
|
||||
editFrame->GetLayerManager()->SetLayerVisible( routingLayer, true );
|
||||
|
||||
// for some reason I don't understand, GetNetclass() may return null sometimes...
|
||||
if( m_startItem && m_startItem->Net() >= 0 &&
|
||||
|
@ -768,10 +770,10 @@ bool ROUTER_TOOL::prepareInteractive()
|
|||
{
|
||||
highlightNet( true, m_startItem->Net() );
|
||||
// Update track width and via size shown in main toolbar comboboxes
|
||||
frame()->SetCurrentNetClass( m_startItem->Parent()->GetNetClass()->GetName() );
|
||||
editFrame->SetCurrentNetClass( m_startItem->Parent()->GetNetClass()->GetName() );
|
||||
}
|
||||
else
|
||||
frame()->SetCurrentNetClass( NETCLASS::Default );
|
||||
editFrame->SetCurrentNetClass( NETCLASS::Default );
|
||||
|
||||
controls()->ForceCursorPosition( false );
|
||||
controls()->SetAutoPan( true );
|
||||
|
|
|
@ -1549,7 +1549,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
GRID_HELPER m_gridHelper;
|
||||
|
||||
VIA_PLACER( PCB_EDIT_FRAME* aFrame ) : m_gridHelper( aFrame )
|
||||
VIA_PLACER( PCB_BASE_EDIT_FRAME* aFrame ) : m_gridHelper( aFrame )
|
||||
{}
|
||||
|
||||
TRACK* findTrack( VIA* aVia )
|
||||
|
|
|
@ -143,7 +143,8 @@ int GLOBAL_EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent )
|
|||
|
||||
// invoke the exchange dialog process
|
||||
{
|
||||
DIALOG_EXCHANGE_FOOTPRINTS dialog( frame(), mod, updateMode, currentMode );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_EXCHANGE_FOOTPRINTS dialog( editFrame, mod, updateMode, currentMode );
|
||||
dialog.ShowQuasiModal();
|
||||
}
|
||||
|
||||
|
|
|
@ -506,14 +506,14 @@ int PCB_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_EDITOR_CONTROL::BoardSetup( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
frame()->DoShowBoardSetupDialog();
|
||||
getEditFrame<PCB_EDIT_FRAME>()->DoShowBoardSetupDialog();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PCB_EDITOR_CONTROL::ImportNetlist( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
frame()->InstallNetlistFrame();
|
||||
getEditFrame<PCB_EDIT_FRAME>()->InstallNetlistFrame();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -532,7 +532,7 @@ int PCB_EDITOR_CONTROL::ImportSpecctraSession( const TOOL_EVENT& aEvent )
|
|||
wxT( ".ses" ), wxT( "*.ses" ), frame(), wxFD_OPEN, false );
|
||||
|
||||
if( !fullFileName.IsEmpty() )
|
||||
frame()->ImportSpecctraSession( fullFileName );
|
||||
getEditFrame<PCB_EDIT_FRAME>()->ImportSpecctraSession( fullFileName );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ int PCB_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent )
|
|||
frame(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT, false );
|
||||
|
||||
if( !fullFileName.IsEmpty() )
|
||||
frame()->ExportSpecctraFile( fullFileName );
|
||||
getEditFrame<PCB_EDIT_FRAME>()->ExportSpecctraFile( fullFileName );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -596,14 +596,14 @@ int PCB_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCB_EDITOR_CONTROL::ToggleLayersManager( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
frame()->ToggleLayersManager();
|
||||
getEditFrame<PCB_EDIT_FRAME>()->ToggleLayersManager();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int PCB_EDITOR_CONTROL::ToggleMicrowaveToolbar( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
frame()->ToggleMicrowaveToolbar();
|
||||
getEditFrame<PCB_EDIT_FRAME>()->ToggleMicrowaveToolbar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ struct INTERACTIVE_PLACER_BASE
|
|||
virtual void SnapItem( BOARD_ITEM *aItem );
|
||||
virtual bool PlaceItem( BOARD_ITEM *aItem, BOARD_COMMIT& aCommit );
|
||||
|
||||
PCB_EDIT_FRAME* m_frame;
|
||||
PCB_BASE_EDIT_FRAME* m_frame;
|
||||
BOARD* m_board;
|
||||
int m_modifiers;
|
||||
};
|
||||
|
@ -134,14 +134,28 @@ protected:
|
|||
virtual void setTransitions() override;
|
||||
|
||||
|
||||
KIGFX::PCB_VIEW* view() const { return static_cast<KIGFX::PCB_VIEW*>( getView() ); }
|
||||
KIGFX::VIEW_CONTROLS* controls() const { return getViewControls(); }
|
||||
PCB_EDIT_FRAME* frame() const { return getEditFrame<PCB_EDIT_FRAME>(); }
|
||||
KIGFX::PCB_VIEW* view() const
|
||||
{
|
||||
return static_cast<KIGFX::PCB_VIEW*>( getView() );
|
||||
}
|
||||
|
||||
KIGFX::VIEW_CONTROLS* controls() const
|
||||
{
|
||||
return getViewControls();
|
||||
}
|
||||
|
||||
PCB_BASE_EDIT_FRAME* frame() const
|
||||
{
|
||||
return getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||
}
|
||||
|
||||
BOARD* board() const { return getModel<BOARD>(); }
|
||||
|
||||
MODULE* module() const
|
||||
{
|
||||
return board()->GetFirstModule();
|
||||
}
|
||||
|
||||
PCB_DISPLAY_OPTIONS* displayOptions() const;
|
||||
PCB_DRAW_PANEL_GAL* canvas() const;
|
||||
const PCBNEW_SELECTION& selection() const;
|
||||
|
|
|
@ -127,7 +127,7 @@ int ZONE_FILLER_TOOL::ZoneFillAll( const TOOL_EVENT& aEvent )
|
|||
filler.SetProgressReporter( progressReporter.get() );
|
||||
|
||||
if( filler.Fill( toFill ) )
|
||||
frame()->m_ZoneFillsDirty = false;
|
||||
getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty = false;
|
||||
|
||||
canvas()->Refresh();
|
||||
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
*/
|
||||
int GLOBAL_EDIT_TOOL::CleanupTracksAndVias( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
DIALOG_CLEANUP_TRACKS_AND_VIAS dlg( frame() );
|
||||
PCB_EDIT_FRAME* editFrame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
DIALOG_CLEANUP_TRACKS_AND_VIAS dlg( editFrame );
|
||||
|
||||
dlg.ShowModal();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue