From 352f1a025ca85661683e54dc76dc55e505200660 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 28 Dec 2016 10:00:39 +0100 Subject: [PATCH] Better compatibility with previous Pcbnew versions: save diff pair prms only when values are not set to default values --- pcbnew/class_netclass.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pcbnew/class_netclass.cpp b/pcbnew/class_netclass.cpp index 88d23420cc..c10f7c8cbb 100644 --- a/pcbnew/class_netclass.cpp +++ b/pcbnew/class_netclass.cpp @@ -264,8 +264,14 @@ void NETCLASS::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl aFormatter->Print( aNestLevel+1, "(uvia_dia %s)\n", FMT_IU( GetuViaDiameter() ).c_str() ); aFormatter->Print( aNestLevel+1, "(uvia_drill %s)\n", FMT_IU( GetuViaDrill() ).c_str() ); - aFormatter->Print( aNestLevel+1, "(diff_pair_gap %s)\n", FMT_IU( GetDiffPairGap() ).c_str() ); - aFormatter->Print( aNestLevel+1, "(diff_pair_width %s)\n", FMT_IU( GetDiffPairWidth() ).c_str() ); + // Save the diff_pair_gap and diff_pair_width values only if not the default, to avoid unnecessary + // incompatibility with previous Pcbnew versions. + if( ( DEFAULT_DIFF_PAIR_WIDTH != GetDiffPairWidth() ) || + ( DEFAULT_DIFF_PAIR_GAP != GetDiffPairGap() ) ) + { + aFormatter->Print( aNestLevel+1, "(diff_pair_gap %s)\n", FMT_IU( GetDiffPairGap() ).c_str() ); + aFormatter->Print( aNestLevel+1, "(diff_pair_width %s)\n", FMT_IU( GetDiffPairWidth() ).c_str() ); + } for( NETCLASS::const_iterator it = begin(); it != end(); ++it )