Bug 46635 - Request: Add a method to remove slides.
Summary: Request: Add a method to remove slides.
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2009-01-30 06:04 UTC by David
Modified: 2009-02-01 07:11 UTC (History)
0 users

sample implementation (2.76 KB, patch)
2009-01-30 06:04 UTC, David
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.