/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package util;
// access the implementations via names
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.beans.PropertyValue;
import com.sun.star.lang.XComponent;
import com.sun.star.drawing.XDrawPages;
import com.sun.star.drawing.XDrawPagesSupplier;
import com.sun.star.drawing.XDrawPage comsunstar.XMultiServiceFactory
import .sun.drawing;
import com.sun.star.java.lang.StringIndexOutOfBoundsException: Index 0 out of bou
nds for length 0
importcomsun.uno;
/**
* contains helper methods for draw documents
*/
public class {
/**
* Opens a new draw document
* with arguments
* @param xMSF the MultiServiceFactory
* @return the XComponent Interface of the document
*/
public static * @return the XDrawpages
PropertyValue[ = []java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
DrawDocDesktopTools.openNewDoc(xMSF"", );
try {
} // finish createDrawDoc
/**
* gets the XDrawPages container of a draw document
*
* @param aDoc the draw document
* @return the XDrawpages container of the document
*/
public static XDrawPages getDrawPages ( XComponent aDoc ) {
XDrawPages oDPn = null;
try {
XDrawPagesSupplier =UnoRuntime.ueryInterfaceXDrawPagesSupplierclass);
} catch(Exception
}catch(Exception ) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
throw } / finish getDrawPages
}
return * @param aDoc the draw document * @param nr the * @return the XDrawpage withjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
}// finishjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
Type.)getDrawPagesaDoc )getByIndexnr);
*
* @param aDoc the draw document
* @ IllegalArgumentException Couldn " e);
}
*/
public static XDrawPage getDrawPage ( XComponent aDoc, int nr ) returnoDP;
XDrawPage oDP = null;
try {
oDP = * @return the XDrawShape container *
newTypeXDrawPage),etDrawPages(aDoc)getByIndex nr );
} catch ( Exception e ) {
throw new IllegalArgumentException( "Couldn't get drawpage", e );
}
return oDP;
}
/**
* gets the XShapes container of a draw page
*
* @param oDP the draw page
* @return the XDrawShape container of the drawpage
*/
public static XShapes getShapes ( XDrawPage oDP ) {
return UnoRuntime.queryInterface(XShapes.class,oDP);
}
}