Pcbnew: fix issue in dialog_fp_lib_table: when the only changes were the plugin name, changes were not taken in account.

Because the FP_LIB_TABLE::operator == was incorrect
This commit is contained in:
jean-pierre charras 2017-06-30 16:03:01 +02:00
parent 22a8df69c4
commit e3d69b619f
4 changed files with 27 additions and 5 deletions

View File

@ -186,6 +186,23 @@ void FP_LIB_TABLE::Parse( LIB_TABLE_LEXER* in )
} }
bool FP_LIB_TABLE::operator==( const FP_LIB_TABLE& aFpTable ) const
{
if( rows.size() == aFpTable.rows.size() )
{
for( unsigned i = 0; i < rows.size(); ++i )
{
if( (FP_LIB_TABLE_ROW&)rows[i] != (FP_LIB_TABLE_ROW&)aFpTable.rows[i] )
return false;
}
return true;
}
return false;
}
void FP_LIB_TABLE::Format( OUTPUTFORMATTER* aOutput, int aIndentLevel ) const void FP_LIB_TABLE::Format( OUTPUTFORMATTER* aOutput, int aIndentLevel ) const
{ {
aOutput->Print( aIndentLevel, "(fp_lib_table\n" ); aOutput->Print( aIndentLevel, "(fp_lib_table\n" );

View File

@ -122,6 +122,11 @@ public:
*/ */
FP_LIB_TABLE( FP_LIB_TABLE* aFallBackTable = NULL ); FP_LIB_TABLE( FP_LIB_TABLE* aFallBackTable = NULL );
bool operator==( const FP_LIB_TABLE& aFpTable ) const;
bool operator!=( const FP_LIB_TABLE& r ) const { return !( *this == r ); }
/** /**
* Function FindRow * Function FindRow
* *

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 CERN * Copyright (C) 2013 CERN
* Copyright (C) 2012-2017 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2012-2017 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View File

@ -248,25 +248,25 @@ int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( wxString aNetName, wxString& aCompl
aComplementNet = "P"; aComplementNet = "P";
rv = -1; rv = -1;
} }
// Match P followed by 2 digits // Match P followed by 2 digits
else if( aNetName.Right( 2 ).IsNumber() && aNetName.Right( 3 ).Left( 1 ) == "P" ) else if( aNetName.Right( 2 ).IsNumber() && aNetName.Right( 3 ).Left( 1 ) == "P" )
{ {
aComplementNet = "N" + aNetName.Right( 2 ); aComplementNet = "N" + aNetName.Right( 2 );
rv = 1; rv = 1;
} }
// Match P followed by 1 digit // Match P followed by 1 digit
else if( aNetName.Right( 1 ).IsNumber() && aNetName.Right( 2 ).Left( 1 ) == "P" ) else if( aNetName.Right( 1 ).IsNumber() && aNetName.Right( 2 ).Left( 1 ) == "P" )
{ {
aComplementNet = "N" + aNetName.Right( 1 ); aComplementNet = "N" + aNetName.Right( 1 );
rv = 1; rv = 1;
} }
// Match N followed by 2 digits // Match N followed by 2 digits
else if( aNetName.Right( 2 ).IsNumber() && aNetName.Right( 3 ).Left( 1 ) == "N" ) else if( aNetName.Right( 2 ).IsNumber() && aNetName.Right( 3 ).Left( 1 ) == "N" )
{ {
aComplementNet = "P" + aNetName.Right( 2 ); aComplementNet = "P" + aNetName.Right( 2 );
rv = -1; rv = -1;
} }
// Match N followed by 1 digit // Match N followed by 1 digit
else if( aNetName.Right( 1 ).IsNumber() && aNetName.Right( 2 ).Left( 1 ) == "N" ) else if( aNetName.Right( 1 ).IsNumber() && aNetName.Right( 2 ).Left( 1 ) == "N" )
{ {
aComplementNet = "P" + aNetName.Right( 1 ); aComplementNet = "P" + aNetName.Right( 1 );