Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
43d7b723
Commit
43d7b723
authored
Jul 31, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user defined fields should fill next available component field slot
parent
d48f6e00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
read_from_file_schematic_items_descriptions.cpp
eeschema/read_from_file_schematic_items_descriptions.cpp
+8
-6
No files found.
eeschema/read_from_file_schematic_items_descriptions.cpp
View file @
43d7b723
...
...
@@ -703,16 +703,18 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if
(
fieldNdx
>=
component
->
GetFieldCount
()
)
{
// The first MANDATOR_FIELDS must be constructed within the SCH_COMPONENT
// constructor.
// The first MANDATOR_FIELDS _must_ be constructed within
// the SCH_COMPONENT constructor. This assert is simply here
// to guard against a change in that constructor.
wxASSERT
(
component
->
GetFieldCount
()
>=
MANDATORY_FIELDS
);
// Ignore the fieldNdx, it is not important anymore if within
// the user defined fields region (i.e. >= MANDATORY_FIELDS).
// Ignore the _supplied_ fieldNdx. It is not important anymore
// if within the user defined fields region (i.e. >= MANDATORY_FIELDS).
// We freely renumber the index to fit the next available field slot.
int
newNdx
=
component
->
GetFieldCount
();
//
has this index after insertion
fieldNdx
=
component
->
GetFieldCount
();
// new
has this index after insertion
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
new
Ndx
,
component
,
fieldName
);
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
field
Ndx
,
component
,
fieldName
);
component
->
AddField
(
field
);
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment