Im creating an add-on for impress, in which one of the feature is to add a slide. I could manage to add a blank slide by using XDrawPages for the current Componenet. How can i add a slide with someother layout(predefined layouts in impress) ? Thanks in advance ..
Asked
Active
Viewed 258 times
1
-
You should use the DrawPage `setMasterPage` method to link the slide to a master. However this only manages to copy the background. Still figuring out how to copy the layout as well... – Emiliano Feb 08 '12 at 12:28
2 Answers
0
I dont know whether this really links it to the master slide but at least we can get some descent (standard) layout:
Sub Main
pages = ThisComponent.getDrawPages()
pages.insertNewByIndex(pages.getCount() - 1)
newSlide = pages.getByIndex(pages.getCount() - 1)
newSlide.layout = 1
End Sub

Fabian Werner
- 957
- 11
- 19
0
So far I had no luck in setting the master's layout to a new slide. However I'm using this workaround:
model = desktop.getCurrentComponent()
model.duplicate(model.getDrawPages().getByIndex(0))
I basically duplicate the first slide (which I keep empty and delete as last step). This copies everything: master, layout, content.

Emiliano
- 22,232
- 11
- 45
- 59