From ef953fabd93b97fff2c02fc4ab004d00cfc24beb Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Wed, 27 Feb 2013 14:00:48 +0000 Subject: Fix bug: failure to set the SubType field of created annotations. Also, in the app, protect against exceptions thrown due to unknown annotation types. --- android/src/com/artifex/mupdfdemo/Annotation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'android/src') 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]; } } -- cgit v1.2.3