Kaydet (Commit) f87e168d authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS qadev25 (1.16.2); FILE MERGED

2005/11/23 15:13:40 sw 1.16.2.1: #i27523# getByIndex now also takes left border into account
üst 3d132516
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: _XAccessibleText.java,v $ * $RCSfile: _XAccessibleText.java,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: kz $ $Date: 2005-11-02 17:44:59 $ * last change: $Author: obo $ $Date: 2006-01-19 14:25:09 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -385,7 +385,7 @@ public class _XAccessibleText extends MultiMethodTest { ...@@ -385,7 +385,7 @@ public class _XAccessibleText extends MultiMethodTest {
} }
try { try {
for (int i = 0; i < (lastIndex + 1); i++) { for (int i = 0; i < lastIndex; i++) {
log.println("getCharacterBounds(" + i + ")"); log.println("getCharacterBounds(" + i + ")");
chBounds = oObj.getCharacterBounds(i); chBounds = oObj.getCharacterBounds(i);
...@@ -398,6 +398,7 @@ public class _XAccessibleText extends MultiMethodTest { ...@@ -398,6 +398,7 @@ public class _XAccessibleText extends MultiMethodTest {
localres &= ((chBounds.Y + chBounds.Height) > 0); localres &= ((chBounds.Y + chBounds.Height) > 0);
if (!localres) { if (!localres) {
log.println("Text at this place: "+oObj.getCharacter(i));
log.println("Character bounds outside component"); log.println("Character bounds outside component");
log.println("Character rect: " + chBounds.X + ", " + log.println("Character rect: " + chBounds.X + ", " +
chBounds.Y + ", " + chBounds.Width + ", " + chBounds.Y + ", " + chBounds.Width + ", " +
...@@ -479,6 +480,13 @@ public class _XAccessibleText extends MultiMethodTest { ...@@ -479,6 +480,13 @@ public class _XAccessibleText extends MultiMethodTest {
Point aPoint = new Point(x, y); Point aPoint = new Point(x, y);
int nIndex = oObj.getIndexAtPoint(aPoint); int nIndex = oObj.getIndexAtPoint(aPoint);
x = aRect.X;
y = aRect.Y + (aRect.Height / 2);
aPoint = new Point(x, y);
int left = oObj.getIndexAtPoint(aPoint);
int[] previous = (int[]) tEnv.getObjRelation("PreviousUsed"); int[] previous = (int[]) tEnv.getObjRelation("PreviousUsed");
if (previous != null) { if (previous != null) {
...@@ -490,12 +498,18 @@ public class _XAccessibleText extends MultiMethodTest { ...@@ -490,12 +498,18 @@ public class _XAccessibleText extends MultiMethodTest {
} }
if (nIndex != i) { if (nIndex != i) {
log.println("## Method didn't work for Point (" + x + "," + y + // for some letters the center of the rectangle isn't recognised
// in this case we are happy if the left border of the rectangle
// returns the correct value.
if (left !=i) {
log.println("## Method didn't work for Point (" + x + "," + y +
")"); ")");
log.println("Expected Index " + i); log.println("Expected Index " + i);
log.println("Gained Index: " + nIndex); log.println("Gained Index: " + nIndex);
log.println("CharacterAtIndex: " + text); log.println("Left Border: "+left);
res &= false; log.println("CharacterAtIndex: " + text);
res &= false;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment