Hello Mikhail,
On Sunday 07 March 2010, 15:50, Mikhail Kulinich wrote:
> Hello,
>
> I have an issue with searching the place where the reference points to. I
> dont understand how to do that.
>
> I use the following code to iterate through the text:
>
> *XEnumeration range = ....;
> .....
> while (range.hasMoreElements()) {
> XTextRange xTextPortion = (XTextRange) UnoRuntime.queryInterface(
> XTextRange.class, range.nextElement());
>
> ....**
> *
>
> At some moment xTextPortion will contain a text which is in fact a
> reference to some other part of the document (for example, chapter).
> And I want to determine where the reference points to (maybe in future i
> will need to go to this place...).
> Example of document structure:
> ------------------------------
> Chapter 1.
> SubChapter 1.1
> SubChapter 1.2
>
> Chapter 2
> A *reference to the SubChapter 1.1*
> ------------------------------
>
> *reference to the SubChapter 1.1* can be replaced by any text and I need to
> find "SubChapter 1.1" (the place where reference points to) using only
> OpenOffice.org API.
> As I know the reference can point only to exact place.
>
> Also, I have the following property on XTextRange object:
> Property[ReferenceMark] = Any[Type[com.sun.star.text.XTextContent], null]
>
> Can somebody give me an example of code which is suitable for this task?
http://arielch.fedorapeople.org/docs/Iterating_over_Text.odt
> I search for an example on Java.
well, it's in Ooo Basic, so do your homework:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Iterating_over_Text
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Text_Fields
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Reference_Marks
http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/GetReference.html
Regards
--
Ariel Constenla-Haile
La Plata, Argentina
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]