Hi Morten,
Morten Omholt Alver schrieb:
2009/3/2 Peter Eberlein <[email protected]>:
Hi Morten,
Morten Omholt Alver schrieb:
You can can query for the XText of the XTextRange of your citation. If
xText.supportsService("com.sun.star.text.FootNote") then you're in a footer.
The field has a property "SourceName" which gives you the ReferenceMark name
it is linked to.
If the property "ReferenceFieldSource" is of type
com.sun.star.text.ReferenceFieldSource.REFERENCE_MARK, then you can find the
location with (simplified)
document.getReferenceMarks().getByName(sourceName).
Peter,
thanks again! I managed to find out whether a citation was in a
footnote or not this way, but I have problems finding the "SourceName"
property. Which object's properties should I query? I tried looking at
the properties of the XFootnote object (which I acquired using
UnoRuntime.queryInterface() on the XText of the citation), but
couldn't find that one.
may be I misunderstood you here.
I thought you were looking for a XTextField of type
"com.sun.star.text.Textfield.GetReference" in the footnote.
But if you are only searching for the anchor of the footnote, then
xFootNote.getAnchor() gives you the XTextRange you're looking for.
BTW, how do you find your fields of type "Bibliography"? I figured out,
that searching for the XDependentTextFields of the Masterfield is much
more slowly then vice versa.
Means, creating an Enumeration of all XTextFields, finding the correct
type with XServiceInfo and then accessing the master is much more
performant.
Regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]