Habe RectangleShape und sein Text probiert, habe TextShape and PolyPolygonShape probiert.
Leider wirkt das Property TextContourFrame nicht (reicht aus für meine Aufgabe).
Hier etwas Code:
Code: Alles auswählen
Object shape = msf.createInstance("com.sun.star.drawing.TextShape");
XShape xShape = (XShape)shape;
xShape.setPosition(new Point(5000,1000));
XDrawPageSupplier dps = (XDrawPageSupplier)activeSheet;
XDrawPage drawPage = dps.getDrawPage();
drawPage.add(xShape);
XPropertySet shapeProperties = (XPropertySet)shape;
shapeProperties.setPropertyValue("TextContourFrame", new Any(true));
XText xText = (XText)xShape;
xText.setString("Hello World");
XPropertySet shapeProperties2 = (XPropertySet)shape;
shapeProperties2.setPropertyValue("TextContourFrame", new Any(true));