diff options
author | Noel Grandin <noel@peralex.com> | 2013-04-23 09:08:33 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-04-23 10:30:31 +0000 |
commit | ada02981672ae74bbdf6c4e5606d78c9211b2317 (patch) | |
tree | d58d507e66abf09f0551890824b87c6433dbb7c7 /qadevOOo/tests/java | |
parent | 68b9fb0aaeff4aef41dfd6989491b522578ca079 (diff) |
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@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'qadevOOo/tests/java')
20 files changed, 25 insertions, 64 deletions
diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index 882ad1080db6..4d6922cec0d0 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 93565d80ec77..cabb17eb24f1 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 9560d4628ea2..195548477793 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 9e1d545cf579..2ba1da5fadea 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 4e5e83c98f08..2927527b80be 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 17a780026534..5068fcb18f17 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 5225a05f5bba..9ac839f75ef6 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 214da23caf6e..1f081555e3c3 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 2bf763e48344..d116123e78cd 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 b48a85f1438d..cb512e761511 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 fee79ae2df41..4aa5c4be7351 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 439a9dfa28fa..736639c0a987 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 4a1c92123fc0..ec2a1db402f1 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 5443b1966fb3..9d51b5c5db79 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 a6b7d154b20e..63988cfb5830 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 2404af5bbbd8..573b0ca94f39 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 184814c677e0..e20761c837a4 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 e5c17767d6fc..d805a5afbdaa 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 8c78416a9160..977e8482faec 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 a1f1ae213599..765778b9e3c2 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)); |