fixed: eeschema: incorrect default position of void fields when loading schematic files

This commit is contained in:
charras 2009-02-26 16:21:19 +00:00
parent b0a2d7a48f
commit 663959f4c8
3 changed files with 1385 additions and 606 deletions

View File

@ -18,8 +18,7 @@ SCH_ITEM* ReadTextDescr( FILE * aFile,
char* aLine,
int aBufsize,
int* aLineNum,
int aSchematicFileVersion)
{
int aSchematicFileVersion ) {
/**
* Function ReadTextDescr
* Reads the data structures for a Text (Comment, label, Hlabel and Hlabel
@ -605,6 +604,14 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
{
sscanf( Line + 1, "%d %d",
&component->m_Pos.x, &component->m_Pos.y );
// Set fields position to a default position (that is the component position
// For existing fields, the real position will be set later
for( int i = 0; i<component->GetFieldCount(); ++i )
{
if( component->GetField( i )->m_Text.IsEmpty() )
component->GetField( i )->m_Pos = component->m_Pos;
}
}
else if( Line[0] == 'A' && Line[1] == 'R' )
{
@ -745,7 +752,8 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
else
component->GetField( fieldNdx )->m_Italic = false;
if( Char3[2] == 'B' )
component->GetField( fieldNdx )->m_Width = component->GetField( fieldNdx )->m_Size.x / 4;
component->GetField( fieldNdx )->m_Width = component->GetField( fieldNdx )->
m_Size.x / 4;
else
component->GetField( fieldNdx )->m_Width = 0;
@ -812,4 +820,3 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f,
return Failed; /* Fin lecture 1 composant */
}

Binary file not shown.

File diff suppressed because it is too large Load Diff