[Libreoffice-commits] core.git: qadevOOo/runner qadevOOo/tests sw/qa

Noel Grandin noel at peralex.com
Tue Apr 23 03:30:50 PDT 2013


 qadevOOo/runner/util/AccessibilityTools.java                    |   40 ++++------
 qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java             |    4 -
 qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java        |    4 -
 qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java       |    4 -
 qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java        |    4 -
 qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java        |    7 -
 qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java     |    4 -
 qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java          |    4 -
 qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java            |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java   |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java       |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java        |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java         |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java       |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java         |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java      |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java      |   10 +-
 qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java          |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java      |    4 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java  |    4 -
 sw/qa/complex/accessibility/AccessibleRelationSet.java          |    8 +-
 22 files changed, 46 insertions(+), 91 deletions(-)

New commits:
commit ada02981672ae74bbdf6c4e5606d78c9211b2317
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 23 09:08:33 2013 +0200

    Java cleanup - reduce use of global fields
    
    This field does not need to be global, it is returned from the relevant
    methods
    
    Change-Id: Ic53eec4a699d6acc4410e71dde385e6a49ded745
    Reviewed-on: https://gerrit.libreoffice.org/3567
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/qadevOOo/runner/util/AccessibilityTools.java b/qadevOOo/runner/util/AccessibilityTools.java
index e6f345b..85cd442 100644
--- a/qadevOOo/runner/util/AccessibilityTools.java
+++ b/qadevOOo/runner/util/AccessibilityTools.java
@@ -32,13 +32,11 @@ import java.io.PrintWriter;
 
 
 public class AccessibilityTools {
-    public static XAccessibleContext SearchedContext = null;
     public static XAccessible SearchedAccessible = null;
     private static boolean debug = false;
 
     public AccessibilityTools() {
         //done = false;
-        SearchedContext = null;
     }
 
     public static XAccessible getAccessibleObject(XInterface xObject) {
@@ -93,35 +91,29 @@ public class AccessibilityTools {
 
     public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
         short role) {
-        SearchedContext = null;
         SearchedAccessible = null;
-        getAccessibleObjectForRole_(xacc, role);
-
-        return SearchedContext;
+        return getAccessibleObjectForRole_(xacc, role);
     }
 
     public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
         short role,
         boolean ignoreShowing) {
-        SearchedContext = null;
         SearchedAccessible = null;
 
         if (ignoreShowing) {
-            getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
+            return getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
         } else {
-            getAccessibleObjectForRole_(xacc, role);
+            return getAccessibleObjectForRole_(xacc, role);
         }
-
-        return SearchedContext;
     }
 
-    public static void getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
+    public static XAccessibleContext getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
         short role) {
         XAccessibleContext ac = xacc.getAccessibleContext();
 
         if (ac.getAccessibleRole() == role) {
-            SearchedContext = ac;
             SearchedAccessible = xacc;
+            return ac;
         } else {
             int k = ac.getAccessibleChildCount();
 
@@ -131,28 +123,29 @@ public class AccessibilityTools {
 
             for (int i = 0; i < k; i++) {
                 try {
-                    getAccessibleObjectForRoleIgnoreShowing_(
+                    XAccessibleContext ac2 = getAccessibleObjectForRoleIgnoreShowing_(
                         ac.getAccessibleChild(i), role);
 
-                    if (SearchedContext != null) {
-                        return;
+                    if (ac2 != null) {
+                        return ac2;
                     }
                 } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
                     System.out.println("Couldn't get Child");
                 }
             }
+            return null;
         }
     }
 
-    public static void getAccessibleObjectForRole_(XAccessible xacc,
+    public static XAccessibleContext getAccessibleObjectForRole_(XAccessible xacc,
         short role) {
         XAccessibleContext ac = xacc.getAccessibleContext();
         boolean isShowing = ac.getAccessibleStateSet()
         .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
 
         if ((ac.getAccessibleRole() == role) && isShowing) {
-            SearchedContext = ac;
             SearchedAccessible = xacc;
+            return ac;
         } else {
             int k = ac.getAccessibleChildCount();
 
@@ -162,15 +155,16 @@ public class AccessibilityTools {
 
             for (int i = 0; i < k; i++) {
                 try {
-                    getAccessibleObjectForRole_(ac.getAccessibleChild(i), role);
+                    XAccessibleContext ac2 = getAccessibleObjectForRole_(ac.getAccessibleChild(i), role);
 
-                    if (SearchedContext != null) {
-                        return;
+                    if (ac2 != null) {
+                        return ac2;
                     }
                 } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
                     System.out.println("Couldn't get Child");
                 }
             }
+            return null;
         }
     }
 
@@ -238,7 +232,7 @@ public class AccessibilityTools {
         .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
 
         // hotfix for i91828:
-        // if role to serach is 0 then ignore the role.
+        // if role to search is 0 then ignore the role.
         if ( (role == 0 || ac.getAccessibleRole() == role) &&
             (ac.getAccessibleName().indexOf(name) > -1) &&
             (utils.getImplName(ac).indexOf(implName) > -1) &&
@@ -297,7 +291,7 @@ public class AccessibilityTools {
                 cellIndex= cellIndex+ (bytes[0]-65);
             } else {
                 String sNumb = cellName.substring(n, cellName.length());
-                int iNumb = new Integer(0).valueOf(sNumb).intValue();
+                int iNumb = Integer.valueOf(sNumb).intValue();
                 cellIndex += (iNumb-1) * 256;
                 System.out.println("numb:" + (iNumb-1) * 256);
             }
diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
index 882ad10..4d6922c 100644
--- a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
+++ b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
@@ -176,9 +176,9 @@ public class _XRangeSelection extends MultiMethodTest {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)tParam.getMSF(), xModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE  );
+        XAccessibleContext ctx = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE  );
 
-        XAccessibleComponent AccessibleSpreadsheet = UnoRuntime.queryInterface(XAccessibleComponent.class,AccessibilityTools.SearchedContext);
+        XAccessibleComponent AccessibleSpreadsheet = UnoRuntime.queryInterface(XAccessibleComponent.class,ctx);
 
         log.println("Got " + util.utils.getImplName(AccessibleSpreadsheet));
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
index 93565d8..cabb17e 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java
@@ -167,9 +167,7 @@ public class ScAccessiblePreviewCell extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), xModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL, true);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL, true);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
index 9560d46..1955484 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
@@ -172,9 +172,7 @@ public class ScAccessiblePreviewTable extends TestCase {
 
         at.printAccessibleTree(log,xRoot, Param.getBool(PropertyName.DEBUG_IS_ACTIVE));
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
index 9e1d545..2ba1da5 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java
@@ -112,9 +112,7 @@ public class ScAccessibleSpreadsheet extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), xModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE  );
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE  );
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
index 4e5e83c..2927527 100644
--- a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
+++ b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java
@@ -54,15 +54,12 @@ public class AccessibleDocumentView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
         if (oObj == null) {
             log.println("DocumentView hasn't the role 'Document'");
             log.println("trying the role 'Shape'");
-            at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
-            oObj = AccessibilityTools.SearchedContext;
+            oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
         }
 
         log.println("ImplementationName " + utils.getImplName(oObj));
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
index 17a7800..5068fcb 100644
--- a/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java
@@ -105,9 +105,7 @@ public class AccessibleDrawDocumentView extends TestCase {
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
         //com.sun.star.accessibility.AccessibleRole
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
         log.println("ImplementationName "+utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
index 5225a05..9ac839f 100644
--- a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java
@@ -70,9 +70,7 @@ public class AccessibleOutlineView extends TestCase {
                         (XMultiServiceFactory)Param.getMSF(),aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
         log.println("ImplementationName "+utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
index 214da23..1f08155 100644
--- a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
+++ b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java
@@ -79,9 +79,7 @@ public class AccessibleSlideView extends TestCase {
 
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
         System.out.println("ImplementationName "+utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
index 2bf763e..d116123 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java
@@ -121,9 +121,7 @@ public class SwAccessibleDocumentPageView extends TestCase {
         XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT );
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT );
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
index b48a85f..cb512e7 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java
@@ -102,9 +102,7 @@ public class SwAccessibleDocumentView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
index fee79ae..4aa5c4b 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java
@@ -118,9 +118,7 @@ public class SwAccessibleEndnoteView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.END_NOTE);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.END_NOTE);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
index 439a9df..736639c 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java
@@ -132,9 +132,7 @@ public class SwAccessibleFooterView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTER);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTER);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
index 4a1c921..ec2a1db 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java
@@ -119,9 +119,7 @@ public class SwAccessibleFootnoteView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTNOTE);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.FOOTNOTE);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
index 5443b19..9d51b5c 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java
@@ -122,9 +122,7 @@ public class SwAccessibleHeaderView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.HEADER);
-
-        oObj = AccessibilityTools.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.HEADER);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
index a6b7d15..63988cf 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java
@@ -74,9 +74,7 @@ public class SwAccessibleParagraphView extends TestCase {
         XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.PARAGRAPH);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PARAGRAPH);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
