From 81a1e9e83e9ef37c433b083ad06319788a2c1384 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 18 Jun 2024 17:49:00 -0400 Subject: [PATCH] Don't write out non-explicit tenting Fixes https://gitlab.com/kicad/code/kicad/-/issues/18230 --- .../pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp index de8d17a68f..07a68925f4 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp @@ -2250,23 +2250,26 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_TRACK* aTrack, int aNestLevel ) const m_out->Print( 0, ")" ); } - bool front = via->Padstack().FrontOuterLayers().has_solder_mask.value_or( false ); - bool back = via->Padstack().BackOuterLayers().has_solder_mask.value_or( false ); + std::optional front = via->Padstack().FrontOuterLayers().has_solder_mask; + std::optional back = via->Padstack().BackOuterLayers().has_solder_mask; - if( front || back ) + if( front.has_value() || back.has_value() ) { - m_out->Print( 0, " (tenting " ); + if( front.value_or( false ) || back.value_or( false ) ) + { + m_out->Print( 0, " (tenting " ); - if( via->Padstack().FrontOuterLayers().has_solder_mask.value_or( false ) ) - m_out->Print( 0, " front" ); - if( via->Padstack().BackOuterLayers().has_solder_mask.value_or( false ) ) - m_out->Print( 0, " back" ); + if( front.value_or( false ) ) + m_out->Print( 0, " front" ); + if( back.value_or( false ) ) + m_out->Print( 0, " back" ); - m_out->Print( 0, ")" ); - } - else - { - m_out->Print( 0, " (tenting none)" ); + m_out->Print( 0, ")" ); + } + else + { + m_out->Print( 0, " (tenting none)" ); + } } if( !isDefaultTeardropParameters( via->GetTeardropParams() ) )