diff --git a/.bzrignore b/.bzrignore index 134cb81e0e..58d900b762 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,7 +1,10 @@ -eeschema/cmp_library_keywords.cpp -eeschema/cmp_library_keywords.h -eeschema/template_fieldnames_keywords.cpp -eeschema/template_fieldnames_keywords.h +common/netlist_keywords.* +common/netlist_lexer.h +include/netlist_lexer.h +eeschema/cmp_library_lexer.h +eeschema/cmp_library_keywords.* +eeschema/template_fieldnames_keywords.* +eeschema/template_fieldnames_lexer.h pcbnew/dialog_freeroute_exchange_help_html.h Makefile CMakeFiles diff --git a/eeschema/build_BOM.cpp b/eeschema/build_BOM.cpp index 035c284028..6ba9d732ee 100644 --- a/eeschema/build_BOM.cpp +++ b/eeschema/build_BOM.cpp @@ -322,9 +322,8 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName, { sort( listOfLabels.begin(), listOfLabels.end(), SortLabelsBySheet ); - msg.Printf( _( - "\n#Global, Hierarchical Labels and PinSheets " - "( order = Sheet Number ) count = %d\n" ), + msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets \ +( order = Sheet Number ) count = %d\n" ), itemCount ); fprintf( f, "%s", CONV_TO_UTF8( msg ) ); @@ -335,9 +334,8 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName, { sort( listOfLabels.begin(), listOfLabels.end(), SortLabelsByValue ); - msg.Printf( _( - "\n#Global, Hierarchical Labels and PinSheets ( " - "order = Alphab. ) count = %d\n\n" ), + msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets ( \ +order = Alphab. ) count = %d\n\n" ), itemCount ); fprintf( f, "%s", CONV_TO_UTF8( msg ) ); @@ -449,8 +447,7 @@ static void GenListeGLabels( std::vector & aList ) * if same value: by reference * if same reference: by unit number */ -bool SortComponentsByValue( const OBJ_CMP_TO_LIST& obj1, - const OBJ_CMP_TO_LIST& obj2 ) +bool SortComponentsByValue( const OBJ_CMP_TO_LIST& obj1, const OBJ_CMP_TO_LIST& obj2 ) { int ii; const wxString* Text1, * Text2; @@ -607,12 +604,12 @@ void DIALOG_BUILD_BOM::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, if( CompactForm ) { fprintf( f, "%c%s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( DrawLibItem->GetField( FOOTPRINT )->m_Text ) ); + CONV_TO_UTF8( DrawLibItem->GetField( FOOTPRINT )->m_Text ) ); } else { fprintf( f, "; %-12s", - CONV_TO_UTF8( DrawLibItem->GetField( FOOTPRINT )->m_Text ) ); + CONV_TO_UTF8( DrawLibItem->GetField( FOOTPRINT )->m_Text ) ); } } @@ -623,10 +620,10 @@ void DIALOG_BUILD_BOM::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, if( CompactForm ) fprintf( f, "%c%s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( DrawLibItem->GetField( ii )->m_Text ) ); + CONV_TO_UTF8( DrawLibItem->GetField( ii )->m_Text ) ); else fprintf( f, "; %-12s", - CONV_TO_UTF8( DrawLibItem->GetField( ii )->m_Text ) ); + CONV_TO_UTF8( DrawLibItem->GetField( ii )->m_Text ) ); } } @@ -666,8 +663,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( msg = _( "Field" ); - fprintf( f, "%c%s%d", s_ExportSeparatorSymbol, CONV_TO_UTF8( - msg ), ii - FIELD1 + 1 ); + fprintf( f, "%c%s%d", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ), ii - FIELD1 + 1 ); } fprintf( f, "\n" ); @@ -716,22 +712,21 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( if( CompactForm ) #if defined(KICAD_GOST) fprintf( f, "%s%c%s%c%s", CmpName.c_str(), s_ExportSeparatorSymbol, - CONV_TO_UTF8( comp->GetField( - VALUE )->m_Text ), s_ExportSeparatorSymbol, - CONV_TO_UTF8( comp->GetField( DATASHEET )->m_Text ) ); + CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ), s_ExportSeparatorSymbol, + CONV_TO_UTF8( comp->GetField( DATASHEET )->m_Text ) ); #else fprintf( f, "%s%c%s", CmpName.c_str(), s_ExportSeparatorSymbol, - CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ) ); + CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ) ); #endif else #if defined(KICAD_GOST) fprintf( f, "| %-10s %-12s %-20s", CmpName.c_str(), - CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ), - CONV_TO_UTF8( comp->GetField( DATASHEET )->m_Text ) ); + CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ), + CONV_TO_UTF8( comp->GetField( DATASHEET )->m_Text ) ); #else fprintf( f, "| %-10s %-12s", CmpName.c_str(), - CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ) ); + CONV_TO_UTF8( comp->GetField( VALUE )->m_Text ) ); #endif if( aIncludeSubComponents ) @@ -740,23 +735,20 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( if( CompactForm ) { - fprintf( f, "%c%s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( msg ) ); + fprintf( f, "%c%s", s_ExportSeparatorSymbol, CONV_TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( - (BASE_SCREEN*) comp->GetParent(), - comp->m_Pos ); + msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) comp->GetParent(), + comp->m_Pos ); fprintf( f, "%c%s)", s_ExportSeparatorSymbol, - CONV_TO_UTF8( msg ) ); + CONV_TO_UTF8( msg ) ); } else { fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( - (BASE_SCREEN*) comp->GetParent(), - comp->m_Pos ); + msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) comp->GetParent(), + comp->m_Pos ); fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) ); } @@ -866,16 +858,16 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( if( IsFieldChecked(FOOTPRINT ) ) fprintf( f, "%c%15s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( currCmp->GetField( FOOTPRINT )->m_Text ) ); + CONV_TO_UTF8( currCmp->GetField( FOOTPRINT )->m_Text ) ); #if defined(KICAD_GOST) fprintf( f, "%c%20s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( currCmp->GetField( DATASHEET )->m_Text ) ); + CONV_TO_UTF8( currCmp->GetField( DATASHEET )->m_Text ) ); #endif // wrap the field in quotes, since it has commas in it. fprintf( f, "%c\"%s\"", s_ExportSeparatorSymbol, - CONV_TO_UTF8( refNames ) ); + CONV_TO_UTF8( refNames ) ); // print fields, on demand int last_nonempty_field_idx = 0; @@ -888,7 +880,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( { if ( IsFieldChecked( jj ) ) fprintf( f, "%c%4s", s_ExportSeparatorSymbol, - CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) ); + CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) ); } fprintf( f, "\n" ); @@ -959,8 +951,8 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( { msg = aList[ii].m_SheetPath.PathHumanReadable(); fprintf( f, " (Sheet %s)", CONV_TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( - (BASE_SCREEN*) DrawLibItem->GetParent(), DrawLibItem->m_Pos ); + msg = m_Parent->GetXYSheetReferences( (BASE_SCREEN*) DrawLibItem->GetParent(), + DrawLibItem->m_Pos ); fprintf( f, " (loc %s)", CONV_TO_UTF8( msg ) ); } @@ -996,13 +988,12 @@ static int PrintListeGLabel( FILE* f, std::vector & aList ) labeltype = wxT( "Global " ); sheetpath = aList[ii].m_SheetPath.PathHumanReadable(); - msg.Printf( - _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ), - GetChars( DrawTextItem->m_Text ), - GetChars( labeltype ), - GetChars( sheetpath ), - (float) DrawTextItem->m_Pos.x / 1000, - (float) DrawTextItem->m_Pos.y / 1000 ); + msg.Printf( _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ), + GetChars( DrawTextItem->m_Text ), + GetChars( labeltype ), + GetChars( sheetpath ), + (float) DrawTextItem->m_Pos.x / 1000, + (float) DrawTextItem->m_Pos.y / 1000 ); fputs( CONV_TO_UTF8( msg ), f ); break; @@ -1020,13 +1011,12 @@ static int PrintListeGLabel( FILE* f, std::vector & aList ) wxString labtype = CONV_FROM_UTF8( SheetLabelType[jj] ); - msg.Printf( - _( "> %-28.28s PinSheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n" ), - GetChars( DrawSheetLabel->m_Text ), - GetChars( labtype ), - GetChars( aList[ii].m_SheetPath.PathHumanReadable()), - (float) DrawSheetLabel->m_Pos.x / 1000, - (float) DrawSheetLabel->m_Pos.y / 1000 ); + msg.Printf( _( "> %-28.28s PinSheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n" ), + GetChars( DrawSheetLabel->m_Text ), + GetChars( labtype ), + GetChars( aList[ii].m_SheetPath.PathHumanReadable() ), + (float) DrawSheetLabel->m_Pos.x / 1000, + (float) DrawSheetLabel->m_Pos.y / 1000 ); fputs( CONV_TO_UTF8( msg ), f ); } diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 89a6e4639d..ac5d2aff4f 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -398,8 +398,8 @@ void LIB_COMPONENT::RemoveDrawItem( LIB_DRAW_ITEM* aItem, if( field->m_FieldId < MANDATORY_FIELDS ) { - wxLogWarning( _( "An attempt was made to remove the %s field " - "from component %s in library %s." ), + wxLogWarning( _( "An attempt was made to remove the %s field \ +from component %s in library %s." ), GetChars( field->m_Name ), GetChars( GetName() ), GetChars( GetLibraryName() ) ); return; @@ -854,8 +854,8 @@ bool LIB_COMPONENT::LoadDrawEntries( FILE* aFile, char* aLine, { if( GetLine( aFile, aLine, aLineNum, LINE_BUFFER_LEN_LARGE ) == NULL ) { - aErrorMsg = wxT( "file ended prematurely while attempting " - "to flush to end of drawing section." ); + aErrorMsg = wxT( "file ended prematurely while attempting \ +to flush to end of drawing section." ); return false; } } while( strncmp( aLine, "ENDDRAW", 7 ) != 0 ); diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 4943f253f9..7800322c04 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -298,7 +298,10 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent ) msg << wxT( "\n\n" ) << _( "All old aliases will be removed. Continue ?" ); int diag = wxMessageBox( msg, title, wxYES | wxICON_QUESTION ); if( diag != wxYES ) + { + delete newCmp; return NULL; + } } } diff --git a/eeschema/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialog_edit_libentry_fields_in_lib.cpp index 1b0f2e05fd..53710a608f 100644 --- a/eeschema/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialog_edit_libentry_fields_in_lib.cpp @@ -226,8 +226,8 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick( wxCommandEvent& event if( newvalue->CmpNoCase( m_LibEntry->m_AliasList[i] ) == 0 ) { wxString msg; - msg.Printf( _( "A new name is entered for this component\n" - "An alias %s already exists!\nCannot update this component" ), + msg.Printf( _( "A new name is entered for this component\n\ +An alias %s already exists!\nCannot update this component" ), newvalue->GetData() ); DisplayError( this, msg ); return;