]> source.dussan.org Git - poi.git/commitdiff
Close document always in SlideShowRecordDumper
authorDominik Stadler <centic@apache.org>
Wed, 15 Nov 2023 10:22:49 +0000 (10:22 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 15 Nov 2023 10:22:49 +0000 (10:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913795 13f79535-47bb-0310-9956-ffa450edef68

poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java

index 005da134728a2f7b89c0839f20a5dc686bd8d61a..c7cecd8b372145ffc8fcc9bd15e2e03f220591d6 100644 (file)
@@ -79,12 +79,12 @@ public final class SlideShowRecordDumper {
 
         String filename = args[ndx];
 
-        SlideShowRecordDumper foo = new SlideShowRecordDumper(System.out,
-                filename, verbose, escher);
-
-        foo.printDump();
-
-        foo.doc.close();
+        SlideShowRecordDumper foo = new SlideShowRecordDumper(System.out, filename, verbose, escher);
+        try {
+            foo.printDump();
+        } finally {
+            foo.doc.close();
+        }
     }
 
     public static void printUsage() {
index 2a45921a11d4062b84ed2246e474222d886bada5..73bbd376fd873508652f4f961905ef830abdf498 100644 (file)
@@ -35,6 +35,8 @@ public class TestSlideShowRecordDumper extends BaseTestPPTIterating {
 
     @Test
     void testMain() throws IOException {
+        SlideShowRecordDumper.main(new String[] {});
+
         SlideShowRecordDumper.main(new String[] {
                 HSLFTestDataSamples.getSampleFile("slide_master.ppt").getAbsolutePath(),
         });