Issue 17014 - getTextAtIndex(LINE) returns wrong value
Summary: getTextAtIndex(LINE) returns wrong value
Status: CLOSED FIXED
Alias: None
Product: ui
Classification: Code
Component: code (show other issues)
Version: current
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: ru
QA Contact: issues@ui
URL:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2003-07-17 12:12 UTC by ru
Modified: 2004-01-27 17:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ru 2003-07-17 12:12:42 UTC
In edit engine of Calc, Impress and Draw application getTextAtIndex(LINE)
returns always (-1,-1) when cursor is at the end of text. This is wrong because
an at-tool does not report a text when cursor is placed at its end and at-tool
does not report a just written character.

Output from logging of java_uno_accessbridge when cursor is at the end of a text:
[text] Paragraph 4: getTextAtIndex(LINE,2) returns (-1,-1,)
[text] Paragraph 4: getCaretPosition() returns 2

Output from logging of java_uno_accessbridge when cursor is in the text:
[text] Paragraph 1: getTextAtIndex(LINE,11) returns (0,14,This is a text)
[text] Paragraph 1: getCaretPosition() returns 11
Comment 1 ru 2003-07-17 12:13:08 UTC
.
Comment 2 thb 2003-07-17 13:24:49 UTC
Assuming that the API spec allows it, I would use the same methods here as within the 
AccessibleStaticTextBase::ImpCalcInternal() method (around line 388), namely, 
not only allow one past the end values, but also returning the last found instance for 
them.

BTW, with which AT tool did you produce this bug? AFAIK, ZoomText never asks 
for lines.
Comment 3 ru 2003-07-17 13:50:02 UTC
It is Gnopernicus. This is a combined screen reader and Braille
monitor on Gnome.
Comment 4 ru 2003-08-15 16:57:33 UTC
Agreed with TZ.
Comment 5 thb 2003-10-28 10:45:34 UTC
Okay, fixed as described. TextType::LINE now returns the last line, even for one-
behind-the-last index values. While doing this, removed the special case for ::LINE 
from getText*Index() methods. The overridden implGetLineBounds() for the 
OCommonAccessibleTextHelper was already there (though buggy implemented), only 
not reached because of the early interception of the ::LINE case in the named 
methods.

Along the lines, added some more consts, adapted assert strings to the 
actual method names.
Comment 6 thb 2003-11-06 17:51:27 UTC
.
Comment 7 thb 2003-11-12 19:00:27 UTC
Please verify.
Comment 8 ru 2003-11-20 09:08:10 UTC
Ralf -> Thorsten: I verified the bug in thb07. It still occurs. When
positioning curser at the end of text getTextAtIndex() still returns
(-1,-1) and at-tool does not report on text.
Comment 9 thb 2003-11-20 16:51:28 UTC
Okay, hope I've found it now. Problem was that a helper class 
(OCommonAccessibleText) was a little bit sensitive to empty ranges. And I returned 
(textLength,textLength) for start/end index for the described case. Said helper 
then mapped that back to (-1,-1).
Comment 10 thb 2003-11-20 16:51:46 UTC
.
Comment 11 ru 2003-11-21 08:47:09 UTC
Works fine now.
Comment 12 ru 2004-01-27 17:18:47 UTC
.