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&qu
ot;, 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&q
uot;, "_blank", 0,
> loadProps) instead of
>
XDocumentInsertable.insertDocumentFromURL("private:stre
am", 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/Gu
llFOSS
Please don't reply to "nospamformba gmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|