Use auto to reduce some verbosity.
This commit is contained in:
@@ -31,23 +31,23 @@ void glbarcode::Renderer::render( double w, double h, const std::list<DrawingPri
|
||||
|
||||
for ( primitive = primitives.begin(); primitive != primitives.end(); primitive++ )
|
||||
{
|
||||
if ( DrawingPrimitiveLine* line = dynamic_cast<DrawingPrimitiveLine*>(*primitive) )
|
||||
if ( auto* line = dynamic_cast<DrawingPrimitiveLine*>(*primitive) )
|
||||
{
|
||||
drawLine( line->x(), line->y(), line->w(), line->h() );
|
||||
}
|
||||
else if ( DrawingPrimitiveBox* box = dynamic_cast<DrawingPrimitiveBox*>(*primitive) )
|
||||
else if ( auto* box = dynamic_cast<DrawingPrimitiveBox*>(*primitive) )
|
||||
{
|
||||
drawBox( box->x(), box->y(), box->w(), box->h() );
|
||||
}
|
||||
else if ( DrawingPrimitiveText* text = dynamic_cast<DrawingPrimitiveText*>(*primitive) )
|
||||
else if ( auto* text = dynamic_cast<DrawingPrimitiveText*>(*primitive) )
|
||||
{
|
||||
drawText( text->x(), text->y(), text->size(), text->text() );
|
||||
}
|
||||
else if ( DrawingPrimitiveRing* ring = dynamic_cast<DrawingPrimitiveRing*>(*primitive) )
|
||||
else if ( auto* ring = dynamic_cast<DrawingPrimitiveRing*>(*primitive) )
|
||||
{
|
||||
drawRing( ring->x(), ring->y(), ring->r(), ring->w() );
|
||||
}
|
||||
else if ( DrawingPrimitiveHexagon* hex = dynamic_cast<DrawingPrimitiveHexagon*>(*primitive) )
|
||||
else if ( auto* hex = dynamic_cast<DrawingPrimitiveHexagon*>(*primitive) )
|
||||
{
|
||||
drawHexagon( hex->x(), hex->y(), hex->h() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user