Peter Eberlein schrieb:
Hi Andre,
Andre Heine schrieb:
Ok, the next problem...
Am Montag, 11. Februar 2008 15:37 schrieb Andre Heine:
Am Montag, 11. Februar 2008 13:41 schrieb Andre Heine:
Reference<XTextEmbeddedObject>
object(fac->createInstance("com.sun.star.text.TextEmbeddedObject"),
UNO_QUERY);
Using XTextContent for XTextEmbeddedObject will work for me. Now,
I can see a spreadsheet in my writer component...
Ok, I can see the SpreadsheetDocument in my writer, but how can I
access them?
XTextContent has not any methods like getObject() or setObject()?
How can I get the Object from XTextContent?
An untested Java snippet:
to add:
XTextContent embeddedObject = null;
document is your XTextDocument.
XTextEmbeddedObjectsSupplier xes = (XTextEmbeddedObjectsSupplier)
UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, document);
XNameAccess xna = xes.getEmbeddedObjects();
if (xna.hasByName("Objekt1")) {
XEmbeddedObjectSupplier xeo;
try {
embeddedObject
=(XTextContent)UnoRuntime.queryInterface(XTextContent.class,
xna.getByName("Objekt1"));
xeo = (XEmbeddedObjectSupplier)
UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, embeddedObject);
XComponent xComponent = xeo.getEmbeddedObject();
XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
UnoRuntime.queryInterface(XSpreadsheetDocument.class, xComponent);
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]