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
52d2e7eb
Commit
52d2e7eb
authored
Jun 12, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in ClassOf which crashes Pcbnew when its argument is NULL. It fixes bug #1329364.
parent
bb79ec84
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
8 deletions
+12
-8
typeinfo.h
include/core/typeinfo.h
+2
-2
class_board.h
pcbnew/class_board.h
+1
-1
class_board_connected_item.h
pcbnew/class_board_connected_item.h
+4
-1
class_edge_mod.h
pcbnew/class_edge_mod.h
+1
-1
class_text_mod.h
pcbnew/class_text_mod.h
+1
-1
class_track.h
pcbnew/class_track.h
+2
-2
editrack.cpp
pcbnew/editrack.cpp
+1
-0
No files found.
include/core/typeinfo.h
View file @
52d2e7eb
...
...
@@ -150,11 +150,11 @@ struct remove_pointer<T*>
template
<
class
T
,
class
I
>
bool
IsA
(
const
I
*
aObject
)
{
return
remove_pointer
<
T
>::
type
::
ClassOf
(
aObject
);
return
aObject
&&
remove_pointer
<
T
>::
type
::
ClassOf
(
aObject
);
}
template
<
class
T
,
class
I
>
bool
IsA
(
const
I
&
aObject
)
bool
IsA
(
const
I
&
aObject
)
{
return
remove_pointer
<
T
>::
type
::
ClassOf
(
&
aObject
);
}
...
...
pcbnew/class_board.h
View file @
52d2e7eb
...
...
@@ -222,7 +222,7 @@ private:
public
:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
return
PCB_T
==
aItem
->
Type
();
return
aItem
&&
PCB_T
==
aItem
->
Type
();
}
void
SetFileName
(
const
wxString
&
aFileName
)
{
m_fileName
=
aFileName
;
}
...
...
pcbnew/class_board_connected_item.h
View file @
52d2e7eb
...
...
@@ -60,9 +60,12 @@ public:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
if
(
aItem
==
NULL
)
return
false
;
switch
(
aItem
->
Type
()
)
{
case
PCB_PAD_T
:
case
PCB_PAD_T
:
case
PCB_TRACE_T
:
case
PCB_VIA_T
:
case
PCB_ZONE_AREA_T
:
...
...
pcbnew/class_edge_mod.h
View file @
52d2e7eb
...
...
@@ -56,7 +56,7 @@ public:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
return
PCB_MODULE_EDGE_T
==
aItem
->
Type
();
return
aItem
&&
PCB_MODULE_EDGE_T
==
aItem
->
Type
();
}
void
Copy
(
EDGE_MODULE
*
source
);
// copy structure
...
...
pcbnew/class_text_mod.h
View file @
52d2e7eb
...
...
@@ -68,7 +68,7 @@ public:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
return
PCB_MODULE_TEXT_T
==
aItem
->
Type
();
return
aItem
&&
PCB_MODULE_TEXT_T
==
aItem
->
Type
();
}
...
...
pcbnew/class_track.h
View file @
52d2e7eb
...
...
@@ -82,7 +82,7 @@ class TRACK : public BOARD_CONNECTED_ITEM
public
:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
return
PCB_TRACE_T
==
aItem
->
Type
();
return
aItem
&&
PCB_TRACE_T
==
aItem
->
Type
();
}
BOARD_CONNECTED_ITEM
*
start
;
// pointers to a connected item (pad or track)
...
...
@@ -382,7 +382,7 @@ public:
static
inline
bool
ClassOf
(
const
EDA_ITEM
*
aItem
)
{
return
PCB_VIA_T
==
aItem
->
Type
();
return
aItem
&&
PCB_VIA_T
==
aItem
->
Type
();
}
// Do not create a copy constructor. The one generated by the compiler is adequate.
...
...
pcbnew/editrack.cpp
View file @
52d2e7eb
...
...
@@ -62,6 +62,7 @@ static void Abort_Create_Track( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
PCB_EDIT_FRAME
*
frame
=
(
PCB_EDIT_FRAME
*
)
Panel
->
GetParent
();
BOARD
*
pcb
=
frame
->
GetBoard
();
TRACK
*
track
=
dyn_cast
<
TRACK
*>
(
frame
->
GetCurItem
()
);
if
(
track
)
...
...
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