mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
2005-08-08 Alain Magloire
Fix PR 106340: ArrayOutOfBoundException * src/org/eclipse/cdt/internal/ui/actions/GoToNextPreviousMemberAction.java
This commit is contained in:
parent
eaa4628837
commit
ecce7764c9
2 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,7 @@
|
|||
2005-08-08 Alain Magloire
|
||||
Fix PR 106340: ArrayOutOfBoundException
|
||||
* src/org/eclipse/cdt/internal/ui/actions/GoToNextPreviousMemberAction.java
|
||||
|
||||
2005-07-28 David Inglis
|
||||
|
||||
Disable browsing and hierarchy views/perspectives and open hierarchy action as per
|
||||
|
|
|
@ -99,9 +99,11 @@ public class GoToNextPreviousMemberAction extends TextEditorAction {
|
|||
* @return Found offset or actual.
|
||||
*/
|
||||
private static int getNextOffset(Integer[] offsets, int actualOffset) {
|
||||
if (actualOffset < offsets[0].intValue())
|
||||
{
|
||||
return offsets[0].intValue();
|
||||
if (offsets.length > 0) {
|
||||
if (actualOffset < offsets[0].intValue())
|
||||
{
|
||||
return offsets[0].intValue();
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < offsets.length - 1; i++) {
|
||||
if (offsets[i].intValue() == actualOffset) {
|
||||
|
@ -121,10 +123,12 @@ public class GoToNextPreviousMemberAction extends TextEditorAction {
|
|||
* @return Found offset or actual.
|
||||
*/
|
||||
private static int getPreviousOffset(Integer[] offsets, int actualOffset) {
|
||||
if (actualOffset > offsets[offsets.length - 1].intValue())
|
||||
{
|
||||
return offsets[offsets.length - 1].intValue();
|
||||
}
|
||||
if (offsets.length > 0) {
|
||||
if (actualOffset > offsets[offsets.length - 1].intValue())
|
||||
{
|
||||
return offsets[offsets.length - 1].intValue();
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < offsets.length; i++) {
|
||||
if (offsets[i].intValue() == actualOffset) {
|
||||
return offsets[i - 1].intValue();
|
||||
|
|
Loading…
Add table
Reference in a new issue