Use a yes/no for the suppress_zeroes bool in the format

Roll this into the prior version bump for the dimension arrow
directions.
This commit is contained in:
John Beard
2024-10-30 21:22:37 +08:00
parent d973fd723e
commit a59cd7401a
3 changed files with 8 additions and 4 deletions
@@ -944,8 +944,11 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_DIMENSION_BASE* aDimension, int aNest
m_out->Quotew( aDimension->GetOverrideText() ).c_str() );
}
if( aDimension->GetSuppressZeroes() )
m_out->Print( 0, " suppress_zeroes" );
if( bool suppressZeroes = aDimension->GetSuppressZeroes() )
{
KICAD_FORMAT::FormatBool( m_out, 0, "suppress_zeroes", suppressZeroes );
}
m_out->Print( 0, ")\n" );
}
@@ -169,7 +169,7 @@ class PCB_IO_KICAD_SEXPR; // forward decl
//#define SEXPR_BOARD_FILE_VERSION 20241007 // Tracks can have soldermask layer and margin
//#define SEXPR_BOARD_FILE_VERSION 20241009 // Evolve placement rule areas file format
//#define SEXPR_BOARD_FILE_VERSION 20241010 // Graphic shapes can have soldermask layer and margin
#define SEXPR_BOARD_FILE_VERSION 20241030 // Dimension arrow directions
#define SEXPR_BOARD_FILE_VERSION 20241030 // Dimension arrow directions, suppress_zeroes normalization
#define BOARD_FILE_HOST_VERSION 20200825 ///< Earlier files than this include the host tag
#define LEGACY_ARC_FORMATTING 20210925 ///< These were the last to use old arc formatting
@@ -4085,10 +4085,11 @@ PCB_DIMENSION_BASE* PCB_IO_KICAD_SEXPR_PARSER::parseDIMENSION( BOARD_ITEM* aPare
break;
case T_suppress_zeroes:
dim->SetSuppressZeroes( true );
dim->SetSuppressZeroes( parseMaybeAbsentBool( true ) );
break;
default:
std::cerr << "Unknown format token: " << GetTokenString( token ) << std::endl;
Expecting( "prefix, suffix, units, units_format, precision, override_value, "
"suppress_zeroes" );
}