index 2404af5..573b0ca 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java
@@ -30,6 +30,7 @@ import util.utils;
 
 import com.sun.star.accessibility.AccessibleRole;
 import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
 import com.sun.star.accessibility.XAccessibleSelection;
 import com.sun.star.awt.XWindow;
 import com.sun.star.frame.XModel;
@@ -37,7 +38,6 @@ import com.sun.star.lang.XMultiServiceFactory;
 import com.sun.star.text.XTextDocument;
 import com.sun.star.text.XTextTable;
 import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
 
 
 /**
@@ -65,7 +65,7 @@ public class SwAccessibleTableCellView extends TestCase {
     */
     protected TestEnvironment createTestEnvironment(TestParameters Param,
                                                     PrintWriter log) {
-        XInterface oObj = null;
+        XAccessibleContext oObj = null;
         XTextTable oTable = null;
 
         SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
@@ -94,9 +94,7 @@ public class SwAccessibleTableCellView extends TestCase {
         XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
@@ -105,7 +103,7 @@ public class SwAccessibleTableCellView extends TestCase {
 
         final XAccessibleSelection accSel = UnoRuntime.queryInterface(
                                                     XAccessibleSelection.class,
-                                                    at.SearchedContext.getAccessibleParent());
+                                                    oObj.getAccessibleParent());
 
         tEnv.addObjRelation("EventProducer",
                             new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
index 184814c..e20761c 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java
@@ -95,9 +95,7 @@ public class SwAccessibleTableView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
index e5c1776..d805a5a 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java
@@ -73,9 +73,7 @@ public class SwAccessibleTextEmbeddedObject extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.EMBEDDED_OBJECT);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.EMBEDDED_OBJECT);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
index 8c78416..977e848 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java
@@ -106,9 +106,7 @@ public class SwAccessibleTextFrameView extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
index a1f1ae2..765778b 100644
--- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
+++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java
@@ -95,9 +95,7 @@ public class SwAccessibleTextGraphicObject extends TestCase {
         XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)Param.getMSF(), aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.GRAPHIC);
-
-        oObj = at.SearchedContext;
+        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.GRAPHIC);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
         at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
diff --git a/sw/qa/complex/accessibility/AccessibleRelationSet.java b/sw/qa/complex/accessibility/AccessibleRelationSet.java
index 286f005..1e64978 100644
--- a/sw/qa/complex/accessibility/AccessibleRelationSet.java
+++ b/sw/qa/complex/accessibility/AccessibleRelationSet.java
@@ -174,11 +174,11 @@ public class AccessibleRelationSet {
         XWindow xWindow = at.getCurrentWindow(factory, aModel);
         XAccessible xRoot = at.getAccessibleObject(xWindow);
 
-        at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
+        XAccessibleContext ctx = at.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT);
 
-        para1 = at.SearchedContext.getAccessibleChild(0);
-        para2 = at.SearchedContext.getAccessibleChild(1);
-        para3 = at.SearchedContext.getAccessibleChild(2);
+        para1 = ctx.getAccessibleChild(0);
+        para2 = ctx.getAccessibleChild(1);
+        para3 = ctx.getAccessibleChild(2);
     }
 
     @After public void after() {


More information about the Libreoffice-commits mailing list