pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1694535 - /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java
Date Thu, 06 Aug 2015 16:25:30 GMT
Author: tilman
Date: Thu Aug  6 16:25:29 2015
New Revision: 1694535

URL: http://svn.apache.org/r1694535
Log:
PDFBOX-2530: fixed IndexOutOfBoundsException if there is only one search result, as done by
Khyrul Bashar in GSoC2015

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java?rev=1694535&r1=1694534&r2=1694535&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java
(original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/ui/textsearcher/Searcher.java
Thu Aug  6 16:25:29 2015
@@ -56,7 +56,7 @@ public class Searcher implements Documen
         @Override
         public void actionPerformed(ActionEvent actionEvent)
         {
-            if (totalMatch != 0)
+            if (totalMatch != 0 && currentMatch != 0)
             {
                 currentMatch = currentMatch - 1;
                 int offset = highlights.get(currentMatch).getStartOffset();
@@ -72,7 +72,7 @@ public class Searcher implements Documen
         @Override
         public void actionPerformed(ActionEvent actionEvent)
         {
-            if (totalMatch != 0)
+            if (totalMatch != 0 && currentMatch != totalMatch - 1)
             {
                 currentMatch = currentMatch + 1;
                 int offset = highlights.get(currentMatch).getStartOffset();



Mime
View raw message