Created attachment 109250 [details]
testcase written in java that reproduces the annotation start==end bug
When I get all annotations from an ODT document using UNO api, I iterate through
them(they are of type XTextField which I suppose is the actual object sitting
at the right side of the page, the actual annotations) and call .getAnchor().getText() on them in order to get the start and end position of
the selected text (the text that is part of the document, to which the annotation refers to) they're associated with.
For every such annotation, it seems that the start position(I call .getStart() to get it) is the same as the end position(I call .getEnd() to get that).
And the value of this, is actually the right value for .getEnd().
So .getStart() returns the wrong value.
I've read every possible part of the documentation(of both libreoffice
and openoffice) related to this, I've read the examples
in the SDK, I've downloaded all the libreoffice/openoffice
mailing lists related to this, I've checked http://ask.libreoffice.org/ for
similar problems, I've downloaded all libreoffice/openoffice extensions, unpacked them and indexed them and searched through them to
see how other people get the start and end positions of annotations.
I wasn't able to find a way to get the correct position for the document text
referenced by the annotation.
I am attaching a testcase written in Java to this bug report.
Also, below I tried to collect all the versions of Libreoffice
on my system.
user@xw:/usr/share/java$ ls | grep uno | xargs stat | grep File:
File: ‘unoil.jar’ -> ‘unoil-4.3.3.jar’
user@xw:/usr/share/java$ aptitude show libreoffice | grep Version
user@xw:/usr/share/java$ libreoffice --version
LibreOffice 184.108.40.206.0 430m0(Build:1)
Annotated text ranges is my stuff, CC'ing myself.
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":
fdo#86131 SwXTextField::getAnchor: handle postit field with annotation mark
It will be available in 4.4.0.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
libreoffice-4-3 review: https://gerrit.libreoffice.org/12979