jca wrote:
> Hello,
>
> I want to insert (at specific bookmark location) several generated sub
> documents, into a global document.
> For the first subdocument, all is ok, but for all others ... it insert the
> first !
> I think the XTransferable is not up to date, so how can I refresh the
> XTransferable ?
There is no way and no need to refresh it. Just get a new one. The
Transferable object always represents the current selection of the
Controller that returns it.
As your function seems to retrieve a new transferable object everytime I
can't spot a problem in this code. Are you sure that the code outside
this method is correct? A simple basic test program demonstrates that
the idea basically works:
> Sub Main
>
> dim noargs()
> targetdoc = StarDesktop.loadComponentFromURL("private:factory/swriter",
> "_blank", 0, noargs())
> doc1 = StarDesktop.loadComponentFromURL("file:///d:/test1.odt",
> "_blank", 0, noargs())
>
> insertSubDocument( doc1, targetdoc )
>
> doc2 = StarDesktop.loadComponentFromURL("file:///d:/test2.odt",
> "_blank", 0, noargs())
>
> insertSubDocument( doc2, targetdoc )
>
> end sub
>
>
> sub insertSubDocument( sourceDoc, targetDoc )
>
> sourceDoc.CurrentController.ViewCursor.gotoEnd(true)
>
> transfer = sourceDoc.CurrentController.Transferable
> targetDoc.CurrentController.insertTransferable( transfer )
>
> end sub
The result is that "doc1" and "doc2" are inserted into the new blank
document one after another.
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]