Пример #1
0
 /** get master page by index */
 public static XDrawPage getMasterPageByIndex(XComponent xComponent, int nIndex)
     throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException {
   XMasterPagesSupplier xMasterPagesSupplier =
       (XMasterPagesSupplier) UnoRuntime.queryInterface(XMasterPagesSupplier.class, xComponent);
   XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
   return (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, xDrawPages.getByIndex(nIndex));
 }
Пример #2
0
 /** get the page count for master pages */
 public static int getMasterPageCount(XComponent xComponent) {
   XMasterPagesSupplier xMasterPagesSupplier =
       (XMasterPagesSupplier) UnoRuntime.queryInterface(XMasterPagesSupplier.class, xComponent);
   XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
   return xDrawPages.getCount();
 }
Пример #3
0
 /** removes the given page */
 public static void removeMasterPage(XComponent xComponent, XDrawPage xDrawPage) {
   XMasterPagesSupplier xMasterPagesSupplier =
       (XMasterPagesSupplier) UnoRuntime.queryInterface(XMasterPagesSupplier.class, xComponent);
   XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
   xDrawPages.remove(xDrawPage);
 }
Пример #4
0
 /**
  * creates and inserts a new master page into the giving position, the method returns the new
  * created page
  */
 public static XDrawPage insertNewMasterPageByIndex(XComponent xComponent, int nIndex) {
   XMasterPagesSupplier xMasterPagesSupplier =
       (XMasterPagesSupplier) UnoRuntime.queryInterface(XMasterPagesSupplier.class, xComponent);
   XDrawPages xDrawPages = xMasterPagesSupplier.getMasterPages();
   return xDrawPages.insertNewByIndex(nIndex);
 }