Pcbnew! fix Bug #1184030

very minor other chnages.
This commit is contained in:
jean-pierre charras 2013-05-25 18:10:19 +02:00
parent da51dbe1e0
commit 94dccc9128
4 changed files with 16 additions and 6 deletions

View File

@ -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( "-" ) );

View File

@ -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" );

View File

@ -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;
}

View File

@ -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 );
};