From 5aaae3d936afc0aa4ff999b42b5a754c40885f75 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 31 May 2011 14:16:28 +0100 Subject: 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. --- android/src/com/artifex/mupdf/MuPDFCore.java | 10 +++++----- android/src/com/artifex/mupdf/PixmapView.java | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'android/src/com') 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) { -- cgit v1.2.3