Hi all.
I have some user textfileds that I added to a document using something like this
XDependentTextField xUserField = (XDependentTextField)UnoRuntime.queryInterface(
XDependentTextField.class,
mxDocFactory.createInstance("com.sun.star.text.TextField.User"));
XPropertySet xMasterPropSet =
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,
mxDocFactory.createInstance("com.sun.star.text.FieldMaster.User"));
xMasterPropSet.setPropertyValue ( "Name", "SGT_Com_" + compoNom);
xUserField.attachTextFieldMaster ( xMasterPropSet );
mxDocText.insertTextContent(cursorDocumento, xUserField, false);
Then I removed that user field from the visible document, and if I press
ctrl+F2 I can see the field is there.
Up to here it's everything ok
The thing is that later in time I want to add that field again to the same
document, but I can't use the lines above, cause they gave me an
IllegalArgumentException, because that field already exists.
So, I would like to know how can I add the field again to the document.
Thanks