From: Andreas Beeker Date: Sat, 31 Oct 2015 23:10:17 +0000 (+0000) Subject: Make SlideShow closeable as of HSLF references a NPOIFSFileSystem and hasn't closed it X-Git-Tag: REL_3_14_BETA1~194 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f91f9120c222867574050ac59fe3f737951d026f;p=poi.git Make SlideShow closeable as of HSLF references a NPOIFSFileSystem and hasn't closed it git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711706 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/sl/usermodel/SlideShow.java b/src/java/org/apache/poi/sl/usermodel/SlideShow.java index 968911b95f..9d4a5cf9dc 100644 --- a/src/java/org/apache/poi/sl/usermodel/SlideShow.java +++ b/src/java/org/apache/poi/sl/usermodel/SlideShow.java @@ -18,6 +18,7 @@ package org.apache.poi.sl.usermodel; import java.awt.Dimension; +import java.io.Closeable; import java.io.IOException; import java.io.OutputStream; import java.util.List; @@ -27,7 +28,7 @@ import org.apache.poi.sl.usermodel.PictureData.PictureType; public interface SlideShow< S extends Shape, P extends TextParagraph -> { +> extends Closeable { Slide createSlide() throws IOException; List> getSlides(); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java index 46a356fec9..1162cbaa48 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java @@ -20,6 +20,7 @@ package org.apache.poi.hslf.usermodel; import java.awt.Dimension; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -88,7 +89,7 @@ import org.apache.poi.util.Units; * @author Nick Burch * @author Yegor kozlov */ -public final class HSLFSlideShow implements SlideShow { +public final class HSLFSlideShow implements SlideShow, Closeable { // What we're based on private HSLFSlideShowImpl _hslfSlideShow; @@ -1157,4 +1158,9 @@ public final class HSLFSlideShow implements SlideShow