Remove some more unneeded atof() calls
This commit is contained in:
parent
ac479a1c75
commit
016bffc899
|
@ -968,11 +968,11 @@ FABMASTER::GRAPHIC_LINE* FABMASTER::processLine( const FABMASTER::GRAPHIC_DATA&
|
|||
GRAPHIC_LINE* new_line = new GRAPHIC_LINE ;
|
||||
|
||||
new_line->shape = GR_SHAPE_LINE;
|
||||
new_line->start_x = KiROUND( std::atof( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_line->start_y = -KiROUND( std::atof( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_line->end_x = KiROUND( std::atof( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_line->end_y = -KiROUND( std::atof( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_line->width = KiROUND( std::atof( aData.graphic_data5.c_str() ) * aScale );
|
||||
new_line->start_x = KiROUND( readDouble( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_line->start_y = -KiROUND( readDouble( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_line->end_x = KiROUND( readDouble( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_line->end_y = -KiROUND( readDouble( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_line->width = KiROUND( readDouble( aData.graphic_data5.c_str() ) * aScale );
|
||||
|
||||
return new_line;
|
||||
}
|
||||
|
@ -982,14 +982,14 @@ FABMASTER::GRAPHIC_ARC* FABMASTER::processArc( const FABMASTER::GRAPHIC_DATA& aD
|
|||
GRAPHIC_ARC* new_arc = new GRAPHIC_ARC ;
|
||||
|
||||
new_arc->shape = GR_SHAPE_ARC;
|
||||
new_arc->start_x = KiROUND( std::atof( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_arc->start_y = -KiROUND( std::atof( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_arc->end_x = KiROUND( std::atof( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_arc->end_y = -KiROUND( std::atof( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_arc->center_x = KiROUND( std::atof( aData.graphic_data5.c_str() ) * aScale );
|
||||
new_arc->center_y = -KiROUND( std::atof( aData.graphic_data6.c_str() ) * aScale );
|
||||
new_arc->radius = KiROUND( std::atof( aData.graphic_data7.c_str() ) * aScale );
|
||||
new_arc->width = KiROUND( std::atof( aData.graphic_data8.c_str() ) * aScale );
|
||||
new_arc->start_x = KiROUND( readDouble( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_arc->start_y = -KiROUND( readDouble( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_arc->end_x = KiROUND( readDouble( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_arc->end_y = -KiROUND( readDouble( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_arc->center_x = KiROUND( readDouble( aData.graphic_data5.c_str() ) * aScale );
|
||||
new_arc->center_y = -KiROUND( readDouble( aData.graphic_data6.c_str() ) * aScale );
|
||||
new_arc->radius = KiROUND( readDouble( aData.graphic_data7.c_str() ) * aScale );
|
||||
new_arc->width = KiROUND( readDouble( aData.graphic_data8.c_str() ) * aScale );
|
||||
|
||||
new_arc->clockwise = ( aData.graphic_data9 != "COUNTERCLOCKWISE" );
|
||||
|
||||
|
@ -1028,10 +1028,10 @@ FABMASTER::GRAPHIC_RECTANGLE* FABMASTER::processRectangle( const FABMASTER::GRAP
|
|||
GRAPHIC_RECTANGLE* new_rect = new GRAPHIC_RECTANGLE;
|
||||
|
||||
new_rect->shape = GR_SHAPE_RECTANGLE;
|
||||
new_rect->start_x = KiROUND( std::atof( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_rect->start_y = -KiROUND( std::atof( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_rect->end_x = KiROUND( std::atof( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_rect->end_y = -KiROUND( std::atof( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_rect->start_x = KiROUND( readDouble( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_rect->start_y = -KiROUND( readDouble( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_rect->end_x = KiROUND( readDouble( aData.graphic_data3.c_str() ) * aScale );
|
||||
new_rect->end_y = -KiROUND( readDouble( aData.graphic_data4.c_str() ) * aScale );
|
||||
new_rect->fill = aData.graphic_data5 == "1";
|
||||
new_rect->width = 0;
|
||||
|
||||
|
@ -1043,9 +1043,9 @@ FABMASTER::GRAPHIC_TEXT* FABMASTER::processText( const FABMASTER::GRAPHIC_DATA&
|
|||
GRAPHIC_TEXT* new_text = new GRAPHIC_TEXT;
|
||||
|
||||
new_text->shape = GR_SHAPE_TEXT;
|
||||
new_text->start_x = KiROUND( std::atof( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_text->start_y = -KiROUND( std::atof( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_text->rotation = KiROUND( std::atof( aData.graphic_data3.c_str() ) );
|
||||
new_text->start_x = KiROUND( readDouble( aData.graphic_data1.c_str() ) * aScale );
|
||||
new_text->start_y = -KiROUND( readDouble( aData.graphic_data2.c_str() ) * aScale );
|
||||
new_text->rotation = KiROUND( readDouble( aData.graphic_data3.c_str() ) );
|
||||
new_text->mirror = ( aData.graphic_data4 == "YES" );
|
||||
|
||||
if( aData.graphic_data5 == "RIGHT" )
|
||||
|
@ -1071,12 +1071,12 @@ FABMASTER::GRAPHIC_TEXT* FABMASTER::processText( const FABMASTER::GRAPHIC_DATA&
|
|||
{
|
||||
// 0 = size
|
||||
// 1 = font
|
||||
new_text->height = KiROUND( std::atof( toks[2].c_str() ) * aScale );
|
||||
new_text->width = KiROUND( std::atof( toks[3].c_str() ) * aScale );
|
||||
new_text->ital = std::atof( toks[4].c_str() ) != 0.0;
|
||||
new_text->height = KiROUND( readDouble( toks[2].c_str() ) * aScale );
|
||||
new_text->width = KiROUND( readDouble( toks[3].c_str() ) * aScale );
|
||||
new_text->ital = readDouble( toks[4].c_str() ) != 0.0;
|
||||
// 5 = character spacing
|
||||
// 6 = line spacing
|
||||
new_text->thickness = KiROUND( std::atof( toks[7].c_str() ) * aScale );
|
||||
new_text->thickness = KiROUND( readDouble( toks[7].c_str() ) * aScale );
|
||||
}
|
||||
|
||||
new_text->text = aData.graphic_data7;
|
||||
|
|
Loading…
Reference in New Issue