From 3a618567bbf8e3595bec4f53bd509586480b93d0 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Sat, 7 Feb 2009 16:45:07 +0000 Subject: [PATCH] netless zone support fix to specctra export --- pcbnew/specctra.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index b30a2735ab..44c8672f0b 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -2465,10 +2465,6 @@ struct PIN_REF : public ELEM // the quotes unconditional on this one. const char* newline = nestLevel ? "\n" : ""; -#if 0 - return out->Print( nestLevel, "\"%s\"-\"%s\"%s", - component_id.c_str(), pin_id.c_str(), newline ); -#else const char* cquote = out->GetQuoteChar( component_id.c_str() ); const char* pquote = out->GetQuoteChar( pin_id.c_str() ); @@ -2476,7 +2472,6 @@ struct PIN_REF : public ELEM cquote, component_id.c_str(), cquote, pquote, pin_id.c_str(), pquote, newline ); -#endif } }; typedef std::vector PIN_REFS; @@ -2583,7 +2578,11 @@ public: }; typedef boost::ptr_vector COMP_ORDERS; - +/** + * Class NET + * corresponds to a <net_descriptor> + * in the DSN spec. + */ class NET : public ELEM { friend class SPECCTRA_DB; @@ -2635,7 +2634,6 @@ public: delete comp_order; } - int FindPIN_REF( const std::string& aComponent ) { for( unsigned i=0; iGetQuoteChar( net_id.c_str() ); @@ -2669,22 +2666,25 @@ public: out->Print( 0, "\n" ); - const int RIGHTMARGIN = 80; - int perLine = out->Print( nestLevel+1, "(%s", LEXER::GetTokenText( pins_type ) ); - - for( PIN_REFS::iterator i=pins.begin(); i!=pins.end(); ++i ) + if( pins.size() ) { - if( perLine > RIGHTMARGIN ) - { - out->Print( 0, "\n"); - perLine = out->Print( nestLevel+2, "%s", "" ); - } - else - perLine += out->Print( 0, " " ); + const int RIGHTMARGIN = 80; + int perLine = out->Print( nestLevel+1, "(%s", LEXER::GetTokenText( pins_type ) ); - perLine += i->FormatIt( out, 0 ); + for( PIN_REFS::iterator i=pins.begin(); i!=pins.end(); ++i ) + { + if( perLine > RIGHTMARGIN ) + { + out->Print( 0, "\n"); + perLine = out->Print( nestLevel+2, "%s", "" ); + } + else + perLine += out->Print( 0, " " ); + + perLine += i->FormatIt( out, 0 ); + } + out->Print( 0, ")\n" ); } - out->Print( 0, ")\n" ); if( comp_order ) comp_order->Format( out, nestLevel+1 );