Question

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 ..

No correct solution

OTHER TIPS

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.

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top