2011-01-22 42 views
0

我使用OpenOffice SDK打開並解析ppt和pptx文件;現在我可以打開PPT文件並提取形狀。如何從OpenOffice SDK獲取自定義形狀類型?

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

通過使用上面的代碼我可以得到形狀類型和矩形,橢圓形等,但我得到com.sun.star.drawing.CustomShape

有沒有辦法獲得形狀類型,如矩形,橢圓等?

回答

0

我能找到的唯一方法就是讓UINameSingular財產

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