2009/3/3 Peter Eberlein <[email protected]>:
> 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.

> 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.

I am not using any of the bibliographic fields, just inserting
reference marks and formatting a reference list section manually. In
the footnote case, it is a matter of a normal footnote where the user
has inserted a citation within the footnote text (not a footnote based
citation). In order to find the correct location for this citation, I
belive I need to find the reference to this footnote in the text,
rather than using the location of the footnote body.

So, when I find a citation within a footnote, what I'm actually
looking for is the location reference to this footnote in the text.


-- 
Morten

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to