Commit b0ad779e authored by Maciej Suminski's avatar Maciej Suminski

Calming down the Coverity report.

parent d819a380
......@@ -492,8 +492,15 @@ public:
{
wxASSERT( aLayer < (int) m_layers.size() );
try
{
return m_layers.at( aLayer ).target == TARGET_CACHED;
}
catch( std::out_of_range )
{
return false;
}
}
/**
* Function MarkDirty()
......
......@@ -82,6 +82,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_PcbTextSize = wxSize( DEFAULT_TEXT_PCB_SIZE,
DEFAULT_TEXT_PCB_SIZE ); // current Pcb (not module) Text size
m_useCustomTrackVia = false;
m_customTrackWidth = DMils2iu( 100 );
m_TrackMinWidth = DMils2iu( 100 ); // track min value for width (min copper size value)
m_ViasMinSize = DMils2iu( 350 ); // vias (not micro vias) min diameter
m_ViasMinDrill = DMils2iu( 200 ); // vias (not micro vias) min drill diameter
......
......@@ -800,6 +800,8 @@ EDA_ITEM* MODULE::Clone() const
void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
{
try
{
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
aFunction( static_cast<BOARD_ITEM*>( pad ) );
......@@ -808,6 +810,11 @@ void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
}
catch( boost::bad_function_call& e )
{
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
}
}
......
......@@ -52,7 +52,8 @@
#include <class_module.h>
DRAWING_TOOL::DRAWING_TOOL() :
TOOL_INTERACTIVE( "pcbnew.InteractiveDrawing" ), m_editModules( false )
TOOL_INTERACTIVE( "pcbnew.InteractiveDrawing" ), m_view( NULL ),
m_controls( NULL ), m_board( NULL ), m_frame( NULL ), m_editModules( false ), m_lineWidth( 1 )
{
}
......@@ -901,7 +902,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
// Init the new item attributes
aGraphic->SetShape( (STROKE_T) aShape );
aGraphic->SetWidth( lineWidth );
aGraphic->SetWidth( m_lineWidth );
aGraphic->SetStart( wxPoint( aStartingPoint->x, aStartingPoint->y ) );
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
aGraphic->SetLayer( layer );
......@@ -963,8 +964,8 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
{
// Init the new item attributes
aGraphic->SetShape( (STROKE_T) aShape );
lineWidth = getSegmentWidth( layer );
aGraphic->SetWidth( lineWidth );
m_lineWidth = getSegmentWidth( layer );
aGraphic->SetWidth( m_lineWidth );
aGraphic->SetStart( wxPoint( cursorPos.x, cursorPos.y ) );
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
aGraphic->SetLayer( layer );
......@@ -1012,17 +1013,17 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
{
lineWidth += WIDTH_STEP;
aGraphic->SetWidth( lineWidth );
m_lineWidth += WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
updatePreview = true;
}
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) )
{
if( lineWidth > (unsigned) WIDTH_STEP )
if( m_lineWidth > (unsigned) WIDTH_STEP )
{
lineWidth -= WIDTH_STEP;
aGraphic->SetWidth( lineWidth );
m_lineWidth -= WIDTH_STEP;
aGraphic->SetWidth( m_lineWidth );
updatePreview = true;
}
}
......
......@@ -203,7 +203,7 @@ private:
bool m_editModules;
/// Stores the current line width for multisegment drawing.
unsigned int lineWidth;
unsigned int m_lineWidth;
// How does line width change after one -/+ key press.
static const int WIDTH_STEP = 100000;
......
......@@ -43,7 +43,8 @@
#include "edit_tool.h"
EDIT_TOOL::EDIT_TOOL() :
TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ), m_editModules( false )
TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ),
m_dragging( false ), m_editModules( false ), m_updateFlag( KIGFX::VIEW_ITEM::NONE )
{
}
......@@ -51,6 +52,7 @@ EDIT_TOOL::EDIT_TOOL() :
void EDIT_TOOL::Reset( RESET_REASON aReason )
{
m_dragging = false;
m_updateFlag = KIGFX::VIEW_ITEM::NONE;
}
......
......@@ -47,7 +47,8 @@
#include <wx/defs.h>
MODULE_TOOLS::MODULE_TOOLS() :
TOOL_INTERACTIVE( "pcbnew.ModuleEditor" )
TOOL_INTERACTIVE( "pcbnew.ModuleEditor" ), m_view( NULL ), m_controls( NULL ),
m_board( NULL ), m_frame( NULL )
{
}
......
......@@ -47,7 +47,7 @@ public:
PCB_EDITOR_CONTROL::PCB_EDITOR_CONTROL() :
TOOL_INTERACTIVE( "pcbnew.EditorControl" )
TOOL_INTERACTIVE( "pcbnew.EditorControl" ), m_frame( NULL )
{
}
......
......@@ -41,7 +41,7 @@
PCBNEW_CONTROL::PCBNEW_CONTROL() :
TOOL_INTERACTIVE( "pcbnew.Control" )
TOOL_INTERACTIVE( "pcbnew.Control" ), m_frame( NULL )
{
}
......
......@@ -34,7 +34,7 @@
#include <boost/foreach.hpp>
PLACEMENT_TOOL::PLACEMENT_TOOL() :
TOOL_INTERACTIVE( "pcbnew.Placement" )
TOOL_INTERACTIVE( "pcbnew.Placement" ), m_selectionTool( NULL )
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment