From f91f9120c222867574050ac59fe3f737951d026f Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 31 Oct 2015 23:10:17 +0000 Subject: [PATCH] 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 --- src/java/org/apache/poi/sl/usermodel/SlideShow.java | 3 ++- .../org/apache/poi/hslf/usermodel/HSLFSlideShow.java | 8 +++++++- .../apache/poi/hslf/usermodel/HSLFSlideShowImpl.java | 11 ++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) 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