Commit c4c58e12 authored by Dick Hollenbeck's avatar Dick Hollenbeck

copyright and formatting

parent 8bafc54c
......@@ -623,7 +623,7 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
LIB_FIELDS fields;
GetFields( fields );
// Fixed fields:
// Mandatory fields:
// may have their own save policy so there is a separate loop for them.
// Empty fields are saved, because the user may have set visibility,
// size and orientation
......
......@@ -338,7 +338,7 @@ bool LIB_EDIT_FRAME::SaveActiveLibrary( bool newFile )
{
fn = wxFileName( m_library->GetFullFileName() );
msg.Printf( _( "Modify library file <%s> ?" ),
msg.Printf( _( "Modify library file <%s> ?" ),
GetChars( fn.GetFullPath() ) );
if( !IsOK( this, msg ) )
......@@ -386,7 +386,7 @@ bool LIB_EDIT_FRAME::SaveActiveLibrary( bool newFile )
catch( ... /* IO_ERROR ioe */ )
{
libFileName.MakeAbsolute();
msg.Printf( _( "Failed to create component library file <%s>" ),
msg.Printf( _( "Failed to create component library file <%s>" ),
GetChars( libFileName.GetFullPath() ) );
DisplayError( this, msg );
return false;
......@@ -686,7 +686,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
void LIB_EDIT_FRAME::SaveOnePartInMemory()
{
LIB_COMPONENT* oldComponent;
LIB_COMPONENT* Component;
LIB_COMPONENT* component;
wxString msg;
if( m_component == NULL )
......@@ -720,15 +720,15 @@ void LIB_EDIT_FRAME::SaveOnePartInMemory()
m_drawItem = m_lastDrawItem = NULL;
if( oldComponent != NULL )
Component = m_library->ReplaceComponent( oldComponent, m_component );
component = m_library->ReplaceComponent( oldComponent, m_component );
else
Component = m_library->AddComponent( m_component );
component = m_library->AddComponent( m_component );
if( Component == NULL )
if( component == NULL )
return;
msg.Printf( _( "Component %s saved in library %s" ),
GetChars( Component->GetName() ),
GetChars( component->GetName() ),
GetChars( m_library->GetName() ) );
SetStatusText( msg );
}
......@@ -62,7 +62,7 @@ static LIB_COMPONENT* DummyCmp;
* convert a wxString to UTF8 and replace any control characters with a ~,
* where a control character is one of the first ASCII values up to ' ' 32d.
*/
std::string toUTFTildaText( const wxString& txt )
static std::string toUTFTildaText( const wxString& txt )
{
std::string ret = TO_UTF8( txt );
......@@ -957,8 +957,8 @@ bool SCH_COMPONENT::Save( FILE* f ) const
static wxString delimiters( wxT( " " ) );
//this is redundant with the AR entries below, but it makes the
//files backwards-compatible.
// this is redundant with the AR entries below, but it makes the
// files backwards-compatible.
if( m_PathsAndReferences.GetCount() > 0 )
{
reference_fields = wxStringTokenize( m_PathsAndReferences[0], delimiters );
......@@ -1031,9 +1031,8 @@ bool SCH_COMPONENT::Save( FILE* f ) const
}
// Fixed fields:
// Save fixed fields even they are non blank,
// because the visibility, size and orientation are set from libaries
// mainly for footprint names, for those who do not use CvPcb
// Save mandatory fields even if they are blank,
// because the visibility, size and orientation are set from libary editor.
for( unsigned i = 0; i<MANDATORY_FIELDS; ++i )
{
SCH_FIELD* fld = GetField( i );
......@@ -1085,10 +1084,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
{
newfmt = 1;
if( !aLine.ReadLine() )
if( !(line = aLine.ReadLine()) )
return true;
line = aLine.Line();
}
if( sscanf( &line[1], "%s %s", name1, name2 ) != 2 )
......@@ -1178,11 +1175,9 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
*/
for( ; ; )
{
if( !aLine.ReadLine() )
if( !(line = aLine.ReadLine()) )
return false;
line = aLine.Line();
if( line[0] == 'U' )
{
sscanf( line + 1, "%d %d %lX", &m_unit, &m_convert, &m_TimeStamp );
......@@ -1354,8 +1349,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
return false;
}
if( !aLine.ReadLine() ||
sscanf( ((char*)aLine), "%d %d %d %d",
if( !(line = aLine.ReadLine()) ||
sscanf( line, "%d %d %d %d",
&m_transform.x1,
&m_transform.y1,
&m_transform.x2,
......@@ -1368,11 +1363,9 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
if( newfmt )
{
if( !aLine.ReadLine() )
if( !(line = aLine.ReadLine()) )
return false;
line = aLine.Line();
if( strnicmp( "$End", line, 4 ) != 0 )
{
aErrorMsg.Printf( wxT( "Component End expected at line %d, aborted" ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment