Kaydet (Commit) af7572b3 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS qadev26 (1.10.12); FILE MERGED

2006/03/29 13:40:18 sw 1.10.12.1: #116268#
üst e641458a
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: _XAccessibleComponent.java,v $ * $RCSfile: _XAccessibleComponent.java,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 22:46:47 $ * last change: $Author: vg $ $Date: 2006-05-17 13:32:28 $
* *
* 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.
...@@ -243,6 +243,7 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -243,6 +243,7 @@ public class _XAccessibleComponent extends MultiMethodTest {
XAccessibleContext.class, XAccessibleContext.class,
children[i]); children[i]);
boolean MightBeCovered = false;
boolean isShowing = xAc.getAccessibleStateSet() boolean isShowing = xAc.getAccessibleStateSet()
.contains(com.sun.star.accessibility.AccessibleStateType.SHOWING); .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
log.println("\tStateType containsPoint SHOWING: " + log.println("\tStateType containsPoint SHOWING: " +
...@@ -254,17 +255,6 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -254,17 +255,6 @@ public class _XAccessibleComponent extends MultiMethodTest {
continue; continue;
} }
String pos = "(" + chBnd.X + "," + chBnd.Y + ")";
if (KnownBounds.contains(pos) && isShowing) {
log.println(
"Child is covered by another and can't be reached");
continue;
}
KnownBounds.add(pos);
log.println("finding the point which lies on the component"); log.println("finding the point which lies on the component");
int curX = chBnd.Width / 2; int curX = chBnd.Width / 2;
...@@ -289,6 +279,17 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -289,6 +279,17 @@ public class _XAccessibleComponent extends MultiMethodTest {
new Point(chBnd.X + curX, new Point(chBnd.X + curX,
chBnd.Y + curY)); chBnd.Y + curY));
Point p = new Point(chBnd.X + curX,chBnd.X + curX);
if (isCovered(p) && isShowing) {
log.println(
"Child might be covered by another and can't be reached");
MightBeCovered = true;
}
KnownBounds.add(chBnd);
if (xAcc == null) { if (xAcc == null) {
log.println("The child not found at point (" + log.println("The child not found at point (" +
(chBnd.X + curX) + "," + (chBnd.Y + curY) + (chBnd.X + curX) + "," + (chBnd.Y + curY) +
...@@ -343,7 +344,7 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -343,7 +344,7 @@ public class _XAccessibleComponent extends MultiMethodTest {
.getAccessibleName() + " - OK"); .getAccessibleName() + " - OK");
} else { } else {
log.println( log.println(
"The children found is not the same - FAILED"); "The children found is not the same");
log.println("Expected: " + expName); log.println("Expected: " + expName);
log.println("Description: " + expDesc); log.println("Description: " + expDesc);
log.println("Found: " + log.println("Found: " +
...@@ -352,7 +353,13 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -352,7 +353,13 @@ public class _XAccessibleComponent extends MultiMethodTest {
log.println("Description: " + log.println("Description: " +
xAcc.getAccessibleContext() xAcc.getAccessibleContext()
.getAccessibleDescription()); .getAccessibleDescription());
result = false; if (MightBeCovered) {
log.println("... Child is covered by another - OK");
} else {
log.println("... FAILED");
result = false;
}
} }
} }
} }
...@@ -613,4 +620,21 @@ public class _XAccessibleComponent extends MultiMethodTest { ...@@ -613,4 +620,21 @@ public class _XAccessibleComponent extends MultiMethodTest {
disposeEnvironment(); disposeEnvironment();
} }
} }
private boolean isCovered(Point p) {
int elements = KnownBounds.size();
boolean Covered = false;
for (int k=0;k<elements;k++) {
Rectangle known = (Rectangle) KnownBounds.get(k);
Covered = (known.X < p.X);
Covered &= (known.Y < p.Y);
Covered &= (p.Y < known.Y+known.Height);
Covered &= (p.X < known.X+known.Width);
if (Covered) {
break;
}
}
return Covered;
}
} }
\ No newline at end of file
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