if(xText.getString().equals("") || xText.getString().trim().equals("")){
String title = getGui().getDialogPropertyValue("Strings2", "Strings2.CouldnotCreateDiagram.Title.Label");
String message = getGui().getDialogPropertyValue("Strings2", "Strings2.CouldnotCreateDiagram.Message.Label");
getGui().showMessageBox(title, message);
}else{
DataOfDiagram datas = new DataOfDiagram();
XEnumeration xParagraphEnumeration = null;
XTextContent xTextElement = null;
XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface(XEnumerationAccess.class, xText);
xParagraphEnumeration = xEnumerationAccess.createEnumeration();
short m = 0;
while (xParagraphEnumeration.hasMoreElements()) {
Object o = xParagraphEnumeration.nextElement();
XServiceInfo xInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, o);
if (xInfo.supportsService("com.sun.star.text.Paragraph")) {
xTextElement = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, o);
XTextRange xTextRange = xTextElement.getAnchor();
String[] str = xTextRange.getString().split("\n");
String elementContent = "";
if(str.length > m)
elementContent = str[m];
XPropertySet xSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xInfo);
short level = 0;
try{
level = AnyConverter.toShort(xSet.getPropertyValue("NumberingLevel"));
}catch(Exception ex){ }
datas.add(level, elementContent);
m++;
}
}
if(!datas.isEmpty()){
// datas.print();
short exec = executeGalleryDialog();
if(exec == 1){
Object oDocument = m_xFrame.getController().getModel();
XDrawPagesSupplier pagesSupplier = (XDrawPagesSupplier)UnoRuntime.queryInterface(XDrawPagesSupplier.class, oDocument);