[Solved] Set Layout through UNO API

The Application Programming Interface and the OASIS Open Document Format

[Solved] Set Layout through UNO API

Postby libra_kevin » Tue Sep 18, 2012 8:36 am

I'm trying to create Impress documents with UNO API (on Java), and want to set "Layouts" programatically (corresponding to "Tasks" sidebar -> Layouts). I looked through UNO reference and the guide, but didn't find anything about that.

Does anyone know if it is possible in UNO? If it is, how to do that or where should I be looking at?

Thanks a lot in advance!

-Terry
Last edited by libra_kevin on Wed Sep 19, 2012 4:38 am, edited 1 time in total.
LibreOffice 3.6 on Arch Linux
libra_kevin
 
Posts: 2
Joined: Tue Sep 18, 2012 8:30 am

Re: Set Layout through UNO API

Postby FJCC » Tue Sep 18, 2012 9:09 pm

I see that each DrawPage of a presentation has a Layout property. In OOBasic
Code: Select all   Expand viewCollapse view
oDrawPages = oInitialTarget.DrawPages
  oObj_1 = oDrawPages.getByIndex(0)
  nLayout = oObj_1.Layout

where oInitialTarget is the Impress document. I see that slides with different layouts have a different value of Layout, but I haven't found a list of which layouts have what value. The only documentation I found is http://www.openoffice.org/api/docs/common/ref/com/sun/star/presentation/DrawPage.html#Layout
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8126
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Set Layout through UNO API

Postby libra_kevin » Wed Sep 19, 2012 4:37 am

Thanks, FJCC! That works. I tried different values to find the layout I want.
LibreOffice 3.6 on Arch Linux
libra_kevin
 
Posts: 2
Joined: Tue Sep 18, 2012 8:30 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 3 guests