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
f2003d8d
Commit
f2003d8d
authored
Jul 20, 2013
by
Thiadmer Riemersma
Committed by
Wayne Stambaugh
Jul 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: fix subtle find bug when at the end of the search list. (fixes lp 1199689)
parent
ba16d9e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
sch_collectors.cpp
eeschema/sch_collectors.cpp
+9
-15
sch_collectors.h
eeschema/sch_collectors.h
+5
-5
No files found.
eeschema/sch_collectors.cpp
View file @
f2003d8d
...
...
@@ -338,7 +338,7 @@ bool SCH_COLLECTOR::IsDraggableJunction() const
}
bool
SCH_FIND_COLLECTOR
::
at
End
()
const
bool
SCH_FIND_COLLECTOR
::
Passed
End
()
const
{
bool
retv
=
false
;
...
...
@@ -351,12 +351,12 @@ bool SCH_FIND_COLLECTOR::atEnd() const
{
if
(
flags
&
wxFR_DOWN
)
{
if
(
m_foundIndex
>=
(
GetCount
()
-
1
)
)
if
(
m_foundIndex
>=
GetCount
(
)
)
retv
=
true
;
}
else
{
if
(
m_foundIndex
==
0
)
if
(
m_foundIndex
<
0
)
retv
=
true
;
}
}
...
...
@@ -390,21 +390,15 @@ void SCH_FIND_COLLECTOR::UpdateIndex()
if
(
flags
&
wxFR_DOWN
)
{
if
(
!
(
flags
&
FR_SEARCH_WRAP
)
&&
(
m_foundIndex
==
(
GetCount
()
-
1
))
)
return
;
if
(
m_foundIndex
<
GetCount
()
)
m_foundIndex
+=
1
;
if
(
(
m_foundIndex
>=
GetCount
())
&&
(
flags
&
FR_SEARCH_WRAP
)
)
m_foundIndex
=
0
;
}
else
{
if
(
!
(
flags
&
FR_SEARCH_WRAP
)
&&
(
m_foundIndex
==
0
)
)
return
;
if
(
m_foundIndex
>=
0
)
m_foundIndex
-=
1
;
if
(
(
m_foundIndex
<
0
)
&&
(
flags
&
FR_SEARCH_WRAP
)
)
m_foundIndex
=
GetCount
()
-
1
;
}
...
...
@@ -452,7 +446,7 @@ wxString SCH_FIND_COLLECTOR::GetText()
EDA_ITEM
*
SCH_FIND_COLLECTOR
::
GetItem
(
SCH_FIND_COLLECTOR_DATA
&
aData
)
{
if
(
at
End
()
)
if
(
Passed
End
()
)
return
NULL
;
aData
=
m_data
[
m_foundIndex
];
...
...
@@ -462,7 +456,7 @@ EDA_ITEM* SCH_FIND_COLLECTOR::GetItem( SCH_FIND_COLLECTOR_DATA& aData )
bool
SCH_FIND_COLLECTOR
::
ReplaceItem
()
{
if
(
at
End
()
)
if
(
Passed
End
()
)
return
false
;
wxCHECK_MSG
(
IsValidIndex
(
m_foundIndex
),
false
,
...
...
eeschema/sch_collectors.h
View file @
f2003d8d
...
...
@@ -238,13 +238,13 @@ class SCH_FIND_COLLECTOR : public COLLECTOR
bool
m_forceSearch
;
/**
* Function
at
End
* tests if #m_foundIndex is
at the end of the list give the current find/replace
* criterial in #m_findReplaceData.
* Function
Passed
End
* tests if #m_foundIndex is
beyond the end of the list give the current
*
find/replace
criterial in #m_findReplaceData.
*
* @return True if #m_foundIndex
is at
the end of the found item list.
* @return True if #m_foundIndex
has crossed
the end of the found item list.
*/
bool
at
End
()
const
;
bool
Passed
End
()
const
;
/**
* Function dump
...
...
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