Markus Buch wrote:

> Hello,
> 
> I'm trying to insert an RTF stream to a "OpenOffice" instance running inside 
> the "OOoBean". Here is the code for this.
> 
> XDocumentInsertable xDocInsertable = (XDocumentInsertable) 
> UnoRuntime.queryInterface(XDocumentInsertable.class, xTextCursor);
> 
> PropertyValue[] loadProps = new PropertyValue[1];
> loadProps[0] = new PropertyValue();
> loadProps[0].Name = "FilterName";
> loadProps[0].Value = "Rich Text Format";
> 
> loadProps[1] = new PropertyValue();
> loadProps[1].Name = "InputStream";
> loadProps[1].Value = new ByteArrayToXInputStreamAdapter(data);
> 
> xDocInsertable.insertDocumentFromURL("private:stream", loadProps);
> 
> But I always get an "com.sun.star.lang.IllegalArgumentException" and don't 
> understand what's the problem. When I'm using the function 
> XComponentLoader.loadComponentFromURL("private:stream", "_blank", 0, 
> loadProps) instead of 
> XDocumentInsertable.insertDocumentFromURL("private:stream", loadProps) 
> everything works fine.

The insertDocumentFromURL method does not support reading from a stream.
IIRC there is already a filed issue for this (don't remember the number,
sorry).

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to