Cannot use two layers of temporary in range-for (yet)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6244
This commit is contained in:
Jon Evans 2020-10-31 15:13:30 -04:00
parent 33e54f136b
commit 52cb410952
2 changed files with 4 additions and 2 deletions

View File

@ -619,7 +619,7 @@ void EDA_TEXT::TransformTextShapeToSegmentList( std::vector<wxPoint>& aCornerBuf
std::shared_ptr<SHAPE_COMPOUND> EDA_TEXT::GetEffectiveTextShape( ) const std::shared_ptr<SHAPE_COMPOUND> EDA_TEXT::GetEffectiveTextShape( ) const
{ {
std::shared_ptr<SHAPE_COMPOUND> shape ( new SHAPE_COMPOUND ); std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
int penWidth = GetEffectiveTextPenWidth(); int penWidth = GetEffectiveTextPenWidth();
std::vector<wxPoint> pts; std::vector<wxPoint> pts;
TransformTextShapeToSegmentList( pts ); TransformTextShapeToSegmentList( pts );

View File

@ -375,7 +375,9 @@ std::vector<SHAPE*> DIMENSION::MakeEffectiveShapes() const
{ {
std::vector<SHAPE*> effectiveShapes; std::vector<SHAPE*> effectiveShapes;
for( SHAPE* shape : Text().GetEffectiveTextShape()->Shapes() ) std::shared_ptr<SHAPE_COMPOUND> ets = Text().GetEffectiveTextShape();
for( const SHAPE* shape : ets->Shapes() )
effectiveShapes.emplace_back( shape->Clone() ); effectiveShapes.emplace_back( shape->Clone() );
for( const std::shared_ptr<SHAPE>& shape : GetShapes() ) for( const std::shared_ptr<SHAPE>& shape : GetShapes() )