0

我正在使用 OpenOffice SDK 打开和解析 ppt 和 pptx 文件;现在我可以打开 ppt 文件并提取形状。

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

通过使用上面的代码,我可以获得形状类型和矩形、椭圆等,但我得到com.sun.star.drawing.CustomShape.

有没有办法获得形状类型,如矩形、椭圆等?

4

1 回答 1

0

我能找到的唯一方法是获取UINameSingular属性

XPropertySet xShapeProperties = (XPropertySet) 
    UnoRuntime.queryInterface(XPropertySet.class, xShape);
String uiName = (String) xShapeProperties.getPropertyValue("UINameSingular");
于 2011-02-02T20:35:35.133 回答