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
b338dfdc
Commit
b338dfdc
authored
Mar 03, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug 2962142 (Eeschema: Crash SaveEEFile on demo)
parent
d438cf68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
class_library.cpp
eeschema/class_library.cpp
+17
-11
libarch.cpp
eeschema/libarch.cpp
+7
-3
No files found.
eeschema/class_library.cpp
View file @
b338dfdc
...
...
@@ -229,14 +229,12 @@ bool CMP_LIBRARY::AddAlias( LIB_ALIAS* aAlias )
*/
LIB_COMPONENT
*
CMP_LIBRARY
::
AddComponent
(
LIB_COMPONENT
*
aComponent
)
{
wxASSERT
(
aComponent
!=
NULL
);
if
(
aComponent
==
NULL
)
return
NULL
;
LIB_COMPONENT
*
newCmp
=
new
LIB_COMPONENT
(
*
aComponent
,
this
);
newCmp
->
ClearAliasDataDoc
();
// Remove data used only in edition
if
(
newCmp
==
NULL
)
return
NULL
;
// Conflict detection: See if already existing aliases exist,
// and if yes, ask user for continue or abort
// Special case: if the library is the library cache of the project,
...
...
@@ -252,13 +250,15 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
if
(
alias
==
NULL
)
continue
;
LIB_COMPONENT
*
cparent
=
alias
->
GetComponent
();
if
(
alias
->
GetComponent
()
->
GetName
().
CmpNoCase
(
newCmp
->
GetName
()
)
!=
0
)
if
(
cparent
==
NULL
||
// Lib error, should not occurs
(
cparent
->
GetName
().
CmpNoCase
(
newCmp
->
GetName
()
)
!=
0
)
)
{
wxString
msg1
;
msg1
.
Printf
(
_
(
"alias <%s> already exists and has root name<%s>"
),
GetChars
(
alias
->
GetName
()
),
GetChars
(
alias
->
GetComponent
()
->
GetName
(
)
)
);
GetChars
(
cparent
?
cparent
->
GetName
()
:
_
(
"unknown"
)
)
);
msg
<<
msg1
<<
wxT
(
"
\n
"
);
conflict_count
++
;
}
...
...
@@ -292,12 +292,18 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
entries
.
push_back
(
alias
);
}
else
if
(
alias
->
GetComponent
()
->
GetName
().
CmpNoCase
(
newCmp
->
GetName
()
)
!=
0
)
else
{
// Remove alias from library and alias list of its root component
RemoveEntry
(
alias
);
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
entries
.
push_back
(
alias
);
LIB_COMPONENT
*
cparent
=
alias
->
GetComponent
();
if
(
cparent
==
NULL
||
// Lib error, should not occurs
(
cparent
->
GetName
().
CmpNoCase
(
newCmp
->
GetName
()
)
!=
0
)
)
{
// Remove alias from library and alias list of its root component
RemoveEntry
(
alias
);
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
entries
.
push_back
(
alias
);
}
}
// Update alias data:
alias
->
SetDescription
(
aComponent
->
GetAliasDataDoc
(
aliasname
)
);
...
...
eeschema/libarch.cpp
View file @
b338dfdc
...
...
@@ -43,10 +43,14 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
continue
;
SCH_COMPONENT
*
component
=
(
SCH_COMPONENT
*
)
SchItem
;
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
component
->
m_ChipName
);
// If not already saved in the new cache, put it:
if
(
libCache
->
FindEntry
(
component
->
m_ChipName
)
==
NULL
)
{
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
component
->
m_ChipName
);
if
(
Entry
)
// if NULL : component not found
libCache
->
AddComponent
(
Entry
);
if
(
Entry
)
// if NULL : component not found, cannot be stored
libCache
->
AddComponent
(
Entry
);
}
}
}
...
...
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