summaryrefslogtreecommitdiff
path: root/android/src/com
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-05-31 14:16:28 +0100
committerTor Andersson <tor.andersson@artifex.com>2011-06-01 15:52:36 +0200
commit5aaae3d936afc0aa4ff999b42b5a754c40885f75 (patch)
treeecac21a3197ccb813d2bd7dc48d7c26666787685 /android/src/com
parent1323675852c82c8dbc79b46d7bfd882e3282edc0 (diff)
downloadmupdf-5aaae3d936afc0aa4ff999b42b5a754c40885f75.tar.xz
Fix android build; bug 692222.
Bring the MuPDF android build up to date with the latest source changes. Many thanks to Dominic Battre for his helpful report in bug 692222.
Diffstat (limited to 'android/src/com')
-rw-r--r--android/src/com/artifex/mupdf/MuPDFCore.java10
-rw-r--r--android/src/com/artifex/mupdf/PixmapView.java12
2 files changed, 11 insertions, 11 deletions
diff --git a/android/src/com/artifex/mupdf/MuPDFCore.java b/android/src/com/artifex/mupdf/MuPDFCore.java
index 28408516..d867b1b1 100644
--- a/android/src/com/artifex/mupdf/MuPDFCore.java
+++ b/android/src/com/artifex/mupdf/MuPDFCore.java
@@ -31,16 +31,16 @@ public class MuPDFCore
{
throw new Exception("Failed to open "+filename);
}
- pageNum = 1;
+ pageNum = 0;
}
/* Shim function */
public void gotoPage(int page)
{
- if (page > numPages)
- page = numPages;
- else if (page < 1)
- page = 1;
+ if (page > numPages-1)
+ page = numPages-1;
+ else if (page < 0)
+ page = 0;
gotoPageInternal(page);
this.pageNum = page;
this.pageWidth = getPageWidth();
diff --git a/android/src/com/artifex/mupdf/PixmapView.java b/android/src/com/artifex/mupdf/PixmapView.java
index c7ba9d72..73e73eda 100644
--- a/android/src/com/artifex/mupdf/PixmapView.java
+++ b/android/src/com/artifex/mupdf/PixmapView.java
@@ -209,16 +209,16 @@ public class PixmapView extends SurfaceView implements SurfaceHolder.Callback
{
action = GOTOPAGE;
if (delta == Integer.MIN_VALUE)
- actionPageNum = 1;
+ actionPageNum = 0;
else if (delta == Integer.MAX_VALUE)
- actionPageNum = core.numPages;
+ actionPageNum = core.numPages-1;
else
{
actionPageNum += delta;
- if (actionPageNum < 1)
- actionPageNum = 1;
- if (actionPageNum > core.numPages)
- actionPageNum = core.numPages;
+ if (actionPageNum < 0)
+ actionPageNum = 0;
+ if (actionPageNum > core.numPages-1)
+ actionPageNum = core.numPages-1;
}
if (wakeMe)
{