Il 12/05/2011 00:32, Ariel Constenla-Haile ha scritto:
Hello Paolo,

On Wednesday 11 May 2011, 13:33, Paolo Mantovani wrote:
Hallo,

I need to change (via API) the database bound to a given document.

In practice I need to perform via API the same operation that you
normally do via the menu Modify->Change Database.

In Writer I see Edit - Exchange Database

Yes, sorry for my heuristic translation from the Italian;)


[....]
the above shows you are missing (b), it is not enough to change the
com.sun.star.text.DocumentSettings, you have to instantiate the field masters,
and modify the existing fields.
Note that SwDoc::ChangeDBFields does a few things more:
it updates the text section's condition (a text section may bi hidden
according to a db related condition like Datasource.Table.Field EQ Something
so you have to change Dataource.Table to newdatasource.newtable in your
example)
http://svn.services.openoffice.org/opengrok/xref/DEV300_m106/sw/source/core/doc/docfld.cxx#1918
it updates *not only* database fields, but also other text fields, see the
switch in
http://svn.services.openoffice.org/opengrok/xref/DEV300_m106/sw/source/core/doc/docfld.cxx#1947

I've studied your reply with great attention and interest.
Thank you very much for the very valuable information and for the solution that you suggested. Unfortunately it seems much more complicated than I could imagine, and currently I'm a bit rusty, but I will give it a try.


Thanks again
Paolo Mantovani
--
-----------------------------------------------------------------
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help

Reply via email to