开发者

How to get custom shape type from OpenOffice SDK?

开发者 https://www.devze.com 2023-02-06 18:27 出处:网络
I am using OpenOffice SDK to open and parse ppt and pptx files; now I can open ppt files and extract shapes.

I am using OpenOffice SDK to open and parse ppt and pptx files; now I can open ppt files and extract shapes.

XShape xShape = (XShape) UnoRuntime.queryInterface(
    XShape.class, xShapes.getByIndex(j));
String type = xShape.getShapeType();

By using the code above I can get shape 开发者_运维技巧type and for rectangle, ellipse, etc., but I get com.sun.star.drawing.CustomShape.

Is there a way to get the shape type, like rectangle, ellipse, etc.?


The only way I could find is getting UINameSingular property

XPropertySet xShapeProperties = (XPropertySet) 
    UnoRuntime.queryInterface(XPropertySet.class, xShape);
String uiName = (String) xShapeProperties.getPropertyValue("UINameSingular");
0

精彩评论

暂无评论...
验证码 换一张
取 消