Pass wxPoint objects by reference instead of on the stack.

This commit is contained in:
Wayne Stambaugh
2021-07-26 15:35:33 -04:00
parent f6cac49802
commit 8fd83cbb95
39 changed files with 218 additions and 183 deletions
+7 -5
View File
@@ -209,7 +209,7 @@ static std::vector<BOARD_ITEM*> initTextTable( std::vector<std::vector<PCB_TEXT*
std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawSpecificationStackup(
wxPoint aOrigin, PCB_LAYER_ID aLayer, bool aDrawNow, wxPoint* tableSize )
const wxPoint& aOrigin, PCB_LAYER_ID aLayer, bool aDrawNow, wxPoint* tableSize )
{
BOARD_COMMIT commit( m_frame );
std::vector<std::vector<PCB_TEXT*>> texts;
@@ -296,6 +296,7 @@ std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawSpecificationStackup(
// If the user did not open the dialog, then get the names from the board.
// But dielectric layer names will be missing.
t = static_cast<PCB_TEXT*>( dataStyle->Duplicate() );
if( layers.at( i )->GetLayerName().IsEmpty() )
{
t->SetText( m_frame->GetBoard()->GetLayerName( layers.at( i )->GetBrdLayerId() ) );
@@ -304,6 +305,7 @@ std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawSpecificationStackup(
{
t->SetText( layers.at( i )->GetLayerName() );
}
colLayer.push_back( t );
t = static_cast<PCB_TEXT*>( dataStyle->Duplicate() );
@@ -342,12 +344,10 @@ std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawSpecificationStackup(
texts.push_back( colColor );
texts.push_back( colEpsilon );
texts.push_back( colTanD );
std::vector<BOARD_ITEM*> table =
initTextTable( texts, aOrigin, aLayer, tableSize, true );
std::vector<BOARD_ITEM*> table = initTextTable( texts, aOrigin, aLayer, tableSize, true );
if( aDrawNow )
{
for( auto item : table )
commit.Add( item );
@@ -359,7 +359,7 @@ std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawSpecificationStackup(
std::vector<BOARD_ITEM*> DRAWING_TOOL::DrawBoardCharacteristics(
wxPoint aOrigin, PCB_LAYER_ID aLayer, bool aDrawNow, wxPoint* tableSize )
const wxPoint& aOrigin, PCB_LAYER_ID aLayer, bool aDrawNow, wxPoint* tableSize )
{
BOARD_COMMIT commit( m_frame );
std::vector<BOARD_ITEM*> objects;
@@ -671,6 +671,7 @@ int DRAWING_TOOL::InteractivePlaceWithPreview( const TOOL_EVENT& aEvent,
return 0;
}
int DRAWING_TOOL::PlaceCharacteristics( const TOOL_EVENT& aEvent )
{
wxPoint tableSize = wxPoint();
@@ -744,6 +745,7 @@ int DRAWING_TOOL::PlaceCharacteristics( const TOOL_EVENT& aEvent )
return 0;
}
int DRAWING_TOOL::PlaceStackup( const TOOL_EVENT& aEvent )
{
wxPoint tableSize = wxPoint();