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
{
aOutput->Print( aIndentLevel, "(fp_lib_table\n" );

View File

@ -122,6 +122,11 @@ public:
*/
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
*

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* 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
* modify it under the terms of the GNU General Public License