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
Show 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 )
...
@@ -229,14 +229,12 @@ bool CMP_LIBRARY::AddAlias( LIB_ALIAS* aAlias )
*/
*/
LIB_COMPONENT
*
CMP_LIBRARY
::
AddComponent
(
LIB_COMPONENT
*
aComponent
)
LIB_COMPONENT
*
CMP_LIBRARY
::
AddComponent
(
LIB_COMPONENT
*
aComponent
)
{
{
wxASSERT
(
aComponent
!=
NULL
);
if
(
aComponent
==
NULL
)
return
NULL
;
LIB_COMPONENT
*
newCmp
=
new
LIB_COMPONENT
(
*
aComponent
,
this
);
LIB_COMPONENT
*
newCmp
=
new
LIB_COMPONENT
(
*
aComponent
,
this
);
newCmp
->
ClearAliasDataDoc
();
// Remove data used only in edition
newCmp
->
ClearAliasDataDoc
();
// Remove data used only in edition
if
(
newCmp
==
NULL
)
return
NULL
;
// Conflict detection: See if already existing aliases exist,
// Conflict detection: See if already existing aliases exist,
// and if yes, ask user for continue or abort
// and if yes, ask user for continue or abort
// Special case: if the library is the library cache of the project,
// Special case: if the library is the library cache of the project,
...
@@ -252,13 +250,15 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
...
@@ -252,13 +250,15 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
if
(
alias
==
NULL
)
if
(
alias
==
NULL
)
continue
;
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
;
wxString
msg1
;
msg1
.
Printf
(
_
(
"alias <%s> already exists and has root name<%s>"
),
msg1
.
Printf
(
_
(
"alias <%s> already exists and has root name<%s>"
),
GetChars
(
alias
->
GetName
()
),
GetChars
(
alias
->
GetName
()
),
GetChars
(
alias
->
GetComponent
()
->
GetName
(
)
)
);
GetChars
(
cparent
?
cparent
->
GetName
()
:
_
(
"unknown"
)
)
);
msg
<<
msg1
<<
wxT
(
"
\n
"
);
msg
<<
msg1
<<
wxT
(
"
\n
"
);
conflict_count
++
;
conflict_count
++
;
}
}
...
@@ -292,13 +292,19 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
...
@@ -292,13 +292,19 @@ LIB_COMPONENT* CMP_LIBRARY::AddComponent( LIB_COMPONENT* aComponent )
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
entries
.
push_back
(
alias
);
entries
.
push_back
(
alias
);
}
}
else
if
(
alias
->
GetComponent
()
->
GetName
().
CmpNoCase
(
newCmp
->
GetName
()
)
!=
0
)
else
{
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
// Remove alias from library and alias list of its root component
RemoveEntry
(
alias
);
RemoveEntry
(
alias
);
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
alias
=
new
LIB_ALIAS
(
aliasname
,
newCmp
);
entries
.
push_back
(
alias
);
entries
.
push_back
(
alias
);
}
}
}
// Update alias data:
// Update alias data:
alias
->
SetDescription
(
aComponent
->
GetAliasDataDoc
(
aliasname
)
);
alias
->
SetDescription
(
aComponent
->
GetAliasDataDoc
(
aliasname
)
);
alias
->
SetKeyWords
(
aComponent
->
GetAliasDataKeyWords
(
aliasname
)
);
alias
->
SetKeyWords
(
aComponent
->
GetAliasDataKeyWords
(
aliasname
)
);
...
...
eeschema/libarch.cpp
View file @
b338dfdc
...
@@ -43,12 +43,16 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
...
@@ -43,12 +43,16 @@ bool LibArchive( wxWindow* frame, const wxString& ArchFullFileName )
continue
;
continue
;
SCH_COMPONENT
*
component
=
(
SCH_COMPONENT
*
)
SchItem
;
SCH_COMPONENT
*
component
=
(
SCH_COMPONENT
*
)
SchItem
;
// If not already saved in the new cache, put it:
if
(
libCache
->
FindEntry
(
component
->
m_ChipName
)
==
NULL
)
{
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
component
->
m_ChipName
);
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
component
->
m_ChipName
);
if
(
Entry
)
// if NULL : component not foun
d
if
(
Entry
)
// if NULL : component not found, cannot be store
d
libCache
->
AddComponent
(
Entry
);
libCache
->
AddComponent
(
Entry
);
}
}
}
}
}
if
(
!
libCache
->
Save
(
ArchFullFileName
)
)
if
(
!
libCache
->
Save
(
ArchFullFileName
)
)
{
{
...
...
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