« Return to Thread: Problems with handling a xTextEmbeddedObject

Problems with handling a xTextEmbeddedObject

by Benjamin Vollmer :: Rate this Message:

Reply to Author | View in Thread

Hi everybody,
my teammate is trying to insert an OLE object in a writer document  
like in the OOo menu structure "create from file" with a given ODS  
file. That's what he got for now. But the inserted object shows always  
only an extract of the table which is just ca. nine cm in width and  
ca. three cm in height. But he wants to see the entire table, if the  
table is bigger than the size of 9x3.

Here's the code so far:

//this.docController.getXInterface is just a wrapper for  
UnoRuntime.queryInterface
XTextContent xTextEmbeddedObject = (XTextContent)  
this.docController.getXInterface( XTextContent.class,  
xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject"));
XPropertySet xTextEmbeddedObjectPropertySet = (XPropertySet)  
this.docController.getXInterface( XPropertySet.class,  
xTextEmbeddedObject);
xTextEmbeddedObjectPropertySet.setPropertyValue("CLSID",  
"47BBB4CB-CE4C-4E80-a591-42d9ae74950f");
xNamed = (XNamed) this.docController.getXInterface(XNamed.class,  
xTextEmbeddedObject);
xNamed.setName(this.docController.getLanguageController().__("Table:  
") + aSource.getShortinfo());
xFrameText.insertTextContent(xFrameCursor, xTextEmbeddedObject, false);
XEmbeddedObjectSupplier xEmbeddedObjectSupplier =  
(XEmbeddedObjectSupplier)  
this.docController.getXInterface(XEmbeddedObjectSupplier.class,  
xTextEmbeddedObject);
XComponent xEmbeddedObjectModel = xEmbeddedObjectSupplier.getEmbeddedObject();
XSpreadsheetDocument xEmbeddedObjectModelSpreadsheetDocument =  
(XSpreadsheetDocument)  
UnoRuntime.queryInterface(XSpreadsheetDocument.class,  
xEmbeddedObjectModel);
String[] xEmbeddedObjectModelSpreadsheets =  
xEmbeddedObjectModelSpreadsheetDocument.getSheets().getElementNames();
XSpreadsheets xAllSpreadsheets =  
xEmbeddedObjectModelSpreadsheetDocument.getSheets();
Object sheetObj =  
xAllSpreadsheets.getByName(xEmbeddedObjectModelSpreadsheets[0]);
XSpreadsheet xSpreadsheet = null;
xSpreadsheet = (XSpreadsheet)  
UnoRuntime.queryInterface(XSpreadsheet.class, sheetObj);
XSheetLinkable xSheetLinkable = (XSheetLinkable)  
this.docController.getXInterface(XSheetLinkable.class, xSpreadsheet);
xSheetLinkable.link(sURL, "", "", "",  
com.sun.star.sheet.SheetLinkMode.NORMAL);

How can he manipulate the size of the embedded object?

Thx for helping and regards
Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

 « Return to Thread: Problems with handling a xTextEmbeddedObject