diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-05-05 14:08:07 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-05-05 14:08:07 +0200 |
commit | 1ac240dcf95343fbdd4c40563203bab5fd204c8f (patch) | |
tree | e4ded440baefb10c0037e0609e988459a63120b5 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | |
parent | e00f1a6ed5766f80357661f47686c0822e1f7e0e (diff) | |
download | pdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.tar.gz pdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.tar.bz2 pdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.zip |
(make an attempt to) make java close files; cf. #86
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index 34dd6c5e..1911ac67 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -129,8 +129,17 @@ public class SignaturePanel extends JPanel { public void setDocument(PDFFile pdf) {
this.pdf = pdf;
this.sigPagePos = null;
- this.numPages = pdf.getNumPages();
- showPage(this.numPages);
+ if (pdf != null)
+ {
+ this.numPages = pdf.getNumPages();
+ showPage(this.numPages);
+ }
+ else
+ {
+ this.page = 0;
+ this.numPages = 0;
+ showPage(null);
+ }
}
/**
|