[C#] TextContourFrame problem

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
freundblase
Posts: 26
Joined: Tue Apr 27, 2010 1:54 pm

[C#] TextContourFrame problem

Post by freundblase »

I try to place a text inside a rectangle where the text is cut off by the rectangle width if the text is overlapping.
Ive tried the RectangleShape and its text, tried the TextShape and the PolyPolygonShape.
Sadly the property TextContourFrame doesnt work (which is sufficient for my need).

Here is some code:

Code: Select all

                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));
The strange thing is that if i replace TextShape through PolyPolygonShape, i can activate this feature in Calc by hand (even though i set the property by code).
OpenOffice 3.2 on Windows Vista
Post Reply