Bug 46635

Summary: Request: Add a method to remove slides.
Product: POI Reporter: David <erwin94>
Component: HSLFAssignee: POI Developers List <dev>
Severity: enhancement    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: sample implementation

Description David 2009-01-30 06:04:15 UTC
Created attachment 23202 [details]
sample implementation


i want to propose adding a method to remove a slide from a slideshow.
My usecase:

I have a template ppt created in Powerpoint, that is filled with values through POI. If there is less data than expected I want to remove superflous slides.

The attached patch works for me, but it could probably share code with reorderSlides and is missing better documentation and tests.

have a nice day, David.
Comment 1 Yegor Kozlov 2009-01-30 06:22:10 UTC
It's rather "hiding", not a true deleting because the slide data remains, you only remove the reference to it from the Document. 

Anyway, thanks for the patch. I will review and apply later.

Comment 2 Yegor Kozlov 2009-02-01 07:11:27 UTC
Added in r739775
Please note, that my implementation uses 0-based arguments, not 1-based as suggested in your patch. I would rather change SlideShow.reorderSlide to accept 0-based arguments than use 1-based throughout the code.