Seite 1 von 1

TextContourFrame Problem

Verfasst: Di, 13.07.2010 17:17
von freundblase
Ich versuche einen Text innerhalb eines Rechtecks zu platzieren, wobei der Text durch die Breite des Rechtecks abgeschnitten wird, falls er übersteht.
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));
Das Seltsame ist, dass wenn ich TextShape durch PolyPolygonShape ersetze, ich das Feature in Calc von Hand setzen kann (Kontextmenü -> Text -> Konturfluss) - obwohl ich das Property im Code gesetzt habe.