如何从OpenOffice SDK获取自定义形状类型?
-
22-10-2019 - |
题
我正在使用OpenOffice SDK打开并解析PPT和PPTX文件;现在,我可以打开PPT文件并提取形状。
XShape xShape = (XShape) UnoRuntime.queryInterface(
XShape.class, xShapes.getByIndex(j));
String type = xShape.getShapeType();
通过使用上面的代码,我可以获得形状类型和矩形,椭圆等,但是我得到 com.sun.star.drawing.CustomShape
.
有没有办法获得形状类型,例如矩形,椭圆等?
解决方案
我能找到的唯一方法就是 uinamesingular 财产
XPropertySet xShapeProperties = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xShape);
String uiName = (String) xShapeProperties.getPropertyValue("UINameSingular");
不隶属于 StackOverflow