From: Dominik Stadler Date: Wed, 15 Nov 2023 10:22:49 +0000 (+0000) Subject: Close document always in SlideShowRecordDumper X-Git-Tag: REL_5_2_5~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=219954c07c1f2569d8a1ccf68bc59f268f37d1ae;p=poi.git Close document always in SlideShowRecordDumper git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913795 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java index 005da13472..c7cecd8b37 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java @@ -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() { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java index 2a45921a11..73bbd376fd 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java @@ -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(), });