https://bugs.freedesktop.org/show_bug.cgi?id=86131

            Bug ID: 86131
           Summary: XTextField.getAnchor().getText() returns XTextRange
                    objects with the start position being the same as the
                    end position
           Product: LibreOffice
           Version: 4.3.3.1 rc
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: sdk
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 109250
  --> https://bugs.freedesktop.org/attachment.cgi?id=109250&action=edit
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: ‘java_uno.jar’
  File: ‘unoil-4.3.3.jar’
  File: ‘unoil.jar’ -> ‘unoil-4.3.3.jar’
  File: ‘unoloader.jar’

user@xw:/usr/share/java$ aptitude show libreoffice | grep Version
Version: 1:4.3.3~rc2~git20141011-1

user@xw:/usr/share/java$ libreoffice --version
LibreOffice 4.3.3.1.0 430m0(Build:1)

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to