summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2013-02-27 14:00:48 +0000
committerRobin Watts <robin.watts@artifex.com>2013-02-28 17:07:43 +0000
commitef953fabd93b97fff2c02fc4ab004d00cfc24beb (patch)
treed724c35812d218ce4802ac94ead4ba7d7de7e3f9 /android
parent092461c105210cfc652984cd96e6c88aec545461 (diff)
downloadmupdf-ef953fabd93b97fff2c02fc4ab004d00cfc24beb.tar.xz
Fix bug: failure to set the SubType field of created annotations.
Also, in the app, protect against exceptions thrown due to unknown annotation types.
Diffstat (limited to 'android')
-rw-r--r--android/src/com/artifex/mupdfdemo/Annotation.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/android/src/com/artifex/mupdfdemo/Annotation.java b/android/src/com/artifex/mupdfdemo/Annotation.java
index 709b66cc..cf915524 100644
--- a/android/src/com/artifex/mupdfdemo/Annotation.java
+++ b/android/src/com/artifex/mupdfdemo/Annotation.java
@@ -6,13 +6,13 @@ public class Annotation extends RectF {
enum Type {
TEXT, LINK, FREETEXT, LINE, SQUARE, CIRCLE, POLYGON, POLYLINE, HIGHLIGHT,
UNDERLINE, SQUIGGLY, STRIKEOUT, STAMP, CARET, INK, POPUP, FILEATTACHMENT,
- SOUND, MOVIE, WIDGET, SCREEN, PRINTERMARK, TRAPNET, WATERMARK, A3D
+ SOUND, MOVIE, WIDGET, SCREEN, PRINTERMARK, TRAPNET, WATERMARK, A3D, UNKNOWN
}
public final Type type;
public Annotation(float x0, float y0, float x1, float y1, int _type) {
super(x0, y0, x1, y1);
- type = Type.values()[_type];
+ type = _type == -1 ? Type.UNKNOWN : Type.values()[_type];
}
}