diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index d3bc8ea108..d6f4a28c7f 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -530,13 +530,14 @@ wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() wxString filename = fn.GetName(); wxString sheetFullName = m_CurrentSheet->PathHumanReadable(); - sheetFullName.Trim( true ); - sheetFullName.Trim( false ); // Remove the last '/' of the path human readable // (and for the root sheet, make sheetFullName empty): sheetFullName.RemoveLast(); + sheetFullName.Trim( true ); + sheetFullName.Trim( false ); + // Convert path human readable separator to '-' sheetFullName.Replace( wxT( "/" ), wxT( "-" ) ); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 7e50e8f82a..ef4bbf3266 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -1090,7 +1090,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const wxPoint shapeoffset = aPad->GetOffset(); if( (sz.GetWidth() > 0) || (sz.GetHeight() > 0) || - (shapeoffset.x > 0) || (shapeoffset.y > 0) ) + (shapeoffset.x != 0) || (shapeoffset.y != 0) ) { m_out->Print( 0, " (drill" ); diff --git a/pcbnew/netlist_reader.cpp b/pcbnew/netlist_reader.cpp index bf71a4fb56..ee41b3187c 100644 --- a/pcbnew/netlist_reader.cpp +++ b/pcbnew/netlist_reader.cpp @@ -370,9 +370,9 @@ NETLIST_READER* NETLIST_READER::GetNetlistReader( NETLIST* aNetlist, } -void CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ) +bool CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ) { - wxCHECK_RET( aNetlist != NULL, wxT( "No netlist passed to CMP_READER::Load()" ) ); + wxCHECK_MSG( aNetlist != NULL,true, wxT( "No netlist passed to CMP_READER::Load()" ) ); wxString reference; // Stores value read from line like Reference = BUS1; wxString timestamp; // Stores value read from line like TimeStamp = /32307DE2/AA450F67; @@ -380,6 +380,7 @@ void CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ) wxString buffer; wxString value; + bool ok = true; while( m_lineReader->ReadLine() ) { @@ -434,5 +435,9 @@ void CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ) // This is an usual case during the life of a design if( component ) component->SetFootprintName( footprint ); + else + ok = false; // can be used to display a warning in Pcbnew. } + + return ok; } diff --git a/pcbnew/netlist_reader.h b/pcbnew/netlist_reader.h index 172f3f3175..72c6101a37 100644 --- a/pcbnew/netlist_reader.h +++ b/pcbnew/netlist_reader.h @@ -417,8 +417,12 @@ public: * * @throw IO_ERROR if a the #LINE_READER IO error occurs. * @throw PARSE_ERROR if an error occurs while parsing the file. + * @return true if OK, false if a component reference found in the + * .cmp file is not found in netlist, which means the .cmp file + * is not updated. This is an usual case, in CvPcb, but can be used to + * print a warning in Pcbnew. */ - void Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ); + bool Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR ); };