hi dev,
This is my problem i could delete all table in doc , but how can i delete
table in cursor position which i dont know the name and index of that table.
here my code to delete all table in textRange but it delete all table in my
doc, if you know please give me a help or point out some helpful links
XTextTable table=null;
XText text = xTextDocument.getText();
XTextRange textRange= text.getStart();
XEnumerationAccess xParaAccess = (XEnumerationAccess)
UnoRuntime.queryInterface(XEnumerationAccess.class, textRange.getText());
XEnumeration xParaEnum = xParaAccess.createEnumeration();
while (xParaEnum.hasMoreElements()) {
try {
Object objElement = xParaEnum.nextElement();
XServiceInfo xInfo = (XServiceInfo)
UnoRuntime.queryInterface(XServiceInfo.class, objElement);
if (xInfo.supportsService("com.sun.star.text.TextTable")) {
table = (XTextTable) UnoRuntime.queryInterface(
XTextTable.class,objElement);
table.dispose();
}
} catch (com.sun.star.container.NoSuchElementException ex) {
java.util.logging.Logger.getLogger(TableOparater.class.getName()).log(Level.SEVERE,
null, ex);
} catch (WrappedTargetException ex) {
java.util.logging.Logger.getLogger(TableOparater.class.getName()).log(Level.SEVERE,
null, ex);
}
}
*thanks *
--
Shameera Rathnayaka
Undergraduate
Department of Computer Science and Engineering
University of Moratuwa.
Sri Lanka.
T.P. 0719221454
--
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help