diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-27 15:40:17 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-29 22:03:01 +0200 |
commit | b65017a2a7af290f6681da7b197a52efe83d5185 (patch) | |
tree | 06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo | |
parent | 33ec740d1438c3dddf8e1974757ed05bb76425ca (diff) |
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo')
655 files changed, 2414 insertions, 3349 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index d80167fa268d..d3864d997be9 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -65,7 +65,7 @@ public class java_fat implements TestBase DescGetter dg = new APIDescGetter(); String job = (String) m_aParams.get("TestJob"); String ExclusionFile = (String) m_aParams.get("ExclusionList"); - ArrayList exclusions = null; + ArrayList<String> exclusions = null; boolean retValue = true; m_isDebug = m_aParams.getBool("DebugIsActive"); logging = m_aParams.getBool("LoggingIsActive"); @@ -494,9 +494,9 @@ public class java_fat implements TestBase // } // } - private ArrayList getExclusionList(String url, boolean debug) + private ArrayList<String> getExclusionList(String url, boolean debug) { - ArrayList entryList = new ArrayList(); + ArrayList<String> entryList = new ArrayList<String>(); String line = "#"; BufferedReader exclusion = null; diff --git a/qadevOOo/runner/complexlib/Assurance.java b/qadevOOo/runner/complexlib/Assurance.java index a980f12bb4ae..2fa05585e907 100644 --- a/qadevOOo/runner/complexlib/Assurance.java +++ b/qadevOOo/runner/complexlib/Assurance.java @@ -260,9 +260,9 @@ public class Assurance * it means that <em>no</em> exception must be throw by invoking the method. */ protected void assureException( final String _message, final Object _object, final String _methodName, - final Class[] _argClasses, final Object[] _methodArgs, final Class _expectedExceptionClass ) + final Class<?>[] _argClasses, final Object[] _methodArgs, final Class<?> _expectedExceptionClass ) { - Class objectClass = _object.getClass(); + Class<?> objectClass = _object.getClass(); boolean noExceptionAllowed = ( _expectedExceptionClass == null ); @@ -296,9 +296,9 @@ public class Assurance * it means that <em>no</em> exception must be throw by invoking the method. */ protected void assureException( final String _message, final Object _object, final String _methodName, - final Object[] _methodArgs, final Class _expectedExceptionClass ) + final Object[] _methodArgs, final Class<?> _expectedExceptionClass ) { - Class[] argClasses = new Class[ _methodArgs.length ]; + Class<?>[] argClasses = new Class[ _methodArgs.length ]; for ( int i=0; i<_methodArgs.length; ++i ) argClasses[i] = _methodArgs[i].getClass(); assureException( _message, _object, _methodName, argClasses, _methodArgs, _expectedExceptionClass ); @@ -313,7 +313,7 @@ public class Assurance * it means that <em>no</em> exception must be throw by invoking the method. */ protected void assureException( final Object _object, final String _methodName, final Object[] _methodArgs, - final Class _expectedExceptionClass ) + final Class<?> _expectedExceptionClass ) { assureException( "did not catch the expected exception (" + @@ -330,8 +330,8 @@ public class Assurance * @param _expectedExceptionClass is the class of the exception to be caught. If this is null, * it means that <em>no</em> exception must be throw by invoking the method. */ - protected void assureException( final Object _object, final String _methodName, final Class[] _argClasses, - final Object[] _methodArgs, final Class _expectedExceptionClass ) + protected void assureException( final Object _object, final String _methodName, final Class<?>[] _argClasses, + final Object[] _methodArgs, final Class<?> _expectedExceptionClass ) { assureException( "did not catch the expected exception (" + diff --git a/qadevOOo/runner/complexlib/ShowTargets.java b/qadevOOo/runner/complexlib/ShowTargets.java index 335614c0d2e4..3835fc44031d 100644 --- a/qadevOOo/runner/complexlib/ShowTargets.java +++ b/qadevOOo/runner/complexlib/ShowTargets.java @@ -33,8 +33,8 @@ public class ShowTargets public static void main( String[] args ) { - ArrayList targets = new ArrayList(); - ArrayList descs = new ArrayList(); + ArrayList<String> targets = new ArrayList<String>(); + ArrayList<String> descs = new ArrayList<String>(); targets.add( "run" ); descs.add( "runs all complex tests in this module" ); @@ -52,7 +52,7 @@ public class ShowTargets continue; // get the class - Class potentialTestClass = null; + Class<?> potentialTestClass = null; try { potentialTestClass = Class.forName( completePotentialClassName ); } catch( java.lang.ClassNotFoundException e ) { @@ -60,7 +60,7 @@ public class ShowTargets } // see if it is derived from complexlib.ComplexTestCase - Class superClass = potentialTestClass.getSuperclass(); + Class<?> superClass = potentialTestClass.getSuperclass(); while ( superClass != null ) { if ( superClass.getName().equals( "complexlib.ComplexTestCase" ) ) @@ -94,7 +94,7 @@ public class ShowTargets /** determines if the test denoted by a given Class is an interactive test */ - static private boolean isInteractiveTest( Class testClass ) + static private boolean isInteractiveTest( Class<?> testClass ) { java.lang.reflect.Method interactiveTestMethod = null; try { interactiveTestMethod = testClass.getMethod( "isInteractiveTest", new Class[]{} ); } @@ -112,7 +112,7 @@ public class ShowTargets return false; } - static private String getShortTestDescription( Class _testClass ) + static private String getShortTestDescription( Class<?> _testClass ) { java.lang.reflect.Method getShortDescriptionMethod = null; try { getShortDescriptionMethod = _testClass.getMethod( "getShortTestDescription", new Class[]{} ); } diff --git a/qadevOOo/runner/convwatch/BorderRemover.java b/qadevOOo/runner/convwatch/BorderRemover.java index 473f84902c7c..e9a81c93bcb6 100644 --- a/qadevOOo/runner/convwatch/BorderRemover.java +++ b/qadevOOo/runner/convwatch/BorderRemover.java @@ -154,7 +154,7 @@ class BorderRemover Exception ex = null; try { - Class imageIOClass = Class.forName("javax.imageio.ImageIO"); + Class<?> imageIOClass = Class.forName("javax.imageio.ImageIO"); // GlobalLogWriter.get().println("Hello World: get Class"); Method getWriterMIMETypesMethod = imageIOClass.getDeclaredMethod("getWriterMIMETypes", new Class[]{ }); diff --git a/qadevOOo/runner/convwatch/ConvWatchStarter.java b/qadevOOo/runner/convwatch/ConvWatchStarter.java index b9fd3ea66b92..f5034bd12be8 100644 --- a/qadevOOo/runner/convwatch/ConvWatchStarter.java +++ b/qadevOOo/runner/convwatch/ConvWatchStarter.java @@ -149,9 +149,9 @@ public class ConvWatchStarter extends EnhancedComplexTestCase * * @return a List of software which must accessable as an external executable */ - protected Object[] mustInstalledSoftware() + protected String[] mustInstalledSoftware() { - ArrayList aList = new ArrayList(); + ArrayList<String> aList = new ArrayList<String>(); // Tools from ImageMagick if (! OSHelper.isWindows()) { @@ -170,7 +170,7 @@ public class ConvWatchStarter extends EnhancedComplexTestCase aList.add( "gswin32c.exe -version" ); } - return aList.toArray(); + return aList.toArray(new String[aList.size()]); } diff --git a/qadevOOo/runner/convwatch/DB.java b/qadevOOo/runner/convwatch/DB.java index 97ff3fd05559..57d831c0b7a7 100644 --- a/qadevOOo/runner/convwatch/DB.java +++ b/qadevOOo/runner/convwatch/DB.java @@ -254,11 +254,11 @@ public class DB extends DBHelper System.out.println("UUID: " + sUUID); } - public ArrayList QuerySQL(Connection _aCon, String _sSQL) + public ArrayList<String> QuerySQL(Connection _aCon, String _sSQL) { java.sql.Statement oStmt = null; Connection oCon = null; - ArrayList aResultList = new ArrayList(); + ArrayList<String> aResultList = new ArrayList<String>(); try { oStmt = _aCon.createStatement(); @@ -418,11 +418,11 @@ public class DB extends DBHelper Connection aCon = new ShareConnection().getConnection(); String sSQL = "SELECT uuid()"; - ArrayList aResultList = QuerySQL(aCon, sSQL); + ArrayList<String> aResultList = QuerySQL(aCon, sSQL); for (int i=0;i<aResultList.size();i++) { - String sResult = (String)aResultList.get(i); + String sResult = aResultList.get(i); StringTokenizer aTokenizer = new StringTokenizer(sResult,",",false); while (aTokenizer.hasMoreTokens()) diff --git a/qadevOOo/runner/convwatch/DirectoryHelper.java b/qadevOOo/runner/convwatch/DirectoryHelper.java index 94992bf739a8..c48ec41fea09 100644 --- a/qadevOOo/runner/convwatch/DirectoryHelper.java +++ b/qadevOOo/runner/convwatch/DirectoryHelper.java @@ -29,7 +29,7 @@ import java.util.ArrayList; */ public class DirectoryHelper { - ArrayList m_aFileList = new ArrayList(); + ArrayList<String> m_aFileList = new ArrayList<String>(); boolean m_bRecursiveIsAllowed = true; void setRecursiveIsAllowed(boolean _bValue) diff --git a/qadevOOo/runner/convwatch/DocumentConverter.java b/qadevOOo/runner/convwatch/DocumentConverter.java index 941fcdf703f1..fce3456b57a8 100644 --- a/qadevOOo/runner/convwatch/DocumentConverter.java +++ b/qadevOOo/runner/convwatch/DocumentConverter.java @@ -131,11 +131,11 @@ public class DocumentConverter extends EnhancedComplexTestCase /** * Function returns a List of software which must accessable as an external executable */ - protected Object[] mustInstalledSoftware() + protected String[] mustInstalledSoftware() { - ArrayList aList = new ArrayList(); + ArrayList<String> aList = new ArrayList<String>(); // aList.add("perl -version"); - return aList.toArray(); + return aList.toArray(new String[aList.size()]); } // the test ====================================================================== diff --git a/qadevOOo/runner/convwatch/GfxCompare.java b/qadevOOo/runner/convwatch/GfxCompare.java index 8d705dd0864f..44f766eeb602 100644 --- a/qadevOOo/runner/convwatch/GfxCompare.java +++ b/qadevOOo/runner/convwatch/GfxCompare.java @@ -53,16 +53,16 @@ public class GfxCompare extends EnhancedComplexTestCase * * @return a List of software which must accessable as an external executable */ - protected Object[] mustInstalledSoftware() + protected String[] mustInstalledSoftware() { - ArrayList aList = new ArrayList(); + ArrayList<String> aList = new ArrayList<String>(); // Tools from ImageMagick aList.add( "composite -version" ); aList.add( "identify -version" ); // Ghostscript aList.add( "gs -version" ); - return aList.toArray(); + return aList.toArray(new String[aList.size()]); } diff --git a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java index e1e10537a05c..0aea19d337b4 100644 --- a/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java +++ b/qadevOOo/runner/convwatch/GraphicalDifferenceCheck.java @@ -280,7 +280,7 @@ public class GraphicalDifferenceCheck String resultURL = URLHelper.getFileURLFromSystemPath(ensureEndingFileSep(_sOutputPath) + resultDocName); XStorable xStorable = null; - xStorable = (com.sun.star.frame.XStorable)UnoRuntime.queryInterface(com.sun.star.frame.XStorable.class, xComponent); + xStorable = UnoRuntime.queryInterface(com.sun.star.frame.XStorable.class, xComponent); if(xStorable == null) { throw new ConvWatchCancelException("com.sun.star.frame.XStorable could not be instantiated from the office."); diff --git a/qadevOOo/runner/convwatch/ImageHelper.java b/qadevOOo/runner/convwatch/ImageHelper.java index 7754893f5d9d..1114a8d6aea8 100644 --- a/qadevOOo/runner/convwatch/ImageHelper.java +++ b/qadevOOo/runner/convwatch/ImageHelper.java @@ -76,7 +76,7 @@ class ImageHelper File aFile = new File(_sFilename); Exception ex = null; try { - Class imageIOClass = Class.forName("javax.imageio.ImageIO"); + Class<?> imageIOClass = Class.forName("javax.imageio.ImageIO"); Method readMethod = imageIOClass.getDeclaredMethod("read", new Class[]{java.io.File.class}); Object retValue = readMethod.invoke(imageIOClass, new Object[]{aFile}); aImage = (Image)retValue; diff --git a/qadevOOo/runner/convwatch/IniFile.java b/qadevOOo/runner/convwatch/IniFile.java index 83d82e62ca32..d7a831413b50 100644 --- a/qadevOOo/runner/convwatch/IniFile.java +++ b/qadevOOo/runner/convwatch/IniFile.java @@ -33,7 +33,7 @@ class IniFile * Problem, if ini file changed why other write something difference, we don't realise this. */ String m_sFilename; - ArrayList m_aList; + ArrayList<String> m_aList; boolean m_bListContainUnsavedChanges = false; /** @@ -47,10 +47,10 @@ class IniFile m_aList = loadLines(); } - ArrayList loadLines() + ArrayList<String> loadLines() { File aFile = new File(m_sFilename); - ArrayList aLines = new ArrayList(); + ArrayList<String> aLines = new ArrayList<String>(); if (! aFile.exists()) { GlobalLogWriter.get().println("couldn't find file " + m_sFilename); @@ -120,7 +120,7 @@ class IniFile String getItem(int i) { - return (String)m_aList.get(i); + return m_aList.get(i); } String buildSectionName(String _sSectionName) diff --git a/qadevOOo/runner/convwatch/MSOfficePrint.java b/qadevOOo/runner/convwatch/MSOfficePrint.java index 2023f6071ef6..e9dafbdd4bb3 100644 --- a/qadevOOo/runner/convwatch/MSOfficePrint.java +++ b/qadevOOo/runner/convwatch/MSOfficePrint.java @@ -37,7 +37,7 @@ import helper.OSHelper; class ProcessHelper { - ArrayList m_aArray; + ArrayList<String> m_aArray; } public class MSOfficePrint @@ -105,7 +105,7 @@ public class MSOfficePrint { String sDocumentSuffix = FileHelper.getSuffix(_sInputFile); String sFilterName = _aGTA.getExportFilterName(); - ArrayList aStartCommand = new ArrayList(); + ArrayList<String> aStartCommand = new ArrayList<String>(); if (isWordDocument(sDocumentSuffix)) { aStartCommand = createWordStoreHelper(); @@ -166,7 +166,7 @@ public class MSOfficePrint setPrinterName(_aGTA.getPrinterName()); - ArrayList aStartCommand = new ArrayList(); + ArrayList<String> aStartCommand = new ArrayList<String>(); if (isWordDocument(sDocumentSuffix)) { aStartCommand = createWordPrintHelper(); @@ -235,7 +235,7 @@ public class MSOfficePrint TimeHelper.waitInSeconds(2, "Give Microsoft Office some time to print."); } - public void realStartCommand(ArrayList _aStartCommand) throws ConvWatchCancelException + public void realStartCommand(ArrayList<String> _aStartCommand) throws ConvWatchCancelException { if (_aStartCommand.isEmpty()) { @@ -281,7 +281,7 @@ public class MSOfficePrint } - ArrayList createWordPrintHelper() throws java.io.IOException + ArrayList<String> createWordPrintHelper() throws java.io.IOException { // create a program in tmp file String sTmpPath = util.utils.getUsersTempDir(); @@ -290,7 +290,7 @@ public class MSOfficePrint String sPrintViaWord = "printViaWord.pl"; - ArrayList aList = searchLocalFile(sPrintViaWord); + ArrayList<String> aList = searchLocalFile(sPrintViaWord); if (aList.isEmpty() == false) { return aList; @@ -386,12 +386,12 @@ public class MSOfficePrint // TODO: Maybe give a possibility to say where search the script from outside - ArrayList searchLocalFile(String _sScriptName) + ArrayList<String> searchLocalFile(String _sScriptName) { String userdir = System.getProperty("user.dir"); String fs = System.getProperty("file.separator"); - ArrayList aList = new ArrayList(); + ArrayList<String> aList = new ArrayList<String>(); File aPerlScript = new File(userdir + fs + _sScriptName); if (FileHelper.isDebugEnabled()) { @@ -415,7 +415,7 @@ public class MSOfficePrint return aList; } - ArrayList createWordStoreHelper() throws java.io.IOException + ArrayList<String> createWordStoreHelper() throws java.io.IOException { // create a program in tmp file String sTmpPath = util.utils.getUsersTempDir(); @@ -425,7 +425,7 @@ public class MSOfficePrint // ArrayList aList = new ArrayList(); String sSaveViaWord = "saveViaWord.pl"; - ArrayList aList = searchLocalFile(sSaveViaWord); + ArrayList<String> aList = searchLocalFile(sSaveViaWord); if (aList.isEmpty() == false) { return aList; @@ -498,7 +498,7 @@ public class MSOfficePrint } - ArrayList createExcelPrintHelper() throws java.io.IOException + ArrayList<String> createExcelPrintHelper() throws java.io.IOException { // create a program in tmp file String sTmpPath = util.utils.getUsersTempDir(); @@ -507,7 +507,7 @@ public class MSOfficePrint String sPrintViaExcel = "printViaExcel.pl"; - ArrayList aList = searchLocalFile(sPrintViaExcel); + ArrayList<String> aList = searchLocalFile(sPrintViaExcel); if (aList.isEmpty() == false) { return aList; @@ -596,7 +596,7 @@ public class MSOfficePrint return aList; } - ArrayList createExcelStoreHelper() throws java.io.IOException + ArrayList<String> createExcelStoreHelper() throws java.io.IOException { // create a program in tmp file String sTmpPath = util.utils.getUsersTempDir(); @@ -605,7 +605,7 @@ public class MSOfficePrint String sSaveViaExcel = "saveViaExcel.pl"; - ArrayList aList = searchLocalFile(sSaveViaExcel); + ArrayList<String> aList = searchLocalFile(sSaveViaExcel); if (aList.isEmpty() == false) { return aList; @@ -686,7 +686,7 @@ public class MSOfficePrint return aList; } - ArrayList createPowerPointPrintHelper() throws java.io.IOException + ArrayList<String> createPowerPointPrintHelper() throws java.io.IOException { // create a program in tmp file String sTmpPath = util.utils.getUsersTempDir(); @@ -695,7 +695,7 @@ public class MSOfficePrint String sPrintViaPowerPoint = "printViaPowerPoint.pl"; - ArrayList aList = searchLocalFile(sPrintViaPowerPoint); + ArrayList<String> aList = searchLocalFile(sPrintViaPowerPoint); if (aList.isEmpty() == false) { return aList; diff --git a/qadevOOo/runner/convwatch/PRNCompare.java b/qadevOOo/runner/convwatch/PRNCompare.java index e5f2f7a0ba90..5c0602eff25c 100644 --- a/qadevOOo/runner/convwatch/PRNCompare.java +++ b/qadevOOo/runner/convwatch/PRNCompare.java @@ -256,7 +256,7 @@ public class PRNCompare // TODO: return a real filename, due to the fact we don't know how much files are created, maybe better to return a list - ArrayList m_aFileList = new ArrayList(); + ArrayList<String> m_aFileList = new ArrayList<String>(); for (int i=1;i<9999;i++) { String sNewJPEGFilename = utils.replaceAll13(sJPGFilename, sGS_PageOutput, StringHelper.createValueString(i, 4)); @@ -270,7 +270,7 @@ public class PRNCompare } } String[] aList = new String[m_aFileList.size()]; - aList = (String[])m_aFileList.toArray(aList); + aList = m_aFileList.toArray(aList); return aList; // sNewJPEGFilename; } diff --git a/qadevOOo/runner/convwatch/ReferenceBuilder.java b/qadevOOo/runner/convwatch/ReferenceBuilder.java index f41797ed759c..d3cf71afc5e3 100644 --- a/qadevOOo/runner/convwatch/ReferenceBuilder.java +++ b/qadevOOo/runner/convwatch/ReferenceBuilder.java @@ -131,11 +131,9 @@ public class ReferenceBuilder extends EnhancedComplexTestCase /** * Function returns a List of software which must accessable as an external executable */ - protected Object[] mustInstalledSoftware() + protected String[] mustInstalledSoftware() { - ArrayList aList = new ArrayList(); - aList.add("perl -version"); - return aList.toArray(); + return new String[] { "perl -version" }; } // the test ====================================================================== diff --git a/qadevOOo/runner/convwatch/ReportDesignerTest.java b/qadevOOo/runner/convwatch/ReportDesignerTest.java index f6fdb9295c9d..14a75a91965a 100644 --- a/qadevOOo/runner/convwatch/ReportDesignerTest.java +++ b/qadevOOo/runner/convwatch/ReportDesignerTest.java @@ -115,7 +115,7 @@ class PropertyHelper @param _aArrayList @return a PropertyValue[] */ - public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList) + public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList<PropertyValue> _aPropertyList) { // copy the whole PropertyValue List to an PropertyValue Array PropertyValue[] aSaveProperties = null; @@ -131,7 +131,7 @@ class PropertyHelper aSaveProperties = new PropertyValue[_aPropertyList.size()]; for (int i = 0;i<_aPropertyList.size(); i++) { - aSaveProperties[i] = (PropertyValue) _aPropertyList.get(i); + aSaveProperties[i] = _aPropertyList.get(i); } } else @@ -199,7 +199,7 @@ public class ReportDesignerTest extends ComplexTestCase { try { XInterface xInterface = (XInterface) m_xXMultiServiceFactory.createInstance( "com.sun.star.frame.Desktop" ); - m_xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface); + m_xDesktop = UnoRuntime.queryInterface(XDesktop.class, xInterface); } catch (com.sun.star.uno.Exception e) { @@ -388,7 +388,7 @@ public class ReportDesignerTest extends ComplexTestCase { // log.println("1"); // PropertySetHelper aHelper = new PropertySetHelper(aObj); - XDocumentDataSource xDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, aObj); + XDocumentDataSource xDataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, aObj); // Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument"); XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument(); @@ -396,12 +396,12 @@ public class ReportDesignerTest extends ComplexTestCase { assure("can't access DatabaseDocument", xOfficeDBDoc != null); // log.println("2"); - XModel xDBSource = (XModel)UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc); + XModel xDBSource = UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc); Object aController = xDBSource.getCurrentController(); assure("Controller of xOfficeDatabaseDocument is empty!", aController != null); // log.println("3"); - XDatabaseDocumentUI aDBDocUI = (XDatabaseDocumentUI)UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController); + XDatabaseDocumentUI aDBDocUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController); aDBDocUI.connect(); // if (aDBDocUI.isConnected()) // { @@ -420,14 +420,14 @@ public class ReportDesignerTest extends ComplexTestCase { assure("ActiveConnection is empty", aActiveConnectionObj != null); // log.println("5"); - XReportDocumentsSupplier xSupplier = (XReportDocumentsSupplier)UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc); + XReportDocumentsSupplier xSupplier = UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc); xNameAccess = xSupplier.getReportDocuments(); assure("xOfficeDatabaseDocument returns no Report Document", xNameAccess != null); // log.println("5"); showElements(xNameAccess); - ArrayList aPropertyList = new ArrayList(); + ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); PropertyValue aActiveConnection = new PropertyValue(); aActiveConnection.Name = "ActiveConnection"; @@ -494,7 +494,7 @@ public class ReportDesignerTest extends ComplexTestCase { // System.exit(1); } - private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList _aPropertyList /*, int _nType*/ ) + private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList<PropertyValue> _aPropertyList /*, int _nType*/ ) { if (_xNameAccess != null) { @@ -608,7 +608,7 @@ public class ReportDesignerTest extends ComplexTestCase { String sOutputURL = URLHelper.getFileURLFromSystemPath(sOutputPath); - ArrayList aPropertyList = new ArrayList(); // set some properties for storeAsURL + ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); // set some properties for storeAsURL // PropertyValue aFileFormat = new PropertyValue(); // aFileFormat.Name = "FilterName"; @@ -621,7 +621,7 @@ public class ReportDesignerTest extends ComplexTestCase { aPropertyList.add(aOverwrite); // store the document in an other directory - XStorable aStorable = (XStorable) UnoRuntime.queryInterface( XStorable.class, _xComponent); + XStorable aStorable = UnoRuntime.queryInterface( XStorable.class, _xComponent); if (aStorable != null) { log.println("store document as URL: '" + sOutputURL + "'"); @@ -638,10 +638,10 @@ public class ReportDesignerTest extends ComplexTestCase { } } - private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList) + private XComponent loadComponent(String _sName, Object _xComponent, ArrayList<PropertyValue> _aPropertyList) { XComponent xDocComponent = null; - XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, _xComponent ); + XComponentLoader xComponentLoader = UnoRuntime.queryInterface( XComponentLoader.class, _xComponent ); try { @@ -668,7 +668,7 @@ public class ReportDesignerTest extends ComplexTestCase { private void closeComponent(XComponent _xDoc) { // Close the document - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, _xDoc); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, _xDoc); try { xCloseable.close(true); diff --git a/qadevOOo/runner/graphical/ImageHelper.java b/qadevOOo/runner/graphical/ImageHelper.java index b7ff7b5d1eed..beea44fe056d 100644 --- a/qadevOOo/runner/graphical/ImageHelper.java +++ b/qadevOOo/runner/graphical/ImageHelper.java @@ -80,7 +80,7 @@ class ImageHelper File aFile = new File(_sFilename); Exception ex = null; try { - Class imageIOClass = Class.forName("javax.imageio.ImageIO"); + Class<?> imageIOClass = Class.forName("javax.imageio.ImageIO"); Method readMethod = imageIOClass.getDeclaredMethod("read", new Class[]{java.io.File.class}); Object retValue = readMethod.invoke(imageIOClass, new Object[]{aFile}); aImage = (Image)retValue; diff --git a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java index 8f338a4e9e8a..f4180560855f 100644 --- a/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java +++ b/qadevOOo/runner/graphical/MSOfficePostscriptCreator.java @@ -318,7 +318,7 @@ public class MSOfficePostscriptCreator implements IOffice TimeHelper.waitInSeconds(2, "Give Microsoft Office some time to print."); } - public void realStartCommand(ArrayList _aStartCommand) throws OfficeException + public void realStartCommand(ArrayList<String> _aStartCommand) throws OfficeException { if (_aStartCommand.isEmpty()) { diff --git a/qadevOOo/runner/graphical/Office.java b/qadevOOo/runner/graphical/Office.java index 5377a6fb2e8d..33470cb35ab3 100644 --- a/qadevOOo/runner/graphical/Office.java +++ b/qadevOOo/runner/graphical/Office.java @@ -80,7 +80,7 @@ public class Office implements IOffice } // TODO: run through all documents which exists as reports in odb files OpenOfficeDatabaseReportExtractor aExtractor = new OpenOfficeDatabaseReportExtractor(m_aParameterHelper); - ArrayList aList = aExtractor.load(m_sDocumentName); + ArrayList<String> aList = aExtractor.load(m_sDocumentName); if (aList != null) { // remove the whole section about the 'name'.odb there are no information we need diff --git a/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java b/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java index 55cf50d381a3..7d5d99831207 100644 --- a/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java +++ b/qadevOOo/runner/graphical/OpenOfficeDatabaseReportExtractor.java @@ -510,7 +510,7 @@ public class OpenOfficeDatabaseReportExtractor extends Assurance return sBackPathName; } - private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList) + private XComponent loadComponent(String _sName, Object _xComponent, ArrayList<PropertyValue> _aPropertyList) { XComponent xDocComponent = null; XComponentLoader xComponentLoader = UnoRuntime.queryInterface( XComponentLoader.class, _xComponent ); diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java index a99bd979d37e..7dad332e2908 100644 --- a/qadevOOo/runner/helper/APIDescGetter.java +++ b/qadevOOo/runner/helper/APIDescGetter.java @@ -99,7 +99,7 @@ public class APIDescGetter extends DescGetter } else { - ArrayList subs = getSubInterfaces(job); + ArrayList<String> subs = getSubInterfaces(job); String partjob = job.substring(0, job.indexOf(",")).trim(); DescEntry entry = getDescriptionForSingleJob(partjob, descPath, debug); @@ -167,13 +167,13 @@ public class APIDescGetter extends DescGetter { //look the scenarion like this? : // sw.SwXBodyText,sw.SwXTextCursor - ArrayList subs = getSubObjects(job); + ArrayList<String> subs = getSubObjects(job); DescEntry[] entries = new DescEntry[subs.size()]; for (int i = 0; i < subs.size(); i++) { entries[i] = getDescriptionForSingleJob( - (String) subs.get(i), descPath, debug); + subs.get(i), descPath, debug); } return entries; } @@ -263,8 +263,8 @@ public class APIDescGetter extends DescGetter { String line = ""; String old_ifc_name = ""; - ArrayList ifc_names = new ArrayList(); - ArrayList meth_names = new ArrayList(); + ArrayList<DescEntry> ifc_names = new ArrayList<DescEntry>(); + ArrayList<DescEntry> meth_names = new ArrayList<DescEntry>(); DescEntry ifcDesc = null; while (line != null) @@ -464,17 +464,17 @@ public class APIDescGetter extends DescGetter return methDesc; } - private static void createIfcName(String ifc_name, ArrayList meth_names, DescEntry ifcDesc) + private static void createIfcName(String ifc_name, ArrayList<String> meth_names, DescEntry ifcDesc) { } /** * This method ensures that XComponent will be the last in the list of interfaces */ - protected static Object[] makeArray(ArrayList entries) + protected static Object[] makeArray(ArrayList<DescEntry> entries) { Object[] entriesArray = entries.toArray(); - ArrayList returnArray = new ArrayList(); + ArrayList<Object> returnArray = new ArrayList<Object>(); Object addAtEnd = null; for (int k = 0; k < entriesArray.length; k++) @@ -730,9 +730,9 @@ public class APIDescGetter extends DescGetter return aEntry; } - protected ArrayList getSubInterfaces(String job) + protected ArrayList<String> getSubInterfaces(String job) { - ArrayList namesList = new ArrayList(); + ArrayList<String> namesList = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(job, ","); for (int i = 0; st.hasMoreTokens(); i++) @@ -748,9 +748,9 @@ public class APIDescGetter extends DescGetter return namesList; } - protected ArrayList getSubObjects(String job) + protected ArrayList<String> getSubObjects(String job) { - ArrayList namesList = new ArrayList(); + ArrayList<String> namesList = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(job, ","); for (int i = 0; st.hasMoreTokens(); i++) @@ -792,7 +792,7 @@ public class APIDescGetter extends DescGetter boolean debug) { String[] modules = null; - ArrayList componentList = new ArrayList(); + ArrayList<String> componentList = new ArrayList<String>(); if (!job.equals("unknown") && !job.equals("listall")) { @@ -841,7 +841,7 @@ public class APIDescGetter extends DescGetter for (int i = 0; i < componentList.size(); i++) { - scenario[i] = (String) componentList.get(i); + scenario[i] = componentList.get(i); } return scenario; @@ -864,7 +864,7 @@ public class APIDescGetter extends DescGetter return null; } - ArrayList scenarioList = new ArrayList(); + ArrayList<String> scenarioList = new ArrayList<String>(); try { @@ -945,7 +945,7 @@ public class APIDescGetter extends DescGetter protected boolean isUnusedModule(String moduleName) { - ArrayList removed = new ArrayList(); + ArrayList<String> removed = new ArrayList<String>(); removed.add("acceptor"); removed.add("brdgfctr"); removed.add("connectr"); diff --git a/qadevOOo/runner/helper/ComplexDescGetter.java b/qadevOOo/runner/helper/ComplexDescGetter.java index 413733342be1..e269e1816d1c 100644 --- a/qadevOOo/runner/helper/ComplexDescGetter.java +++ b/qadevOOo/runner/helper/ComplexDescGetter.java @@ -85,7 +85,7 @@ public class ComplexDescGetter extends DescGetter // case3: method1(param1,param2),method2(param1,param2) String method = className.substring(index + 2); className = className.substring(0, index); - ArrayList methods = new ArrayList(); + ArrayList<String> methods = new ArrayList<String>(); String[] split = method.split("(?<=\\)),(?=\\w+)"); @@ -102,7 +102,7 @@ public class ComplexDescGetter extends DescGetter } methodNames = new String[methods.size()]; - methodNames = (String[]) methods.toArray(methodNames); + methodNames = methods.toArray(methodNames); } // create an instance diff --git a/qadevOOo/runner/helper/ConfigHelper.java b/qadevOOo/runner/helper/ConfigHelper.java index a5d1191f1e5b..b65056ef229a 100644 --- a/qadevOOo/runner/helper/ConfigHelper.java +++ b/qadevOOo/runner/helper/ConfigHelper.java @@ -96,11 +96,10 @@ public class ConfigHelper { m_xSMGR = xSMGR; - XMultiServiceFactory xConfigRoot = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, - m_xSMGR.createInstance( - "com.sun.star.configuration.ConfigurationProvider")); + XMultiServiceFactory xConfigRoot = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + m_xSMGR.createInstance( + "com.sun.star.configuration.ConfigurationProvider")); PropertyValue[] lParams = new PropertyValue[1]; lParams[0] = new PropertyValue(); @@ -117,7 +116,7 @@ public class ConfigHelper "com.sun.star.configuration.ConfigurationUpdateAccess", lParams); - m_xConfig = (XHierarchicalNameAccess)UnoRuntime.queryInterface( + m_xConfig = UnoRuntime.queryInterface( XHierarchicalNameAccess.class, aConfig); @@ -172,7 +171,7 @@ public class ConfigHelper { try { - XChangesBatch xBatch = (XChangesBatch)UnoRuntime.queryInterface( + XChangesBatch xBatch = UnoRuntime.queryInterface( XChangesBatch.class, m_xConfig); xBatch.commitChanges(); @@ -228,7 +227,7 @@ public class ConfigHelper try { Object xChild=xSetCont.getByName(groupName); - xChildAccess = (XNameReplace) UnoRuntime.queryInterface( + xChildAccess = UnoRuntime.queryInterface( XNameReplace.class,xSetCont); } catch(com.sun.star.container.NoSuchElementException e) { // proceed with inserting @@ -311,7 +310,7 @@ public class ConfigHelper try { Object xGroup=xSetCont.getByName(group); - xGroupAccess = (XNameReplace) UnoRuntime.queryInterface( + xGroupAccess = UnoRuntime.queryInterface( XNameReplace.class,xGroup); } catch(com.sun.star.container.NoSuchElementException e) { throw new com.sun.star.uno.Exception( @@ -350,8 +349,7 @@ public class ConfigHelper public XNameContainer getSet(String setName) throws com.sun.star.uno.Exception { - XNameReplace xCont = (XNameReplace) - UnoRuntime.queryInterface(XNameReplace.class, m_xConfig); + XNameReplace xCont = UnoRuntime.queryInterface(XNameReplace.class, m_xConfig); Object oSet = xCont.getByName(setName); diff --git a/qadevOOo/runner/helper/ConfigurationRead.java b/qadevOOo/runner/helper/ConfigurationRead.java index b865c3064925..3940edc5e361 100644 --- a/qadevOOo/runner/helper/ConfigurationRead.java +++ b/qadevOOo/runner/helper/ConfigurationRead.java @@ -53,9 +53,8 @@ public class ConfigurationRead { "com.sun.star.configuration.ConfigurationAccess", nodeArgs); - root = (XHierarchicalNameAccess) - UnoRuntime.queryInterface( - XHierarchicalNameAccess.class, rootObject); + root = UnoRuntime.queryInterface( + XHierarchicalNameAccess.class, rootObject); } catch(com.sun.star.uno.Exception e) { e.printStackTrace(); diff --git a/qadevOOo/runner/helper/ContextMenuInterceptor.java b/qadevOOo/runner/helper/ContextMenuInterceptor.java index ea377c2e0158..6d80e1fdbbaf 100644 --- a/qadevOOo/runner/helper/ContextMenuInterceptor.java +++ b/qadevOOo/runner/helper/ContextMenuInterceptor.java @@ -37,8 +37,8 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { // create sub menus, menu entries and separators XIndexContainer xContextMenu = aEvent.ActionTriggerContainer; XMultiServiceFactory xMenuElementFactory = - (XMultiServiceFactory)UnoRuntime.queryInterface( - XMultiServiceFactory.class, xContextMenu ); + UnoRuntime.queryInterface( + XMultiServiceFactory.class, xContextMenu ); if ( xMenuElementFactory != null ) { @@ -58,9 +58,9 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { // query sub menu for index container to get access XIndexContainer xSubMenuContainer = - (XIndexContainer)UnoRuntime.queryInterface( - XIndexContainer.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" )); + UnoRuntime.queryInterface( + XIndexContainer.class, + xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" )); // intialize root menu entry "Help" xRootMenuEntry.setPropertyValue( "Text", new String( "Help" )); diff --git a/qadevOOo/runner/helper/CwsDataExchangeImpl.java b/qadevOOo/runner/helper/CwsDataExchangeImpl.java index ba873d6ff149..1619a8146c88 100644 --- a/qadevOOo/runner/helper/CwsDataExchangeImpl.java +++ b/qadevOOo/runner/helper/CwsDataExchangeImpl.java @@ -49,7 +49,7 @@ public class CwsDataExchangeImpl implements CwsDataExchange mDebug = param.getBool(PropertyName.DEBUG_IS_ACTIVE); } - public ArrayList getModules() + public ArrayList<String> getModules() { // the cwstouched command send its version information to StdErr. // A piping from StdErr to SdtOut the tcsh does not support. diff --git a/qadevOOo/runner/helper/InetTools.java b/qadevOOo/runner/helper/InetTools.java index b7529920a3f6..b4c5a8443239 100644 --- a/qadevOOo/runner/helper/InetTools.java +++ b/qadevOOo/runner/helper/InetTools.java @@ -45,7 +45,7 @@ public class InetTools { Object oProvider = xMSF.createInstance( "com.sun.star.configuration.ConfigurationProvider"); - XMultiServiceFactory oProviderMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oProviderMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oProvider); @@ -67,7 +67,7 @@ public class InetTools { oInetProps.setPropertyValue("ooInetHTTPProxyPort", HTTPProxyPort); oInetProps.setPropertyValue("ooInetProxyType", new Long(2)); - XChangesBatch oSecureChange = (XChangesBatch) UnoRuntime.queryInterface( + XChangesBatch oSecureChange = UnoRuntime.queryInterface( XChangesBatch.class, oInet); oSecureChange.commitChanges(); } diff --git a/qadevOOo/runner/helper/PropertyHelper.java b/qadevOOo/runner/helper/PropertyHelper.java index 76179927cd87..c91b4053aeb4 100644 --- a/qadevOOo/runner/helper/PropertyHelper.java +++ b/qadevOOo/runner/helper/PropertyHelper.java @@ -29,7 +29,7 @@ public class PropertyHelper @param _aArrayList @return a PropertyValue[] */ - public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList) + public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList<PropertyValue> _aPropertyList) { // copy the whole PropertyValue List to an PropertyValue Array PropertyValue[] aSaveProperties = null; @@ -40,7 +40,7 @@ public class PropertyHelper } else { - aSaveProperties = (PropertyValue[])_aPropertyList.toArray(new PropertyValue[_aPropertyList.size()]); + aSaveProperties = _aPropertyList.toArray(new PropertyValue[_aPropertyList.size()]); // old java 1.4 // if (_aPropertyList.size() > 0) // { diff --git a/qadevOOo/runner/helper/StreamSimulator.java b/qadevOOo/runner/helper/StreamSimulator.java index f53f17de5cab..fe4a19deda09 100644 --- a/qadevOOo/runner/helper/StreamSimulator.java +++ b/qadevOOo/runner/helper/StreamSimulator.java @@ -88,9 +88,8 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , try { - XSimpleFileAccess xHelper = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, - ((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.ucb.SimpleFileAccess")); + XSimpleFileAccess xHelper = UnoRuntime.queryInterface(XSimpleFileAccess.class, + ((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.ucb.SimpleFileAccess")); /* com.sun.star.ucb.XSimpleFileAccess xHelper = (com.sun.star.ucb.XSimpleFileAccess)OfficeConnect.createRemoteInstance( com.sun.star.ucb.XSimpleFileAccess.class, "com.sun.star.ucb.SimpleFileAccess");*/ @@ -101,14 +100,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , if (bInput) { m_xInStream = xHelper.openFileRead(m_sFileName); - m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( + m_xSeek = UnoRuntime.queryInterface( com.sun.star.io.XSeekable.class, m_xInStream); } else { m_xOutStream = xHelper.openFileWrite(m_sFileName); - m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( + m_xSeek = UnoRuntime.queryInterface( com.sun.star.io.XSeekable.class, m_xOutStream); } diff --git a/qadevOOo/runner/helper/URLHelper.java b/qadevOOo/runner/helper/URLHelper.java index c33ac40ffb8b..bd091a988f01 100644 --- a/qadevOOo/runner/helper/URLHelper.java +++ b/qadevOOo/runner/helper/URLHelper.java @@ -240,7 +240,7 @@ public class URLHelper * a filtered list of java File objects of all available files of the start dir * and all accessable sub directories. */ - public static ArrayList getSystemFilesFromDir(String sStartDir) + public static ArrayList<File> getSystemFilesFromDir(String sStartDir) { File aRoot = new File(sStartDir); @@ -254,7 +254,7 @@ public class URLHelper if (lAllFiles == null ) return null; - ArrayList lFilteredFiles = new ArrayList(lAllFiles.length); + ArrayList<File> lFilteredFiles = new ArrayList<File>(lAllFiles.length); for (int i=0; i<lAllFiles.length; ++i) { @@ -264,10 +264,10 @@ public class URLHelper if (lAllFiles[i].isDirectory()) { // recursion! - ArrayList lSubFiles = URLHelper.getSystemFilesFromDir(lAllFiles[i].getPath()); + ArrayList<File> lSubFiles = URLHelper.getSystemFilesFromDir(lAllFiles[i].getPath()); if (lSubFiles != null) { - Iterator aSnapshot = lSubFiles.iterator(); + Iterator<File> aSnapshot = lSubFiles.iterator(); while (aSnapshot.hasNext()) lFilteredFiles.add(aSnapshot.next()); } diff --git a/qadevOOo/runner/helper/UnoProvider.java b/qadevOOo/runner/helper/UnoProvider.java index 9194ec54e549..e8b444cb9ef3 100644 --- a/qadevOOo/runner/helper/UnoProvider.java +++ b/qadevOOo/runner/helper/UnoProvider.java @@ -105,7 +105,7 @@ public class UnoProvider implements AppProvider { return null; } XMultiComponentFactory xMCF = xContext.getServiceManager(); - xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface( + xMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xMCF); } return xMSF; diff --git a/qadevOOo/runner/lib/DynamicClassLoader.java b/qadevOOo/runner/lib/DynamicClassLoader.java index 5104350422a0..ef38533bb8f3 100644 --- a/qadevOOo/runner/lib/DynamicClassLoader.java +++ b/qadevOOo/runner/lib/DynamicClassLoader.java @@ -32,7 +32,7 @@ public class DynamicClassLoader { * policy is required for Component and Interface * testing classes. */ - public static Class forName(String className) + public static Class<?> forName(String className) throws ClassNotFoundException { return Class.forName(className) ; @@ -41,7 +41,7 @@ public class DynamicClassLoader { public Object getInstance(String className) throws IllegalArgumentException { try { - Class cls = DynamicClassLoader.forName(className); + Class<?> cls = DynamicClassLoader.forName(className); return cls.newInstance(); } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException("Couldn't find " + className @@ -58,12 +58,12 @@ public class DynamicClassLoader { public Object getInstance(String className, Object[] ctorArgs) throws IllegalArgumentException { try { - Class cls = DynamicClassLoader.forName(className); - Class[] ctorType = new Class[ctorArgs.length]; + Class<?> cls = DynamicClassLoader.forName(className); + Class<?>[] ctorType = new Class[ctorArgs.length]; for(int i=0; i<ctorType.length; i++) { ctorType[i] = ctorArgs[i].getClass(); } - Constructor ctor = cls.getConstructor(ctorType); + Constructor<?> ctor = cls.getConstructor(ctorType); return ctor.newInstance(ctorArgs); } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException("Couldn't find " + className diff --git a/qadevOOo/runner/lib/MultiMethodTest.java b/qadevOOo/runner/lib/MultiMethodTest.java index 004dd448fb74..e2c695671a73 100644 --- a/qadevOOo/runner/lib/MultiMethodTest.java +++ b/qadevOOo/runner/lib/MultiMethodTest.java @@ -97,7 +97,7 @@ public class MultiMethodTest /** * Contains names of the methods have been already called */ - private ArrayList methCalled = new ArrayList(10); + private ArrayList<String> methCalled = new ArrayList<String>(10); /** * Disposes the test environment, which was corrupted by the test. @@ -147,7 +147,7 @@ public class MultiMethodTest // this.log = log; this.entry = entry; this.tRes = new TestResult(); - Class testedClass; + Class<?> testedClass; // Some fake code for a self test. // For normal test we must not be a "ifc.qadevooo._SelfTest" @@ -445,7 +445,7 @@ public class MultiMethodTest mName = mName.substring(0, mName.length() - 2); } - final Class[] paramTypes = new Class[0]; + final Class<?>[] paramTypes = new Class[0]; try { diff --git a/qadevOOo/runner/lib/Parameters.java b/qadevOOo/runner/lib/Parameters.java index 9f0a7e58108d..bd24289ded5a 100644 --- a/qadevOOo/runner/lib/Parameters.java +++ b/qadevOOo/runner/lib/Parameters.java @@ -41,7 +41,7 @@ import com.sun.star.uno.Type; public class Parameters implements XPropertySet { /* final protected Map parameters; final Parameters defaults; */ - final protected Map parameters; + final protected Map<String, Object> parameters; final Parameters defaults; Property[] props; @@ -49,12 +49,12 @@ public class Parameters implements XPropertySet { this (params, null); } - public Parameters(Map params, Parameters defaultParams) { + public Parameters(Map<String, Object> params, Parameters defaultParams) { parameters = params; defaults = defaultParams; checkParameters(parameters); - Set paramSet = new HashSet(parameters.keySet()); + Set<String> paramSet = new HashSet<String>(parameters.keySet()); if (defaults != null) { Set defSet = defaults.toMap().keySet(); @@ -65,8 +65,8 @@ public class Parameters implements XPropertySet { int num = 0; - for (Iterator i = paramSet.iterator(); i.hasNext(); num++) { - String name = (String)i.next(); + for (Iterator<String> i = paramSet.iterator(); i.hasNext(); num++) { + String name = i.next(); props[num] = new Property(name, num, new Type(String.class), (short)0); } @@ -160,8 +160,8 @@ public class Parameters implements XPropertySet { }; } - private static void checkParameters(Map params) { - for (Iterator i = params.keySet().iterator(); i.hasNext();) { + private static void checkParameters(Map<String, Object> params) { + for (Iterator<String> i = params.keySet().iterator(); i.hasNext();) { Object key = i.next(); if (!(key instanceof String)) { @@ -198,8 +198,8 @@ public class Parameters implements XPropertySet { } } - public static Map toMap(XPropertySet props) { - HashMap result = new HashMap(10); + public static Map<String, Object> toMap(XPropertySet props) { + HashMap<String, Object> result = new HashMap<String, Object>(10); XPropertySetInfo setInfo = props.getPropertySetInfo(); Property[] properties = setInfo.getProperties(); diff --git a/qadevOOo/runner/lib/TestEnvironment.java b/qadevOOo/runner/lib/TestEnvironment.java index e88c90e3c0f3..7c9b3d7cbe82 100644 --- a/qadevOOo/runner/lib/TestEnvironment.java +++ b/qadevOOo/runner/lib/TestEnvironment.java @@ -34,7 +34,7 @@ public final class TestEnvironment { * Contains object relations - auxiliary objects associated with the * tested object and required for testing. */ - private final HashMap relations = new HashMap(10); + private final HashMap<String, Object> relations = new HashMap<String, Object>(10); /** * An instance of the tested implementation object. diff --git a/qadevOOo/runner/lib/TestResult.java b/qadevOOo/runner/lib/TestResult.java index e49aaa6224b3..1df57a950d53 100644 --- a/qadevOOo/runner/lib/TestResult.java +++ b/qadevOOo/runner/lib/TestResult.java @@ -27,7 +27,7 @@ public class TestResult { /** * Contains methods having been tested and their results. */ - protected HashMap testedMethods = new HashMap(); + protected HashMap<String, Status> testedMethods = new HashMap<String, Status>(); /** * The method makes method tested with the result, i.e. it adds to its @@ -70,7 +70,7 @@ public class TestResult { * @return methods available in the interface tested. */ public String[] getTestedMethods() { - return (String[])testedMethods.keySet().toArray( + return testedMethods.keySet().toArray( new String[testedMethods.size()]); } @@ -91,7 +91,7 @@ public class TestResult { * @see #assert */ public Status getStatusFor( String method ) { - return (Status)testedMethods.get( method ); + return testedMethods.get( method ); } }
\ No newline at end of file diff --git a/qadevOOo/runner/org/openoffice/RunnerService.java b/qadevOOo/runner/org/openoffice/RunnerService.java index 6a0d131f6386..8b7489ec50eb 100644 --- a/qadevOOo/runner/org/openoffice/RunnerService.java +++ b/qadevOOo/runner/org/openoffice/RunnerService.java @@ -213,7 +213,7 @@ public class RunnerService implements XJob, XServiceInfo, return pVal; } - ArrayList v = new ArrayList(600); + ArrayList<String> v = new ArrayList<String>(600); try { // open connection to Jar java.net.JarURLConnection con = diff --git a/qadevOOo/runner/share/CwsDataExchange.java b/qadevOOo/runner/share/CwsDataExchange.java index 6593cedef6f3..3b160a179a24 100644 --- a/qadevOOo/runner/share/CwsDataExchange.java +++ b/qadevOOo/runner/share/CwsDataExchange.java @@ -30,7 +30,7 @@ public interface CwsDataExchange { * Retunrs all module names which are added to the specified childworkspace * @return a String array of all added modules */ - public ArrayList getModules(); + public ArrayList<String> getModules(); /** * Set the test status of cws related UnoAPI tests to the EIS dabase diff --git a/qadevOOo/runner/share/DescGetter.java b/qadevOOo/runner/share/DescGetter.java index 7ab8b2de044f..22d8b62199a0 100644 --- a/qadevOOo/runner/share/DescGetter.java +++ b/qadevOOo/runner/share/DescGetter.java @@ -46,7 +46,7 @@ public abstract class DescGetter protected DescEntry[] getScenario(String url, String descPath, boolean debug) { - ArrayList entryList = new ArrayList(); + ArrayList<DescEntry> entryList = new ArrayList<DescEntry>(); String line = ""; BufferedReader scenario = null; DescEntry[] entries = null; @@ -78,7 +78,7 @@ public abstract class DescGetter } else { - ArrayList subs = getSubInterfaces(job); + ArrayList<String> subs = getSubInterfaces(job); String partjob = job.substring(0, job.indexOf(",")).trim(); aEntry = getDescriptionForSingleJob(partjob, descPath, debug); @@ -163,14 +163,14 @@ public abstract class DescGetter return null; } entries = new DescEntry[entryList.size()]; - entries = (DescEntry[]) entryList.toArray(entries); + entries = entryList.toArray(entries); return entries; } - protected ArrayList getSubInterfaces(String job) + protected ArrayList<String> getSubInterfaces(String job) { - ArrayList namesList = new ArrayList(); + ArrayList<String> namesList = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(job, ","); for (int i = 0; st.hasMoreTokens(); i++) diff --git a/qadevOOo/runner/stats/DataBaseOutProducer.java b/qadevOOo/runner/stats/DataBaseOutProducer.java index e0b8e172098d..08e44d369b66 100644 --- a/qadevOOo/runner/stats/DataBaseOutProducer.java +++ b/qadevOOo/runner/stats/DataBaseOutProducer.java @@ -28,7 +28,7 @@ import java.util.HashMap; */ public abstract class DataBaseOutProducer implements LogWriter { protected HashMap mSqlInput = null; - protected HashMap mSqlOutput = null; + protected HashMap<String, String[]> mSqlOutput = null; protected String[] mWriteableEntryTypes = null; protected SQLExecution mSqlExec; protected boolean m_bDebug = false; diff --git a/qadevOOo/runner/stats/FileLogWriter.java b/qadevOOo/runner/stats/FileLogWriter.java index d27f8295f735..b8e545351ce6 100644 --- a/qadevOOo/runner/stats/FileLogWriter.java +++ b/qadevOOo/runner/stats/FileLogWriter.java @@ -32,7 +32,7 @@ import java.util.Iterator; public class FileLogWriter extends PrintWriter implements LogWriter { - HashMap mFileWriters = null; + HashMap<String, FileWriter> mFileWriters = null; boolean logging = false; share.DescEntry entry = null; share.Watcher ow = null; @@ -61,7 +61,7 @@ public class FileLogWriter extends PrintWriter implements LogWriter { public void addFileLog(String filePath){ try{ if(mFileWriters == null) - mFileWriters = new HashMap(); + mFileWriters = new HashMap<String, FileWriter>(); mFileWriters.put(filePath, new FileWriter(filePath)); }catch(IOException e ){ e.printStackTrace(this); @@ -92,9 +92,9 @@ public class FileLogWriter extends PrintWriter implements LogWriter { if(mFileWriters != null && mFileWriters.size() > 0){ try{ FileWriter fw = null; - Iterator iter = mFileWriters.values().iterator(); + Iterator<FileWriter> iter = mFileWriters.values().iterator(); while(iter.hasNext()){ - fw = (FileWriter) iter.next(); + fw = iter.next(); fw.write("LOG> " + msg + "\n"); fw.flush(); } diff --git a/qadevOOo/runner/stats/SQLExecution.java b/qadevOOo/runner/stats/SQLExecution.java index 6fcab9ee84a0..21d0cbeecf86 100644 --- a/qadevOOo/runner/stats/SQLExecution.java +++ b/qadevOOo/runner/stats/SQLExecution.java @@ -125,7 +125,7 @@ public class SQLExecution { * @param sqlOutput The results of the command are put in this HashMap. * @return True, if no error occurred. */ - public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap sqlOutput) + public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap<String, String[]> sqlOutput) throws IllegalArgumentException { return executeSQLCommand(command, sqlInput, sqlOutput, false); } @@ -139,10 +139,10 @@ public class SQLExecution { * sqlInput HashMap. * @return True, if no error occurred. */ - public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap sqlOutput, boolean mergeOutputIntoInput) + public boolean executeSQLCommand(String command, HashMap sqlInput, HashMap<String, String[]> sqlOutput, boolean mergeOutputIntoInput) throws IllegalArgumentException { if (sqlOutput == null) { - sqlOutput = new HashMap(); + sqlOutput = new HashMap<String, String[]>(); // this has to be true, so the user of this method gets a return mergeOutputIntoInput = true; if (sqlInput == null) { @@ -150,7 +150,7 @@ public class SQLExecution { return false; } } - ArrayList sqlCommand = new ArrayList(); + ArrayList<String> sqlCommand = new ArrayList<String>(); sqlCommand.add(""); boolean update = false; // synchronize all "$varname" occurrences in the command string with @@ -231,10 +231,10 @@ public class SQLExecution { execute((String)sqlCommand.get(i), sqlOutput, update); // merge output with input if (!update && mergeOutputIntoInput) { - Iterator keys = sqlOutput.keySet().iterator(); + Iterator<String> keys = sqlOutput.keySet().iterator(); while(keys.hasNext()) { - String key = (String)keys.next(); - String[]val = (String[])sqlOutput.get(key); + String key = keys.next(); + String[]val = sqlOutput.get(key); if (val != null && val.length != 0) { if (val.length == 1) sqlInput.put(key, val[0]); @@ -256,7 +256,7 @@ public class SQLExecution { * command * @return A HashMap with the result. */ - private void execute(String command, HashMap output, boolean update) { + private void execute(String command, HashMap<String, String[]> output, boolean update) { if (m_bDebug) System.out.println("Debug - SQLExecution - execute Command: " + command); try { @@ -275,7 +275,7 @@ public class SQLExecution { for(int i=1; i<=columnCount; i++) { columnNames[i-1] = sqlRSMeta.getColumnName(i); // initialize output - ArrayList v = new ArrayList(); + ArrayList<String> v = new ArrayList<String>(); sqlResult.beforeFirst(); while (sqlResult.next()) { @@ -291,7 +291,7 @@ public class SQLExecution { // put result in output HashMap String[]s = new String[countRows]; - s = (String[])v.toArray(s); + s = v.toArray(s); output.put(columnNames[i-1], s); if (m_bDebug) { if (i == 1) { diff --git a/qadevOOo/runner/stats/Summarizer.java b/qadevOOo/runner/stats/Summarizer.java index 3d9afbc10ad8..b63c5c255eb1 100644 --- a/qadevOOo/runner/stats/Summarizer.java +++ b/qadevOOo/runner/stats/Summarizer.java @@ -42,8 +42,8 @@ public class Summarizer } int count = entry.SubEntryCount; int knownIssues = 0; - ArrayList failures = new ArrayList(); - ArrayList states = new ArrayList(); + ArrayList<String> failures = new ArrayList<String>(); + ArrayList<String> states = new ArrayList<String>(); for (int i = 0; i < count; i++) { if (entry.SubEntries[i].State == null) diff --git a/qadevOOo/runner/util/AccessibilityTools.java b/qadevOOo/runner/util/AccessibilityTools.java index 95f45cf8b286..e6f345b0493c 100644 --- a/qadevOOo/runner/util/AccessibilityTools.java +++ b/qadevOOo/runner/util/AccessibilityTools.java @@ -339,7 +339,7 @@ public class AccessibilityTools { ac.getAccessibleDescription() + "):" + utils.getImplName(ac)); - XAccessibleComponent aComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent aComp = UnoRuntime.queryInterface( XAccessibleComponent.class, xacc); if (aComp != null) { @@ -389,7 +389,7 @@ public class AccessibilityTools { } public static String accessibleToString(Object AC) { - XAccessibleContext xAC = (XAccessibleContext) UnoRuntime.queryInterface( + XAccessibleContext xAC = UnoRuntime.queryInterface( XAccessibleContext.class, AC); if (xAC != null) { @@ -398,7 +398,7 @@ public class AccessibilityTools { xAC.getAccessibleDescription() + "):"; } - XAccessible xA = (XAccessible) UnoRuntime.queryInterface( + XAccessible xA = UnoRuntime.queryInterface( XAccessible.class, AC); if (xA == null) { diff --git a/qadevOOo/runner/util/BasicMacroTools.java b/qadevOOo/runner/util/BasicMacroTools.java index b5e55278c787..313ed1b0f565 100644 --- a/qadevOOo/runner/util/BasicMacroTools.java +++ b/qadevOOo/runner/util/BasicMacroTools.java @@ -66,7 +66,7 @@ public class BasicMacroTools { mLCxNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, DocLibCont); - mLCxLC = (XLibraryContainer) UnoRuntime.queryInterface( + mLCxLC = UnoRuntime.queryInterface( XLibraryContainer.class, DocLibCont); } catch (Exception e) { @@ -98,7 +98,7 @@ public class BasicMacroTools { mLCxNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, ASLC); - mLCxLC = (XLibraryContainer) UnoRuntime.queryInterface( + mLCxLC = UnoRuntime.queryInterface( XLibraryContainer.class, ASLC); } catch (Exception e) { @@ -117,14 +117,14 @@ public class BasicMacroTools { throw new Exception("Could not create DispatchProvider"); } - return (XDispatchProvider) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XDispatchProvider.class, xFrame); } private static XURLTransformer makeParser(XMultiServiceFactory mMSF) throws java.lang.Exception { try { - return (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XURLTransformer.class, mMSF.createInstance( "com.sun.star.util.URLTransformer")); } catch (Exception e) { @@ -231,8 +231,7 @@ public class BasicMacroTools { Object oProvider = xMSF.createInstance("com.sun.star.configuration.ConfigurationProvider"); - XMultiServiceFactory oProviderMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, oProvider); + XMultiServiceFactory oProviderMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oProvider); Object oSecure = oProviderMSF.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", @@ -246,7 +245,7 @@ public class BasicMacroTools { oScriptingSettings.setPropertyValue("SecureURL", new String[]{secureURL}); oScriptingSettings.setPropertyValue("OfficeBasic", new Integer(2)); - XChangesBatch oSecureChange = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, oSecure); + XChangesBatch oSecureChange = UnoRuntime.queryInterface(XChangesBatch.class, oSecure); oSecureChange.commitChanges(); } } diff --git a/qadevOOo/runner/util/CalcTools.java b/qadevOOo/runner/util/CalcTools.java index 7f12b2462aba..22bd2258ca3c 100644 --- a/qadevOOo/runner/util/CalcTools.java +++ b/qadevOOo/runner/util/CalcTools.java @@ -95,7 +95,7 @@ public class CalcTools { "Couldn't get CellRange from sheett: " + e.toString()); } - XCellRangeData xRangeData = (XCellRangeData) UnoRuntime.queryInterface(XCellRangeData.class, xRange); + XCellRangeData xRangeData = UnoRuntime.queryInterface(XCellRangeData.class, xRange); xRangeData.setDataArray(newData); } catch (Exception e){ @@ -119,13 +119,11 @@ public class CalcTools { XSpreadsheet xSheet = null; try{ - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XIndexAccess xSheetsIndexArray = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try{ xSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/runner/util/DBTools.java b/qadevOOo/runner/util/DBTools.java index 825c626403e6..30c1b230548f 100644 --- a/qadevOOo/runner/util/DBTools.java +++ b/qadevOOo/runner/util/DBTools.java @@ -274,7 +274,7 @@ public class DBTools { try { Object cont = xMSF.createInstance("com.sun.star.sdb.DatabaseContext") ; - dbContext = (XNamingService) UnoRuntime.queryInterface + dbContext = UnoRuntime.queryInterface (XNamingService.class, cont) ; } catch (com.sun.star.uno.Exception e) {} @@ -320,9 +320,8 @@ public class DBTools { revokeDB(name) ; } catch (com.sun.star.uno.Exception e) {} - XDocumentDataSource xDDS = (XDocumentDataSource) - UnoRuntime.queryInterface(XDocumentDataSource.class, dataSource); - XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, dataSource); + XStorable store = UnoRuntime.queryInterface(XStorable.class, xDDS.getDatabaseDocument()); String aFile = utils.getOfficeTemp(xMSF) + name + ".odb"; store.storeAsURL(aFile, new PropertyValue[] { }); @@ -355,11 +354,9 @@ public class DBTools { dbContext.registerObject(contextName, newSource) ; Object handler = xMSF.createInstance("com.sun.star.sdb.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler) - UnoRuntime.queryInterface(XInteractionHandler.class, handler) ; + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, handler) ; - XCompletedConnection xSrcCon = (XCompletedConnection) - UnoRuntime.queryInterface(XCompletedConnection.class, newSource) ; + XCompletedConnection xSrcCon = UnoRuntime.queryInterface(XCompletedConnection.class, newSource) ; XConnection con = xSrcCon.connectWithCompletion(xHandler) ; @@ -416,11 +413,9 @@ public class DBTools { throws com.sun.star.uno.Exception { Object handler = xMSF.createInstance("com.sun.star.sdb.InteractionHandler"); - XInteractionHandler xHandler = (XInteractionHandler) - UnoRuntime.queryInterface(XInteractionHandler.class, handler) ; + XInteractionHandler xHandler = UnoRuntime.queryInterface(XInteractionHandler.class, handler) ; - XCompletedConnection xSrcCon = (XCompletedConnection) - UnoRuntime.queryInterface(XCompletedConnection.class, dbSource) ; + XCompletedConnection xSrcCon = UnoRuntime.queryInterface(XCompletedConnection.class, dbSource) ; return xSrcCon.connectWithCompletion(xHandler) ; } @@ -510,7 +505,7 @@ public class DBTools { XResultSet set = stat.executeQuery("SELECT * FROM " + table) ; - XResultSetUpdate updt = (XResultSetUpdate) UnoRuntime.queryInterface + XResultSetUpdate updt = UnoRuntime.queryInterface (XResultSetUpdate.class, set) ; int count = 0 ; @@ -524,7 +519,7 @@ public class DBTools { count ++ ; } - XCloseable xClose = (XCloseable) UnoRuntime.queryInterface + XCloseable xClose = UnoRuntime.queryInterface (XCloseable.class, set) ; xClose.close() ; @@ -556,10 +551,10 @@ public class DBTools { XResultSet set = stat.executeQuery("SELECT * FROM " + table) ; - XResultSetUpdate updt = (XResultSetUpdate) UnoRuntime.queryInterface + XResultSetUpdate updt = UnoRuntime.queryInterface (XResultSetUpdate.class, set) ; - XRowUpdate rowUpdt = (XRowUpdate) UnoRuntime.queryInterface + XRowUpdate rowUpdt = UnoRuntime.queryInterface (XRowUpdate.class, set) ; updt.moveToInsertRow() ; @@ -592,7 +587,7 @@ public class DBTools { updt.insertRow() ; - XCloseable xClose = (XCloseable) UnoRuntime.queryInterface + XCloseable xClose = UnoRuntime.queryInterface (XCloseable.class, set) ; xClose.close() ; } @@ -622,8 +617,7 @@ public class DBTools { * Prints full info about currently registered DataSource's. */ public void printRegisteredDatabasesInfo(PrintWriter out) { - XEnumerationAccess dbContEA = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, dbContext) ; + XEnumerationAccess dbContEA = UnoRuntime.queryInterface(XEnumerationAccess.class, dbContext) ; XEnumeration xEnum = dbContEA.createEnumeration() ; diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index 0c7e6b3913d4..e24037f6c622 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -59,10 +59,10 @@ public class DesktopTools */ public static XComponentLoader getCLoader(XMultiServiceFactory xMSF) { - XDesktop oDesktop = (XDesktop) UnoRuntime.queryInterface( + XDesktop oDesktop = UnoRuntime.queryInterface( XDesktop.class, createDesktop(xMSF)); - XComponentLoader oCLoader = (XComponentLoader) UnoRuntime.queryInterface( + XComponentLoader oCLoader = UnoRuntime.queryInterface( XComponentLoader.class, oDesktop); return oCLoader; @@ -97,7 +97,7 @@ public class DesktopTools */ public static XEnumeration getAllComponents(XMultiServiceFactory xMSF) { - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface( + XDesktop xDesktop = UnoRuntime.queryInterface( XDesktop.class, createDesktop(xMSF)); return xDesktop.getComponents().createEnumeration(); } @@ -109,7 +109,7 @@ public class DesktopTools */ public static XComponent getCurrentComponent(XMultiServiceFactory xMSF) { - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface( + XDesktop xDesktop = UnoRuntime.queryInterface( XDesktop.class, createDesktop(xMSF)); return xDesktop.getCurrentComponent(); } @@ -121,7 +121,7 @@ public class DesktopTools */ public static XFrame getCurrentFrame(XMultiServiceFactory xMSF) { - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface( + XDesktop xDesktop = UnoRuntime.queryInterface( XDesktop.class, createDesktop(xMSF)); return xDesktop.getCurrentFrame(); } @@ -138,8 +138,8 @@ public class DesktopTools */ public static Object[] getAllOpenDocuments(XMultiServiceFactory xMSF) { - ArrayList components = new ArrayList(); - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface( + ArrayList<XComponent> components = new ArrayList<XComponent>(); + XDesktop xDesktop = UnoRuntime.queryInterface( XDesktop.class, createDesktop(xMSF)); XEnumeration allComp = getAllComponents(xMSF); @@ -148,7 +148,7 @@ public class DesktopTools { try { - XComponent xComponent = (XComponent) UnoRuntime.queryInterface( + XComponent xComponent = UnoRuntime.queryInterface( XComponent.class, allComp.nextElement()); if (getDocumentType(xComponent) != null) @@ -293,8 +293,8 @@ public class DesktopTools System.out.println("The property 'KeepDocument' is set and so the document won't be disposed"); return; } - XModifiable modified = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, DocumentToClose); - XCloseable closer = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, DocumentToClose); + XModifiable modified = UnoRuntime.queryInterface(XModifiable.class, DocumentToClose); + XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, DocumentToClose); try { @@ -363,7 +363,7 @@ public class DesktopTools throw new StatusException("Couldn't get toolkit", e); } - XToolkit tk = (XToolkit) UnoRuntime.queryInterface( + XToolkit tk = UnoRuntime.queryInterface( XToolkit.class, oObj); WindowDescriptor descriptor = new com.sun.star.awt.WindowDescriptor(); @@ -408,9 +408,9 @@ public class DesktopTools { try { - XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc); + XModel xMod = UnoRuntime.queryInterface(XModel.class, xDoc); XInterface oCont = xMod.getCurrentController(); - XViewSettingsSupplier oVSSupp = (XViewSettingsSupplier) UnoRuntime.queryInterface(XViewSettingsSupplier.class, oCont); + XViewSettingsSupplier oVSSupp = UnoRuntime.queryInterface(XViewSettingsSupplier.class, oCont); XInterface oViewSettings = oVSSupp.getViewSettings(); XPropertySet oViewProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oViewSettings); @@ -488,9 +488,9 @@ public class DesktopTools // System.out.println("DEBUG: bring to front xModel"); XTopWindow xTopWindow = - (XTopWindow) UnoRuntime.queryInterface( - XTopWindow.class, - xModel.getCurrentController().getFrame().getContainerWindow()); + UnoRuntime.queryInterface( + XTopWindow.class, + xModel.getCurrentController().getFrame().getContainerWindow()); xTopWindow.toFront(); } @@ -498,7 +498,7 @@ public class DesktopTools public static void bringWindowToFront(XComponent xComponent) { // System.out.println("DEBUG: bring to front xComponent"); - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent); if (xModel != null) { bringWindowToFront(xModel); diff --git a/qadevOOo/runner/util/DrawTools.java b/qadevOOo/runner/util/DrawTools.java index 64270d8ca9f9..842f34affee5 100644 --- a/qadevOOo/runner/util/DrawTools.java +++ b/qadevOOo/runner/util/DrawTools.java @@ -68,8 +68,7 @@ public class DrawTools { public static XDrawPages getDrawPages ( XComponent aDoc ) { XDrawPages oDPn = null; try { - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,aDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,aDoc); oDPn = oDPS.getDrawPages(); } catch ( Exception e ) { @@ -105,7 +104,7 @@ public class DrawTools { */ public static XShapes getShapes ( XDrawPage oDP ) { - return (XShapes) UnoRuntime.queryInterface(XShapes.class,oDP); + return UnoRuntime.queryInterface(XShapes.class,oDP); } /** diff --git a/qadevOOo/runner/util/DynamicClassLoader.java b/qadevOOo/runner/util/DynamicClassLoader.java index 702264017176..dbb3dd7972c2 100644 --- a/qadevOOo/runner/util/DynamicClassLoader.java +++ b/qadevOOo/runner/util/DynamicClassLoader.java @@ -31,7 +31,7 @@ public class DynamicClassLoader { * @param className The name of the class to create. * @return The created class. */ - public static Class forName(String className) + public static Class<?> forName(String className) throws ClassNotFoundException { return Class.forName(className) ; @@ -45,7 +45,7 @@ public class DynamicClassLoader { public Object getInstance(String className) throws IllegalArgumentException { try { - Class cls = DynamicClassLoader.forName(className); + Class<?> cls = DynamicClassLoader.forName(className); return cls.newInstance(); } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException("Couldn't find " + className @@ -68,7 +68,7 @@ public class DynamicClassLoader { */ public Object getInstance(String className, Object[] ctorArgs) throws IllegalArgumentException { - Class[] ctorType = new Class[ctorArgs.length]; + Class<?>[] ctorType = new Class[ctorArgs.length]; for(int i=0; i<ctorType.length; i++) { ctorType[i] = ctorArgs[i].getClass(); } @@ -85,11 +85,11 @@ public class DynamicClassLoader { * @param ctorArgs Arguments for the constructor. * @return The instance of the class. */ - public Object getInstance(String className, Class[]ctorClassTypes, Object[] ctorArgs) + public Object getInstance(String className, Class<?>[]ctorClassTypes, Object[] ctorArgs) throws IllegalArgumentException { try { - Class cls = DynamicClassLoader.forName(className); - Constructor ctor = cls.getConstructor(ctorClassTypes); + Class<?> cls = DynamicClassLoader.forName(className); + Constructor<?> ctor = cls.getConstructor(ctorClassTypes); System.out.println("ctor: " + ctor.getName() + " " + ctor.getModifiers()); return ctor.newInstance(ctorArgs); diff --git a/qadevOOo/runner/util/FormTools.java b/qadevOOo/runner/util/FormTools.java index 2dc2f3bc1906..7bafd75047df 100644 --- a/qadevOOo/runner/util/FormTools.java +++ b/qadevOOo/runner/util/FormTools.java @@ -65,8 +65,7 @@ public class FormTools { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); try{ Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); @@ -74,8 +73,8 @@ public class FormTools { XPropertySet model_props = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,aCon); model_props.setPropertyValue("DefaultControl","com.sun.star.form.control."+kind); - aControl = (XControlModel) UnoRuntime.queryInterface( XControlModel.class, aCon ); - oCShape = (XControlShape) UnoRuntime.queryInterface( XControlShape.class, oInt ); + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon ); + oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt ); size.Height = height; size.Width = width; position.X = x; @@ -101,7 +100,7 @@ public class FormTools { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); try{ Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); @@ -109,8 +108,8 @@ public class FormTools { XPropertySet model_props = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,aCon); model_props.setPropertyValue("DefaultControl","com.sun.star.awt."+defControl); - aControl = (XControlModel) UnoRuntime.queryInterface( XControlModel.class, aCon ); - oCShape = (XControlShape) UnoRuntime.queryInterface( XControlShape.class, oInt ); + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon ); + oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt ); size.Height = height; size.Width = width; position.X = x; @@ -138,14 +137,14 @@ public class FormTools { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); try{ Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance("com.sun.star.form.component."+kind); - aControl = (XControlModel) UnoRuntime.queryInterface( XControlModel.class, aCon ); - oCShape = (XControlShape) UnoRuntime.queryInterface( XControlShape.class, oInt ); + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon ); + oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt ); size.Height = height; size.Width = width; position.X = x; @@ -168,8 +167,7 @@ public class FormTools { XInterface oControl = null; - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc ); try{ oControl = (XInterface) oDocMSF.createInstance( @@ -183,16 +181,16 @@ public class FormTools { public static XNameContainer getForms ( XDrawPage oDP ) { - XFormsSupplier oFS = (XFormsSupplier) UnoRuntime.queryInterface( + XFormsSupplier oFS = UnoRuntime.queryInterface( XFormsSupplier.class,oDP); return oFS.getForms(); } //finish getForms public static XIndexContainer getIndexedForms ( XDrawPage oDP ) { - XFormsSupplier oFS = (XFormsSupplier) UnoRuntime.queryInterface( + XFormsSupplier oFS = UnoRuntime.queryInterface( XFormsSupplier.class,oDP); - return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, + return UnoRuntime.queryInterface( XIndexContainer.class, oFS.getForms() ); } //finish getIndexedForms @@ -231,7 +229,7 @@ public class FormTools { formProps.setPropertyValue("DataSourceName","Bibliography"); formProps.setPropertyValue("Command","biblio"); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); - formLoader = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, the_form); + formLoader = UnoRuntime.queryInterface(XLoadable.class, the_form); } catch (Exception ex) { System.out.println("Exception: "+ex); @@ -261,7 +259,7 @@ public class FormTools { formProps.setPropertyValue("Command",tableName); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); - return (XLoadable) UnoRuntime.queryInterface(XLoadable.class, the_form); + return UnoRuntime.queryInterface(XLoadable.class, the_form); } public static XLoadable bindForm( XTextDocument aDoc, String formName ) { @@ -273,7 +271,7 @@ public class FormTools { formProps.setPropertyValue("DataSourceName","Bibliography"); formProps.setPropertyValue("Command","biblio"); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); - formLoader = (XLoadable) UnoRuntime.queryInterface(XLoadable.class, the_form); + formLoader = UnoRuntime.queryInterface(XLoadable.class, the_form); } catch (Exception ex) { System.out.println("Exception: "+ex); @@ -304,22 +302,21 @@ public class FormTools { formProps.setPropertyValue("Command",tableName); formProps.setPropertyValue("CommandType",new Integer(com.sun.star.sdb.CommandType.TABLE)); - return (XLoadable) UnoRuntime.queryInterface(XLoadable.class, the_form); + return UnoRuntime.queryInterface(XLoadable.class, the_form); } public static void switchDesignOf(XMultiServiceFactory xMSF, XTextDocument aDoc) { try { com.sun.star.frame.XController aController = aDoc.getCurrentController(); com.sun.star.frame.XFrame aFrame = aController.getFrame(); - com.sun.star.frame.XDispatchProvider aDispProv = (com.sun.star.frame.XDispatchProvider) - UnoRuntime.queryInterface(com.sun.star.frame.XDispatchProvider.class,aFrame); + com.sun.star.frame.XDispatchProvider aDispProv = UnoRuntime.queryInterface(com.sun.star.frame.XDispatchProvider.class,aFrame); com.sun.star.util.URL aURL = new com.sun.star.util.URL(); aURL.Complete = ".uno:SwitchControlDesignMode"; Object instance = xMSF.createInstance("com.sun.star.util.URLTransformer"); com.sun.star.util.XURLTransformer atrans = - (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface( - com.sun.star.util.XURLTransformer.class,instance); + UnoRuntime.queryInterface( + com.sun.star.util.XURLTransformer.class,instance); com.sun.star.util.URL[] aURLA = new com.sun.star.util.URL[1]; aURLA[0] = aURL; atrans.parseStrict(aURLA); diff --git a/qadevOOo/runner/util/FrameDsc.java b/qadevOOo/runner/util/FrameDsc.java index 86a80465f0eb..e5448afa651c 100644 --- a/qadevOOo/runner/util/FrameDsc.java +++ b/qadevOOo/runner/util/FrameDsc.java @@ -85,7 +85,7 @@ public class FrameDsc extends InstDescr { } catch( com.sun.star.uno.Exception cssuE ){ } - XShape shape = (XShape)UnoRuntime.queryInterface( XShape.class, SrvObj ); + XShape shape = UnoRuntime.queryInterface( XShape.class, SrvObj ); try { shape.setSize(size); } diff --git a/qadevOOo/runner/util/InstCreator.java b/qadevOOo/runner/util/InstCreator.java index bfd894c0e296..684b93479dd8 100644 --- a/qadevOOo/runner/util/InstCreator.java +++ b/qadevOOo/runner/util/InstCreator.java @@ -43,7 +43,7 @@ public class InstCreator implements XInstCreator { this.xParent = xParent; this.iDsc = iDsc; - xMSF = (XMultiServiceFactory)UnoRuntime.queryInterface( + xMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xParent ); xInstance = createInstance(); @@ -70,44 +70,39 @@ public class InstCreator implements XInstCreator { XNameAccess oNA = null; if ( iDsc instanceof TableDsc ) { - XTextTablesSupplier oTTS = (XTextTablesSupplier) - UnoRuntime.queryInterface( - XTextTablesSupplier.class, xParent ); + XTextTablesSupplier oTTS = UnoRuntime.queryInterface( + XTextTablesSupplier.class, xParent ); oNA = oTTS.getTextTables(); } if ( iDsc instanceof FrameDsc ) { - XTextFramesSupplier oTTS = (XTextFramesSupplier) - UnoRuntime.queryInterface( - XTextFramesSupplier.class, xParent ); + XTextFramesSupplier oTTS = UnoRuntime.queryInterface( + XTextFramesSupplier.class, xParent ); oNA = oTTS.getTextFrames(); } if ( iDsc instanceof BookmarkDsc ) { - XBookmarksSupplier oTTS = (XBookmarksSupplier) - UnoRuntime.queryInterface( - XBookmarksSupplier.class, xParent ); + XBookmarksSupplier oTTS = UnoRuntime.queryInterface( + XBookmarksSupplier.class, xParent ); oNA = oTTS.getBookmarks(); } if ( iDsc instanceof FootnoteDsc ) { - XFootnotesSupplier oTTS = (XFootnotesSupplier) - UnoRuntime.queryInterface( - XFootnotesSupplier.class, xParent ); + XFootnotesSupplier oTTS = UnoRuntime.queryInterface( + XFootnotesSupplier.class, xParent ); return( oTTS.getFootnotes() ); } if ( iDsc instanceof TextSectionDsc ) { - XTextSectionsSupplier oTSS = (XTextSectionsSupplier) - UnoRuntime.queryInterface( - XTextSectionsSupplier.class, xParent ); + XTextSectionsSupplier oTSS = UnoRuntime.queryInterface( + XTextSectionsSupplier.class, xParent ); oNA = oTSS.getTextSections(); } - return (XIndexAccess)UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XIndexAccess.class, oNA); } }
\ No newline at end of file diff --git a/qadevOOo/runner/util/InstDescr.java b/qadevOOo/runner/util/InstDescr.java index 14a7bc89f0db..7b349b0f8427 100644 --- a/qadevOOo/runner/util/InstDescr.java +++ b/qadevOOo/runner/util/InstDescr.java @@ -25,7 +25,7 @@ import com.sun.star.uno.XInterface; */ abstract public class InstDescr { - protected Class ifcClass = null; + protected Class<?> ifcClass = null; protected abstract String getIfcName(); protected abstract String getName(); @@ -33,7 +33,7 @@ abstract public class InstDescr { /** * the method getIfcClass */ - public Class getIfcClass() { + public Class<?> getIfcClass() { return ifcClass; } /** diff --git a/qadevOOo/runner/util/RegistryTools.java b/qadevOOo/runner/util/RegistryTools.java index cff6783272c1..d8129087d4f9 100644 --- a/qadevOOo/runner/util/RegistryTools.java +++ b/qadevOOo/runner/util/RegistryTools.java @@ -43,7 +43,7 @@ public class RegistryTools { Object oInterface = xMSF.createInstance ("com.sun.star.registry.SimpleRegistry"); - return (XSimpleRegistry) UnoRuntime.queryInterface ( + return UnoRuntime.queryInterface ( XSimpleRegistry.class, oInterface) ; } diff --git a/qadevOOo/runner/util/SOfficeFactory.java b/qadevOOo/runner/util/SOfficeFactory.java index 27398b2f486e..327b271c946c 100644 --- a/qadevOOo/runner/util/SOfficeFactory.java +++ b/qadevOOo/runner/util/SOfficeFactory.java @@ -44,7 +44,7 @@ import com.sun.star.awt.*; public class SOfficeFactory { - private static HashMap lookup = new HashMap(10); + private static HashMap<String, SOfficeFactory> lookup = new HashMap<String, SOfficeFactory>(10); protected XComponentLoader oCLoader; private SOfficeFactory(XMultiServiceFactory xMSF) { @@ -58,16 +58,16 @@ public class SOfficeFactory { } // query the desktop interface and then it's componentloader - XDesktop oDesktop = (XDesktop) UnoRuntime.queryInterface( + XDesktop oDesktop = UnoRuntime.queryInterface( XDesktop.class, oInterface); - oCLoader = (XComponentLoader) UnoRuntime.queryInterface( + oCLoader = UnoRuntime.queryInterface( XComponentLoader.class, oDesktop); } public static SOfficeFactory getFactory(XMultiServiceFactory xMSF) { - SOfficeFactory soFactory = (SOfficeFactory) lookup.get(new Integer(xMSF.hashCode()).toString()); + SOfficeFactory soFactory = lookup.get(new Integer(xMSF.hashCode()).toString()); if (soFactory == null) { soFactory = new SOfficeFactory(xMSF); @@ -92,7 +92,7 @@ public class SOfficeFactory { if (oDoc != null) { DesktopTools.bringWindowToFront(oDoc); - return (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, oDoc); + return UnoRuntime.queryInterface(XTextDocument.class, oDoc); } else { return null; } @@ -111,7 +111,7 @@ public class SOfficeFactory { if (oDoc != null) { DesktopTools.bringWindowToFront(oDoc); - return (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, oDoc); + return UnoRuntime.queryInterface(XTextDocument.class, oDoc); } else { return null; } @@ -129,7 +129,7 @@ public class SOfficeFactory { if (oDoc != null) { DesktopTools.bringWindowToFront(oDoc); - return (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, oDoc); + return UnoRuntime.queryInterface(XSpreadsheetDocument.class, oDoc); } else { return null; } @@ -147,7 +147,7 @@ public class SOfficeFactory { if (oDoc != null) { DesktopTools.bringWindowToFront(oDoc); - return (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, oDoc); + return UnoRuntime.queryInterface(XSpreadsheetDocument.class, oDoc); } else { return null; } @@ -225,7 +225,7 @@ public class SOfficeFactory { if (oDoc != null) { DesktopTools.bringWindowToFront(oDoc); - return (XChartDocument) UnoRuntime.queryInterface(XChartDocument.class, oDoc); + return UnoRuntime.queryInterface(XChartDocument.class, oDoc); } else { return null; } @@ -290,7 +290,7 @@ public class SOfficeFactory { public static void insertString(XTextDocument xTextDoc, String cString) throws com.sun.star.uno.Exception { XText xText = xTextDoc.getText(); - XText oText = (XText) UnoRuntime.queryInterface( + XText oText = UnoRuntime.queryInterface( XText.class, xText); XTextCursor oCursor = oText.createTextCursor(); @@ -301,7 +301,7 @@ public class SOfficeFactory { XTextContent xCont) throws com.sun.star.lang.IllegalArgumentException { XText xText = xTextDoc.getText(); - XText oText = (XText) UnoRuntime.queryInterface( + XText oText = UnoRuntime.queryInterface( XText.class, xText); XTextCursor oCursor = oText.createTextCursor(); @@ -367,12 +367,12 @@ public class SOfficeFactory { public static XTextContent createIndex(XTextDocument xTextDoc, String kind) throws com.sun.star.uno.Exception { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object oInt = oDocMSF.createInstance(kind); - XTextContent xTC = (XTextContent) UnoRuntime.queryInterface(XDocumentIndex.class, oInt); + XTextContent xTC = UnoRuntime.queryInterface(XDocumentIndex.class, oInt); return xTC; @@ -381,7 +381,7 @@ public class SOfficeFactory { public static XSpreadsheet createSpreadsheet(XSpreadsheetDocument oDoc) throws com.sun.star.uno.Exception { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); Object oInt = oDocMSF.createInstance( "com.sun.star.sheet.Spreadsheet"); @@ -393,10 +393,10 @@ public class SOfficeFactory { public static XIndexAccess getTableCollection(XTextDocument oDoc) { - XTextTablesSupplier oTTS = (XTextTablesSupplier) UnoRuntime.queryInterface(XTextTablesSupplier.class, oDoc); + XTextTablesSupplier oTTS = UnoRuntime.queryInterface(XTextTablesSupplier.class, oDoc); XNameAccess oNA = oTTS.getTextTables(); - XIndexAccess oIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oNA); + XIndexAccess oIA = UnoRuntime.queryInterface(XIndexAccess.class, oNA); return oIA; } @@ -433,11 +433,11 @@ public class SOfficeFactory { XDiagram oDiagram = null; //get LineDiagram - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); try { oInterface = (XInterface) oDocMSF.createInstance("com.sun.star.chart." + kind); - oDiagram = (XDiagram) UnoRuntime.queryInterface(XDiagram.class, oInterface); + oDiagram = UnoRuntime.queryInterface(XDiagram.class, oInterface); } catch (Exception e) { // Some exception occures.FAILED System.out.println("Couldn't create " + kind + "-Diagram " + e); @@ -452,7 +452,7 @@ public class SOfficeFactory { XInterface oControl = null; - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); try { oControl = (XInterface) oDocMSF.createInstance("com.sun.star.form.component." + kind); @@ -470,7 +470,7 @@ public class SOfficeFactory { Object oInstance = null; - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); try { oInstance = (Object) oDocMSF.createInstance(kind); @@ -489,13 +489,13 @@ public class SOfficeFactory { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); try { Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance("com.sun.star.form.component." + kind); - aControl = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, aCon); - oCShape = (XControlShape) UnoRuntime.queryInterface(XControlShape.class, oInt); + aControl = UnoRuntime.queryInterface(XControlModel.class, aCon); + oCShape = UnoRuntime.queryInterface(XControlShape.class, oInt); size.Height = height; size.Width = width; position.X = x; diff --git a/qadevOOo/runner/util/SysUtils.java b/qadevOOo/runner/util/SysUtils.java index 6252a7eb930d..78abc9502883 100644 --- a/qadevOOo/runner/util/SysUtils.java +++ b/qadevOOo/runner/util/SysUtils.java @@ -41,7 +41,7 @@ public class SysUtils { return jh; } - static ArrayList files = new ArrayList(); + static ArrayList<String> files = new ArrayList<String>(); public static Object[] traverse( String afileDirectory ) { @@ -89,7 +89,7 @@ public class SysUtils { XComponent ac = null; try { Object desk = msf.createInstance("com.sun.star.frame.Desktop"); - XDesktop xDesk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,desk); + XDesktop xDesk = UnoRuntime.queryInterface(XDesktop.class,desk); ac = xDesk.getCurrentComponent(); } catch (com.sun.star.uno.Exception e) { System.out.println("Couldn't get active Component"); @@ -100,7 +100,7 @@ public class SysUtils { public static XFrame getActiveFrame(XMultiServiceFactory msf) { try { Object desk = msf.createInstance("com.sun.star.frame.Desktop"); - XDesktop xDesk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,desk); + XDesktop xDesk = UnoRuntime.queryInterface(XDesktop.class,desk); return xDesk.getCurrentFrame(); } catch (com.sun.star.uno.Exception e) { System.out.println("Couldn't get active Component"); @@ -122,7 +122,7 @@ public class SysUtils { public static String getSysClipboardText(XMultiServiceFactory msf) throws com.sun.star.uno.Exception { - XClipboard xCB = (XClipboard) UnoRuntime.queryInterface + XClipboard xCB = UnoRuntime.queryInterface (XClipboard.class, msf.createInstance ("com.sun.star.datatransfer.clipboard.SystemClipboard")); diff --git a/qadevOOo/runner/util/UITools.java b/qadevOOo/runner/util/UITools.java index a489498fd8b4..bb35f80fd87e 100644 --- a/qadevOOo/runner/util/UITools.java +++ b/qadevOOo/runner/util/UITools.java @@ -61,7 +61,7 @@ public class UITools { public UITools(XMultiServiceFactory msf, XTextDocument xTextDoc) { mMSF = msf; - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); mXRoot = makeRoot(mMSF, xModel); } @@ -80,23 +80,20 @@ public class UITools { private static String getString(XInterface xInt) { - XAccessibleText oText = (XAccessibleText) - UnoRuntime.queryInterface(XAccessibleText.class, xInt); + XAccessibleText oText = UnoRuntime.queryInterface(XAccessibleText.class, xInt); return oText.getText(); } private static void setString(XInterface xInt, String cText) { - XAccessibleEditableText oText = (XAccessibleEditableText) - UnoRuntime.queryInterface(XAccessibleEditableText.class, xInt); + XAccessibleEditableText oText = UnoRuntime.queryInterface(XAccessibleEditableText.class, xInt); oText.setText(cText); } private static Object getValue(XInterface xInt) { - XAccessibleValue oValue = (XAccessibleValue) - UnoRuntime.queryInterface(XAccessibleValue.class, xInt); + XAccessibleValue oValue = UnoRuntime.queryInterface(XAccessibleValue.class, xInt); return oValue.getCurrentValue(); } @@ -154,8 +151,7 @@ public class UITools { if (oButton == null){ throw new Exception("Could not get button '" + buttonName + "'"); } - XAccessibleAction oAction = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, oButton); + XAccessibleAction oAction = UnoRuntime.queryInterface(XAccessibleAction.class, oButton); // "click" the button try{ @@ -183,8 +179,7 @@ public class UITools { if (oButton != null){ boolean isChecked = oButton.getAccessibleStateSet().contains(com.sun.star.accessibility.AccessibleStateType.CHECKED); if((isChecked && !toBePressed) || (!isChecked && toBePressed)){ - XAccessibleAction oAction = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, oButton); + XAccessibleAction oAction = UnoRuntime.queryInterface(XAccessibleAction.class, oButton); try{ // "click" the button oAction.doAccessibleAction(0); @@ -269,8 +264,7 @@ public class UITools { XInterface xRB =mAT.getAccessibleObjectForRole(mXRoot, AccessibleRole.RADIO_BUTTON, buttonName); if(xRB == null) System.out.println("AccessibleObjectForRole couldn't be found for " + buttonName); - XAccessibleValue oValue = (XAccessibleValue) - UnoRuntime.queryInterface(XAccessibleValue.class, xRB); + XAccessibleValue oValue = UnoRuntime.queryInterface(XAccessibleValue.class, xRB); if(oValue == null) System.out.println("XAccessibleValue couldn't be queried for " + buttonName); oValue.setCurrentValue(new Integer(iValue)); @@ -301,15 +295,13 @@ public class UITools { xListBox =mAT.getAccessibleObjectForRole(mXRoot, AccessibleRole.PANEL, ListBoxName); } - XAccessible xListBoxAccess = (XAccessible) - UnoRuntime.queryInterface(XAccessible.class, xListBox); + XAccessible xListBoxAccess = UnoRuntime.queryInterface(XAccessible.class, xListBox); // if a List is not pulled to be open all entries are not visiblle, therefore the // boolean argument XAccessibleContext xList =mAT.getAccessibleObjectForRole( xListBoxAccess, AccessibleRole.LIST, true); - XAccessibleSelection xListSelect = (XAccessibleSelection) - UnoRuntime.queryInterface(XAccessibleSelection.class, xList); + XAccessibleSelection xListSelect = UnoRuntime.queryInterface(XAccessibleSelection.class, xList); xListSelect.selectAccessibleChild(nChildIndex); @@ -329,7 +321,7 @@ public class UITools { public Object[] getListBoxObjects(String ListBoxName) throws java.lang.Exception { - ArrayList Items = new ArrayList(); + ArrayList<XInterface> Items = new ArrayList<XInterface>(); try { XAccessibleContext xListBox = null; XAccessibleContext xList = null; @@ -349,8 +341,7 @@ public class UITools { // all other list boxes have a children of kind of LIST } else { - XAccessible xListBoxAccess = (XAccessible) - UnoRuntime.queryInterface(XAccessible.class, xListBox); + XAccessible xListBoxAccess = UnoRuntime.queryInterface(XAccessible.class, xListBox); // if a List is not pulled to be open all entries are not visiblle, therefore the // boolean argument xList =mAT.getAccessibleObjectForRole( @@ -393,7 +384,7 @@ public class UITools { public String[] getListBoxItems(String ListBoxName) throws java.lang.Exception { - ArrayList Items = new ArrayList(); + ArrayList<String> Items = new ArrayList<String>(); try { XAccessibleContext xListBox = null; XAccessibleContext xList = null; @@ -413,8 +404,7 @@ public class UITools { // all other list boxes have a children of kind of LIST } else { - XAccessible xListBoxAccess = (XAccessible) - UnoRuntime.queryInterface(XAccessible.class, xListBox); + XAccessible xListBoxAccess = UnoRuntime.queryInterface(XAccessible.class, xListBox); // if a List is not pulled to be open all entries are not visiblle, therefore the // boolean argument xList =mAT.getAccessibleObjectForRole( @@ -441,7 +431,7 @@ public class UITools { + ListBoxName + "' : " + e.toString()); } String[]ret = new String[Items.size()]; - return (String[])Items.toArray(ret); + return Items.toArray(ret); } /** * set to a named nureric filed a given value @@ -456,9 +446,8 @@ public class UITools { XInterface xNumericField =mAT.getAccessibleObjectForRole( mXRoot, AccessibleRole.TEXT, NumericFieldName); //util.dbg.printInterfaces(xNumericField); - XAccessibleEditableText oValue = (XAccessibleEditableText) - UnoRuntime.queryInterface( - XAccessibleEditableText.class, xNumericField); + XAccessibleEditableText oValue = UnoRuntime.queryInterface( + XAccessibleEditableText.class, xNumericField); setString(xNumericField, cValue); } catch (Exception e) { @@ -566,8 +555,7 @@ public class UITools { try{ XAccessibleContext xTextField =mAT.getAccessibleObjectForRole(mXRoot, AccessibleRole.SCROLL_PANE, TextFieldName); - XAccessible xTextFieldAccess = (XAccessible) - UnoRuntime.queryInterface(XAccessible.class, xTextField); + XAccessible xTextFieldAccess = UnoRuntime.queryInterface(XAccessible.class, xTextField); XAccessibleContext xFrame =mAT.getAccessibleObjectForRole( xTextFieldAccess, AccessibleRole.TEXT_FRAME); for (int i=0;i<xFrame.getAccessibleChildCount();i++) { @@ -608,8 +596,7 @@ public class UITools { try { XInterface xCheckBox =mAT.getAccessibleObjectForRole(mXRoot, AccessibleRole.CHECK_BOX, CheckBoxName); - XAccessibleValue xCheckBoxValue = (XAccessibleValue) - UnoRuntime.queryInterface(XAccessibleValue.class, xCheckBox); + XAccessibleValue xCheckBoxValue = UnoRuntime.queryInterface(XAccessibleValue.class, xCheckBox); xCheckBoxValue.setCurrentValue(Value); } catch (Exception e) { @@ -630,8 +617,7 @@ public class UITools { try { XInterface xCheckBox =mAT.getAccessibleObjectForRole(mXRoot, AccessibleRole.CHECK_BOX, CheckBoxName); - XAccessibleValue xCheckBoxValue = (XAccessibleValue) - UnoRuntime.queryInterface(XAccessibleValue.class, xCheckBox); + XAccessibleValue xCheckBoxValue = UnoRuntime.queryInterface(XAccessibleValue.class, xCheckBox); return (Integer) xCheckBoxValue.getCurrentValue(); } catch (Exception e) { @@ -677,8 +663,7 @@ public class UITools { } catch (com.sun.star.uno.Exception e) { throw new Exception("Could not toolkit: " + e.toString()); } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, xToolKit); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xToolKit); int count = tk.getTopWindowCount(); @@ -706,13 +691,13 @@ public class UITools { if (retWindow == null) System.out.println("could not found window with name '" + WindowName + "'"); System.out.println("<- getTopWindow "); } - return (XWindow) UnoRuntime.queryInterface(XWindow.class, retWindow); + return UnoRuntime.queryInterface(XWindow.class, retWindow); } public void clickMiddleOfAccessibleObject(short role, String name){ XAccessibleContext xAcc =mAT.getAccessibleObjectForRole(mXRoot, role, name); - XAccessibleComponent aComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent aComp = UnoRuntime.queryInterface( XAccessibleComponent.class, xAcc); System.out.println(xAcc.getAccessibleRole() + "," + @@ -744,7 +729,7 @@ public class UITools { public void doubleClickMiddleOfAccessibleObject(short role, String name) { XAccessibleContext xAcc =mAT.getAccessibleObjectForRole(mXRoot, role, name); - XAccessibleComponent aComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent aComp = UnoRuntime.queryInterface( XAccessibleComponent.class, xAcc); System.out.println(xAcc.getAccessibleRole() + "," + diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index b2e9b2873654..00c86ff4138e 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -748,7 +748,7 @@ public class ValueChanger { if (oldValue instanceof com.sun.star.uno.Enum) { // universal changer for Enumerations try { - Class enumClass = oldValue.getClass() ; + Class<?> enumClass = oldValue.getClass() ; Field[] flds = enumClass.getFields() ; newValue = null ; @@ -861,7 +861,7 @@ public class ValueChanger { } else if (oldValue.getClass().isArray()) { // changer for arrays : changes all elements - Class arrType = oldValue.getClass().getComponentType() ; + Class<?> arrType = oldValue.getClass().getComponentType() ; newValue = Array.newInstance(arrType, Array.getLength(oldValue)) ; for (int i = 0; i < Array.getLength(newValue); i++) { if (!arrType.isPrimitive()) { @@ -900,13 +900,13 @@ public class ValueChanger { } else if (isStructure(oldValue)) { // universal changer for structures - Class clazz = oldValue.getClass() ; + Class<?> clazz = oldValue.getClass() ; try { newValue = clazz.newInstance() ; Field[] fields = clazz.getFields(); for (int i = 0; i < fields.length; i++) { if ((fields[i].getModifiers() & Modifier.PUBLIC) != 0) { - Class fType = fields[i].getType() ; + Class<?> fType = fields[i].getType() ; Field field = fields[i] ; if (!fType.isPrimitive()) { field.set(newValue, changePValue(field.get(oldValue))); diff --git a/qadevOOo/runner/util/ValueComparer.java b/qadevOOo/runner/util/ValueComparer.java index 47dd0a9e7f5f..3ce1719156d5 100644 --- a/qadevOOo/runner/util/ValueComparer.java +++ b/qadevOOo/runner/util/ValueComparer.java @@ -73,7 +73,7 @@ public class ValueComparer { if ( pv1.length != pv2.length) { return false; } - HashMap hm1 = new HashMap(); + HashMap<String, Object> hm1 = new HashMap<String, Object>(); boolean result = true; int i = 0; diff --git a/qadevOOo/runner/util/WaitUnreachable.java b/qadevOOo/runner/util/WaitUnreachable.java index cfae04a08d16..33e383be95de 100644 --- a/qadevOOo/runner/util/WaitUnreachable.java +++ b/qadevOOo/runner/util/WaitUnreachable.java @@ -48,7 +48,7 @@ public final class WaitUnreachable { public WaitUnreachable(Object obj) { this.obj = obj; queue = new ReferenceQueue(); - ref = new PhantomReference(obj, queue); + ref = new PhantomReference<Object>(obj, queue); } /** @@ -114,5 +114,5 @@ public final class WaitUnreachable { private Object obj; private final ReferenceQueue queue; - private final PhantomReference ref; + private final PhantomReference<Object> ref; } diff --git a/qadevOOo/runner/util/WriterTools.java b/qadevOOo/runner/util/WriterTools.java index 82c7208a0229..7b6b0cc8d18b 100644 --- a/qadevOOo/runner/util/WriterTools.java +++ b/qadevOOo/runner/util/WriterTools.java @@ -40,7 +40,7 @@ public class WriterTools { public static XTextDocument createTextDoc(XMultiServiceFactory xMSF) { PropertyValue[] Args = new PropertyValue[0]; XComponent comp = DesktopTools.openNewDoc(xMSF, "swriter", Args); - XTextDocument WriterDoc = (XTextDocument) UnoRuntime.queryInterface( + XTextDocument WriterDoc = UnoRuntime.queryInterface( XTextDocument.class, comp); return WriterDoc; @@ -57,7 +57,7 @@ public class WriterTools { public static XTextDocument loadTextDoc(XMultiServiceFactory xMSF, String url, PropertyValue[] Args) { XComponent comp = DesktopTools.loadDoc(xMSF, url, Args); - XTextDocument WriterDoc = (XTextDocument) UnoRuntime.queryInterface( + XTextDocument WriterDoc = UnoRuntime.queryInterface( XTextDocument.class, comp); return WriterDoc; @@ -67,7 +67,7 @@ public class WriterTools { XDrawPage oDP = null; try { - XDrawPageSupplier oDPS = (XDrawPageSupplier) UnoRuntime.queryInterface( + XDrawPageSupplier oDPS = UnoRuntime.queryInterface( XDrawPageSupplier.class, aDoc); oDP = (XDrawPage) oDPS.getDrawPage(); } catch (Exception e) { @@ -87,7 +87,7 @@ public class WriterTools { XText the_text = aDoc.getText(); XTextCursor the_cursor = the_text.createTextCursor(); - XTextContent the_content = (XTextContent) UnoRuntime.queryInterface( + XTextContent the_content = UnoRuntime.queryInterface( XTextContent.class, oGObject); the_text.insertTextContent(the_cursor, the_content, true); @@ -101,7 +101,7 @@ public class WriterTools { oProps.setPropertyValue("Width", new Integer(width)); oProps.setPropertyValue("Height", new Integer(height)); - XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed the_name = UnoRuntime.queryInterface(XNamed.class, oGObject); the_name.setName(name); } catch (Exception ex) { diff --git a/qadevOOo/runner/util/XMLTools.java b/qadevOOo/runner/util/XMLTools.java index c5acb225b048..bfaa6b53f405 100644 --- a/qadevOOo/runner/util/XMLTools.java +++ b/qadevOOo/runner/util/XMLTools.java @@ -58,8 +58,8 @@ public class XMLTools { public String Type ; public String Value ; } - private Hashtable attrByName = new Hashtable() ; - private ArrayList attributes = new ArrayList() ; + private Hashtable<String, Attribute> attrByName = new Hashtable<String, Attribute>() ; + private ArrayList<Attribute> attributes = new ArrayList<Attribute>() ; private PrintWriter log = null ; /** @@ -128,7 +128,7 @@ public class XMLTools { } public String getNameByIndex(short idx) { - String name = ((Attribute) attributes.get(idx)).Name ; + String name = attributes.get(idx).Name ; if (log != null) log.println("getNameByIndex(" + idx + ") called -> '" + name + "'") ; @@ -136,7 +136,7 @@ public class XMLTools { } public String getTypeByIndex(short idx) { - String type = ((Attribute) attributes.get(idx)).Type ; + String type = attributes.get(idx).Type ; if (log != null) log.println("getTypeByIndex(" + idx + ") called -> '" + type + "'") ; @@ -144,14 +144,14 @@ public class XMLTools { } public String getTypeByName(String name) { - String type = ((Attribute) attrByName.get(name)).Type ; + String type = attrByName.get(name).Type ; if (log != null) log.println("getTypeByName('" + name + "') called -> '" + type + "'") ; return type; } public String getValueByIndex(short idx) { - String value = ((Attribute) attributes.get(idx)).Value ; + String value = attributes.get(idx).Value ; if (log != null) log.println("getValueByIndex(" + idx + ") called -> '" + value + "'") ; @@ -159,7 +159,7 @@ public class XMLTools { } public String getValueByName(String name) { - String value = ((Attribute) attrByName.get(name)).Value ; + String value = attrByName.get(name).Value ; if (log != null) log.println("getValueByName('" + name + "') called -> '" + value + "'") ; @@ -255,7 +255,7 @@ public class XMLTools { public static class XMLWellFormChecker extends XMLWriter { protected boolean docStarted = false ; protected boolean docEnded = false ; - protected ArrayList tagStack = new ArrayList() ; + protected ArrayList<String> tagStack = new ArrayList<String>() ; protected boolean wellFormed = true ; protected boolean noOtherErrors = true ; protected PrintWriter log = null ; @@ -279,7 +279,7 @@ public class XMLTools { public void reset() { docStarted = false ; docEnded = false ; - tagStack = new ArrayList() ; + tagStack = new ArrayList<String>() ; wellFormed = true ; noOtherErrors = true ; PrintWriter log = null ; @@ -320,7 +320,7 @@ public class XMLTools { wellFormed = false ; printError("No tags to close (bad closing tag </" + name + ">)") ; } else { - String startTag = (String) tagStack.get(0) ; + String startTag = tagStack.get(0) ; tagStack.remove(0) ; if (!startTag.equals(name)) { wellFormed = false ; @@ -355,7 +355,7 @@ public class XMLTools { if (printXMLData) return ; log.println(" Tag trace :") ; for (int i = 0; i < tagStack.size(); i++) { - String tag = (String) tagStack.get(i) ; + String tag = tagStack.get(i) ; log.println(" <" + tag + ">") ; } } @@ -411,7 +411,7 @@ public class XMLTools { if (!outerTag.equals("")) { boolean isInTag = false ; for (int i = 0; i < tagStack.size(); i++) { - if (outerTag.equals((String) tagStack.get(i))) { + if (outerTag.equals(tagStack.get(i))) { isInTag = true ; break ; } @@ -434,7 +434,7 @@ public class XMLTools { if (!outerTag.equals("")) { boolean isInTag = false ; for (int i = 0; i < tagStack.size(); i++) { - if (outerTag.equals((String) tagStack.get(i))) { + if (outerTag.equals(tagStack.get(i))) { isInTag = true ; break ; } @@ -456,21 +456,21 @@ public class XMLTools { public boolean checkTags() { allOK &= isWellFormed() ; - Enumeration badTags = tags.keys() ; - Enumeration badChars = chars.keys() ; + Enumeration<String> badTags = tags.keys() ; + Enumeration<String> badChars = chars.keys() ; if (badTags.hasMoreElements()) { allOK = false ; log.println("Required tags were not found in export :") ; while(badTags.hasMoreElements()) { - log.println(" <" + ((String) badTags.nextElement()) + ">") ; + log.println(" <" + badTags.nextElement() + ">") ; } } if (badChars.hasMoreElements()) { allOK = false ; log.println("Required characters were not found in export :") ; while(badChars.hasMoreElements()) { - log.println(" <" + ((String) badChars.nextElement()) + ">") ; + log.println(" <" + badChars.nextElement() + ">") ; } } reset(); @@ -622,11 +622,11 @@ public class XMLTools { * character data exists inside any tag specified. */ public static class XMLChecker extends XMLWellFormChecker { - protected HashSet tagSet = new HashSet() ; - protected ArrayList tags = new ArrayList() ; - protected ArrayList chars = new ArrayList() ; - protected ArrayList tagStack = new ArrayList() ; - protected ArrayList attrStack = new ArrayList() ; + protected HashSet<String> tagSet = new HashSet<String>() ; + protected ArrayList<Tag[]> tags = new ArrayList<Tag[]>() ; + protected ArrayList<Object[]> chars = new ArrayList<Object[]>() ; + protected ArrayList<String> tagStack = new ArrayList<String>() ; + protected ArrayList<AttributeList> attrStack = new ArrayList<AttributeList>() ; public XMLChecker(PrintWriter log, boolean writeXML) { super(log, writeXML) ; @@ -656,15 +656,15 @@ public class XMLTools { if (tagSet.contains(name)) { for (int i = 0; i < tags.size(); i++) { - Tag[] tag = (Tag[]) tags.get(i); + Tag[] tag = tags.get(i); if (tag[0].isMatchTo(name, attr)) { if (tag[1] == null) { tags.remove(i--); } else { boolean isInStack = false ; for (int j = 0; j < tagStack.size(); j++) { - if (tag[1].isMatchTo((String) tagStack.get(j), - (XAttributeList) attrStack.get(j))) { + if (tag[1].isMatchTo(tagStack.get(j), + attrStack.get(j))) { isInStack = true ; break ; @@ -688,15 +688,15 @@ public class XMLTools { public void characters(String ch) { super.characters(ch) ; for (int i = 0; i < chars.size(); i++) { - Object[] chr = (Object[]) chars.get(i); + Object[] chr = chars.get(i); if (((String) chr[0]).equals(ch)) { if (chr[1] == null) { chars.remove(i--); } else { boolean isInStack = false ; for (int j = 0; j < tagStack.size(); j++) { - if (((Tag) chr[1]).isMatchTo((String) tagStack.get(j), - (XAttributeList) attrStack.get(j))) { + if (((Tag) chr[1]).isMatchTo(tagStack.get(j), + attrStack.get(j))) { isInStack = true ; break ; @@ -727,7 +727,7 @@ public class XMLTools { if (tags.size()> 0) { log.println("!!! Error: Some tags were not found :") ; for (int i = 0; i < tags.size(); i++) { - Tag[] tag = (Tag[]) tags.get(i) ; + Tag[] tag = tags.get(i) ; log.println(" Tag " + tag[0] + " was not found"); if (tag[1] != null) log.println(" inside tag " + tag[1]) ; @@ -736,7 +736,7 @@ public class XMLTools { if (chars.size() > 0) { log.println("!!! Error: Some character data blocks were not found :") ; for (int i = 0; i < chars.size(); i++) { - Object[] ch = (Object[]) chars.get(i) ; + Object[] ch = chars.get(i) ; log.println(" Character data \"" + ch[0] + "\" was not found ") ; if (ch[1] != null) log.println(" inside tag " + ch[1]) ; @@ -767,11 +767,10 @@ public class XMLTools { "com.sun.star.xml.sax.Writer"); XInterface oPipe = (XInterface) xMSF.createInstance ( "com.sun.star.io.Pipe" ); - XOutputStream xPipeOutput = (XOutputStream) UnoRuntime. + XOutputStream xPipeOutput = UnoRuntime. queryInterface(XOutputStream.class, oPipe) ; - XActiveDataSource xADS = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class,Writer); + XActiveDataSource xADS = UnoRuntime.queryInterface(XActiveDataSource.class,Writer); xADS.setOutputStream(xPipeOutput); XDocumentHandler handler = (XDocumentHandler) UnoRuntime.queryInterface(XDocumentHandler.class,Writer); @@ -812,13 +811,12 @@ public class XMLTools { { XInterface oFacc = (XInterface)xMSF.createInstance( "com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess xFacc = (XSimpleFileAccess)UnoRuntime.queryInterface + XSimpleFileAccess xFacc = UnoRuntime.queryInterface (XSimpleFileAccess.class, oFacc) ; XInterface oWriter = (XInterface)xMSF.createInstance( "com.sun.star.xml.sax.Writer"); - XActiveDataSource xWriterDS = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, oWriter); + XActiveDataSource xWriterDS = UnoRuntime.queryInterface(XActiveDataSource.class, oWriter); XDocumentHandler xDocHandWriter = (XDocumentHandler) UnoRuntime.queryInterface (XDocumentHandler.class, oWriter) ; @@ -842,13 +840,13 @@ public class XMLTools { { XInterface oFacc = (XInterface)xMSF.createInstance( "com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess xFacc = (XSimpleFileAccess)UnoRuntime.queryInterface + XSimpleFileAccess xFacc = UnoRuntime.queryInterface (XSimpleFileAccess.class, oFacc) ; XInputStream oIn = xFacc.openFileRead(fileURL) ; XInterface oParser = (XInterface)xMSF.createInstance( "com.sun.star.xml.sax.Parser"); - XParser xParser = (XParser) UnoRuntime.queryInterface(XParser.class, oParser); + XParser xParser = UnoRuntime.queryInterface(XParser.class, oParser); xParser.setDocumentHandler(handler) ; InputSource inSrc = new InputSource() ; @@ -886,11 +884,11 @@ public class XMLTools { "com.sun.star.comp." + docType + ".XML" + exportType + "Exporter", new Object[] {arg}); - XExporter xExp = (XExporter) UnoRuntime.queryInterface + XExporter xExp = UnoRuntime.queryInterface (XExporter.class, oExp) ; xExp.setSourceDocument(xDoc) ; - XFilter filter = (XFilter) UnoRuntime.queryInterface(XFilter.class, oExp) ; + XFilter filter = UnoRuntime.queryInterface(XFilter.class, oExp) ; filter.filter(XMLTools.createMediaDescriptor( new String[] {"FilterName"}, new Object[] {"Custom filter"})) ; @@ -919,7 +917,7 @@ public class XMLTools { XInterface oImp = (XInterface)xMSF.createInstance( "com.sun.star.comp." + docType + ".XML" + importType + "Importer"); - XImporter xImp = (XImporter) UnoRuntime.queryInterface + XImporter xImp = UnoRuntime.queryInterface (XImporter.class, oImp) ; XDocumentHandler xDocHandImp = (XDocumentHandler) UnoRuntime.queryInterface (XDocumentHandler.class, oImp) ; diff --git a/qadevOOo/runner/util/db/DataSource.java b/qadevOOo/runner/util/db/DataSource.java index 2b861f156c37..4c612fb08969 100644 --- a/qadevOOo/runner/util/db/DataSource.java +++ b/qadevOOo/runner/util/db/DataSource.java @@ -45,7 +45,7 @@ public class DataSource m_orb = _orb; try { - m_dataSource = (XDataSource)UnoRuntime.queryInterface( XDataSource.class, + m_dataSource = UnoRuntime.queryInterface( XDataSource.class, m_orb.createInstance( "com.sun.star.sdb.DataSource" ) ); m_properties = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_dataSource ); @@ -90,7 +90,7 @@ public class DataSource try { dataSourceName = (String)m_properties.getPropertyValue( "Name" ); - XNamingService dbContext = (XNamingService)UnoRuntime.queryInterface( XNamingService.class, + XNamingService dbContext = UnoRuntime.queryInterface( XNamingService.class, m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) ); dbContext.revokeObject( dataSourceName ); } diff --git a/qadevOOo/runner/util/db/DatabaseDocument.java b/qadevOOo/runner/util/db/DatabaseDocument.java index bc2683c63678..b045d50f0110 100644 --- a/qadevOOo/runner/util/db/DatabaseDocument.java +++ b/qadevOOo/runner/util/db/DatabaseDocument.java @@ -37,13 +37,13 @@ public class DatabaseDocument m_orb = _orb; m_dataSource = _dataSource; - XDocumentDataSource docDataSource = (XDocumentDataSource)UnoRuntime.queryInterface( + XDocumentDataSource docDataSource = UnoRuntime.queryInterface( XDocumentDataSource.class, m_dataSource.getDataSource() ); - m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, + m_databaseDocument = UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, docDataSource.getDatabaseDocument() ); - m_model = (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument ); - m_storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument ); + m_model = UnoRuntime.queryInterface( XModel.class, m_databaseDocument ); + m_storeDoc = UnoRuntime.queryInterface( XStorable.class, m_databaseDocument ); } public DataSource getDataSource() diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 61ebf8480507..65c2f8da97cc 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -468,7 +468,7 @@ public class utils { try { Object fileacc = msf.createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, + XSimpleFileAccess simpleAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, fileacc); if (simpleAccess.exists(fileURL)) { exists = true; @@ -494,7 +494,7 @@ public class utils { try { Object fileacc = xMsf.createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, + XSimpleFileAccess simpleAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, fileacc); if (simpleAccess.exists(fileURL)) { simpleAccess.kill(fileURL); @@ -519,7 +519,7 @@ public class utils { boolean res = false; try { Object fileacc = xMsf.createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, + XSimpleFileAccess simpleAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, fileacc); if (!simpleAccess.exists(destinaion)) { simpleAccess.copy(source, destinaion); @@ -541,7 +541,7 @@ public class utils { try { Object fileacc = xMsf.createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, + XSimpleFileAccess simpleAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, fileacc); if (simpleAccess.exists(newF)) { simpleAccess.kill(newF); @@ -681,7 +681,7 @@ public class utils { XURLTransformer xTrans = null; try { Object inst = xMSF.createInstance("com.sun.star.util.URLTransformer"); - xTrans = (XURLTransformer) UnoRuntime.queryInterface(XURLTransformer.class, inst); + xTrans = UnoRuntime.queryInterface(XURLTransformer.class, inst); } catch (com.sun.star.uno.Exception e) { } @@ -734,7 +734,7 @@ public class utils { public static String[] getFilteredPropertyNames(XPropertySet props, short includePropertyAttribute, short excludePropertyAttribute) { Property[] the_props = props.getPropertySetInfo().getProperties(); - ArrayList l = new ArrayList(); + ArrayList<String> l = new ArrayList<String>(); for (int i = 0; i < the_props.length; i++) { boolean exclude = ((the_props[i].Attributes & excludePropertyAttribute) != 0); boolean include = (includePropertyAttribute == 0) || @@ -745,7 +745,7 @@ public class utils { } Collections.sort(l); String[] names = new String[l.size()]; - names = (String[]) l.toArray(names); + names = l.toArray(names); return names; } @@ -899,7 +899,7 @@ public class utils { XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF); XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, xPS.getPropertyValue("DefaultContext")); - XMacroExpander xME = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class, + XMacroExpander xME = UnoRuntime.queryInterface(XMacroExpander.class, xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander")); return xME.expandMacros(expand); } catch (Exception e) { @@ -948,7 +948,7 @@ public class utils { * @throws java.lang.Exception throws <CODE>java.lang.Exception</CODE> on any error */ public static void dispatchURL(XMultiServiceFactory xMSF, XComponent xDoc, String URL) throws java.lang.Exception { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDoc); XController xCont = aModel.getCurrentController(); @@ -966,9 +966,9 @@ public class utils { public static void dispatchURL(XMultiServiceFactory xMSF, XController xCont, String URL) throws java.lang.Exception { try { - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, xCont); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xCont); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, xMSF.createInstance("com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java index 4e4f1d4d8172..e9bfd53dae86 100644 --- a/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java +++ b/qadevOOo/testdocs/backend/org/openoffice/JavaSystemBackend.java @@ -219,7 +219,7 @@ public class JavaSystemBackend implements XSingleLayerStratum, XTypeProvider, XLayerContentDescriber xLayerContentDescriber = null; try { - xLayerContentDescriber = (XLayerContentDescriber) UnoRuntime.queryInterface( + xLayerContentDescriber = UnoRuntime.queryInterface( XLayerContentDescriber.class, msf.createInstance( "com.sun.star.comp.configuration.backend.LayerDescriber")); diff --git a/qadevOOo/testdocs/qadevlibs/source/test/Job.java b/qadevOOo/testdocs/qadevlibs/source/test/Job.java index 8762a1081a40..e8d443db56e0 100644 --- a/qadevOOo/testdocs/qadevlibs/source/test/Job.java +++ b/qadevOOo/testdocs/qadevlibs/source/test/Job.java @@ -89,7 +89,7 @@ public class Job { } public Type[] getTypes() { - Class interfaces[] = getClass().getInterfaces(); + Class<?> interfaces[] = getClass().getInterfaces(); Type types[] = new Type[interfaces.length]; for(int i = 0; i < interfaces.length; ++ i) types[i] = new Type(interfaces[i]); diff --git a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java index 95051613074d..98fbbc7c1427 100644 --- a/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java +++ b/qadevOOo/tests/java/complex/unoapi/CheckModuleAPI.java @@ -306,9 +306,9 @@ public class CheckModuleAPI extends ComplexTestCase // cws version: all added modules must be tested final String cws = version.substring(4, version.length()); final CwsDataExchangeImpl cde = new CwsDataExchangeImpl(cws, param, log); - final ArrayList addedModules = cde.getModules(); + final ArrayList<String> addedModules = cde.getModules(); - final ArrayList moduleNames = new ArrayList(); + final ArrayList<String> moduleNames = new ArrayList<String>(); Iterator iterator = addedModules.iterator(); while (iterator.hasNext()) { @@ -320,7 +320,7 @@ public class CheckModuleAPI extends ComplexTestCase moduleNames.add(sModuleName); } } - names = (String[]) moduleNames.toArray(new String[0]); + names = moduleNames.toArray(new String[0]); } catch (ParameterNotFoundException ex) { @@ -497,7 +497,7 @@ public class CheckModuleAPI extends ComplexTestCase log.println("search for qa/unoapi foldres in all modules based in "); log.println("'" + mSRC_ROOT + "'"); - final ArrayList moduleNames = new ArrayList(); + final ArrayList<String> moduleNames = new ArrayList<String>(); final File sourceRoot = new File(mSRC_ROOT); final File[] sourceTree = sourceRoot.listFiles(); @@ -514,7 +514,7 @@ public class CheckModuleAPI extends ComplexTestCase } } - final String[] names = (String[]) moduleNames.toArray(new String[0]); + final String[] names = moduleNames.toArray(new String[0]); return names; } diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java index aa7753836029..68617deb488d 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleComponent.java @@ -51,7 +51,7 @@ public class _XAccessibleComponent extends MultiMethodTest { public XAccessibleComponent oObj = null; private Rectangle bounds = null; - private ArrayList KnownBounds = new ArrayList(); + private ArrayList<Rectangle> KnownBounds = new ArrayList<Rectangle>(); /** @@ -242,7 +242,7 @@ public class _XAccessibleComponent extends MultiMethodTest { util.AccessibilityTools.accessibleToString( children[i])); - XAccessibleContext xAc = (XAccessibleContext) UnoRuntime.queryInterface( + XAccessibleContext xAc = UnoRuntime.queryInterface( XAccessibleContext.class, children[i]); @@ -304,10 +304,10 @@ public class _XAccessibleComponent extends MultiMethodTest { result &= true; } } else { - XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface( + XAccessible xAccCh = UnoRuntime.queryInterface( XAccessible.class, children[i]); - XAccessibleContext xAccC = (XAccessibleContext) UnoRuntime.queryInterface( + XAccessibleContext xAccC = UnoRuntime.queryInterface( XAccessibleContext.class, children[i]); log.println("Child found at point (" + (chBnd.X + curX) + @@ -378,7 +378,7 @@ public class _XAccessibleComponent extends MultiMethodTest { ") - OK"); result &= true; } else { - XAccessible xAccCh = (XAccessible) UnoRuntime.queryInterface( + XAccessible xAccCh = UnoRuntime.queryInterface( XAccessible.class, children[i]); boolean res = util.AccessibilityTools.equals(xAccCh, xAcc); @@ -518,7 +518,7 @@ public class _XAccessibleComponent extends MultiMethodTest { * such children were not found or some error occurred. */ private XAccessibleComponent[] getChildrenComponents() { - XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface( + XAccessible xAcc = UnoRuntime.queryInterface( XAccessible.class, oObj); if (xAcc == null) { @@ -535,13 +535,13 @@ public class _XAccessibleComponent extends MultiMethodTest { cnt = 50; } - ArrayList childComp = new ArrayList(); + ArrayList<XAccessibleComponent> childComp = new ArrayList<XAccessibleComponent>(); for (int i = 0; i < cnt; i++) { try { XAccessible child = xAccCon.getAccessibleChild(i); XAccessibleContext xAccConCh = child.getAccessibleContext(); - XAccessibleComponent xChAccComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent xChAccComp = UnoRuntime.queryInterface( XAccessibleComponent.class, xAccConCh); @@ -552,7 +552,7 @@ public class _XAccessibleComponent extends MultiMethodTest { } } - return (XAccessibleComponent[]) childComp.toArray( + return childComp.toArray( new XAccessibleComponent[childComp.size()]); } @@ -564,7 +564,7 @@ public class _XAccessibleComponent extends MultiMethodTest { * has no parent or some errors occurred. */ private XAccessibleComponent getParentComponent() { - XAccessible xAcc = (XAccessible) UnoRuntime.queryInterface( + XAccessible xAcc = UnoRuntime.queryInterface( XAccessible.class, oObj); if (xAcc == null) { @@ -583,7 +583,7 @@ public class _XAccessibleComponent extends MultiMethodTest { } XAccessibleContext xAccConPar = xAccPar.getAccessibleContext(); - XAccessibleComponent parent = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent parent = UnoRuntime.queryInterface( XAccessibleComponent.class, xAccConPar); @@ -628,7 +628,7 @@ public class _XAccessibleComponent extends MultiMethodTest { int elements = KnownBounds.size(); boolean Covered = false; for (int k=0;k<elements;k++) { - Rectangle known = (Rectangle) KnownBounds.get(k); + Rectangle known = KnownBounds.get(k); Covered = (known.X < p.X); Covered &= (known.Y < p.Y); Covered &= (p.Y < known.Y+known.Height); diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java index b8f3744c00d8..e4c41d9f1efe 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java @@ -178,8 +178,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { protected static boolean chkTransient(Object Testcase) { boolean ret = false; - XAccessibleContext accCon = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class,Testcase); + XAccessibleContext accCon = UnoRuntime.queryInterface(XAccessibleContext.class,Testcase); if (accCon.getAccessibleStateSet().contains( com.sun.star.accessibility.AccessibleStateType.TRANSIENT)){ if (!accCon.getAccessibleParent().getAccessibleContext().getAccessibleStateSet().contains( diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java index e377cd645c8f..54e40ae826d9 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java @@ -72,7 +72,7 @@ public class _XAccessibleSelection extends MultiMethodTest { * @see ifc.accessibility.XAccessibleContext */ protected void before() { - xAC = (XAccessibleContext) UnoRuntime.queryInterface( + xAC = UnoRuntime.queryInterface( XAccessibleContext.class, oObj); if (xAC == null) { @@ -533,7 +533,7 @@ public class _XAccessibleSelection extends MultiMethodTest { protected static int chkSelectable(Object Testcase) { int ret = 0; - XAccessibleContext accCon = (XAccessibleContext) UnoRuntime.queryInterface( + XAccessibleContext accCon = UnoRuntime.queryInterface( XAccessibleContext.class, Testcase); int cc = accCon.getAccessibleChildCount(); @@ -557,7 +557,7 @@ public class _XAccessibleSelection extends MultiMethodTest { } protected static boolean isSelectable(Object Testcase, int index) { - XAccessibleContext accCon = (XAccessibleContext) UnoRuntime.queryInterface( + XAccessibleContext accCon = UnoRuntime.queryInterface( XAccessibleContext.class, Testcase); boolean res = false; diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java index 4c787397efc3..f237d60cbc28 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleTable.java @@ -59,16 +59,14 @@ public class _XAccessibleTable extends MultiMethodTest { XAccessibleContext xACont = null; protected void before() { - xASel = (XAccessibleSelection) - UnoRuntime.queryInterface(XAccessibleSelection.class, oObj); + xASel = UnoRuntime.queryInterface(XAccessibleSelection.class, oObj); if (xASel == null) { log.println("The component doesn't implement the interface " + "XAccessibleSelection."); log.println("This interface is required for more detailed tests."); } - xACont = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + xACont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); } int rowCount = 0; diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java index 3c9ec0c6a641..954c35839fb3 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java @@ -86,9 +86,9 @@ public class _XAccessibleText extends MultiMethodTest { XAccessibleComponent component = null; if (xat != null) { - oObj = (XAccessibleText) UnoRuntime.queryInterface( + oObj = UnoRuntime.queryInterface( XAccessibleText.class, xat); - component = (XAccessibleComponent) UnoRuntime.queryInterface( + component = UnoRuntime.queryInterface( XAccessibleComponent.class, xat); } @@ -107,7 +107,7 @@ public class _XAccessibleText extends MultiMethodTest { LimitedBounds = tEnv.getObjRelation("LimitedBounds"); if (component == null) { - component = (XAccessibleComponent) UnoRuntime.queryInterface( + component = UnoRuntime.queryInterface( XAccessibleComponent.class, tEnv.getTestObject()); } diff --git a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java index de6afad01b73..106b67b7c750 100644 --- a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java +++ b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java @@ -163,17 +163,17 @@ public class _XScrollBar extends MultiMethodTest { private void adjustScrollBar() { - XScrollBar sc = (XScrollBar) UnoRuntime.queryInterface( + XScrollBar sc = UnoRuntime.queryInterface( XScrollBar.class, tEnv.getTestObject()); sc.setValue(500); shortWait(); - XAccessible acc = (XAccessible) UnoRuntime.queryInterface( + XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); - XAccessibleComponent aCom = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent aCom = UnoRuntime.queryInterface( XAccessibleComponent.class, acc.getAccessibleContext()); diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java index bd42613a04be..2bec1d15c68f 100644 --- a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java +++ b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java @@ -154,17 +154,17 @@ public class _XSpinValue extends MultiMethodTest { private void adjustScrollBar() { - XSpinValue sv = (XSpinValue) UnoRuntime.queryInterface( + XSpinValue sv = UnoRuntime.queryInterface( XSpinValue.class, tEnv.getTestObject()); sv.setValue(500); shortWait(); - XAccessible acc = (XAccessible) UnoRuntime.queryInterface( + XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); - XAccessibleComponent aCom = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent aCom = UnoRuntime.queryInterface( XAccessibleComponent.class, acc.getAccessibleContext()); diff --git a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java index 6c32e414d376..ca056c780afd 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java +++ b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java @@ -163,7 +163,7 @@ public class _XTopWindow extends MultiMethodTest { boolean result = true ; try { - menu = (XMenuBar) UnoRuntime.queryInterface(XMenuBar.class, + menu = UnoRuntime.queryInterface(XMenuBar.class, ((XMultiServiceFactory)tParam.getMSF()). createInstance("com.sun.star.awt.MenuBar")) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java index 3036cafbb274..3d1dc2d52a6b 100644 --- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java +++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java @@ -472,7 +472,7 @@ public class _XUserInputInterception extends MultiMethodTest { XAccessibleContext xPanel = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent xPanelCont = (XAccessibleComponent) UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel); + XAccessibleComponent xPanelCont = UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel); // the position of the panel Point point = xPanelCont.getLocationOnScreen(); diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java index 75d751643f3d..8b35f7cf6217 100644 --- a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java @@ -55,7 +55,7 @@ import com.sun.star.uno.UnoRuntime; public class _XFastPropertySet extends MultiMethodTest { public XFastPropertySet oObj = null; - private List handles = new ArrayList(); + private List<Integer> handles = new ArrayList<Integer>(); private int handle = -1; private Set exclude = null ; @@ -177,7 +177,7 @@ public class _XFastPropertySet extends MultiMethodTest { Random rnd = new Random(); int nr = rnd.nextInt(handles.size()); - handle = ((Integer)handles.get(nr)).intValue(); + handle = handles.get(nr).intValue(); } private boolean isChangeable(int handle) { diff --git a/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java index 12f7afe71b6d..06d32c933e83 100644 --- a/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XTolerantMultiPropertySet.java @@ -65,7 +65,7 @@ public class _XTolerantMultiPropertySet extends MultiMethodTest { "Component doesn't provide the needed XPropertySet")); } - pState = (XPropertyState) UnoRuntime.queryInterface( + pState = UnoRuntime.queryInterface( XPropertyState.class, tEnv.getTestObject()); if (pState == null) { @@ -228,7 +228,7 @@ public class _XTolerantMultiPropertySet extends MultiMethodTest { * have the state DIRECT_VALUE */ protected String[] getDirectProperties(Property[] props) { - ArrayList direct = new ArrayList(); + ArrayList<String> direct = new ArrayList<String>(); for (int i = 0; i < props.length; i++) { String pName = props[i].Name; @@ -268,7 +268,7 @@ public class _XTolerantMultiPropertySet extends MultiMethodTest { * contained in a given sequence of properties */ protected String[] getProperties() { - ArrayList names = new ArrayList(); + ArrayList<String> names = new ArrayList<String>(); for (int i = 0; i < properties.length; i++) { String pName = properties[i].Name; diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridge.java b/qadevOOo/tests/java/ifc/bridge/_XBridge.java index a4afd75d05a0..1809631e4032 100644 --- a/qadevOOo/tests/java/ifc/bridge/_XBridge.java +++ b/qadevOOo/tests/java/ifc/bridge/_XBridge.java @@ -65,7 +65,7 @@ public class _XBridge extends MultiMethodTest { if (args == null) throw new StatusException(Status.failed ("Relation 'XInitialization.args' not found")) ; - XInitialization xInit = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, oObj); try { xInit.initialize(args); diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java index 54f7637cc4f1..9e0a8e661752 100644 --- a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java +++ b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java @@ -149,13 +149,13 @@ public class _XBridgeFactory extends MultiMethodTest { ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.connection.Connector") ; - XConnector xCntr = (XConnector) UnoRuntime.queryInterface + XConnector xCntr = UnoRuntime.queryInterface (XConnector.class, x) ; x = (XInterface) ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.connection.Acceptor") ; - XAcceptor xAccptr = (XAcceptor)UnoRuntime.queryInterface( + XAcceptor xAccptr = UnoRuntime.queryInterface( XAcceptor.class, x); connectString = (String)tEnv.getObjRelation("CNNCTSTR"); acceptorThread = new AcceptorThread(xAccptr) ; diff --git a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java index 7be0cab448b9..bc7656dc87f4 100644 --- a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java +++ b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java @@ -151,12 +151,11 @@ public class _XUnoUrlResolver extends MultiMethodTest { XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); // get the bridge factory - XBridgeFactory xBrdgFctr = (XBridgeFactory) - UnoRuntime.queryInterface(XBridgeFactory.class, - tEnv.getObjRelation("BRIDGEFACTORY")); + XBridgeFactory xBrdgFctr = UnoRuntime.queryInterface(XBridgeFactory.class, + tEnv.getObjRelation("BRIDGEFACTORY")); // get the acceptor - XAcceptor xAcc = (XAcceptor)UnoRuntime.queryInterface( + XAcceptor xAcc = UnoRuntime.queryInterface( XAcceptor.class, tEnv.getObjRelation("ACCEPTOR")); // instance provider @@ -174,8 +173,7 @@ public class _XUnoUrlResolver extends MultiMethodTest { Object obj = oObj.resolve( "uno:" + connectStr + ";urp;com.sun.star.lang.ServiceManager"); // got the instance? - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, obj); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, obj); if (brThread.isAlive()) brThread.interrupt(); diff --git a/qadevOOo/tests/java/ifc/chart/_XChartData.java b/qadevOOo/tests/java/ifc/chart/_XChartData.java index b0a7214ac014..e928453e0b30 100644 --- a/qadevOOo/tests/java/ifc/chart/_XChartData.java +++ b/qadevOOo/tests/java/ifc/chart/_XChartData.java @@ -59,7 +59,7 @@ public class _XChartData extends MultiMethodTest { oObj.addChartDataChangeEventListener(listener1); oObj.addChartDataChangeEventListener(listener2); - dataArray = (XChartDataArray) UnoRuntime.queryInterface( + dataArray = UnoRuntime.queryInterface( XChartDataArray.class, oObj); double[][] data = dataArray.getData(); @@ -97,7 +97,7 @@ public class _XChartData extends MultiMethodTest { dataChanged[1] = false; oObj.removeChartDataChangeEventListener(listener1); - dataArray = (XChartDataArray) UnoRuntime.queryInterface( + dataArray = UnoRuntime.queryInterface( XChartDataArray.class, oObj); double[][] data = dataArray.getData(); diff --git a/qadevOOo/tests/java/ifc/configuration/backend/_XBackend.java b/qadevOOo/tests/java/ifc/configuration/backend/_XBackend.java index fae4db5916cd..656135806752 100644 --- a/qadevOOo/tests/java/ifc/configuration/backend/_XBackend.java +++ b/qadevOOo/tests/java/ifc/configuration/backend/_XBackend.java @@ -247,7 +247,7 @@ public class _XBackend extends MultiMethodTest { } if (xPathSubst != null) { - return (XStringSubstitution) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XStringSubstitution.class, xPathSubst); } else { return null; diff --git a/qadevOOo/tests/java/ifc/configuration/backend/_XLayerHandler.java b/qadevOOo/tests/java/ifc/configuration/backend/_XLayerHandler.java index 0cba8299ba41..4b824ef30bc4 100644 --- a/qadevOOo/tests/java/ifc/configuration/backend/_XLayerHandler.java +++ b/qadevOOo/tests/java/ifc/configuration/backend/_XLayerHandler.java @@ -104,11 +104,11 @@ public class _XLayerHandler extends MultiMethodTest { Object LayerParser = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.comp.configuration.backend.xml.LayerParser"); - XActiveDataSink xSink = (XActiveDataSink) UnoRuntime.queryInterface( + XActiveDataSink xSink = UnoRuntime.queryInterface( XActiveDataSink.class, LayerParser); Object fileacc = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess simpleAccess = (XSimpleFileAccess) UnoRuntime.queryInterface( + XSimpleFileAccess simpleAccess = UnoRuntime.queryInterface( XSimpleFileAccess.class, fileacc); @@ -121,7 +121,7 @@ public class _XLayerHandler extends MultiMethodTest { xSink.setInputStream(xStream); - XLayer xLayer = (XLayer) UnoRuntime.queryInterface(XLayer.class, + XLayer xLayer = UnoRuntime.queryInterface(XLayer.class, LayerParser); XLayerHandlerImpl xLayerHandler = new XLayerHandlerImpl(); diff --git a/qadevOOo/tests/java/ifc/configuration/backend/_XSchema.java b/qadevOOo/tests/java/ifc/configuration/backend/_XSchema.java index cfb08074ef80..b0bc8f5b3368 100644 --- a/qadevOOo/tests/java/ifc/configuration/backend/_XSchema.java +++ b/qadevOOo/tests/java/ifc/configuration/backend/_XSchema.java @@ -241,14 +241,13 @@ public class _XSchema extends MultiMethodTest { XInputStream xStream = null; try { Object fileacc = ((XMultiServiceFactory)tParam.getMSF()).createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - simpleAccess = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); + simpleAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); log.println("Going to parse: "+filename); xStream = simpleAccess.openFileRead(filename); } catch (com.sun.star.uno.Exception e) { } - XActiveDataSink xSink = (XActiveDataSink) UnoRuntime.queryInterface(XActiveDataSink.class, oObj); + XActiveDataSink xSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj); xSink.setInputStream(xStream); } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java index 7c4c3b90cdc1..9a066723da4e 100644 --- a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java +++ b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java @@ -127,14 +127,14 @@ public class _XAcceptor extends MultiMethodTest { Object oConnector = ((XMultiServiceFactory)tParam.getMSF()). createInstance("com.sun.star.connection.Connector") ; - xConnector = (XConnector) UnoRuntime.queryInterface + xConnector = UnoRuntime.queryInterface (XConnector.class, oConnector) ; XInterface acceptor = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance ("com.sun.star.connection.Acceptor") ; - dupAcceptor = (XAcceptor) UnoRuntime.queryInterface + dupAcceptor = UnoRuntime.queryInterface (XAcceptor.class, acceptor) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/ifc/connection/_XConnector.java b/qadevOOo/tests/java/ifc/connection/_XConnector.java index 914aa3ffdfdc..dca84f120954 100644 --- a/qadevOOo/tests/java/ifc/connection/_XConnector.java +++ b/qadevOOo/tests/java/ifc/connection/_XConnector.java @@ -122,7 +122,7 @@ public class _XConnector extends MultiMethodTest { throw new StatusException("Can't create service", e) ; } - xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, x); + xAcceptor = UnoRuntime.queryInterface(XAcceptor.class, x); acceptorThread = new AcceptorThread(xAcceptor) ; acceptorThread.start() ; diff --git a/qadevOOo/tests/java/ifc/container/_XChild.java b/qadevOOo/tests/java/ifc/container/_XChild.java index 2da3cf513747..fc32dc9c43c3 100644 --- a/qadevOOo/tests/java/ifc/container/_XChild.java +++ b/qadevOOo/tests/java/ifc/container/_XChild.java @@ -48,7 +48,7 @@ public class _XChild extends MultiMethodTest { */ public void _getParent() { gotten = oObj.getParent(); - XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,gotten); + XNamed the_name = UnoRuntime.queryInterface(XNamed.class,gotten); if (the_name != null) log.println("Parent:"+the_name.getName()); tRes.tested("getParent()",gotten != null); diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java index 78511de2419d..aa1fbcfb8090 100644 --- a/qadevOOo/tests/java/ifc/container/_XContainer.java +++ b/qadevOOo/tests/java/ifc/container/_XContainer.java @@ -89,7 +89,7 @@ public class _XContainer extends MultiMethodTest { // do this test with a different object Object altObj = tEnv.getObjRelation("XContainer.AlternateObject"); if (altObj != null) { - oObj = (XContainer)UnoRuntime.queryInterface(XContainer.class, altObj); + oObj = UnoRuntime.queryInterface(XContainer.class, altObj); } NC = (XNameContainer) UnoRuntime.queryInterface diff --git a/qadevOOo/tests/java/ifc/container/_XNameReplace.java b/qadevOOo/tests/java/ifc/container/_XNameReplace.java index ff2aa089f437..0c040344797c 100644 --- a/qadevOOo/tests/java/ifc/container/_XNameReplace.java +++ b/qadevOOo/tests/java/ifc/container/_XNameReplace.java @@ -172,11 +172,9 @@ public class _XNameReplace extends MultiMethodTest { // method returns false if the ranges are equal and true otherwise private boolean compareRanges(Object old, Object newEl) { - XCellRangeAddressable xCRA = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class,old); + XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class,old); - XCellRangeAddressable xCRA2 = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class,newEl); + XCellRangeAddressable xCRA2 = UnoRuntime.queryInterface(XCellRangeAddressable.class,newEl); int orgStartCol = xCRA.getRangeAddress().StartColumn; int orgEndCol = xCRA.getRangeAddress().EndColumn; diff --git a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java index a3984a45ebf0..8aa05877742e 100644 --- a/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java +++ b/qadevOOo/tests/java/ifc/datatransfer/clipboard/_XClipboardNotifier.java @@ -113,7 +113,7 @@ public class _XClipboardNotifier extends MultiMethodTest { public void _addClipboardListener() { oObj.addClipboardListener(myListener = new MyClipboardListener()); - XClipboard board = (XClipboard)UnoRuntime.queryInterface( + XClipboard board = UnoRuntime.queryInterface( XClipboard.class, tEnv.getTestObject()); board.setContents(new MyTransferable(), new MyOwner()); @@ -148,7 +148,7 @@ public class _XClipboardNotifier extends MultiMethodTest { oObj.removeClipboardListener(myListener); } - XClipboard board = (XClipboard)UnoRuntime.queryInterface( + XClipboard board = UnoRuntime.queryInterface( XClipboard.class, oObj); board.setContents(new MyTransferable(), new MyOwner()); diff --git a/qadevOOo/tests/java/ifc/document/_Settings.java b/qadevOOo/tests/java/ifc/document/_Settings.java index 7ef4cce685d0..4a8dde8fb10e 100644 --- a/qadevOOo/tests/java/ifc/document/_Settings.java +++ b/qadevOOo/tests/java/ifc/document/_Settings.java @@ -113,7 +113,7 @@ public class _Settings extends MultiPropertyTest { //check if the property has the right type Object pValue = oObj.getPropertyValue("ForbiddenCharacters"); - XForbiddenCharacters fc = (XForbiddenCharacters) UnoRuntime.queryInterface( + XForbiddenCharacters fc = UnoRuntime.queryInterface( XForbiddenCharacters.class, pValue); res &= (fc != null); diff --git a/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java index 57ce99afc302..d6a6576a2e11 100644 --- a/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java +++ b/qadevOOo/tests/java/ifc/document/_XDocumentInsertable.java @@ -106,8 +106,7 @@ public class _XDocumentInsertable extends MultiMethodTest { if (checker == null) { log.println("Relaion not found, trying to query for "+ "XTextRange ...") ; - range = (XTextRange) - UnoRuntime.queryInterface (XTextRange.class, oObj) ; + range = UnoRuntime.queryInterface (XTextRange.class, oObj) ; if (range == null) { log.println("XTextRange isn't supported by the component."); throw new StatusException(Status.failed diff --git a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java index 28decb4399cb..02c41b583378 100644 --- a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java +++ b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java @@ -45,11 +45,11 @@ public class _XEventBroadcaster extends MultiMethodTest { } private void switchFocus() { - XModel docModel = (XModel) UnoRuntime.queryInterface( + XModel docModel = UnoRuntime.queryInterface( XModel.class,tEnv.getTestObject()); docModel.getCurrentController().getFrame().getContainerWindow().setFocus(); util.utils.shortWait(1000); - XController xc = (XController) UnoRuntime.queryInterface(XController.class,tEnv.getObjRelation("CONT2")); + XController xc = UnoRuntime.queryInterface(XController.class,tEnv.getObjRelation("CONT2")); xc.getFrame().getContainerWindow().setFocus(); } diff --git a/qadevOOo/tests/java/ifc/document/_XFilter.java b/qadevOOo/tests/java/ifc/document/_XFilter.java index 31b41728a820..212d8c2aa089 100644 --- a/qadevOOo/tests/java/ifc/document/_XFilter.java +++ b/qadevOOo/tests/java/ifc/document/_XFilter.java @@ -85,7 +85,7 @@ public class _XFilter extends MultiMethodTest { sourceDoc = (XComponent)tEnv.getObjRelation("SourceDocument"); try { if (sourceDoc != null) { - XExporter xEx = (XExporter)UnoRuntime.queryInterface( + XExporter xEx = UnoRuntime.queryInterface( XExporter.class,oObj); xEx.setSourceDocument(sourceDoc); } diff --git a/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java b/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java index 77fa1b02498d..e5966fbd189b 100644 --- a/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java +++ b/qadevOOo/tests/java/ifc/document/_XViewDataSupplier.java @@ -64,7 +64,7 @@ public class _XViewDataSupplier extends MultiMethodTest { } private void setViewID(XIndexAccess xAccess, String value) { - XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xAccess); + XIndexContainer xIndexContainer = UnoRuntime.queryInterface(XIndexContainer.class, xAccess); int count = xAccess.getCount(); try { if (count > 0) { diff --git a/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java index c73039544149..86d546cdcf0e 100644 --- a/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java +++ b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java @@ -47,8 +47,7 @@ public class _DrawingDocumentDrawView extends MultiPropertyTest { protected void before() { drawPage = (XDrawPage)tEnv.getObjRelation("DrawPage"); - XNamed xNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, drawPage); + XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, drawPage); xNamed.setName(test_name); } @@ -62,8 +61,8 @@ public class _DrawingDocumentDrawView extends MultiPropertyTest { } protected boolean compare(Object obj1, Object obj2) { - XNamed named1 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj1); - XNamed named2 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj2); + XNamed named1 = UnoRuntime.queryInterface(XNamed.class, obj1); + XNamed named2 = UnoRuntime.queryInterface(XNamed.class, obj2); boolean res = false; if (named1 != null && named2 != null) { @@ -78,7 +77,7 @@ public class _DrawingDocumentDrawView extends MultiPropertyTest { } protected String toString(Object obj) { - XNamed named = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj); + XNamed named = UnoRuntime.queryInterface(XNamed.class, obj); String res = (named == null) ? "null" : named.getName(); return res; } diff --git a/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java index 66f511195491..124a534fa172 100644 --- a/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java +++ b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java @@ -130,7 +130,7 @@ public class _GraphicObjectShape extends MultiPropertyTest { } Object o = oObj.getPropertyValue("ImageMap"); - XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, o); + XIndexContainer xIndexContainer = UnoRuntime.queryInterface(XIndexContainer.class, o); util.dbg.printInterfaces(xIndexContainer); int elementCountFirst = xIndexContainer.getCount(); xIndexContainer.insertByIndex(elementCountFirst, imapObject); @@ -140,7 +140,7 @@ public class _GraphicObjectShape extends MultiPropertyTest { // implementation is needed. See css.lang.XUnoTunnel oObj.setPropertyValue("ImageMap", xIndexContainer); Object newObject = oObj.getPropertyValue("ImageMap"); - xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, newObject); + xIndexContainer = UnoRuntime.queryInterface(XIndexContainer.class, newObject); int elementCountSecond = xIndexContainer.getCount(); result = (elementCountFirst + 1 == elementCountSecond); diff --git a/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java b/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java index 0ede2af574df..bf0cf9ccf5e8 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java +++ b/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java @@ -66,9 +66,9 @@ public class _XConnectorShape extends MultiMethodTest { tEnv.getObjRelation("XConnectorShape.Shapes") ; if (shapes == null) throw new StatusException(Status.failed ("Relation not found.")) ; - shape1 = (XConnectableShape) UnoRuntime.queryInterface + shape1 = UnoRuntime.queryInterface (XConnectableShape.class, shapes[0]) ; - shape2 = (XConnectableShape) UnoRuntime.queryInterface + shape2 = UnoRuntime.queryInterface (XConnectableShape.class, shapes[1]) ; if (shape1 == null || shape2 == null) throw new StatusException (Status.failed("Shapes don't implement XConnectableShape"+ diff --git a/qadevOOo/tests/java/ifc/drawing/_XControlShape.java b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java index 42f796f5d352..4510fba79c18 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XControlShape.java +++ b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java @@ -77,7 +77,7 @@ public class _XControlShape extends MultiMethodTest { XInterface oNewControl = FormTools.createControl ((XComponent)tEnv.getObjRelation("xDoc"), "ComboBox") ; - XControlModel xControl = (XControlModel) UnoRuntime.queryInterface + XControlModel xControl = UnoRuntime.queryInterface (XControlModel.class, oNewControl) ; oObj.setControl(xControl) ; diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java index 9eec1f733b2a..3da980b11f2b 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java +++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java @@ -56,8 +56,7 @@ public class _XDrawPageDuplicator extends MultiMethodTest { public void _duplicate(){ boolean result = false; XInterface testobj = tEnv.getTestObject(); - XDrawPagesSupplier PS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, testobj); + XDrawPagesSupplier PS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, testobj); XDrawPages DPs = PS.getDrawPages(); XDrawPage DP = null; try { diff --git a/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java index 3e6731d50385..65ca37d872d6 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java +++ b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java @@ -50,8 +50,7 @@ public class _XLayerSupplier extends MultiMethodTest{ log.println("testing getLayerManager() ... "); oNA = oObj.getLayerManager(); - oLM = (XLayerManager) - UnoRuntime.queryInterface ( XLayerManager.class, oNA); + oLM = UnoRuntime.queryInterface ( XLayerManager.class, oNA); result = oLM != null; tRes.tested("getLayerManager()", result); diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java index 921b47c22c1f..548a57eaa6c9 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java +++ b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java @@ -57,7 +57,7 @@ public class _XShapeBinder extends MultiMethodTest { */ public void _bind () { XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage"); - oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp ); + oShapes = UnoRuntime.queryInterface( XShapes.class, dp ); boolean result = false; log.println("testing bind() ... "); countBeforeBind = oShapes.getCount(); diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java index c4801679afbe..6f6e2ec21f99 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java +++ b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java @@ -56,7 +56,7 @@ public class _XShapeCombiner extends MultiMethodTest { */ public void _combine () { XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage"); - oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp ); + oShapes = UnoRuntime.queryInterface( XShapes.class, dp ); boolean result = false; diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java index d7cbbc34083b..6be0f1bfa633 100644 --- a/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java +++ b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java @@ -59,7 +59,7 @@ public class _XShapeGrouper extends MultiMethodTest { if (dp == null) throw new StatusException(Status.failed("Relation not found")) ; - oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp ); + oShapes = UnoRuntime.queryInterface( XShapes.class, dp ); boolean result = false; log.println("Grouping " + oShapes.getCount() + " shapes ... "); diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java index 166d798ece80..e11a12f07718 100644 --- a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java +++ b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java @@ -101,8 +101,7 @@ public class _XChangeBroadcaster extends MultiMethodTest { * is queried. */ public void before() { - xText = (XTextComponent) - UnoRuntime.queryInterface(XTextComponent.class,oObj); + xText = UnoRuntime.queryInterface(XTextComponent.class,oObj); changer = (Changer) tEnv.getObjRelation("XChangeBroadcaster.Changer") ; if (xText == null && changer == null) @@ -127,7 +126,7 @@ public class _XChangeBroadcaster extends MultiMethodTest { shortWait(); win2.setFocus(); - XTextComponent TC = (XTextComponent)UnoRuntime.queryInterface + XTextComponent TC = UnoRuntime.queryInterface (XTextComponent.class,tEnv.getObjRelation("CONTROL")); TC.setText("NOXChangeBroadcaster"); shortWait(); diff --git a/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java index 2afae1f01b57..80e888516d99 100644 --- a/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java +++ b/qadevOOo/tests/java/ifc/form/_XDatabaseParameterBroadcaster.java @@ -72,7 +72,7 @@ public class _XDatabaseParameterBroadcaster extends MultiMethodTest { // trigger the action. try { - XRowSet xRowSet = (XRowSet)UnoRuntime.queryInterface(XRowSet.class, oObj); + XRowSet xRowSet = UnoRuntime.queryInterface(XRowSet.class, oObj); xRowSet.execute(); } catch(com.sun.star.sdbc.SQLException e) { diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java index e2062a361397..13b0580f7acb 100644 --- a/qadevOOo/tests/java/ifc/form/_XFormController.java +++ b/qadevOOo/tests/java/ifc/form/_XFormController.java @@ -85,7 +85,7 @@ public class _XFormController extends MultiMethodTest { requiredMethod("getCurrentControl()"); oObj.addActivateListener(listener) ; - XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl); + XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl); wind.setFocus(); shortWait(); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); @@ -110,7 +110,7 @@ public class _XFormController extends MultiMethodTest { log.println("ActiveListener removed"); listener.init(); - XWindow wind = (XWindow)UnoRuntime.queryInterface(XWindow.class, cntrl); + XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl); wind.setFocus(); shortWait(); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); diff --git a/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java b/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java index fd3eca9cd156..498235f450b7 100644 --- a/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java +++ b/qadevOOo/tests/java/ifc/form/binding/_XBindableValue.java @@ -83,7 +83,7 @@ public class _XBindableValue extends MultiMethodTest { class MyValueBinding implements XValueBinding { private Type[] TypeArray; - private ArrayList types = new ArrayList(); + private ArrayList<Type> types = new ArrayList<Type>(); public com.sun.star.uno.Type[] getSupportedValueTypes() { return TypeArray; diff --git a/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java b/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java index 91a320147220..0ac972a9cafa 100644 --- a/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java +++ b/qadevOOo/tests/java/ifc/form/validation/_XValidatableFormComponent.java @@ -98,9 +98,9 @@ public class _XValidatableFormComponent extends MultiMethodTest protected void changeAllProperties() { XMultiPropertySet mProps = - (XMultiPropertySet) UnoRuntime.queryInterface( - XMultiPropertySet.class, tEnv.getTestObject() - ); + UnoRuntime.queryInterface( + XMultiPropertySet.class, tEnv.getTestObject() + ); XPropertySetInfo propertySetInfo = mProps.getPropertySetInfo(); Property[] properties = propertySetInfo.getProperties(); getPropsToTest(properties); diff --git a/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java b/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java index 2cfbdb505a0f..3c4362758664 100644 --- a/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java +++ b/qadevOOo/tests/java/ifc/form/validation/_XValidityConstraintListener.java @@ -32,7 +32,7 @@ public class _XValidityConstraintListener extends MultiMethodTest { public void _validityConstraintChanged() { boolean res = false; try { - XValidatable xValidatable = (XValidatable) UnoRuntime.queryInterface( + XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, tEnv.getTestObject()); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatch.java b/qadevOOo/tests/java/ifc/frame/_XDispatch.java index 4bd983985ddf..7265a4ce2aa1 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatch.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatch.java @@ -121,8 +121,7 @@ public class _XDispatch extends MultiMethodTest { */ private boolean checkXDispatchWithNotification() { - XNotifyingDispatch xND = (XNotifyingDispatch) - UnoRuntime.queryInterface(XNotifyingDispatch.class, oObj); + XNotifyingDispatch xND = UnoRuntime.queryInterface(XNotifyingDispatch.class, oObj); if ( xND != null) { log.println(" XNotifyingDispatch found:"); PropertyValue[] arguments = (PropertyValue[]) diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java b/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java index 76bbe98898b6..38ff45aa2083 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchProvider.java @@ -70,10 +70,9 @@ public class _XDispatchProvider extends MultiMethodTest { url.Complete = dispatchUrl; try { - XURLTransformer xParser=(XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.util.URLTransformer")); + XURLTransformer xParser=UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)tParam.getMSF()).createInstance + ("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of // URL objects. URL[] aParseURL = new URL[1]; @@ -105,10 +104,9 @@ public class _XDispatchProvider extends MultiMethodTest { url2.Complete = dispatchUrl; try { log.println("Parsing URL"); - XURLTransformer xParser = (XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)tParam.getMSF()).createInstance - ("com.sun.star.util.URLTransformer")); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)tParam.getMSF()).createInstance + ("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of // URL objects. URL[] aParseURL = new URL[1]; diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java index a7f0912695fc..c418842de11a 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java @@ -82,8 +82,7 @@ public class _XDispatchRecorder extends MultiMethodTest { dispArgs = new PropertyValue[] {prop}; log.println("Dispatching event for frame ..."); - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); XDispatch xDisp = xDispProv.queryDispatch(dispURL, "", 0); xDisp.dispatch(dispURL, dispArgs); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java index 5748613a4b9f..57d7cb756dcf 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java @@ -83,7 +83,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { Object inst = (XInterface)((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.frame.Desktop"); - desktop = (XDesktop) UnoRuntime.queryInterface + desktop = UnoRuntime.queryInterface (XDesktop.class, inst); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -166,7 +166,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { try { Object inst = ((XMultiServiceFactory) tParam.getMSF()).createInstance ("com.sun.star.comp.framework.DispatchRecorder"); - recorder = (XDispatchRecorder) UnoRuntime.queryInterface + recorder = UnoRuntime.queryInterface (XDispatchRecorder.class, inst); oObj.setDispatchRecorder(recorder); } catch (com.sun.star.uno.Exception e) { @@ -178,11 +178,10 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { Thread.sleep(500); } catch (InterruptedException ex) {} - XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel model = UnoRuntime.queryInterface(XModel.class, xTextDoc); XFrame fr = model.getCurrentController().getFrame(); - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, fr); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, fr); URL dispURL = utils.parseURL((XMultiServiceFactory) tParam.getMSF(), ".uno:InsertText"); diff --git a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java index b02e7a4030a4..b7ce48c70758 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java +++ b/qadevOOo/tests/java/ifc/frame/_XDocumentTemplates.java @@ -192,7 +192,7 @@ public class _XDocumentTemplates extends MultiMethodTest { String ret = ""; try { statRes.first(); - XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes); + XRow row = UnoRuntime.queryInterface(XRow.class, statRes); while(! statRes.isAfterLast()) { ret += "\n " + row.getString(1); statRes.next(); @@ -227,8 +227,7 @@ public class _XDocumentTemplates extends MultiMethodTest { command.Handle = -1; command.Argument = comArg; - XCommandProcessor comProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, content); + XCommandProcessor comProc = UnoRuntime.queryInterface(XCommandProcessor.class, content); XDynamicResultSet DynResSet = null; try { @@ -245,9 +244,8 @@ public class _XDocumentTemplates extends MultiMethodTest { protected XContent getSubContent(XContent content, String subName) { XResultSet statRes = getStatResultSet(content); - XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes); - XContentAccess contAcc = (XContentAccess) - UnoRuntime.queryInterface(XContentAccess.class, statRes); + XRow row = UnoRuntime.queryInterface(XRow.class, statRes); + XContentAccess contAcc = UnoRuntime.queryInterface(XContentAccess.class, statRes); XContent subContent = null; try { statRes.first(); diff --git a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java index 6cb0d1c69542..44f54206eb1c 100644 --- a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java @@ -102,8 +102,7 @@ public class _XFrameLoader extends MultiMethodTest { Object oDsk = ((XMultiServiceFactory)tParam.getMSF()) .createInstance("com.sun.star.frame.Desktop") ; - XDesktop dsk = (XDesktop) - UnoRuntime.queryInterface(XDesktop.class, oDsk) ; + XDesktop dsk = UnoRuntime.queryInterface(XDesktop.class, oDsk) ; shortWait() ; frame = dsk.getCurrentFrame() ; diff --git a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java index 789e69e4a432..e12ba0766c29 100644 --- a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java @@ -93,14 +93,14 @@ public class _XSynchronousFrameLoader extends MultiMethodTest { Object oDsk = ( (XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.frame.Desktop") ; - XDesktop dsk = (XDesktop) UnoRuntime.queryInterface + XDesktop dsk = UnoRuntime.queryInterface (XDesktop.class, oDsk) ; frame = dsk.getCurrentFrame() ; Object o = ( (XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.util.URLTransformer") ; - xURLTrans = (XURLTransformer) UnoRuntime.queryInterface + xURLTrans = UnoRuntime.queryInterface (XURLTransformer.class, o) ; } catch ( com.sun.star.uno.Exception e ) { diff --git a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java index 27cc0ae55e0a..0fb7f2497446 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java +++ b/qadevOOo/tests/java/ifc/i18n/_XBreakIterator.java @@ -170,7 +170,7 @@ public class _XBreakIterator extends MultiMethodTest { tRes.tested("previousCharacters()", bRes); } - ArrayList vBounds = new ArrayList(); + ArrayList<Boundary> vBounds = new ArrayList<Boundary>(); /** * Saves bounds of all returned words for the future tests. <p> @@ -205,7 +205,7 @@ public class _XBreakIterator extends MultiMethodTest { requiredMethod("nextWord()"); int i = UnicodeString.length() - 1; - ArrayList vPrevBounds = new ArrayList(); + ArrayList<Boundary> vPrevBounds = new ArrayList<Boundary>(); while( i > 0 ) { Boundary bounds = oObj.previousWord(UnicodeString, i, locale, wordType); @@ -237,7 +237,7 @@ public class _XBreakIterator extends MultiMethodTest { for(int i = 0; i < vBounds.size(); i++) { // calculate middle of the word - Boundary iBounds = (Boundary)vBounds.get(i); + Boundary iBounds = vBounds.get(i); int iPos = (iBounds.endPos - iBounds.startPos) / 2 + iBounds.startPos; Boundary bounds = oObj.getWordBoundary(UnicodeString, iPos, @@ -268,7 +268,7 @@ public class _XBreakIterator extends MultiMethodTest { for(int i = 0; i < vBounds.size(); i++) { // calculate middle of the word - Boundary iBounds = (Boundary)vBounds.get(i); + Boundary iBounds = vBounds.get(i); int iPos = (iBounds.endPos - iBounds.startPos) / 2 + iBounds.startPos; @@ -294,7 +294,7 @@ public class _XBreakIterator extends MultiMethodTest { boolean bRes = true; for(int i = 0; i < vBounds.size(); i++) { - Boundary iBounds = (Boundary)vBounds.get(i); + Boundary iBounds = vBounds.get(i); boolean isBegin = oObj.isBeginWord(UnicodeString, iBounds.startPos, locale, WordType.ANY_WORD); bRes = bRes && isBegin; @@ -326,7 +326,7 @@ public class _XBreakIterator extends MultiMethodTest { boolean bRes = true; for(int i = 0; i < vBounds.size(); i++) { - Boundary iBounds = (Boundary)vBounds.get(i); + Boundary iBounds = vBounds.get(i); boolean isEnd = oObj.isEndWord(UnicodeString, iBounds.endPos, locale, WordType.ANY_WORD); bRes = bRes && isEnd; @@ -343,7 +343,7 @@ public class _XBreakIterator extends MultiMethodTest { tRes.tested("isEndWord()", bRes); } - ArrayList vSentenceStart = new ArrayList(); + ArrayList<Integer> vSentenceStart = new ArrayList<Integer>(); /** * Tries to find all sentences starting positions passing every character * as position parameter and stores them. Then tries to pass invalid @@ -389,7 +389,7 @@ public class _XBreakIterator extends MultiMethodTest { public void _endOfSentence() { boolean bRes = true; for(int i = 0; i < vSentenceStart.size(); i++) { - int start = ((Integer)vSentenceStart.get(i)).intValue(); + int start = vSentenceStart.get(i).intValue(); int end = oObj.endOfSentence(UnicodeString, start, locale); bRes &= end > start; log.println("Sentence " + i + " range is [" + start + ", " @@ -549,8 +549,8 @@ public class _XBreakIterator extends MultiMethodTest { return cType; } - ArrayList vCharBlockBounds = new ArrayList(); - ArrayList vCharBlockTypes = new ArrayList(); + ArrayList<Boundary> vCharBlockBounds = new ArrayList<Boundary>(); + ArrayList<Short> vCharBlockTypes = new ArrayList<Short>(); /** * Creates array of all char blocks with their boundaries and @@ -579,16 +579,16 @@ public class _XBreakIterator extends MultiMethodTest { } for(int i = 0; i < vCharBlockBounds.size() - 1; i++) { - int endPos = ((Boundary)vCharBlockBounds.get(i)).endPos; - int startPos = ((Boundary)vCharBlockBounds.get(i + 1)).startPos; + int endPos = vCharBlockBounds.get(i).endPos; + int startPos = vCharBlockBounds.get(i + 1).startPos; bCharBlockRes &= endPos == startPos; } log.println("Testing for no intersections : " + bCharBlockRes); - int startPos = ((Boundary)vCharBlockBounds.get(0)).startPos; + int startPos = vCharBlockBounds.get(0).startPos; bCharBlockRes &= startPos == 0; - int endPos = ((Boundary)vCharBlockBounds.get - (vCharBlockBounds.size() - 1)).endPos; + int endPos = vCharBlockBounds.get + (vCharBlockBounds.size() - 1).endPos; bCharBlockRes &= endPos == UnicodeString.length(); log.println("Regions should starts with 0 and ends with " + UnicodeString.length()); @@ -621,8 +621,8 @@ public class _XBreakIterator extends MultiMethodTest { boolean bRes = true; for(int i = 0; i < vCharBlockBounds.size(); i++) { - Boundary bounds = (Boundary)vCharBlockBounds.get(i); - Short type = (Short)vCharBlockTypes.get(i); + Boundary bounds = vCharBlockBounds.get(i); + Short type = vCharBlockTypes.get(i); if (bounds.startPos - 1 < 0) continue; int iPos = oObj.nextCharBlock(UnicodeString, bounds.startPos - 1, locale, type.shortValue()); @@ -652,8 +652,8 @@ public class _XBreakIterator extends MultiMethodTest { boolean bRes = true; for(int i = 0; i < vCharBlockBounds.size(); i++) { - Boundary bounds = (Boundary)vCharBlockBounds.get(i); - Short type = (Short)vCharBlockTypes.get(i); + Boundary bounds = vCharBlockBounds.get(i); + Short type = vCharBlockTypes.get(i); int iPos = oObj.previousCharBlock(UnicodeString, bounds.endPos + 1, locale, type.shortValue()); if (iPos != bounds.startPos) { diff --git a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java index 484bca394fa2..7dc2dffe6029 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XCalendar.java +++ b/qadevOOo/tests/java/ifc/i18n/_XCalendar.java @@ -72,7 +72,7 @@ public class _XCalendar extends MultiMethodTest { public void before() { XLocaleData locData = null; try { - locData = (XLocaleData) UnoRuntime.queryInterface( + locData = UnoRuntime.queryInterface( XLocaleData.class, ((XMultiServiceFactory)tParam.getMSF()).createInstance( "com.sun.star.i18n.LocaleData")); diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java index bee1a1bc95d2..7f89b7d93a9b 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java +++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedCalendar.java @@ -43,7 +43,7 @@ public class _XExtendedCalendar extends MultiMethodTest { Locale[] installed_locales = null; XLocaleData locData = null; try { - locData = (XLocaleData) UnoRuntime.queryInterface( + locData = UnoRuntime.queryInterface( XLocaleData.class, ((XMultiServiceFactory)tParam.getMSF()).createInstance( "com.sun.star.i18n.LocaleData")); diff --git a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java index d30e7b2fefbe..773ea0a1490f 100644 --- a/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java +++ b/qadevOOo/tests/java/ifc/i18n/_XExtendedIndexEntrySupplier.java @@ -29,7 +29,7 @@ import lib.MultiMethodTest; public class _XExtendedIndexEntrySupplier extends MultiMethodTest { public XExtendedIndexEntrySupplier oObj; protected Locale[] locales = null; - protected HashMap algorithms = new HashMap(); + protected HashMap<Integer, String[]> algorithms = new HashMap<Integer, String[]>(); public void _compareIndexEntry() { requiredMethod("getIndexKey()"); @@ -83,7 +83,7 @@ public class _XExtendedIndexEntrySupplier extends MultiMethodTest { log.println("Language: " + locales[i].Language); for (int j = 0; j < algorithms.size(); j++) { - String[] algs = (String[])algorithms.get(new Integer(j)); + String[] algs = algorithms.get(new Integer(j)); for (int k=0;k<algs.length;k++) { log.println("\t Algorythm :" + algs[k]); @@ -145,7 +145,7 @@ public class _XExtendedIndexEntrySupplier extends MultiMethodTest { boolean res = true; for (int i = 0; i < algorithms.size(); i++) { - String[] names = (String[]) algorithms.get(new Integer(i)); + String[] names = algorithms.get(new Integer(i)); log.println("loading algorithms for " + locales[i].Country + "," + locales[i].Language); diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java b/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java index 1e1636e13709..a7092aa91ce2 100644 --- a/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java +++ b/qadevOOo/tests/java/ifc/io/_XActiveDataSource.java @@ -55,7 +55,7 @@ public class _XActiveDataSource extends MultiMethodTest { */ public void before() { XInterface x = (XInterface)tEnv.getObjRelation("OutputStream"); - oStream = (XOutputStream) UnoRuntime.queryInterface + oStream = UnoRuntime.queryInterface (XOutputStream.class, x) ; } diff --git a/qadevOOo/tests/java/ifc/io/_XConnectable.java b/qadevOOo/tests/java/ifc/io/_XConnectable.java index c46cc881f882..8c8d061b9c7c 100644 --- a/qadevOOo/tests/java/ifc/io/_XConnectable.java +++ b/qadevOOo/tests/java/ifc/io/_XConnectable.java @@ -53,7 +53,7 @@ public class _XConnectable extends MultiMethodTest { */ public void before() { XInterface x = (XInterface)tEnv.getObjRelation("Connectable"); - xConnect = (XConnectable)UnoRuntime.queryInterface( + xConnect = UnoRuntime.queryInterface( XConnectable.class, x) ; } diff --git a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java index c59fe46493f1..cb96c3ca11a6 100644 --- a/qadevOOo/tests/java/ifc/io/_XDataInputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XDataInputStream.java @@ -79,7 +79,7 @@ public class _XDataInputStream extends MultiMethodTest { public void before(){ XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter") ; - oStream = (XDataOutputStream)UnoRuntime.queryInterface( + oStream = UnoRuntime.queryInterface( XDataOutputStream.class, x); List data = (List) tEnv.getObjRelation("StreamData") ; if (data == null || oStream == null) { diff --git a/qadevOOo/tests/java/ifc/io/_XInputStream.java b/qadevOOo/tests/java/ifc/io/_XInputStream.java index 3f16ce62d0d4..738b252b96d1 100644 --- a/qadevOOo/tests/java/ifc/io/_XInputStream.java +++ b/qadevOOo/tests/java/ifc/io/_XInputStream.java @@ -62,7 +62,7 @@ public class _XInputStream extends MultiMethodTest { */ public void before() { XInterface x = (XInterface)tEnv.getObjRelation("StreamWriter"); - oStream = (XOutputStream)UnoRuntime.queryInterface( + oStream = UnoRuntime.queryInterface( XOutputStream.class, x) ; bytes = (byte[])tEnv.getObjRelation("ByteData"); try { diff --git a/qadevOOo/tests/java/ifc/io/_XPersistObject.java b/qadevOOo/tests/java/ifc/io/_XPersistObject.java index 66aab4e42b09..fe8f9c162fd9 100644 --- a/qadevOOo/tests/java/ifc/io/_XPersistObject.java +++ b/qadevOOo/tests/java/ifc/io/_XPersistObject.java @@ -214,33 +214,25 @@ public class _XPersistObject extends MultiMethodTest { Object mostream = ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.io.MarkableOutputStream"); - XActiveDataSink xdSi = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, istream); - XActiveDataSource xdSo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, ostream); - XActiveDataSink xdSmi = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, mistream); - XActiveDataSource xdSmo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, mostream); + XActiveDataSink xdSi = UnoRuntime.queryInterface(XActiveDataSink.class, istream); + XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream); + XActiveDataSink xdSmi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); + XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); XInputStream miStream = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, mistream); - XOutputStream moStream = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, mostream); + XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream); XInputStream PipeIn = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, aPipe); - XOutputStream PipeOut = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class,aPipe); + XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); xdSi.setInputStream(miStream); xdSo.setOutputStream(moStream); xdSmi.setInputStream(PipeIn); xdSmo.setOutputStream(PipeOut); - iStream = (XObjectInputStream) - UnoRuntime.queryInterface(XObjectInputStream.class, istream); - oStream = (XObjectOutputStream) - UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); + iStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream); + oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java b/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java index 0344b1755771..49eab6fd21f1 100644 --- a/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java +++ b/qadevOOo/tests/java/ifc/reflection/_XProxyFactory.java @@ -67,7 +67,7 @@ public class _XProxyFactory extends MultiMethodTest { XAggregation xAggr = oObj.createProxy(obj); - XInitialization xInit = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, xAggr); Object params[] = new Object[0]; diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java index 5dcf08766603..c3b6b7ca4a0f 100644 --- a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java +++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java @@ -75,7 +75,7 @@ public class _XInvocationAdapterFactory extends MultiMethodTest { Object oInv = xInvFac.createInstanceWithArguments(args) ; - xInv = (XInvocation) UnoRuntime.queryInterface + xInv = UnoRuntime.queryInterface (XInvocation.class, oInv) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java index 4fe927f153db..4f739caebf3f 100644 --- a/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java +++ b/qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java @@ -75,7 +75,7 @@ public class _XInvocationAdapterFactory2 extends MultiMethodTest { Object oInv = xInvFac.createInstanceWithArguments(args) ; - xInv = (XInvocation) UnoRuntime.queryInterface + xInv = UnoRuntime.queryInterface (XInvocation.class, oInv) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java index ac3fd09ee120..450b4b5af02d 100644 --- a/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java +++ b/qadevOOo/tests/java/ifc/sdb/_DataAccessDescriptor.java @@ -33,16 +33,16 @@ public class _DataAccessDescriptor extends MultiPropertyTest { try{ log.println("try to get value from property..."); - XResultSet oldValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); + XResultSet oldValue = UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); log.println("try to get value from object relation..."); - XResultSet newValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("DataAccessDescriptor.XResultSet")); + XResultSet newValue = UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("DataAccessDescriptor.XResultSet")); log.println("set property to a new value..."); oObj.setPropertyValue(propName, newValue); log.println("get the new value..."); - XResultSet getValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); + XResultSet getValue = UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); tRes.tested(propName, this.compare(newValue, getValue)); } catch (com.sun.star.beans.PropertyVetoException e){ diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java index 6338e0a7af43..fe5dd279e16a 100644 --- a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java +++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryAnalyzer.java @@ -63,9 +63,8 @@ public class _XSingleSelectQueryAnalyzer extends MultiMethodTest { */ protected void before() { - xComposer = (XSingleSelectQueryComposer) - UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, - tEnv.getObjRelation("xComposer")); + xComposer = UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, + tEnv.getObjRelation("xComposer")); if (xComposer == null) { throw new StatusException(Status.failed( diff --git a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java index 94de676e3d5c..e5c901cb56c2 100644 --- a/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/ifc/sdb/_XSingleSelectQueryComposer.java @@ -72,9 +72,8 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { */ protected void before() /* throws Exception*/ { - xQueryAna = (XSingleSelectQueryAnalyzer) - UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, - tEnv.getObjRelation("xQueryAna")); + xQueryAna = UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, + tEnv.getObjRelation("xQueryAna")); if (xQueryAna == null) { throw new StatusException(Status.failed( diff --git a/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java b/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java index 377f597f814b..56d149fa74f9 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XCloseable.java @@ -57,8 +57,7 @@ public class _XCloseable extends MultiMethodTest { res = false; } - XResultSet resSet = (XResultSet) - UnoRuntime.queryInterface(XResultSet.class, oObj); + XResultSet resSet = UnoRuntime.queryInterface(XResultSet.class, oObj); if (resSet != null) { try { diff --git a/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java b/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java index 3bc6560d9d59..c405a96fa13f 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XResultSet.java @@ -375,9 +375,8 @@ public class _XResultSet extends MultiMethodTest { * refreshRow() equals to saved value. */ public void _refreshRow() { - XRowUpdate xRowUpdate = (XRowUpdate) - UnoRuntime.queryInterface(XRowUpdate.class, oObj); - XRow xRow = (XRow)UnoRuntime.queryInterface(XRow.class, oObj); + XRowUpdate xRowUpdate = UnoRuntime.queryInterface(XRowUpdate.class, oObj); + XRow xRow = UnoRuntime.queryInterface(XRow.class, oObj); if (xRowUpdate == null || xRow == null) { log.println("Test must be modified because XRow or XRowUpdate is't supported"); diff --git a/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java b/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java index a220237a77aa..6d2a6bb57152 100644 --- a/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java +++ b/qadevOOo/tests/java/ifc/sdbc/_XResultSetUpdate.java @@ -225,8 +225,7 @@ public class _XResultSetUpdate extends MultiMethodTest { oObj.moveToCurrentRow(); int rowsBefore = tester.rowCount() ; oObj.moveToInsertRow() ; - XRowUpdate rowU = (XRowUpdate) - UnoRuntime.queryInterface(XRowUpdate.class, oObj); + XRowUpdate rowU = UnoRuntime.queryInterface(XRowUpdate.class, oObj); rowU.updateString(1,"open"); rowU.updateInt(2,5); rowU.updateDouble(5,3.4); diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java b/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java index 5bb015530156..3a14ed43e03f 100644 --- a/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java +++ b/qadevOOo/tests/java/ifc/sdbcx/_XDataDefinitionSupplier.java @@ -88,8 +88,7 @@ public class _XDataDefinitionSupplier extends MultiMethodTest { */ public void _getDataDefinitionByConnection() { boolean bRes = true; - XDriver xDriver = (XDriver) - UnoRuntime.queryInterface(XDriver.class, oObj); + XDriver xDriver = UnoRuntime.queryInterface(XDriver.class, oObj); if (xDriver == null) { log.println("The XDriver interface isn't supported"); tRes.tested("getDataDefinitionByConnection()", diff --git a/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java b/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java index 7e6e0fa3a7e5..64287c973139 100644 --- a/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java +++ b/qadevOOo/tests/java/ifc/sdbcx/_XDeleteRows.java @@ -46,10 +46,8 @@ public class _XDeleteRows extends MultiMethodTest { * and no exception rizes while method call, FAILED otherwise. <p> */ public void _deleteRows() { - XRowLocate xRowLocate = (XRowLocate) - UnoRuntime.queryInterface(XRowLocate.class, oObj); - XResultSet xResultSet = (XResultSet) - UnoRuntime.queryInterface(XResultSet.class, oObj); + XRowLocate xRowLocate = UnoRuntime.queryInterface(XRowLocate.class, oObj); + XResultSet xResultSet = UnoRuntime.queryInterface(XResultSet.class, oObj); if (xRowLocate == null || xResultSet == null) { log.println("The test must be modified according to "+ "component testcase"); diff --git a/qadevOOo/tests/java/ifc/sheet/_Shape.java b/qadevOOo/tests/java/ifc/sheet/_Shape.java index 24068962215d..beed8da55061 100644 --- a/qadevOOo/tests/java/ifc/sheet/_Shape.java +++ b/qadevOOo/tests/java/ifc/sheet/_Shape.java @@ -27,7 +27,7 @@ import lib.MultiPropertyTest; public class _Shape extends MultiPropertyTest { public void _Anchor() { - XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface( + XSpreadsheetDocument xSheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class, tEnv.getObjRelation( "DOCUMENT")); diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java index 984992e0c066..b2a73a0b4533 100644 --- a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java +++ b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java @@ -72,10 +72,10 @@ public class _SpreadsheetDocumentSettings extends MultiPropertyTest { protected boolean compare(Object obj1, Object obj2) { Locale loc = new Locale("ru", "RU", ""); - XForbiddenCharacters fc1 = (XForbiddenCharacters) UnoRuntime.queryInterface( + XForbiddenCharacters fc1 = UnoRuntime.queryInterface( XForbiddenCharacters.class, obj1); - XForbiddenCharacters fc2 = (XForbiddenCharacters) UnoRuntime.queryInterface( + XForbiddenCharacters fc2 = UnoRuntime.queryInterface( XForbiddenCharacters.class, obj2); boolean has1 = fc1.hasForbiddenCharacters(loc); diff --git a/qadevOOo/tests/java/ifc/sheet/_XActivationBroadcaster.java b/qadevOOo/tests/java/ifc/sheet/_XActivationBroadcaster.java index b6bc8ead2ad7..c1cf3f5f369c 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XActivationBroadcaster.java +++ b/qadevOOo/tests/java/ifc/sheet/_XActivationBroadcaster.java @@ -73,7 +73,7 @@ public class _XActivationBroadcaster extends MultiMethodTest { } public void before() { - xSpreadsheetView = (XSpreadsheetView) UnoRuntime.queryInterface( + xSpreadsheetView = UnoRuntime.queryInterface( XSpreadsheetView.class, tEnv.getTestObject()); diff --git a/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java b/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java index 73757b926492..fde204d3ce6a 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java +++ b/qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange.java @@ -80,8 +80,7 @@ public class _XArrayFormulaRange extends MultiMethodTest { log.println("checking that formula was set correctly..."); XCellRangeAddressable crAddr = - (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); CellRangeAddress addr = crAddr.getRangeAddress() ; XSpreadsheet oSheet = (XSpreadsheet)tEnv.getObjRelation("SHEET"); if (oSheet == null) throw new StatusException(Status.failed diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java index f097cd6f61c8..837b2ecea427 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement.java @@ -71,8 +71,7 @@ public class _XCellRangeMovement extends MultiMethodTest { } XCellRangeAddressable oAddr = - (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); + UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; CellAddress sDest; CellRangeAddress sSrc; @@ -109,8 +108,7 @@ public class _XCellRangeMovement extends MultiMethodTest { XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, oObj); - XCellRangeAddressable oAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); + XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; try { oSheet.getCellByPosition(0,20).setValue(100); @@ -129,8 +127,7 @@ public class _XCellRangeMovement extends MultiMethodTest { else{ log.println("Cells were already inserted. "+ "Delete old cells now"); - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); oRows.removeByIndex(21,1); @@ -163,8 +160,7 @@ public class _XCellRangeMovement extends MultiMethodTest { XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, oObj); - XCellRangeAddressable oAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); + XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; //prepare source range @@ -205,8 +201,7 @@ public class _XCellRangeMovement extends MultiMethodTest { XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, oObj); - XCellRangeAddressable oAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); + XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj); short iSheet = oAddr.getRangeAddress().Sheet; try { //prepare source range diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java index 677bb34614b6..de87ca91e436 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java @@ -68,8 +68,7 @@ public class _XCellRangeReferrer extends MultiMethodTest { return; } - XCellRangeAddressable xCRA = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, cr); + XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, cr); CellRangeAddress objCRA = xCRA.getRangeAddress(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java index 78fe8c1434e4..0a9636a680c3 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java +++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery.java @@ -84,7 +84,7 @@ public class _XCellRangesQuery extends MultiMethodTest { mExpectedResults = (String[])tEnv.getObjRelation( "XCellRangesQuery.EXPECTEDRESULTS"); - XColumnRowRange oColumnRowRange = (XColumnRowRange) UnoRuntime.queryInterface( + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface( XColumnRowRange.class, oSheet); oRows = (XTableRows)oColumnRowRange.getRows(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java index ed071186d14d..92c50495e3d9 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotDescriptor.java @@ -195,8 +195,7 @@ public class _XDataPilotDescriptor extends MultiMethodTest { return; } - XNamed named = (XNamed) - UnoRuntime.queryInterface(XNamed.class, field); + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); log.print("Field : '" + name + "' ... ") ; @@ -390,7 +389,7 @@ public class _XDataPilotDescriptor extends MultiMethodTest { log.print("Fields returned ") ; for (int i = 0; i < IA.getCount(); i++) { Object field = IA.getByIndex(i); - XNamed named = (XNamed)UnoRuntime.queryInterface + XNamed named = UnoRuntime.queryInterface (XNamed.class, field); name = named.getName(); log.print(" " + name) ; diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java index 3ed6cfcc0931..c08960529c73 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotFieldGrouping.java @@ -37,7 +37,7 @@ public class _XDataPilotFieldGrouping extends MultiMethodTest public void _createNameGroup() { boolean result = true; try { - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface(XDataPilotField.class, oObj); + XDataPilotField xDataPilotField = UnoRuntime.queryInterface(XDataPilotField.class, oObj); XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xDataPilotField.getItems ()); String[] elements = xNameAccess.getElementNames (); oObj.createNameGroup(elements); diff --git a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java index acad4ca89fef..18d33a96334b 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDataPilotTable2.java @@ -59,8 +59,8 @@ public class _XDataPilotTable2 extends MultiMethodTest private CellRangeAddress mRangeWhole = null; private CellRangeAddress mRangeTable = null; private CellRangeAddress mRangeResult = null; - private ArrayList mDataFieldDims = null; - private ArrayList mResultCells = null; + private ArrayList<Integer> mDataFieldDims = null; + private ArrayList<CellAddress> mResultCells = null; /** * exception to be thrown when obtaining a result data for a cell fails @@ -71,7 +71,7 @@ public class _XDataPilotTable2 extends MultiMethodTest protected void before() { Object o = tEnv.getObjRelation("DATAPILOTTABLE2"); - xDPTab2 = (XDataPilotTable2)UnoRuntime.queryInterface( + xDPTab2 = UnoRuntime.queryInterface( XDataPilotTable2.class, o); if (xDPTab2 == null) @@ -98,10 +98,10 @@ public class _XDataPilotTable2 extends MultiMethodTest int cellCount = mResultCells.size(); for (int i = 0; i < cellCount; ++i) { - CellAddress addr = (CellAddress)mResultCells.get(i); + CellAddress addr = mResultCells.get(i); DataPilotTablePositionData posData = xDPTab2.getPositionData(addr); DataPilotTableResultData resData = (DataPilotTableResultData)posData.PositionData; - int dim = ((Integer)mDataFieldDims.get(resData.DataFieldIndex)).intValue(); + int dim = mDataFieldDims.get(resData.DataFieldIndex).intValue(); DataResult res = resData.Result; double val = res.Value; @@ -188,12 +188,12 @@ public class _XDataPilotTable2 extends MultiMethodTest boolean testResult = true; int cellCount = mResultCells.size(); XSpreadsheets xSheets = xSheetDoc.getSheets(); - XIndexAccess xIA = (XIndexAccess)UnoRuntime.queryInterface( + XIndexAccess xIA = UnoRuntime.queryInterface( XIndexAccess.class, xSheets); int sheetCount = xIA.getCount(); for (int i = 0; i < cellCount && testResult; ++i) { - CellAddress addr = (CellAddress)mResultCells.get(i); + CellAddress addr = mResultCells.get(i); Object[][] data = xDPTab2.getDrillDownData(addr); @@ -238,7 +238,7 @@ public class _XDataPilotTable2 extends MultiMethodTest // Remove the sheet just inserted. - XNamed xNamed = (XNamed)UnoRuntime.queryInterface(XNamed.class, xSheet); + XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xSheet); String name = xNamed.getName(); try { @@ -392,7 +392,7 @@ public class _XDataPilotTable2 extends MultiMethodTest getOutputRanges(); - mResultCells = new ArrayList(); + mResultCells = new ArrayList<CellAddress>(); for (int x = mRangeResult.StartColumn; x <= mRangeResult.EndColumn; ++x) { for (int y = mRangeResult.StartRow; y <= mRangeResult.EndRow; ++y) @@ -414,8 +414,8 @@ public class _XDataPilotTable2 extends MultiMethodTest private void buildDataFields() { - mDataFieldDims = new ArrayList(); - XDataPilotDescriptor xDesc = (XDataPilotDescriptor)UnoRuntime.queryInterface( + mDataFieldDims = new ArrayList<Integer>(); + XDataPilotDescriptor xDesc = UnoRuntime.queryInterface( XDataPilotDescriptor.class, xDPTab2); XIndexAccess xFields = xDesc.getDataPilotFields(); @@ -489,7 +489,7 @@ public class _XDataPilotTable2 extends MultiMethodTest return false; } - XCellRangeData xCRD = (XCellRangeData)UnoRuntime.queryInterface( + XCellRangeData xCRD = UnoRuntime.queryInterface( XCellRangeData.class, xCR); Object[][] sheetData = xCRD.getDataArray(); @@ -544,16 +544,16 @@ public class _XDataPilotTable2 extends MultiMethodTest try { XCellRange xRng = xSheet.getCellRangeByPosition(nCol, nRow, nCol, nRow); - XSheetCellRange xSCR = (XSheetCellRange)UnoRuntime.queryInterface( + XSheetCellRange xSCR = UnoRuntime.queryInterface( XSheetCellRange.class, xRng); XSheetCellCursor xCursor = xSheet.createCursorByRange(xSCR); - XCellCursor xCellCursor = (XCellCursor)UnoRuntime.queryInterface( + XCellCursor xCellCursor = UnoRuntime.queryInterface( XCellCursor.class, xCursor); xCellCursor.gotoEnd(); XCell xCell = xCursor.getCellByPosition(0, 0); - XCellAddressable xCellAddr = (XCellAddressable)UnoRuntime.queryInterface( + XCellAddressable xCellAddr = UnoRuntime.queryInterface( XCellAddressable.class, xCell); return xCellAddr.getCellAddress(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java b/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java index 927c774ba464..936351a30353 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java +++ b/qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing.java @@ -55,10 +55,9 @@ public class _XDocumentAuditing extends MultiMethodTest { // get two sheets xSheet = new XSpreadsheet[2]; try { - XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj); + XSpreadsheetDocument xSpreadsheetDocument = UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj); XSpreadsheets oSheets = xSpreadsheetDocument.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) UnoRuntime.queryInterface( XSpreadsheet.class, oIndexSheets.getByIndex(0)); @@ -84,8 +83,7 @@ public class _XDocumentAuditing extends MultiMethodTest { xDrawPage = (XDrawPage)tEnv.getObjRelation("XDocumentAuditing.DrawPage"); if (xDrawPage == null) { // get from object try { - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, oObj); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, oObj); Object o = oDPS.getDrawPages().getByIndex(1); xDrawPage = (XDrawPage)UnoRuntime.queryInterface(XDrawPage.class, o); } @@ -106,17 +104,17 @@ public class _XDocumentAuditing extends MultiMethodTest { props[0] = new PropertyValue(); props[0].Name = "AutoRefreshArrows"; props[0].Value = Boolean.FALSE; - XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, oObj); + XModel xModel = UnoRuntime.queryInterface(XModel.class, oObj); dispatch(xModel.getCurrentController().getFrame(), (XMultiServiceFactory)tParam.getMSF(), ".uno:AutoRefreshArrows", props); // prepare the sheets try { xSheet[0].getCellByPosition(6, 6).setValue(9); - XNamed xNamed = (XNamed)UnoRuntime.queryInterface(XNamed.class, xSheet[0]); + XNamed xNamed = UnoRuntime.queryInterface(XNamed.class, xSheet[0]); sheetName = xNamed.getName(); xSheet[1].getCellByPosition(6, 6).setValue(16); xSheet[1].getCellByPosition(6, 7).setFormula("= SQRT(G7)"); - XSheetAuditing xSheetAuditing = (XSheetAuditing)UnoRuntime.queryInterface(XSheetAuditing.class, xSheet[1]); + XSheetAuditing xSheetAuditing = UnoRuntime.queryInterface(XSheetAuditing.class, xSheet[1]); CellAddress add = new CellAddress((short)1, 6, 7); xSheetAuditing.showPrecedents(add); boolean ok = hasRightAmountOfShapes(1); @@ -134,7 +132,7 @@ public class _XDocumentAuditing extends MultiMethodTest { props[0] = new PropertyValue(); props[0].Name = "AutoRefreshArrows"; props[0].Value = Boolean.TRUE; - XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, oObj); + XModel xModel = UnoRuntime.queryInterface(XModel.class, oObj); dispatch(xModel.getCurrentController().getFrame(), (XMultiServiceFactory)tParam.getMSF(), ".uno:AutoRefreshArrows", props); } @@ -191,7 +189,7 @@ public class _XDocumentAuditing extends MultiMethodTest { for (int i=elementCount; i<newCount; i++) { try { Object o = xDrawPage.getByIndex(i); - XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, o); + XShape xShape = UnoRuntime.queryInterface(XShape.class, o); pos = xShape.getPosition(); System.out.println("Shape Type: " + xShape.getShapeType()); } @@ -205,7 +203,7 @@ public class _XDocumentAuditing extends MultiMethodTest { } private void dispatch(Object oProvider, XMultiServiceFactory xMSF, String url, PropertyValue[] prop) { - XDispatchProvider xDispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, oProvider); + XDispatchProvider xDispatchProvider = UnoRuntime.queryInterface(XDispatchProvider.class, oProvider); Object dispatcher = null; try { dispatcher = xMSF.createInstance("com.sun.star.frame.DispatchHelper"); @@ -213,7 +211,7 @@ public class _XDocumentAuditing extends MultiMethodTest { catch(com.sun.star.uno.Exception e) { } - XDispatchHelper xDispatchHelper = (XDispatchHelper)UnoRuntime.queryInterface(XDispatchHelper.class, dispatcher); + XDispatchHelper xDispatchHelper = UnoRuntime.queryInterface(XDispatchHelper.class, dispatcher); xDispatchHelper.executeDispatch(xDispatchProvider, url, "", 0, prop); } } diff --git a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java index dae892e4f8b0..c28505aa71d9 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java +++ b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java @@ -52,7 +52,7 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest { private XModel docModel = null; public void before() { - docModel = (XModel) UnoRuntime.queryInterface( + docModel = UnoRuntime.queryInterface( XModel.class,tEnv.getObjRelation("FirstModel")); DesktopTools.bringWindowToFront(docModel); } @@ -90,7 +90,7 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest { XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent window = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); Point point = window.getLocationOnScreen(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java b/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java index 1e4f238fcc49..6b7ddd18b203 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java +++ b/qadevOOo/tests/java/ifc/sheet/_XGoalSeek.java @@ -41,10 +41,9 @@ public class _XGoalSeek extends MultiMethodTest { Exception ex = null; // get two sheets try { - XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj); + XSpreadsheetDocument xSpreadsheetDocument = UnoRuntime.queryInterface(XSpreadsheetDocument.class, oObj); XSpreadsheets oSheets = xSpreadsheetDocument.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); xSheet = (XSpreadsheet) UnoRuntime.queryInterface( XSpreadsheet.class, oIndexSheets.getByIndex(1)); diff --git a/qadevOOo/tests/java/ifc/sheet/_XMultipleOperation.java b/qadevOOo/tests/java/ifc/sheet/_XMultipleOperation.java index 21289661ede3..8aaede910f0b 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XMultipleOperation.java +++ b/qadevOOo/tests/java/ifc/sheet/_XMultipleOperation.java @@ -54,7 +54,7 @@ public class _XMultipleOperation extends MultiMethodTest { public void _setTableOperation() { boolean res = true; XCellRange cellRange = oSheet.getCellRangeByName("$A$17:$A$17"); - XCellRangeAddressable CRA = (XCellRangeAddressable) UnoRuntime.queryInterface( + XCellRangeAddressable CRA = UnoRuntime.queryInterface( XCellRangeAddressable.class, cellRange); XCell cell = null; @@ -69,9 +69,9 @@ public class _XMultipleOperation extends MultiMethodTest { log.println("Exception while getting Cell " + e.getMessage()); } - XCellAddressable CA = (XCellAddressable) UnoRuntime.queryInterface( + XCellAddressable CA = UnoRuntime.queryInterface( XCellAddressable.class, cell); - XCellAddressable CA2 = (XCellAddressable) UnoRuntime.queryInterface( + XCellAddressable CA2 = UnoRuntime.queryInterface( XCellAddressable.class, cell2); Point[] cellCoords = new Point[3]; double[] cellValues = new double[3]; diff --git a/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java b/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java index 7d949abc304d..a1505b5138b2 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java +++ b/qadevOOo/tests/java/ifc/sheet/_XNamedRanges.java @@ -132,12 +132,12 @@ public class _XNamedRanges extends MultiMethodTest { for (int i = 1; i < 4; i++) { cell = oSheet.getCellByPosition(0, i); - textrange = (XTextRange)UnoRuntime. + textrange = UnoRuntime. queryInterface(XTextRange.class, cell); textrange.setString("Row" + i); cell = oSheet.getCellByPosition(i, 0); - textrange = (XTextRange)UnoRuntime. + textrange = UnoRuntime. queryInterface(XTextRange.class, cell); textrange.setString("Column" + i); } @@ -145,7 +145,7 @@ public class _XNamedRanges extends MultiMethodTest { for (int i = 1; i < 4; i++) for (int j = 1; j < 4; j++) { cell = oSheet.getCellByPosition(i, j); - textrange = (XTextRange)UnoRuntime. + textrange = UnoRuntime. queryInterface(XTextRange.class, cell); textrange.setString("Val" + ((j - 1) * 3 + i)); } @@ -159,12 +159,11 @@ public class _XNamedRanges extends MultiMethodTest { bResult &= oObj.hasByName("Column" + i); Object range = oObj.getByName("Column" + i); - XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime. + XCellRangeReferrer CRR = UnoRuntime. queryInterface(XCellRangeReferrer.class,range); XCellRange CR = CRR.getReferredCells(); - XCellRangeAddressable xCRA = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); + XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); CellRangeAddress objCRA = xCRA.getRangeAddress(); @@ -180,12 +179,11 @@ public class _XNamedRanges extends MultiMethodTest { bResult &= oObj.hasByName("Row" + i); Object range = oObj.getByName("Row" + i); - XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime. + XCellRangeReferrer CRR = UnoRuntime. queryInterface(XCellRangeReferrer.class,range); XCellRange CR = CRR.getReferredCells(); - XCellRangeAddressable xCRA = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); + XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, CR); CellRangeAddress objCRA = xCRA.getRangeAddress(); @@ -221,7 +219,7 @@ public class _XNamedRanges extends MultiMethodTest { boolean bResult = true; CellAddress CA = new CellAddress((short)0, 0, 0); - XIndexAccess IA = (XIndexAccess)UnoRuntime. + XIndexAccess IA = UnoRuntime. queryInterface(XIndexAccess.class, oObj); int elementsCount = IA.getCount(); @@ -231,8 +229,7 @@ public class _XNamedRanges extends MultiMethodTest { try { for (int i = 0; i < elementsCount; i++) { XCell cell = oSheet.getCellByPosition(0, i); - XTextRange textrange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, cell); + XTextRange textrange = UnoRuntime.queryInterface(XTextRange.class, cell); String str = textrange.getString(); bResult &= oObj.hasByName(str); } @@ -258,7 +255,7 @@ public class _XNamedRanges extends MultiMethodTest { public void _removeByName() { requiredMethod("addNewByName()"); boolean bResult = true; - XIndexAccess IA = (XIndexAccess)UnoRuntime. + XIndexAccess IA = UnoRuntime. queryInterface(XIndexAccess.class, oObj); int elementsCount = IA.getCount(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index 65e2e44eed34..ad7dc91445b1 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java +++ b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java @@ -59,7 +59,7 @@ public class _XRangeSelection extends MultiMethodTest { if (xModel == null) throw new StatusException(Status.failed("Object relation FirstModel' not set.")); XWindow xWindow = xModel.getCurrentController().getFrame().getContainerWindow(); - XTopWindow xTopWindow = (XTopWindow)UnoRuntime.queryInterface(XTopWindow.class, xWindow); + XTopWindow xTopWindow = UnoRuntime.queryInterface(XTopWindow.class, xWindow); xTopWindow.toFront(); util.utils.shortWait(500); } @@ -170,8 +170,7 @@ public class _XRangeSelection extends MultiMethodTest { AccessibilityTools at = new AccessibilityTools(); XComponent xSheetDoc = (XComponent) tEnv.getObjRelation("DOCUMENT"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); System.out.println("Name: " + xModel.getCurrentController().getFrame().getName()); XWindow xWindow = at.getCurrentWindow((XMultiServiceFactory)tParam.getMSF(), xModel); @@ -179,7 +178,7 @@ public class _XRangeSelection extends MultiMethodTest { at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE ); - XAccessibleComponent AccessibleSpreadsheet = (XAccessibleComponent) UnoRuntime.queryInterface(XAccessibleComponent.class,AccessibilityTools.SearchedContext); + XAccessibleComponent AccessibleSpreadsheet = UnoRuntime.queryInterface(XAccessibleComponent.class,AccessibilityTools.SearchedContext); log.println("Got " + util.utils.getImplName(AccessibleSpreadsheet)); @@ -193,7 +192,7 @@ public class _XRangeSelection extends MultiMethodTest { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); XTopWindow tw = null; @@ -202,7 +201,7 @@ public class _XRangeSelection extends MultiMethodTest { for (int i=0;i<k;i++) { try { XTopWindow tw_temp = tk.getTopWindow(i); - XAccessible xacc = (XAccessible) UnoRuntime.queryInterface(XAccessible.class, tw_temp); + XAccessible xacc = UnoRuntime.queryInterface(XAccessible.class, tw_temp); if (xacc != null) { if (xacc.getAccessibleContext().getAccessibleName().indexOf("d2")>0) { tw=tw_temp; @@ -240,7 +239,7 @@ public class _XRangeSelection extends MultiMethodTest { catch(com.sun.star.uno.Exception e) { throw new StatusException("Could not create 'com.sun.star.awt.Toolkit'.", e); } - XExtendedToolkit xExtendedToolkit = (XExtendedToolkit)UnoRuntime.queryInterface(XExtendedToolkit.class, aToolkit); + XExtendedToolkit xExtendedToolkit = UnoRuntime.queryInterface(XExtendedToolkit.class, aToolkit); XTopWindow tw = null; XAccessibleComponent xAccessibleComponent = null; @@ -248,13 +247,13 @@ public class _XRangeSelection extends MultiMethodTest { for (int i=0;i<k;i++) { try { XTopWindow tw_temp = xExtendedToolkit.getTopWindow(i); - XAccessible xacc = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, tw_temp); + XAccessible xacc = UnoRuntime.queryInterface(XAccessible.class, tw_temp); if (xacc != null) { System.out.println("Name: " + xacc.getAccessibleContext().getAccessibleName()); if (xacc.getAccessibleContext().getAccessibleName().startsWith("the title")) { tw = tw_temp; XAccessibleContext xContext = xacc.getAccessibleContext(); - xAccessibleComponent = (XAccessibleComponent)UnoRuntime.queryInterface(XAccessibleComponent.class, xContext); + xAccessibleComponent = UnoRuntime.queryInterface(XAccessibleComponent.class, xContext); if (xAccessibleComponent == null) System.out.println("!!!! MIST !!!!"); else @@ -273,7 +272,7 @@ public class _XRangeSelection extends MultiMethodTest { return null; } - XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, tw); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tw); Rectangle posSize = xWindow.getPosSize(); // compare the center point with the dimensions of the current top window diff --git a/qadevOOo/tests/java/ifc/sheet/_XScenarioEnhanced.java b/qadevOOo/tests/java/ifc/sheet/_XScenarioEnhanced.java index 2c48dd4c7162..aa53035bf9b8 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XScenarioEnhanced.java +++ b/qadevOOo/tests/java/ifc/sheet/_XScenarioEnhanced.java @@ -32,7 +32,7 @@ public class _XScenarioEnhanced extends MultiMethodTest { public XScenarioEnhanced oObj = null; public void before() { - oObj = (XScenarioEnhanced) UnoRuntime.queryInterface( + oObj = UnoRuntime.queryInterface( XScenarioEnhanced.class, tEnv.getObjRelation("ScenarioSheet")); } diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java index 8eff20ff8811..f82641c80f69 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotation.java @@ -75,8 +75,7 @@ public class _XSheetAnnotation extends MultiMethodTest { * Has <b>OK</b> status if the method returns <code>true</code>. */ public void _getIsVisible() { - XSimpleText oText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oObj); + XSimpleText oText = UnoRuntime.queryInterface(XSimpleText.class, oObj); oText.setString("XSheetAnnotation"); oObj.setIsVisible(true); boolean bVis = oObj.getIsVisible(); @@ -112,8 +111,7 @@ public class _XSheetAnnotation extends MultiMethodTest { */ public void _setIsVisible() { boolean bResult = true; - XSimpleText oText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oObj); + XSimpleText oText = UnoRuntime.queryInterface(XSimpleText.class, oObj); oText.setString("XSheetAnnotation"); oObj.setIsVisible(false); boolean bVis = oObj.getIsVisible(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java index ca536330594f..b8b1b87a35c5 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAnnotationAnchor.java @@ -78,8 +78,7 @@ public class _XSheetAnnotationAnchor extends MultiMethodTest { * Returns <b>true</b> if the method returns <code>true</code>. */ protected boolean check_getIsVisible() { - XSimpleText oText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, anno); + XSimpleText oText = UnoRuntime.queryInterface(XSimpleText.class, anno); oText.setString("XSheetAnnotation"); anno.setIsVisible(true); boolean bVis = anno.getIsVisible(); @@ -104,8 +103,7 @@ public class _XSheetAnnotationAnchor extends MultiMethodTest { */ protected boolean check_setIsVisible() { boolean bResult = true; - XSimpleText oText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, anno); + XSimpleText oText = UnoRuntime.queryInterface(XSimpleText.class, anno); oText.setString("XSheetAnnotation"); anno.setIsVisible(false); boolean bVis = anno.getIsVisible(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java index dbff392834b9..f2f943a7069d 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetAuditing.java @@ -57,8 +57,7 @@ public class _XSheetAuditing extends MultiMethodTest { // get the draw page for checking the shapes xDrawPage = (XDrawPage)tEnv.getObjRelation("XSheetAuditing.DrawPage"); if (xDrawPage == null) { // get from object - XDrawPageSupplier oDPS = (XDrawPageSupplier) - UnoRuntime.queryInterface(XDrawPageSupplier.class, oObj); + XDrawPageSupplier oDPS = UnoRuntime.queryInterface(XDrawPageSupplier.class, oObj); xDrawPage = (XDrawPage) oDPS.getDrawPage(); } if (xDrawPage == null) { @@ -120,7 +119,7 @@ public class _XSheetAuditing extends MultiMethodTest { xPrecedentAddress.setValue(-9); String cellAddress = new String(new byte[]{(byte)(precedentAddress.Column + 65)}) + (precedentAddress.Row+1); xAddress.setFormula("=SQRT(" + cellAddress + ")"); - XText xText = (XText)UnoRuntime.queryInterface(XText.class, xAddress); + XText xText = UnoRuntime.queryInterface(XText.class, xAddress); // correct error in cell: String error = xText.getString(); boolean erg = error.equals("Err:502"); @@ -183,7 +182,7 @@ public class _XSheetAuditing extends MultiMethodTest { for (int i=elementCount; i<newCount; i++) { try { Object o = xDrawPage.getByIndex(i); - XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, o); + XShape xShape = UnoRuntime.queryInterface(XShape.class, o); System.out.println("Shape Type: " + xShape.getShapeType()); } catch(com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java index 85e8d1b4a60a..538f1fc40bf7 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetCellCursor.java @@ -67,8 +67,7 @@ public class _XSheetCellCursor extends MultiMethodTest { public void _collapseToCurrentArray() { boolean bResult = false; - XCellRangeAddressable crAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + XCellRangeAddressable crAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); CellRangeAddress addr = crAddr.getRangeAddress() ; int leftCol = addr.StartColumn ; int topRow = addr.StartRow ; @@ -90,8 +89,7 @@ public class _XSheetCellCursor extends MultiMethodTest { } log.println("DB: Successfully new range created"); - XArrayFormulaRange arrFormulaRange = (XArrayFormulaRange) - UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range); + XArrayFormulaRange arrFormulaRange = UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range); // write a simple formula (this array assigns another array) arrFormulaRange.setArrayFormula("A1:A" + height) ; @@ -100,10 +98,10 @@ public class _XSheetCellCursor extends MultiMethodTest { oObj.collapseToCurrentArray() ; // check the size of result range - int cols = ( (XColumnRowRange)UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ( (XColumnRowRange)UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols == 1 && rows == height) { bResult = true; @@ -124,8 +122,7 @@ public class _XSheetCellCursor extends MultiMethodTest { bResult = false ; log.println( "Array formula hasn't been cleared with setArrayFormula(\"\")"); - XSheetOperation clearRange = (XSheetOperation) - UnoRuntime.queryInterface (XSheetOperation.class, new_range); + XSheetOperation clearRange = UnoRuntime.queryInterface (XSheetOperation.class, new_range); int allFlags = CellFlags.ANNOTATION | CellFlags.DATETIME | CellFlags.EDITATTR; allFlags = allFlags @@ -153,15 +150,13 @@ public class _XSheetCellCursor extends MultiMethodTest { int leftCol = -1, topRow = -1; XSpreadsheet oSheet = oObj.getSpreadsheet(); - ((XSheetOperation) UnoRuntime.queryInterface( - XSheetOperation.class, oSheet) ).clearContents(65535); + UnoRuntime.queryInterface( + XSheetOperation.class, oSheet).clearContents(65535); oObj.collapseToCurrentRegion(); - int cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols != width || rows != height) { bResult = false ; @@ -185,12 +180,10 @@ public class _XSheetCellCursor extends MultiMethodTest { oObj.collapseToCurrentRegion() ; // checking results - cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj)).getColumns().getCount(); - rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj)).getRows().getCount(); + cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols == width + 1 && rows == height + 1) { bResult &= true; @@ -237,8 +230,7 @@ public class _XSheetCellCursor extends MultiMethodTest { bResult = false; } - XMergeable mergeRange = (XMergeable) - UnoRuntime.queryInterface (XMergeable.class, newRange); + XMergeable mergeRange = UnoRuntime.queryInterface (XMergeable.class, newRange); if (mergeRange == null) { log.println("DB: newRange doesn't implement XMergeable interface"); } else { @@ -256,12 +248,10 @@ public class _XSheetCellCursor extends MultiMethodTest { log.println("DB: Successfully unmerged.") ; // checking results - int cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); log.println("DB: Column and row numbers successfully get") ; if (cols == width + 1 && rows == height + 3) { @@ -294,12 +284,10 @@ public class _XSheetCellCursor extends MultiMethodTest { oObj.collapseToSize (width + 3, height + 3); // checking results - int cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols == width + 3 && rows == height + 3) { bResult = true ; @@ -331,12 +319,10 @@ public class _XSheetCellCursor extends MultiMethodTest { oObj.expandToEntireColumns () ; // checking results - int cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols == width && rows >= 32000) { bResult = true ; @@ -368,12 +354,10 @@ public class _XSheetCellCursor extends MultiMethodTest { oObj.expandToEntireRows () ; // checking results - int cols = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getColumns().getCount(); - int rows = ((XColumnRowRange) - UnoRuntime.queryInterface( - XColumnRowRange.class, oObj) ).getRows().getCount(); + int cols = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getColumns().getCount(); + int rows = UnoRuntime.queryInterface( + XColumnRowRange.class, oObj).getRows().getCount(); if (cols >= 256 && rows == height) { bResult = true; diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java index cb2ca228631a..892fadee5961 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterable.java @@ -82,7 +82,7 @@ public class _XSheetFilterable extends MultiMethodTest { oSheet.getCellByPosition(1, 2).setFormula("B"); oObj.filter(desc); - XColumnRowRange oColumnRowRange = (XColumnRowRange) UnoRuntime.queryInterface( + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface( XColumnRowRange.class, oSheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterableEx.java b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterableEx.java index 4a96b79fd1be..7204ca3ab06a 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetFilterableEx.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetFilterableEx.java @@ -46,7 +46,7 @@ public class _XSheetFilterableEx extends MultiMethodTest { public void _createFilterDescriptorByObject() { boolean res = true; Object parent = tEnv.getTestObject(); - XSheetFilterable aFilterable = (XSheetFilterable) UnoRuntime.queryInterface( + XSheetFilterable aFilterable = UnoRuntime.queryInterface( XSheetFilterable.class, parent); XSheetFilterDescriptor desc = oObj.createFilterDescriptorByObject( aFilterable); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java b/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java index 6764f0543767..2b73249a12ef 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSheetOutline.java @@ -108,7 +108,7 @@ public class _XSheetOutline extends MultiMethodTest { private boolean isCellShown(CellRangeAddress range) { boolean isNotShown = true; - XCellRangesQuery xCellRangesQuery = (XCellRangesQuery)UnoRuntime.queryInterface(XCellRangesQuery.class, oObj); + XCellRangesQuery xCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oObj); if (xCellRangesQuery != null) { XSheetCellRanges xRanges = xCellRangesQuery.queryVisibleCells(); CellRangeAddress[] visibleRanges = xRanges.getRangeAddresses(); diff --git a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java index 03372eb40187..1ee921879062 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java +++ b/qadevOOo/tests/java/ifc/sheet/_XSpreadsheet.java @@ -69,8 +69,7 @@ public class _XSpreadsheet extends MultiMethodTest { tRes.tested("createCursorByRange()", false); } - XSheetCellRange oSheetRange = (XSheetCellRange) - UnoRuntime.queryInterface(XSheetCellRange.class, oRange) ; + XSheetCellRange oSheetRange = UnoRuntime.queryInterface(XSheetCellRange.class, oRange) ; log.println("getting Cursor"); XSheetCellCursor oCursor = oObj.createCursorByRange(oSheetRange); tRes.tested("createCursorByRange()", oCursor != null); diff --git a/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java b/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java index 311a06d0989e..7c8922b97f1d 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java +++ b/qadevOOo/tests/java/ifc/sheet/_XUsedAreaCursor.java @@ -58,8 +58,7 @@ public class _XUsedAreaCursor extends MultiMethodTest { public void _gotoEndOfUsedArea() { boolean result = true ; - XCellRangeAddressable oAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ; + XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ; // first with true argument oObj.gotoStartOfUsedArea(false); @@ -92,8 +91,7 @@ public class _XUsedAreaCursor extends MultiMethodTest { * start of the used area in second case. <p> */ public void _gotoStartOfUsedArea() { - XCellRangeAddressable oAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ; + XCellRangeAddressable oAddr = UnoRuntime.queryInterface (XCellRangeAddressable.class, oObj) ; boolean result = true ; diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java index e84635d29d78..9141741aca89 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java @@ -483,11 +483,11 @@ public class _CharacterProperties extends MultiPropertyTest { } private class OwnUserDefinedAttributes implements XNameContainer{ - HashMap members = null; + HashMap<String, Object> members = null; public OwnUserDefinedAttributes() { - members = new HashMap(); + members = new HashMap<String, Object>(); } public Object getByName(String str) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException { @@ -495,18 +495,18 @@ public class _CharacterProperties extends MultiPropertyTest { } public String[] getElementNames() { - Iterator oEnum = members.keySet().iterator(); + Iterator<String> oEnum = members.keySet().iterator(); int count = members.size(); String[] res = new String[count]; int i=0; while(oEnum.hasNext()) - res[i++] = (String)oEnum.next(); + res[i++] = oEnum.next(); return res; } public com.sun.star.uno.Type getElementType() { - Iterator oEnum = members.keySet().iterator(); - String key = (String)oEnum.next(); + Iterator<String> oEnum = members.keySet().iterator(); + String key = oEnum.next(); Object o = members.get(key); return new Type(o.getClass()); } diff --git a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java index 202b15f2a793..c009b351229d 100644 --- a/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java +++ b/qadevOOo/tests/java/ifc/style/_ParagraphProperties.java @@ -446,11 +446,11 @@ public class _ParagraphProperties extends MultiPropertyTest { } private class OwnUserDefinedAttributes implements XNameContainer{ - Hashtable members = null; + Hashtable<String, Object> members = null; public OwnUserDefinedAttributes() { - members = new Hashtable(); + members = new Hashtable<String, Object>(); } public Object getByName(String str) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException { @@ -458,18 +458,18 @@ public class _ParagraphProperties extends MultiPropertyTest { } public String[] getElementNames() { - Enumeration oEnum = members.keys(); + Enumeration<String> oEnum = members.keys(); int count = members.size(); String[] res = new String[count]; int i=0; while(oEnum.hasMoreElements()) - res[i] = (String)oEnum.nextElement(); + res[i] = oEnum.nextElement(); return res; } public com.sun.star.uno.Type getElementType() { - Enumeration oEnum = members.keys(); - String key = (String)oEnum.nextElement(); + Enumeration<String> oEnum = members.keys(); + String key = oEnum.nextElement(); Object o = members.get(key); return new Type(o.getClass()); } diff --git a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java index a7dbf23e7642..49ddddb171c9 100644 --- a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java +++ b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java @@ -74,8 +74,7 @@ public class _XSystemShellExecute extends MultiMethodTest { try { XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF(); Object fa = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"); - xFileAccess = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); + xFileAccess = UnoRuntime.queryInterface(XSimpleFileAccess.class, fa); } catch (com.sun.star.uno.Exception e) { log.println("Couldn't create SimpleFileAccess:" + e); tRes.tested("execute()", false); diff --git a/qadevOOo/tests/java/ifc/table/_XCellCursor.java b/qadevOOo/tests/java/ifc/table/_XCellCursor.java index 52f06a6a6aef..142c2def170c 100644 --- a/qadevOOo/tests/java/ifc/table/_XCellCursor.java +++ b/qadevOOo/tests/java/ifc/table/_XCellCursor.java @@ -70,8 +70,7 @@ public class _XCellCursor extends MultiMethodTest { int startCol, endCol, startRow, endRow = 0; int startCol2, endCol2, startRow2, endRow2 = 0; - XCellRangeAddressable oRange = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + XCellRangeAddressable oRange = UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); CellRangeAddress oAddr = oRange.getRangeAddress(); startRow = oAddr.StartRow; startCol = oAddr.StartColumn; @@ -105,8 +104,7 @@ public class _XCellCursor extends MultiMethodTest { int startCol, endCol, startRow, endRow = 0; int startCol2, endCol2, startRow2, endRow2 = 0; - XCellRangeAddressable oRange = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + XCellRangeAddressable oRange = UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); CellRangeAddress oAddr = oRange.getRangeAddress(); startRow = oAddr.StartRow; startCol = oAddr.StartColumn; @@ -139,8 +137,7 @@ public class _XCellCursor extends MultiMethodTest { int startCol, endCol, startRow, endRow = 0; int startCol2, endCol2, startRow2, endRow2 = 0; - XCellRangeAddressable oRange = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + XCellRangeAddressable oRange = UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); CellRangeAddress oAddr = oRange.getRangeAddress(); startRow = oAddr.StartRow; startCol = oAddr.StartColumn; @@ -174,8 +171,7 @@ public class _XCellCursor extends MultiMethodTest { boolean bResult = false; int startCol, endCol, startRow, endRow = 0; - XCellRangeAddressable oRange = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); + XCellRangeAddressable oRange = UnoRuntime.queryInterface(XCellRangeAddressable.class, oObj); oObj.gotoStart(); CellRangeAddress oAddr = oRange.getRangeAddress(); startRow = oAddr.StartRow; @@ -201,18 +197,15 @@ public class _XCellCursor extends MultiMethodTest { //gotoEnd gets it's own cursor to see a change oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET"); XCellRange testRange = oSheet.getCellRangeByName("$A$1:$g$7") ; - XSheetCellRange testSheetRange = (XSheetCellRange) - UnoRuntime.queryInterface(XSheetCellRange.class,testRange); + XSheetCellRange testSheetRange = UnoRuntime.queryInterface(XSheetCellRange.class,testRange); XSheetCellCursor oCellCursor = oSheet.createCursorByRange (testSheetRange); - XCellCursor oCursor = (XCellCursor) - UnoRuntime.queryInterface(XCellCursor.class,oCellCursor); + XCellCursor oCursor = UnoRuntime.queryInterface(XCellCursor.class,oCellCursor); boolean bResult = false; int startCol, endCol, startRow, endRow = 0; - XCellRangeAddressable oRange = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, oCursor); + XCellRangeAddressable oRange = UnoRuntime.queryInterface(XCellRangeAddressable.class, oCursor); oCursor.gotoEnd(); CellRangeAddress oAddr = oRange.getRangeAddress(); startRow = oAddr.StartRow; diff --git a/qadevOOo/tests/java/ifc/table/_XTableColumns.java b/qadevOOo/tests/java/ifc/table/_XTableColumns.java index 095aa216ec9c..e4cdd1527416 100644 --- a/qadevOOo/tests/java/ifc/table/_XTableColumns.java +++ b/qadevOOo/tests/java/ifc/table/_XTableColumns.java @@ -305,12 +305,12 @@ public class _XTableColumns extends MultiMethodTest { } // end removeByIndex() private void setCellText(XCell cell, String text) { - XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface + XSimpleText xText = UnoRuntime.queryInterface (XSimpleText.class, cell) ; xText.setString(text); } private String getCellText(XCell cell) { - XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface + XSimpleText xText = UnoRuntime.queryInterface (XSimpleText.class, cell) ; return xText.getString(); } diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndex.java b/qadevOOo/tests/java/ifc/text/_BaseIndex.java index 4c5b5d88c1fb..2176db890b24 100644 --- a/qadevOOo/tests/java/ifc/text/_BaseIndex.java +++ b/qadevOOo/tests/java/ifc/text/_BaseIndex.java @@ -142,9 +142,9 @@ public class _BaseIndex extends MultiPropertyTest { Object newValue, Object resValue, Exception exception) throws Exception { - PropertyValue[][] res = (PropertyValue[][]) ((XIndexAccess) UnoRuntime.queryInterface( + PropertyValue[][] res = (PropertyValue[][]) UnoRuntime.queryInterface( XIndexAccess.class, - resValue)).getByIndex(0); + resValue).getByIndex(0); log.println("Result:"); printLevelFormatProperty(resValue); diff --git a/qadevOOo/tests/java/ifc/text/_MailMerge.java b/qadevOOo/tests/java/ifc/text/_MailMerge.java index 668594757797..5e03ae64986e 100644 --- a/qadevOOo/tests/java/ifc/text/_MailMerge.java +++ b/qadevOOo/tests/java/ifc/text/_MailMerge.java @@ -58,16 +58,16 @@ public class _MailMerge extends MultiPropertyTest { try{ log.println("try to get value from property..."); - XResultSet oldValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); + XResultSet oldValue = UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); log.println("try to get value from object relation..."); - XResultSet newValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("MailMerge.XResultSet")); + XResultSet newValue = UnoRuntime.queryInterface(XResultSet.class,tEnv.getObjRelation("MailMerge.XResultSet")); log.println("set property to a new value..."); oObj.setPropertyValue(propName, newValue); log.println("get the new value..."); - XResultSet getValue = (XResultSet) UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); + XResultSet getValue = UnoRuntime.queryInterface(XResultSet.class,oObj.getPropertyValue(propName)); tRes.tested(propName, this.compare(newValue, getValue)); } catch (com.sun.star.beans.PropertyVetoException e){ diff --git a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java index e1de222fb130..3d8428434620 100644 --- a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java +++ b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java @@ -65,7 +65,7 @@ import com.sun.star.beans.PropertyValue; public class _NumberingLevel { private static TestParameters tParam = null; - private static HashMap NumberingLevel = new HashMap(); + private static HashMap<String, Boolean> NumberingLevel = new HashMap<String,Boolean>(); private static PropertyValue[] PropertyArray = null; private static LogWriter log = null; @@ -143,7 +143,7 @@ public class _NumberingLevel { String property = (String) e.next(); // if some elements are not optional -> failed - if ( ! ((Boolean)NumberingLevel.get(property)).booleanValue() ){ + if ( ! NumberingLevel.get(property).booleanValue() ){ if ( status ) { log.println("FAILED: com.sun.star.text.NumberingLevel -> " + diff --git a/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java b/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java index 1b5aaa6c1d0f..e967d89d8dd3 100644 --- a/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java +++ b/qadevOOo/tests/java/ifc/text/_TextGraphicObject.java @@ -103,7 +103,7 @@ public class _TextGraphicObject extends MultiPropertyTest { boolean result = true; try { - XIndexContainer imgMap = (XIndexContainer) UnoRuntime.queryInterface( + XIndexContainer imgMap = UnoRuntime.queryInterface( XIndexContainer.class, oObj.getPropertyValue("ImageMap")); int previous = imgMap.getCount(); @@ -112,7 +112,7 @@ public class _TextGraphicObject extends MultiPropertyTest { Object im = tEnv.getObjRelation("IMGMAP"); imgMap.insertByIndex(0, im); oObj.setPropertyValue("ImageMap", imgMap); - imgMap = (XIndexContainer) UnoRuntime.queryInterface( + imgMap = UnoRuntime.queryInterface( XIndexContainer.class, oObj.getPropertyValue("ImageMap")); diff --git a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java index 6437d76041e6..3135e4c8d096 100644 --- a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java +++ b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java @@ -78,12 +78,11 @@ public class _XDocumentIndex extends MultiMethodTest { XTextRange xTR = xText.getEnd(); xTR.setString("IndexMark"); - XMultiServiceFactory xDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object idxMark = xDocMSF.createInstance ("com.sun.star.text.DocumentIndexMark"); - XTextContent xTC = (XTextContent) UnoRuntime.queryInterface + XTextContent xTC = UnoRuntime.queryInterface (XTextContent.class, idxMark); xText.insertTextContent(xTR, xTC, true); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java b/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java index bcb871746e4a..db58e361c366 100644 --- a/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java +++ b/qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java @@ -70,8 +70,7 @@ public class _XRelativeTextContentInsert extends MultiMethodTest { XInstCreator para = (XInstCreator)tEnv.getObjRelation( "PARA" ); XInterface oInt = para.createInstance(); XTextContent new_content = (XTextContent) oInt; - XText theText = (XText) - UnoRuntime.queryInterface(XText.class,oObj); + XText theText = UnoRuntime.queryInterface(XText.class,oObj); XTextCursor oCursor = theText.createTextCursor(); XInstCreator info = (XInstCreator) tEnv.getObjRelation( "XTEXTINFO" ); diff --git a/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java b/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java index 77e86c9d859a..e23ef8d94d3e 100644 --- a/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java +++ b/qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java @@ -72,17 +72,14 @@ public class _XTextFieldsSupplier extends MultiMethodTest { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -99,15 +96,14 @@ public class _XTextFieldsSupplier extends MultiMethodTest { XPropertySet PFieldMaster = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class,(XInterface) FieldMaster); - XDependentTextField xTF = (XDependentTextField) - UnoRuntime.queryInterface(XDependentTextField.class,aField); + XDependentTextField xTF = UnoRuntime.queryInterface(XDependentTextField.class,aField); PFieldMaster.setPropertyValue("Content","Some content"); xTF.attachTextFieldMaster(PFieldMaster); } - oText = (XText)UnoRuntime.queryInterface(XText.class, xCell); + oText = UnoRuntime.queryInterface(XText.class, xCell); XTextCursor the_Cursor = oText.createTextCursor(); oText.insertTextContent( diff --git a/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java b/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java index 83ecb327d9eb..2f9bf9a5ae14 100644 --- a/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java +++ b/qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java @@ -82,7 +82,7 @@ public class _XTextRangeCompare extends MultiMethodTest { XInterface oIfc = (XInterface)tEnv.getObjRelation("TEXTDOC"); if (oIfc!=null) { - XTextDocument oTDoc = (XTextDocument)UnoRuntime.queryInterface( + XTextDocument oTDoc = UnoRuntime.queryInterface( XTextDocument.class, oIfc); oText = oTDoc.getText(); } diff --git a/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java index 734817128bfe..10e7f000e5d1 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java +++ b/qadevOOo/tests/java/ifc/ucb/_XCachedDynamicResultSetStubFactory.java @@ -129,7 +129,7 @@ public class _XCachedDynamicResultSetStubFactory extends MultiMethodTest { Object fac = ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.ucb.CachedDynamicResultSetFactory") ; - setFac = (XCachedDynamicResultSetFactory) UnoRuntime.queryInterface + setFac = UnoRuntime.queryInterface (XCachedDynamicResultSetFactory.class, fac) ; } catch (com.sun.star.uno.Exception e) { log.println("Cant instantiate a service") ; diff --git a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java index 80282705e569..0b47b4c35996 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java +++ b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java @@ -126,7 +126,7 @@ public class _XCommandProcessor extends MultiMethodTest { throw new StatusException("Unexpected exception", e); } - XCommandInfo xCmdInfo = (XCommandInfo)UnoRuntime.queryInterface( + XCommandInfo xCmdInfo = UnoRuntime.queryInterface( XCommandInfo.class, result); CommandInfo[] cmdInfo = xCmdInfo.getCommands(); diff --git a/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java b/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java index 7de56a9b1d35..250c32ddebea 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java +++ b/qadevOOo/tests/java/ifc/ucb/_XContentProviderManager.java @@ -107,11 +107,11 @@ public class _XContentProviderManager extends MultiMethodTest { log.println("creating testing content providers"); try { - firstContentProvider = (XContentProvider)UnoRuntime.queryInterface( + firstContentProvider = UnoRuntime.queryInterface( XContentProvider.class, xMSF.createInstance( "com.sun.star.ucb.FileContentProvider")); - contentProvider = (XContentProvider)UnoRuntime.queryInterface( + contentProvider = UnoRuntime.queryInterface( XContentProvider.class, xMSF.createInstance( "com.sun.star.ucb.FileContentProvider")); } catch (Exception e) { diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java index 75132c43d5ef..0672500aa48a 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java +++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess.java @@ -522,7 +522,7 @@ public class _XSimpleFileAccess extends MultiMethodTest { (Status.failed("Reelation InteractionHandler not found")); try { - handler = (XInteractionHandler)UnoRuntime.queryInterface + handler = UnoRuntime.queryInterface (XInteractionHandler.class, oHandler); oObj.setInteractionHandler(handler); tRes.tested("setInteractionHandler()", true); diff --git a/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java b/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java index 0ca58e2ab36e..688df54b7e75 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java +++ b/qadevOOo/tests/java/ifc/ucb/_XSortedDynamicResultSetFactory.java @@ -76,9 +76,8 @@ public class _XSortedDynamicResultSetFactory extends MultiMethodTest { ("com.sun.star.ucb.UniversalContentBroker", new Object[] {"Local", "Office"}) ; - XContentIdentifierFactory ciFac = (XContentIdentifierFactory) - UnoRuntime.queryInterface - (XContentIdentifierFactory.class,oUCB) ; + XContentIdentifierFactory ciFac = UnoRuntime.queryInterface + (XContentIdentifierFactory.class,oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; String escUrl = "" ; @@ -97,13 +96,11 @@ public class _XSortedDynamicResultSetFactory extends MultiMethodTest { XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; - XContentProvider cntProv = (XContentProvider) - UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; + XContentProvider cntProv = UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; XContent cnt = cntProv.queryContent(CI) ; - XCommandProcessor cmdProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; + XCommandProcessor cmdProc = UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; Property prop = new Property() ; prop.Name = "Title" ; diff --git a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java index 04aba5cb8f22..a435a7e784e0 100644 --- a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java +++ b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java @@ -54,10 +54,10 @@ public class _XContextMenuInterception extends MultiMethodTest { private Point point = null; public void before() { - docModel = (XModel) UnoRuntime.queryInterface( + docModel = UnoRuntime.queryInterface( XModel.class,tEnv.getObjRelation("FirstModel")); - xCI = (XContextMenuInterceptor) UnoRuntime.queryInterface( + xCI = UnoRuntime.queryInterface( XContextMenuInterceptor.class, new ContextMenuInterceptor()); xMSF = (XMultiServiceFactory)tParam.getMSF(); @@ -103,7 +103,7 @@ public class _XContextMenuInterception extends MultiMethodTest { } catch (com.sun.star.uno.Exception e){ log.println("could not get Toolkit " + e.toString()); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); XAccessible xRoot = null; @@ -111,7 +111,7 @@ public class _XContextMenuInterception extends MultiMethodTest { AccessibilityTools at = new AccessibilityTools(); try { - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getTopWindow(0)); xRoot = at.getAccessibleObject(xWindow); @@ -162,7 +162,7 @@ public class _XContextMenuInterception extends MultiMethodTest { XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent window = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); point = window.getLocationOnScreen(); diff --git a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java index 51820904c42a..c21bb0182792 100644 --- a/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java +++ b/qadevOOo/tests/java/ifc/ui/_XUIConfigurationManager.java @@ -138,10 +138,10 @@ public class _XUIConfigurationManager extends MultiMethodTest { return; } - createMenuBarItem("Click for Macro", (XIndexContainer)UnoRuntime.queryInterface( + createMenuBarItem("Click for Macro", UnoRuntime.queryInterface( XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, mxMenuBarSettings); + XIndexContainer x = UnoRuntime.queryInterface(XIndexContainer.class, mxMenuBarSettings); try { x.insertByIndex(x.getCount(), prop); } @@ -209,10 +209,10 @@ public class _XUIConfigurationManager extends MultiMethodTest { return; } - createMenuBarItem("A new sub entry", (XIndexContainer)UnoRuntime.queryInterface( + createMenuBarItem("A new sub entry", UnoRuntime.queryInterface( XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class,mxSettings); + XIndexContainer x = UnoRuntime.queryInterface(XIndexContainer.class,mxSettings); try { int count = x.getCount(); x.insertByIndex(count, prop); @@ -256,7 +256,7 @@ public class _XUIConfigurationManager extends MultiMethodTest { public void _getImageManager() { Object o = oObj.getImageManager(); log.println("###### ImageManager "); - XImageManager xImageManager = (XImageManager)UnoRuntime.queryInterface(XImageManager.class, o); + XImageManager xImageManager = UnoRuntime.queryInterface(XImageManager.class, o); tRes.tested("getImageManager()", xImageManager != null); } @@ -303,7 +303,7 @@ public class _XUIConfigurationManager extends MultiMethodTest { prop[3] = new PropertyValue(); prop[3].Name = "ItemDescriptorContainer"; - XSingleComponentFactory xFactory = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory xFactory = UnoRuntime.queryInterface( XSingleComponentFactory.class, xMenuBarSettings); try { XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xMSF); diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java index 728b6998f0fb..0ec54bf85f8a 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XControlAccess.java @@ -57,7 +57,7 @@ public class _XControlAccess extends MultiMethodTest { * properties couldn't be get. */ protected void before() { - xCI = (XControlInformation) UnoRuntime.queryInterface + xCI = UnoRuntime.queryInterface (XControlInformation.class, oObj); if (xCI == null) throw new StatusException diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java index 8e5dcccacbba..145c0b2847a1 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java @@ -71,7 +71,7 @@ public class _XExecutableDialog extends MultiMethodTest { eThread = new ExecThread(oObj); log.println("Starting Dialog"); eThread.start(); - XCancellable canc = (XCancellable)UnoRuntime.queryInterface + XCancellable canc = UnoRuntime.queryInterface (XCancellable.class, tEnv.getTestObject()); shortWait(); if (canc != null) { @@ -134,7 +134,7 @@ public class _XExecutableDialog extends MultiMethodTest { } private void closeDialog() { - XCancellable canc = (XCancellable) UnoRuntime.queryInterface( + XCancellable canc = UnoRuntime.queryInterface( XCancellable.class, tEnv.getTestObject()); if (canc != null) { log.println("Cancelling Dialog"); diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java index b4450c2ba302..28c878ede2a4 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java @@ -95,7 +95,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { * interface. */ public void before() { - fps = (XFilePicker) UnoRuntime.queryInterface + fps = UnoRuntime.queryInterface (XFilePicker.class, oObj) ; if (fps == null) { @@ -104,7 +104,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { ("The object doesnt implement XFilePicker")); } - XExecutableDialog exD = (XExecutableDialog) UnoRuntime.queryInterface( + XExecutableDialog exD = UnoRuntime.queryInterface( XExecutableDialog.class, tEnv.getTestObject()); dir1 = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()); @@ -212,7 +212,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { } private void closeDialog() { - XCancellable canc = (XCancellable) UnoRuntime.queryInterface( + XCancellable canc = UnoRuntime.queryInterface( XCancellable.class, tEnv.getTestObject()); if (canc != null) { log.println("Cancelling Dialog"); @@ -267,7 +267,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { eThread.yield(); } - XExecutableDialog exD = (XExecutableDialog) UnoRuntime.queryInterface( + XExecutableDialog exD = UnoRuntime.queryInterface( XExecutableDialog.class, tEnv.getTestObject()); dir1 = util.utils.getOfficeTemp((XMultiServiceFactory)tParam.getMSF()); diff --git a/qadevOOo/tests/java/ifc/uno/_XComponentContext.java b/qadevOOo/tests/java/ifc/uno/_XComponentContext.java index 9b7dfb7bae22..a4fd9955aef8 100644 --- a/qadevOOo/tests/java/ifc/uno/_XComponentContext.java +++ b/qadevOOo/tests/java/ifc/uno/_XComponentContext.java @@ -60,7 +60,7 @@ public class _XComponentContext extends MultiMethodTest { Object value = oObj.getValueByName( "/singletons/com.sun.star.lang.theServiceManager"); - byValue = (XMultiComponentFactory) UnoRuntime.queryInterface( + byValue = UnoRuntime.queryInterface( XMultiComponentFactory.class, value); String[] vNames = byValue.getAvailableServiceNames(); diff --git a/qadevOOo/tests/java/ifc/view/_XControlAccess.java b/qadevOOo/tests/java/ifc/view/_XControlAccess.java index ba30fcdf3f33..68a43c1633a9 100644 --- a/qadevOOo/tests/java/ifc/view/_XControlAccess.java +++ b/qadevOOo/tests/java/ifc/view/_XControlAccess.java @@ -75,17 +75,15 @@ public class _XControlAccess extends MultiMethodTest { Boolean isSheet = (Boolean) tEnv.getObjRelation("XControlAccess.isSheet"); XDrawPage oDP = null; if (isSheet != null) { - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, oDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, oDoc); oDP = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, oDPS.getDrawPages().getByIndex(0)); } else { - XDrawPageSupplier oDPS = (XDrawPageSupplier) - UnoRuntime.queryInterface(XDrawPageSupplier.class, oDoc); + XDrawPageSupplier oDPS = UnoRuntime.queryInterface(XDrawPageSupplier.class, oDoc); oDP = oDPS.getDrawPage(); } - XShapes shapes = (XShapes) UnoRuntime.queryInterface + XShapes shapes = UnoRuntime.queryInterface (XShapes.class, oDP); XShape button = FormTools.createControlShape (oDoc, 100, 100, 10000, 50000, "CommandButton"); diff --git a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java index 4dc29aeea6e2..3ca7861c0db0 100644 --- a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java +++ b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java @@ -53,7 +53,7 @@ public class _XMultiSelectionSupplier extends MultiMethodTest { public XMultiSelectionSupplier oObj = null; public boolean selectionChanged = false; Object[] selections = null; - Comparator ObjCompare = null; + Comparator<Object> ObjCompare = null; protected void before() { selections = (Object[])tEnv.getObjRelation("Selections"); @@ -62,7 +62,7 @@ public class _XMultiSelectionSupplier extends MultiMethodTest { "Couldn't get relation 'Selections'")); } - ObjCompare = (Comparator)tEnv.getObjRelation("Comparer"); + ObjCompare = (Comparator<Object>)tEnv.getObjRelation("Comparer"); } protected void after() { diff --git a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java index 95840c5f4132..35d24ea4b07b 100644 --- a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java +++ b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java @@ -87,7 +87,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest { */ public MyPrintJobListener(Object printable, String printFileName) { this.printFileName = printFileName; - xPrintable = (XPrintable)UnoRuntime.queryInterface(XPrintable.class, printable); + xPrintable = UnoRuntime.queryInterface(XPrintable.class, printable); printProps = new PropertyValue[2]; printProps[0] = new PropertyValue(); printProps[0].Name = "FileName"; diff --git a/qadevOOo/tests/java/ifc/view/_XPrintable.java b/qadevOOo/tests/java/ifc/view/_XPrintable.java index cc5fc008f19e..eba0f695f719 100644 --- a/qadevOOo/tests/java/ifc/view/_XPrintable.java +++ b/qadevOOo/tests/java/ifc/view/_XPrintable.java @@ -131,7 +131,7 @@ public class _XPrintable extends MultiMethodTest { Object oFAcc = ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.ucb.SimpleFileAccess") ; - fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface + fAcc = UnoRuntime.queryInterface (XSimpleFileAccess.class, oFAcc) ; if (fAcc == null) throw new StatusException (Status.failed("Can't create SimpleFileAccess service")) ; diff --git a/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java index ea8206a8453e..37fce51db73d 100644 --- a/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java +++ b/qadevOOo/tests/java/ifc/view/_XSelectionSupplier.java @@ -51,7 +51,7 @@ public class _XSelectionSupplier extends MultiMethodTest { public XSelectionSupplier oObj = null; public boolean selectionChanged = false; Object[] selections = null; - Comparator ObjCompare = null; + Comparator<Object> ObjCompare = null; protected void before() { selections = (Object[])tEnv.getObjRelation("Selections"); @@ -60,7 +60,7 @@ public class _XSelectionSupplier extends MultiMethodTest { "Couldn't get relation 'Selections'")); } - ObjCompare = (Comparator)tEnv.getObjRelation("Comparer"); + ObjCompare = (Comparator<Object>)tEnv.getObjRelation("Comparer"); } protected void after() { diff --git a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java index 9ed346b391e1..d8469bb1ca69 100644 --- a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java +++ b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java @@ -55,7 +55,7 @@ public class AccessibleShape extends TestCase { try { XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF(); Object o = xMSF.createInstance("com.sun.star.frame.Desktop"); - XDesktop xDesk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, o); + XDesktop xDesk = UnoRuntime.queryInterface(XDesktop.class, o); DesktopTools.closeDoc(xDesk.getCurrentFrame()); } catch (Exception e) { log.println("Couldn't close IDE"); @@ -67,14 +67,14 @@ public class AccessibleShape extends TestCase { log.println( "creating a test environment" ); String aURL=utils.getFullTestURL("basDialog.odt"); xTextDoc = WriterTools.loadTextDoc(xMSF,aURL); - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XFrame xFrame = xModel.getCurrentController().getFrame(); - XDispatchProvider xDPP = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); + XDispatchProvider xDPP = UnoRuntime.queryInterface(XDispatchProvider.class, xFrame); log.println( "opening the basic dialog editor" ); try { Object o = xMSF.createInstance("com.sun.star.frame.DispatchHelper"); - XDispatchHelper xDPH = (XDispatchHelper) UnoRuntime.queryInterface(XDispatchHelper.class, o); + XDispatchHelper xDPH = UnoRuntime.queryInterface(XDispatchHelper.class, o); PropertyValue[] aArgs = new PropertyValue[4]; aArgs[0] = new PropertyValue(); aArgs[0].Name = "Document"; diff --git a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java index e47d0001152c..d9f10f5192c7 100644 --- a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java +++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetFactory.java @@ -107,8 +107,7 @@ public class CachedContentResultSetFactory extends TestCase { ("com.sun.star.ucb.UniversalContentBroker", new Object[] {"Local", "Office"}) ; - XContentIdentifierFactory ciFac = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; + XContentIdentifierFactory ciFac = UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; String escUrl = "" ; @@ -127,13 +126,11 @@ public class CachedContentResultSetFactory extends TestCase { XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; - XContentProvider cntProv = (XContentProvider) - UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; + XContentProvider cntProv = UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; XContent cnt = cntProv.queryContent(CI) ; - XCommandProcessor cmdProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; + XCommandProcessor cmdProc = UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; Property prop = new Property() ; prop.Name = "Title" ; @@ -157,8 +154,8 @@ public class CachedContentResultSetFactory extends TestCase { ("com.sun.star.ucb.CachedContentResultSetStubFactory") ; XCachedContentResultSetStubFactory xStubFactory = - (XCachedContentResultSetStubFactory) UnoRuntime.queryInterface - (XCachedContentResultSetStubFactory.class, oStubFactory) ; + UnoRuntime.queryInterface + (XCachedContentResultSetStubFactory.class, oStubFactory) ; resSetStub = xStubFactory.createCachedContentResultSetStub(resSet) ; diff --git a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java index 11fb56fd79c8..e084ab9c1284 100644 --- a/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java +++ b/qadevOOo/tests/java/mod/_cached/CachedContentResultSetStubFactory.java @@ -105,8 +105,7 @@ public class CachedContentResultSetStubFactory extends TestCase { ("com.sun.star.ucb.UniversalContentBroker", new Object[] {"Local", "Office"}) ; - XContentIdentifierFactory ciFac = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; + XContentIdentifierFactory ciFac = UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; String escUrl = "" ; @@ -126,13 +125,11 @@ public class CachedContentResultSetStubFactory extends TestCase { XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; - XContentProvider cntProv = (XContentProvider) - UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; + XContentProvider cntProv = UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; XContent cnt = cntProv.queryContent(CI) ; - XCommandProcessor cmdProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; + XCommandProcessor cmdProc = UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; Property prop = new Property() ; prop.Name = "Title" ; diff --git a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java index f0fcf0619f25..04deb7697ea2 100644 --- a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java +++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetFactory.java @@ -105,8 +105,7 @@ public class CachedDynamicResultSetFactory extends TestCase { ("com.sun.star.ucb.UniversalContentBroker", new Object[] {"Local", "Office"}) ; - XContentIdentifierFactory ciFac = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; + XContentIdentifierFactory ciFac = UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; String escUrl = "" ; @@ -125,13 +124,11 @@ public class CachedDynamicResultSetFactory extends TestCase { XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; - XContentProvider cntProv = (XContentProvider) - UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; + XContentProvider cntProv = UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; XContent cnt = cntProv.queryContent(CI) ; - XCommandProcessor cmdProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; + XCommandProcessor cmdProc = UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; Property prop = new Property() ; prop.Name = "Title" ; @@ -153,8 +150,8 @@ public class CachedDynamicResultSetFactory extends TestCase { ("com.sun.star.ucb.CachedDynamicResultSetStubFactory") ; XCachedDynamicResultSetStubFactory xStubFactory = - (XCachedDynamicResultSetStubFactory) UnoRuntime.queryInterface - (XCachedDynamicResultSetStubFactory.class, oStubFactory) ; + UnoRuntime.queryInterface + (XCachedDynamicResultSetStubFactory.class, oStubFactory) ; resSetStub = xStubFactory.createCachedDynamicResultSetStub(dynResSet) ; diff --git a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java index 05e24d6fd26d..0ab63dcd48a0 100644 --- a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java +++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java @@ -102,8 +102,7 @@ public class CachedDynamicResultSetStubFactory extends TestCase { ("com.sun.star.ucb.UniversalContentBroker", new Object[] {"Local", "Office"}) ; - XContentIdentifierFactory ciFac = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; + XContentIdentifierFactory ciFac = UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ; String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ; String escUrl = "" ; @@ -122,13 +121,11 @@ public class CachedDynamicResultSetStubFactory extends TestCase { XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ; - XContentProvider cntProv = (XContentProvider) - UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; + XContentProvider cntProv = UnoRuntime.queryInterface(XContentProvider.class, oUCB) ; XContent cnt = cntProv.queryContent(CI) ; - XCommandProcessor cmdProc = (XCommandProcessor) - UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; + XCommandProcessor cmdProc = UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ; Property prop = new Property() ; prop.Name = "Title" ; diff --git a/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java b/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java index 215617d23fa9..fafd45873a62 100644 --- a/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java +++ b/qadevOOo/tests/java/mod/_cnt/ChaosContentProvider.java @@ -87,8 +87,7 @@ public class ChaosContentProvider extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); // adding relation for XContentProvider - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class, cntFactory); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class, cntFactory); tEnv.addObjRelation("FACTORY", CIF) ; tEnv.addObjRelation("CONTENT1", "ftp://localhost") ; diff --git a/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java b/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java index 131b79d06d86..2b6929b97259 100644 --- a/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java +++ b/qadevOOo/tests/java/mod/_cnt/CntUnoDataContainer.java @@ -90,7 +90,7 @@ public class CntUnoDataContainer extends TestCase { ( "com.sun.star.ucb.DataContainer" ); // adding one child container - XIndexContainer xIC = (XIndexContainer) UnoRuntime.queryInterface + XIndexContainer xIC = UnoRuntime.queryInterface (XIndexContainer.class, oInterface) ; Object child = xMSF.createInstance diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java index 16f225c119a0..3a9bc8e19979 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -181,9 +181,8 @@ public class ConnectionLineAccessibility extends TestCase try { log.println("writing database file ..."); - XDocumentDataSource xDDS = (XDocumentDataSource) - UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); - store = (XStorable) UnoRuntime.queryInterface(XStorable.class, + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); + store = UnoRuntime.queryInterface(XStorable.class, xDDS.getDatabaseDocument()); aFile = utils.getOfficeTemp((XMultiServiceFactory) Param.getMSF())+"ConnectionLine.odb"; @@ -198,7 +197,7 @@ public class ConnectionLineAccessibility extends TestCase throw new StatusException(Status.failed("Couldn't register object")); } - isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface( + isolConnection = UnoRuntime.queryInterface( XIsolatedConnection.class, oDBSource); @@ -243,7 +242,7 @@ public class ConnectionLineAccessibility extends TestCase } } - XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface( + XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface( XQueryDefinitionsSupplier.class, oDBSource); @@ -383,7 +382,7 @@ public class ConnectionLineAccessibility extends TestCase log.println("... done"); XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF(); Object sfa = xMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, sfa); + XSimpleFileAccess xSFA = UnoRuntime.queryInterface(XSimpleFileAccess.class, sfa); log.println("deleting database file"); xSFA.kill(aFile); log.println("Could delete file "+aFile+": "+!xSFA.exists(aFile)); diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index 7af75a06251f..4b5f2f24f414 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -175,9 +175,8 @@ public class JoinViewAccessibility extends TestCase { try { log.println ("writing database file ..."); - XDocumentDataSource xDDS = (XDocumentDataSource) - UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); - store = (XStorable) UnoRuntime.queryInterface(XStorable.class, + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); + store = UnoRuntime.queryInterface(XStorable.class, xDDS.getDatabaseDocument()); aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"JoinView.odb"; log.println ("... filename will be "+aFile); @@ -190,7 +189,7 @@ public class JoinViewAccessibility extends TestCase { throw new StatusException (Status.failed ("Couldn't register object")); } - isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface ( + isolConnection = UnoRuntime.queryInterface ( XIsolatedConnection.class, oDBSource); @@ -233,7 +232,7 @@ public class JoinViewAccessibility extends TestCase { } } - XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface ( + XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface ( XQueryDefinitionsSupplier.class, oDBSource); @@ -359,7 +358,7 @@ public class JoinViewAccessibility extends TestCase { log.println ("... done"); XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF (); Object sfa = xMSF.createInstance ("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa); + XSimpleFileAccess xSFA = UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa); log.println ("deleting database file"); xSFA.kill (aFile); log.println ("Could delete file "+aFile+": "+!xSFA.exists (aFile)); diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java index 059d51510c66..4809692ace7d 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseContext.java @@ -112,9 +112,8 @@ public class ODatabaseContext extends TestCase { xDSProps.setPropertyValue("URL", "sdbc:dbase:file:///.") ; - XDocumentDataSource xDDS = (XDocumentDataSource) - UnoRuntime.queryInterface(XDocumentDataSource.class, oInterface); - XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oInterface); + XStorable store = UnoRuntime.queryInterface(XStorable.class, xDDS.getDatabaseDocument ()); String aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"DatabaseContext.odb"; log.println("store to '" + aFile + "'"); @@ -125,7 +124,7 @@ public class ODatabaseContext extends TestCase { tEnv.addObjRelation("INSTANCE", oInterface); tEnv.addObjRelation("XContainer.Container", - (XNamingService) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XNamingService.class, oObj)); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java index f2786cb509e5..ee06840e1d0c 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatabaseSource.java @@ -133,8 +133,7 @@ public class ODatabaseSource extends TestCase { throw new StatusException("Service not available", e) ; } - xDBContextNameServ = (XNamingService) - UnoRuntime.queryInterface(XNamingService.class, oInterface) ; + xDBContextNameServ = UnoRuntime.queryInterface(XNamingService.class, oInterface) ; // retrieving temp directory for database String tmpDatabaseUrl = utils.getOfficeTempDir((XMultiServiceFactory)Param.getMSF()); @@ -148,7 +147,7 @@ public class ODatabaseSource extends TestCase { if (oDatabaseDoc == null) throw new StatusException("Could not get service 'com.sun.star.sdb.OfficeDatabaseDocument'", new Exception()); - xDBDoc = (XOfficeDatabaseDocument) UnoRuntime.queryInterface( + xDBDoc = UnoRuntime.queryInterface( XOfficeDatabaseDocument.class, oDatabaseDoc); } @@ -188,7 +187,7 @@ public class ODatabaseSource extends TestCase { } // registering source in DatabaseContext - XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xDBDoc); + XStorable store = UnoRuntime.queryInterface(XStorable.class, xDBDoc); String aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"DataSource.odb"; try{ store.storeAsURL(aFile,new PropertyValue[]{}); diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java index 3898d06bea29..c55c1571faee 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java @@ -98,7 +98,7 @@ public class ODatasourceBrowser extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory)Param.getMSF())); System.setProperty("hideMe", "false"); @@ -116,7 +116,7 @@ public class ODatasourceBrowser extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class ODatasourceBrowser extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -205,7 +205,7 @@ public class ODatasourceBrowser extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); @@ -216,7 +216,7 @@ public class ODatasourceBrowser extends TestCase { log.println("Current frame was not found !!!"); } - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, the_frame1); XDispatch getting = null; @@ -253,7 +253,7 @@ public class ODatasourceBrowser extends TestCase { params[2] = param3; try { - XInitialization xInit = (XInitialization) UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, oObj); xInit.initialize(params); } catch (com.sun.star.uno.Exception e) { @@ -271,7 +271,7 @@ public class ODatasourceBrowser extends TestCase { XControlModel shapeModel = aShape.getControl(); - XControlAccess xCtrlAccess = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess xCtrlAccess = UnoRuntime.queryInterface( XControlAccess.class, secondController); XControl xCtrl = null; @@ -283,7 +283,7 @@ public class ODatasourceBrowser extends TestCase { e.printStackTrace(log); } - XWindow docWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow docWindow = UnoRuntime.queryInterface(XWindow.class, xCtrl); log.println("creating a new environment for ODatasourceBrowser object"); diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java index 978dea5195b3..ab89d5d64d93 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java @@ -63,7 +63,7 @@ public class OQueryDesign extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - xDesk = (XDesktop) UnoRuntime.queryInterface( + xDesk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()) ); } @@ -73,8 +73,7 @@ public class OQueryDesign extends TestCase { XInterface oObj = null; - XDispatchProvider aProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class,xDesk); + XDispatchProvider aProv = UnoRuntime.queryInterface(XDispatchProvider.class,xDesk); XDispatch getting = null; XMultiServiceFactory xMSF = (XMultiServiceFactory) Param.getMSF(); @@ -92,7 +91,7 @@ public class OQueryDesign extends TestCase { throw new StatusException( "Could not get Databasecontext", ex ); } try { - xDS = (XDataSource) UnoRuntime.queryInterface( + xDS = UnoRuntime.queryInterface( XDataSource.class, xNameAccess.getByName( "Bibliography" )); } catch (NoSuchElementException ex) { ex.printStackTrace( log ); @@ -157,7 +156,7 @@ public class OQueryDesign extends TestCase { } catch ( com.sun.star.lang.WrappedTargetException e){ throw new StatusException("could not get '" + sDataSourceName + "'" , e) ; } - XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource); + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource); // XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ()); // Frame = xMod.getCurrentController().getFrame(); @@ -177,7 +176,7 @@ public class OQueryDesign extends TestCase { throw new StatusException( "Could not create document", e ); } - XModel xDocMod = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel xDocMod = UnoRuntime.queryInterface(XModel.class, xTextDoc); XFrame xTextFrame = xDocMod.getCurrentController().getFrame(); @@ -257,8 +256,8 @@ public class OQueryDesign extends TestCase { throw new StatusException("could not get '" + sDataSourceName + "'" , e) ; } - XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource); - XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ()); + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource); + XModel xMod = UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ()); // get an intaces of QueryDesign Object oQueryDesign = null; @@ -268,7 +267,7 @@ public class OQueryDesign extends TestCase { throw new StatusException("Could not instantiate QueryDesign", e) ; } - XController xCont = (XController) UnoRuntime.queryInterface(XController.class, oQueryDesign); + XController xCont = UnoRuntime.queryInterface(XController.class, oQueryDesign); // marry them all xCont.attachModel(xMod); @@ -281,7 +280,7 @@ public class OQueryDesign extends TestCase { //xCont.attachFrame(xFrame); - return (XInitialization) UnoRuntime.queryInterface(XInitialization.class, oQueryDesign); + return UnoRuntime.queryInterface(XInitialization.class, oQueryDesign); } diff --git a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java index e75b1b15d5df..5246edd5a72b 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java @@ -382,7 +382,7 @@ public class ORowSet extends TestCase { // Adding relations for XRow as a Vector with all data // of current row of RowSet. - ArrayList rowData = new ArrayList(); + ArrayList<Object> rowData = new ArrayList<Object>(); for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) { rowData.add(DBTools.TST_TABLE_VALUES[0][i]); @@ -415,7 +415,7 @@ public class ORowSet extends TestCase { } // Adding relation for XParameters ifc test - tEnv.addObjRelation( "XParameters.ParamValues", new ArrayList() ); + tEnv.addObjRelation( "XParameters.ParamValues", new ArrayList<String>() ); // Adding relation for XRowUpdate final XRow row = UnoRuntime.queryInterface( XRow.class, m_rowSet ); diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java index 6fc71fd0547f..aa0641542627 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OSQLMessageDialog.java @@ -96,7 +96,7 @@ public class OSQLMessageDialog extends TestCase { com.sun.star.awt.XToolkit xToolkit = null; try{ - xToolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface( + xToolkit = UnoRuntime.queryInterface( com.sun.star.awt.XToolkit.class, ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.awt.Toolkit") ); } catch (com.sun.star.uno.Exception e){ @@ -130,7 +130,7 @@ public class OSQLMessageDialog extends TestCase { throw new StatusException("could not create window", e) ; } - com.sun.star.awt.XWindow xWindow = (com.sun.star.awt.XWindow)UnoRuntime.queryInterface ( + com.sun.star.awt.XWindow xWindow = UnoRuntime.queryInterface ( com.sun.star.awt.XWindow .class, xPeer); log.println( " creating a new environment for object" ); diff --git a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java index 8e19a63b7296..592bf708d63b 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OSingleSelectQueryComposer.java @@ -182,13 +182,12 @@ public class OSingleSelectQueryComposer extends TestCase { XNameAccess.class, xMSF.createInstance("com.sun.star.sdb.DatabaseContext")); // we use the first datasource - XDataSource xDS = (XDataSource)UnoRuntime.queryInterface( + XDataSource xDS = UnoRuntime.queryInterface( XDataSource.class, xNameAccess.getByName( "Bibliography" )); log.println("check XMultiServiceFactory"); - XMultiServiceFactory xConn = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, - xDS.getConnection(new String(),new String())); + XMultiServiceFactory xConn = UnoRuntime.queryInterface(XMultiServiceFactory.class, + xDS.getConnection(new String(),new String())); log.println("check getAvailableServiceNames"); String[] sServiceNames = xConn.getAvailableServiceNames(); @@ -215,14 +214,12 @@ public class OSingleSelectQueryComposer extends TestCase { xSetProp.setPropertyValue("CommandType", new Integer(CommandType.TABLE)) ; - com.sun.star.sdbc.XRowSet xORowSet = (com.sun.star.sdbc.XRowSet) - UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class, - oRowSet) ; + com.sun.star.sdbc.XRowSet xORowSet = UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class, + oRowSet) ; xORowSet.execute() ; - XColumnsSupplier xColSup = (XColumnsSupplier) - UnoRuntime.queryInterface(XColumnsSupplier.class, oRowSet); + XColumnsSupplier xColSup = UnoRuntime.queryInterface(XColumnsSupplier.class, oRowSet); XNameAccess xCols = xColSup.getColumns(); @@ -230,14 +227,12 @@ public class OSingleSelectQueryComposer extends TestCase { new Type(XPropertySet.class), xCols.getByName(xCols.getElementNames()[0])); - XSingleSelectQueryAnalyzer xQueryAna = (XSingleSelectQueryAnalyzer) - UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, - oInterface); + XSingleSelectQueryAnalyzer xQueryAna = UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, + oInterface); // XSingleSelectQueryComposer - XSingleSelectQueryComposer xComposer = (XSingleSelectQueryComposer) - UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, - xQueryAna); + XSingleSelectQueryComposer xComposer = UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, + xQueryAna); xQueryAna.setQuery("SELECT * FROM \"biblio\""); oObj = (XInterface) oInterface; diff --git a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java index 0983778036fc..80b47938362f 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java +++ b/qadevOOo/tests/java/mod/_dbaccess/SbaXGridControl.java @@ -154,12 +154,12 @@ public class SbaXGridControl extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -167,7 +167,7 @@ public class SbaXGridControl extends TestCase { XInterface button = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON); - XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface( + XAccessibleAction action = UnoRuntime.queryInterface( XAccessibleAction.class, button); try { @@ -181,7 +181,7 @@ public class SbaXGridControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -248,12 +248,12 @@ public class SbaXGridControl extends TestCase { XLoadable formLoader = FormTools.bindForm(xTextDoc); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); try { - columns = (XGridColumnFactory) UnoRuntime.queryInterface( + columns = UnoRuntime.queryInterface( XGridColumnFactory.class, the_Model); aControl = columns.createColumn("TextField"); aControl.setPropertyValue("DataField", "Identifier"); @@ -321,7 +321,7 @@ public class SbaXGridControl extends TestCase { //Try to query XControlAccess - the_access = (XControlAccess) UnoRuntime.queryInterface( + the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -331,7 +331,7 @@ public class SbaXGridControl extends TestCase { try { cntrl = the_access.getControl(the_Model); - win = (XWindow) UnoRuntime.queryInterface(XWindow.class, cntrl); + win = UnoRuntime.queryInterface(XWindow.class, cntrl); } catch (com.sun.star.uno.Exception e) { log.println("Couldn't get Control"); e.printStackTrace(log); @@ -412,9 +412,9 @@ public class SbaXGridControl extends TestCase { } public void commit() throws com.sun.star.sdbc.SQLException { - XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface( + XBoundComponent bound = UnoRuntime.queryInterface( XBoundComponent.class, ctrl); - XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface( + XResultSetUpdate update = UnoRuntime.queryInterface( XResultSetUpdate.class, formLoaderF); @@ -440,7 +440,7 @@ public class SbaXGridControl extends TestCase { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc); @@ -453,9 +453,9 @@ public class SbaXGridControl extends TestCase { XPropertySet.class, aCon); model_props.setPropertyValue("DefaultControl", "com.sun.star.form.control.InteractionGridControl"); - aControl = (XControlModel) UnoRuntime.queryInterface( + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon); - oCShape = (XControlShape) UnoRuntime.queryInterface( + oCShape = UnoRuntime.queryInterface( XControlShape.class, oInt); size.Height = height; size.Width = width; diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index 785b5291e0a0..b5e8af28f601 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -166,9 +166,8 @@ public class TableWindowAccessibility extends TestCase { try { log.println ("writing database file ..."); - XDocumentDataSource xDDS = (XDocumentDataSource) - UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); - store = (XStorable) UnoRuntime.queryInterface(XStorable.class, + XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource); + store = UnoRuntime.queryInterface(XStorable.class, xDDS.getDatabaseDocument()); aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"TableWindow.odb"; log.println("... filename will be "+aFile); @@ -179,7 +178,7 @@ public class TableWindowAccessibility extends TestCase { throw new StatusException(Status.failed("Couldn't register object")); } - isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface( + isolConnection = UnoRuntime.queryInterface( XIsolatedConnection.class, oDBSource); @@ -218,7 +217,7 @@ public class TableWindowAccessibility extends TestCase { } } - XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface( + XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface( XQueryDefinitionsSupplier.class, oDBSource); @@ -309,7 +308,7 @@ public class TableWindowAccessibility extends TestCase { shortWait(); - XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); @@ -346,7 +345,7 @@ public class TableWindowAccessibility extends TestCase { log.println ("... done"); XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF (); Object sfa = xMSF.createInstance ("com.sun.star.comp.ucb.SimpleFileAccess"); - XSimpleFileAccess xSFA = (XSimpleFileAccess) UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa); + XSimpleFileAccess xSFA = UnoRuntime.queryInterface (XSimpleFileAccess.class, sfa); log.println ("deleting database file"); xSFA.kill (aFile); log.println ("Could delete file "+aFile+": "+!xSFA.exists (aFile)); diff --git a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java index 83a563496581..f12e2c73e399 100644 --- a/qadevOOo/tests/java/mod/_forms/GenericModelTest.java +++ b/qadevOOo/tests/java/mod/_forms/GenericModelTest.java @@ -152,7 +152,7 @@ public class GenericModelTest extends TestCase { * myProp.Value = "My special Value"; * m_propertiesToSet.add(myProp); */ - public static ArrayList m_propertiesToSet = new ArrayList(); + public static ArrayList<NamedValue> m_propertiesToSet = new ArrayList<NamedValue>(); /** * This variable contains the name of the property which should be changed while @@ -278,14 +278,14 @@ public class GenericModelTest extends TestCase { log.println("closing data source..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, m_dbSrc); if ( closer == null ) { - XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( + XDocumentDataSource dataSource = UnoRuntime.queryInterface( XDocumentDataSource.class, m_dbSrc); if ( dataSource != null ) - closer = (XCloseable) UnoRuntime.queryInterface( + closer = UnoRuntime.queryInterface( XCloseable.class, dataSource.getDatabaseDocument() ); } if (debug && closer==null){ @@ -302,7 +302,7 @@ public class GenericModelTest extends TestCase { log.println("disposing data source..."); try { - XComponent dataSourceComp = (XComponent)UnoRuntime.queryInterface( + XComponent dataSourceComp = UnoRuntime.queryInterface( XComponent.class, m_dbSrc); dataSourceComp.dispose(); } @@ -313,7 +313,7 @@ public class GenericModelTest extends TestCase { log.println("closing document..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, m_xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -537,9 +537,9 @@ public class GenericModelTest extends TestCase { } public void commit() throws com.sun.star.sdbc.SQLException { - XBoundComponent bound = (XBoundComponent) UnoRuntime.queryInterface( + XBoundComponent bound = UnoRuntime.queryInterface( XBoundComponent.class, ctrl); - XResultSetUpdate update = (XResultSetUpdate) UnoRuntime.queryInterface( + XResultSetUpdate update = UnoRuntime.queryInterface( XResultSetUpdate.class, formLoaderF); diff --git a/qadevOOo/tests/java/mod/_forms/OButtonControl.java b/qadevOOo/tests/java/mod/_forms/OButtonControl.java index a6c554e54564..323dfc372f70 100644 --- a/qadevOOo/tests/java/mod/_forms/OButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OButtonControl.java @@ -104,7 +104,7 @@ public class OButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -170,7 +170,7 @@ public class OButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -203,7 +203,7 @@ public class OButtonControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java index abb3a0b25d10..93a57f04d484 100644 --- a/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCheckBoxControl.java @@ -112,7 +112,7 @@ public class OCheckBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -177,7 +177,7 @@ public class OCheckBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class,xTextDoc.getCurrentController()); //now get the OButtonControl @@ -209,14 +209,13 @@ public class OCheckBoxControl extends TestCase { // Adding relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener() ; - XCheckBox box = (XCheckBox) UnoRuntime.queryInterface + XCheckBox box = UnoRuntime.queryInterface (XCheckBox.class, oObj) ; box.addItemListener(listener) ; tEnv.addObjRelation("TestItemListener", listener) ; // Adding relation for XWindow - XWindow forObjRel = (XWindow) - UnoRuntime.queryInterface(XWindow.class,aControl); + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class,aControl); tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java index 9d7f68ad02aa..abd7dcede6de 100644 --- a/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OComboBoxControl.java @@ -116,7 +116,7 @@ public class OComboBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -182,7 +182,7 @@ public class OComboBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -216,7 +216,7 @@ public class OComboBoxControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -225,7 +225,7 @@ public class OComboBoxControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java index bfa1d0a85efc..14b23c1621b0 100644 --- a/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java +++ b/qadevOOo/tests/java/mod/_forms/OCurrencyControl.java @@ -116,7 +116,7 @@ public class OCurrencyControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -185,7 +185,7 @@ public class OCurrencyControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -223,7 +223,7 @@ public class OCurrencyControl extends TestCase { tEnv.addObjRelation("XTextComponent.onlyNumbers", new Object()); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -232,7 +232,7 @@ public class OCurrencyControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index d9424522eb08..7f3fa6568af9 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -316,7 +316,7 @@ public class ODatabaseForm extends TestCase { PrintWriter log) { if (xTextDoc != null) { try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -401,12 +401,12 @@ public class ODatabaseForm extends TestCase { log.println("Elements in the 'MyForm' :"); - XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess formElements1 = UnoRuntime.queryInterface( XIndexAccess.class, forms.getByName("MyForm")); for (int i = 0; i < formElements1.getCount(); i++) { - XNamed elemName = (XNamed) UnoRuntime.queryInterface( + XNamed elemName = UnoRuntime.queryInterface( XNamed.class, formElements1.getByIndex(i)); log.println(" '" + elemName.getName() + "'"); @@ -443,12 +443,12 @@ public class ODatabaseForm extends TestCase { try { log.println("Elements in the 'MyForm' :"); - XIndexAccess formElements1 = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess formElements1 = UnoRuntime.queryInterface( XIndexAccess.class, forms.getByName("MyForm")); for (int i = 0; i < formElements1.getCount(); i++) { - XNamed elemName = (XNamed) UnoRuntime.queryInterface( + XNamed elemName = UnoRuntime.queryInterface( XNamed.class, formElements1.getByIndex(i)); log.println(" '" + elemName.getName() + "'"); @@ -490,7 +490,7 @@ public class ODatabaseForm extends TestCase { // adding relation for XSubmit XControlModel the_Model = shape2.getControl(); - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); XControl cntrl = null; @@ -505,7 +505,7 @@ public class ODatabaseForm extends TestCase { throw new StatusException("Couldn't get OEditControl", e); } - XResultSet the_set = (XResultSet) UnoRuntime.queryInterface( + XResultSet the_set = UnoRuntime.queryInterface( XResultSet.class, oObj); try { @@ -567,12 +567,12 @@ public class ODatabaseForm extends TestCase { } // Adding obj relation for XRowSetApproveBroadcaster test - final XResultSet xResSet = (XResultSet) UnoRuntime.queryInterface( + final XResultSet xResSet = UnoRuntime.queryInterface( XResultSet.class, oObj); - final XResultSetUpdate xResSetUpdate = (XResultSetUpdate) UnoRuntime.queryInterface( + final XResultSetUpdate xResSetUpdate = UnoRuntime.queryInterface( XResultSetUpdate.class, oObj); - final XRowSet xRowSet = (XRowSet) UnoRuntime.queryInterface( + final XRowSet xRowSet = UnoRuntime.queryInterface( XRowSet.class, oObj); final PrintWriter logF = log; tEnv.addObjRelation("XRowSetApproveBroadcaster.ApproveChecker", @@ -591,7 +591,7 @@ public class ODatabaseForm extends TestCase { try { xResSet.first(); - XRowUpdate row = (XRowUpdate) UnoRuntime.queryInterface( + XRowUpdate row = UnoRuntime.queryInterface( XRowUpdate.class, xResSet); row.updateString(1, "1"); xResSetUpdate.updateRow(); @@ -622,7 +622,7 @@ public class ODatabaseForm extends TestCase { tEnv.addObjRelation("XColumnLocate.ColumnName", DBTools.TST_STRING_F); // Adding relation for XParameters ifc test - ArrayList params = new ArrayList(); + ArrayList<Object> params = new ArrayList<Object>(); /***** statement parameter types and their initial @@ -674,9 +674,9 @@ public class ODatabaseForm extends TestCase { } // Adding relation for XResultSetUpdate - final XRowUpdate xRowUpdate = (XRowUpdate) UnoRuntime.queryInterface( + final XRowUpdate xRowUpdate = UnoRuntime.queryInterface( XRowUpdate.class, oObj); - final XRow xRow = (XRow) UnoRuntime.queryInterface(XRow.class, oObj); + final XRow xRow = UnoRuntime.queryInterface(XRow.class, oObj); tEnv.addObjRelation("XResultSetUpdate.UpdateTester", new ifc.sdbc._XResultSetUpdate.UpdateTester() { @@ -712,7 +712,7 @@ public class ODatabaseForm extends TestCase { // Adding relations for XRow as a Vector with all data // of current row of RowSet. - ArrayList rowData = new ArrayList(); + ArrayList<Object> rowData = new ArrayList<Object>(); for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) { rowData.add(DBTools.TST_TABLE_VALUES[0][i]); @@ -721,7 +721,7 @@ public class ODatabaseForm extends TestCase { tEnv.addObjRelation("CurrentRowData", rowData); // Adding relation for XRowUpdate - XRow row = (XRow) UnoRuntime.queryInterface(XRow.class, oObj); + XRow row = UnoRuntime.queryInterface(XRow.class, oObj); tEnv.addObjRelation("XRowUpdate.XRow", row); @@ -753,7 +753,7 @@ public class ODatabaseForm extends TestCase { log.println("closing data source..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, dbSrc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -766,7 +766,7 @@ public class ODatabaseForm extends TestCase { log.println("closing document..."); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/ODateControl.java b/qadevOOo/tests/java/mod/_forms/ODateControl.java index a2862765bc00..b8a146ccf1bf 100644 --- a/qadevOOo/tests/java/mod/_forms/ODateControl.java +++ b/qadevOOo/tests/java/mod/_forms/ODateControl.java @@ -115,7 +115,7 @@ public class ODateControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class ODateControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class ODateControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class ODateControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OEditControl.java b/qadevOOo/tests/java/mod/_forms/OEditControl.java index 58ff894b6a7a..fcf64d281c98 100644 --- a/qadevOOo/tests/java/mod/_forms/OEditControl.java +++ b/qadevOOo/tests/java/mod/_forms/OEditControl.java @@ -116,7 +116,7 @@ public class OEditControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -191,7 +191,7 @@ public class OEditControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -225,11 +225,11 @@ public class OEditControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // relations for XChangeBroadcaster - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("Win1", - (XWindow) UnoRuntime.queryInterface(XWindow.class, + UnoRuntime.queryInterface(XWindow.class, oObj)); tEnv.addObjRelation("Win2", forObjRel); tEnv.addObjRelation("CONTROL", aControl); @@ -242,7 +242,7 @@ public class OEditControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java index 4f3cd3e6f3d9..509d22fd0821 100644 --- a/qadevOOo/tests/java/mod/_forms/OFileControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OFileControlModel.java @@ -115,7 +115,7 @@ public class OFileControlModel extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -154,7 +154,7 @@ public class OFileControlModel extends TestCase { XControlModel aControl = null; //get MSF - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc); @@ -163,9 +163,9 @@ public class OFileControlModel extends TestCase { "com.sun.star.drawing.ControlShape"); Object aCon = oDocMSF.createInstance( "com.sun.star.form.component." + objName); - aControl = (XControlModel) UnoRuntime.queryInterface( + aControl = UnoRuntime.queryInterface( XControlModel.class, aCon); - aShape = (XControlShape) UnoRuntime.queryInterface( + aShape = UnoRuntime.queryInterface( XControlShape.class, oInt); size.Height = 1500; size.Width = 3000; diff --git a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java index 504275adefed..04f3d4353480 100644 --- a/qadevOOo/tests/java/mod/_forms/OFormattedControl.java +++ b/qadevOOo/tests/java/mod/_forms/OFormattedControl.java @@ -112,7 +112,7 @@ public class OFormattedControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -178,7 +178,7 @@ public class OFormattedControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -212,7 +212,7 @@ public class OFormattedControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -221,7 +221,7 @@ public class OFormattedControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OFormsCollection.java b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java index 0753cc577423..a0554eb987cc 100644 --- a/qadevOOo/tests/java/mod/_forms/OFormsCollection.java +++ b/qadevOOo/tests/java/mod/_forms/OFormsCollection.java @@ -87,7 +87,7 @@ public class OFormsCollection extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -147,7 +147,7 @@ public class OFormsCollection extends TestCase { // INSTANCEn : _XNameContainer; _XNameReplace log.println("adding INSTANCEn as obj relation to environment"); - XComponent xComp = (XComponent) UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xDrawDoc); int THRCNT = 1; if (Param.get("THRCNT")!= null) { diff --git a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java index 266a3582b224..7fe48a4d8c27 100644 --- a/qadevOOo/tests/java/mod/_forms/OGridControlModel.java +++ b/qadevOOo/tests/java/mod/_forms/OGridControlModel.java @@ -180,7 +180,7 @@ public class OGridControlModel extends GenericModelTest { XPropertySet aControl5 = null; try { - XGridColumnFactory columns = (XGridColumnFactory) UnoRuntime.queryInterface( + XGridColumnFactory columns = UnoRuntime.queryInterface( XGridColumnFactory.class, oObj); aControl = columns.createColumn("TextField"); aControl2 = columns.createColumn("DateField"); @@ -229,9 +229,9 @@ public class OGridControlModel extends GenericModelTest { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XNamed named1 = (XNamed) UnoRuntime.queryInterface( + XNamed named1 = UnoRuntime.queryInterface( XNamed.class, o1); - XNamed named2 = (XNamed) UnoRuntime.queryInterface( + XNamed named2 = UnoRuntime.queryInterface( XNamed.class, o2); if (named1.getName().equals(named2.getName())) { @@ -284,7 +284,7 @@ class OGridControlModelold extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -343,7 +343,7 @@ class OGridControlModelold extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); try { - columns = (XGridColumnFactory) UnoRuntime.queryInterface( + columns = UnoRuntime.queryInterface( XGridColumnFactory.class, oObj); aControl = columns.createColumn("TextField"); aControl2 = columns.createColumn("DateField"); diff --git a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java index 8dba76db34cd..483360dc1703 100644 --- a/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OGroupBoxControl.java @@ -94,7 +94,7 @@ public class OGroupBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -160,7 +160,7 @@ public class OGroupBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); diff --git a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java index 01d4fe2b292a..c5c63f71d67a 100644 --- a/qadevOOo/tests/java/mod/_forms/OHiddenModel.java +++ b/qadevOOo/tests/java/mod/_forms/OHiddenModel.java @@ -111,7 +111,7 @@ public class OHiddenModel extends TestCase { log.println(" disposing xDrawDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDrawDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java index e9dacb29ca4f..158e20908bbb 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageButtonControl.java @@ -99,7 +99,7 @@ public class OImageButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -165,7 +165,7 @@ public class OImageButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -200,7 +200,7 @@ public class OImageButtonControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java index fd4861fff424..8d44556e4788 100644 --- a/qadevOOo/tests/java/mod/_forms/OImageControlControl.java +++ b/qadevOOo/tests/java/mod/_forms/OImageControlControl.java @@ -100,7 +100,7 @@ public class OImageControlControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -166,7 +166,7 @@ public class OImageControlControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -201,7 +201,7 @@ public class OImageControlControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java index 8157d8b68ff5..97dcd97a1f64 100644 --- a/qadevOOo/tests/java/mod/_forms/OListBoxControl.java +++ b/qadevOOo/tests/java/mod/_forms/OListBoxControl.java @@ -65,7 +65,7 @@ public class OListBoxControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -98,7 +98,7 @@ public class OListBoxControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class,xTextDoc.getCurrentController()); //now get the OListBoxControl @@ -130,16 +130,14 @@ public class OListBoxControl extends TestCase { // Adding relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener() ; - final XListBox box = (XListBox) UnoRuntime.queryInterface(XListBox.class, oObj) ; + final XListBox box = UnoRuntime.queryInterface(XListBox.class, oObj) ; box.addItemListener(listener) ; tEnv.addObjRelation("TestItemListener", listener) ; // Adding relation for XWindow - XWindow forObjRel = (XWindow) - UnoRuntime.queryInterface(XWindow.class, anotherCtrl); + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); - XWindow objWin = (XWindow) - UnoRuntime.queryInterface(XWindow.class, oObj); + XWindow objWin = UnoRuntime.queryInterface(XWindow.class, oObj); tEnv.addObjRelation("XWindow.AnotherWindow",forObjRel); tEnv.addObjRelation("XWindow.ControlShape",aShape); diff --git a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java index 08222a6d9bdc..e3e1fd35e71b 100644 --- a/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONavigationBarControl.java @@ -127,7 +127,7 @@ public class ONavigationBarControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -160,7 +160,7 @@ public class ONavigationBarControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/ONumericControl.java b/qadevOOo/tests/java/mod/_forms/ONumericControl.java index b70b275496c2..bb5e52d8b7de 100644 --- a/qadevOOo/tests/java/mod/_forms/ONumericControl.java +++ b/qadevOOo/tests/java/mod/_forms/ONumericControl.java @@ -115,7 +115,7 @@ public class ONumericControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class ONumericControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class ONumericControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class ONumericControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/OPatternControl.java b/qadevOOo/tests/java/mod/_forms/OPatternControl.java index e82e510637f4..bb1037225417 100644 --- a/qadevOOo/tests/java/mod/_forms/OPatternControl.java +++ b/qadevOOo/tests/java/mod/_forms/OPatternControl.java @@ -115,7 +115,7 @@ public class OPatternControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -181,7 +181,7 @@ public class OPatternControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class OPatternControl extends TestCase { tEnv.addObjRelation("MODEL", the_Model); // Adding relation for XWindow - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, anotherCtrl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class OPatternControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java index 5a2bfcba397b..30da3081489f 100644 --- a/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java +++ b/qadevOOo/tests/java/mod/_forms/ORadioButtonControl.java @@ -103,7 +103,7 @@ public class ORadioButtonControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -169,7 +169,7 @@ public class ORadioButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -203,7 +203,7 @@ public class ORadioButtonControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java index 3c2c44273bfe..8d014b7ee3b6 100644 --- a/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java +++ b/qadevOOo/tests/java/mod/_forms/OScrollBarModel.java @@ -53,7 +53,7 @@ public class OScrollBarModel extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java index 19c89c134089..ec51dbfa0f2b 100644 --- a/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java +++ b/qadevOOo/tests/java/mod/_forms/OSpinButtonModel.java @@ -53,7 +53,7 @@ public class OSpinButtonModel extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java index 85dc9370c395..a48259feb66c 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeControl.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java @@ -116,7 +116,7 @@ public class OTimeControl extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -182,7 +182,7 @@ public class OTimeControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -215,7 +215,7 @@ public class OTimeControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -224,7 +224,7 @@ public class OTimeControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_fwk/Desktop.java b/qadevOOo/tests/java/mod/_fwk/Desktop.java index 77fc451206cb..86b1a807f20b 100644 --- a/qadevOOo/tests/java/mod/_fwk/Desktop.java +++ b/qadevOOo/tests/java/mod/_fwk/Desktop.java @@ -119,8 +119,7 @@ public class Desktop extends TestCase { tEnv.addObjRelation("XDispatchProvider.URL", ".uno:Open"); - tEnv.addObjRelation("Desktop",(XDesktop) - UnoRuntime.queryInterface(XDesktop.class,oObj)); + tEnv.addObjRelation("Desktop",UnoRuntime.queryInterface(XDesktop.class,oObj)); return tEnv; } // finish method getTestEnvironment diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java index 6f1807a80aa6..a73b632b0084 100644 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java @@ -82,7 +82,7 @@ public class DispatchRecorder extends TestCase { catch (InterruptedException ex) { } - XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc); + XModel model = UnoRuntime.queryInterface(XModel.class, oDoc); xFrame = model.getCurrentController().getFrame(); XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface @@ -106,7 +106,7 @@ public class DispatchRecorder extends TestCase { } else { oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance( "com.sun.star.comp.framework.DispatchRecorder"); - xDR = (XDispatchRecorder) UnoRuntime.queryInterface + xDR = UnoRuntime.queryInterface (XDispatchRecorder.class, oObj); xDRS.setDispatchRecorder(xDR); } diff --git a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java index af40266507a7..97ebe692a24f 100644 --- a/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java +++ b/qadevOOo/tests/java/mod/_fwk/DocumentProperties.java @@ -98,8 +98,7 @@ public class DocumentProperties extends TestCase { shortWait(); - XDocumentInfoSupplier xdis = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc); + XDocumentInfoSupplier xdis = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc); //oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, docInfo); oObj = xdis.getDocumentInfo(); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_fwk/Frame.java b/qadevOOo/tests/java/mod/_fwk/Frame.java index 40c143a67bf0..a8c9251af74c 100644 --- a/qadevOOo/tests/java/mod/_fwk/Frame.java +++ b/qadevOOo/tests/java/mod/_fwk/Frame.java @@ -102,7 +102,7 @@ public class Frame extends TestCase { */ protected void cleanup( TestParameters Param, PrintWriter log) { try { - XCloseable xTextClose = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, xTextDoc); + XCloseable xTextClose = UnoRuntime.queryInterface(XCloseable.class, xTextDoc); xTextClose.close(true); } catch(Exception e){} diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java index 1233eadcc617..003dad6e389c 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -124,16 +124,14 @@ public class JobExecutor extends TestCase { try { Object obj = ((XMultiServiceFactory)Param.getMSF()).createInstance ("com.sun.star.configuration.ConfigurationProvider"); - XMultiServiceFactory xConfigMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, obj); + XMultiServiceFactory xConfigMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, obj); PropertyValue[] args = new PropertyValue[1]; args[0] = new PropertyValue(); args[0].Name = "nodepath"; args[0].Value = "org.openoffice.Office.Jobs"; oRootCfg = xConfigMSF.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", args); - XHierarchicalNameAccess xHNA = (XHierarchicalNameAccess) - UnoRuntime.queryInterface(XHierarchicalNameAccess.class, oRootCfg); + XHierarchicalNameAccess xHNA = UnoRuntime.queryInterface(XHierarchicalNameAccess.class, oRootCfg); obj = xHNA.getByHierarchicalName("Jobs"); jobs = (XNameAccess) UnoRuntime.queryInterface (XNameAccess.class, obj); @@ -155,8 +153,7 @@ public class JobExecutor extends TestCase { XSingleServiceFactory jobsFac = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, jobs); Object oNewJob = jobsFac.createInstance(); - XNameReplace xNewJobNR = (XNameReplace) - UnoRuntime.queryInterface(XNameReplace.class, oNewJob); + XNameReplace xNewJobNR = UnoRuntime.queryInterface(XNameReplace.class, oNewJob); xNewJobNR.replaceByName("Service", "test.Job"); XNameContainer xJobsNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, jobs); @@ -186,8 +183,7 @@ public class JobExecutor extends TestCase { UnoRuntime.queryInterface(XNameContainer.class, events); xEventsNC.insertByName("TestEvent", oNewEvent); - XChangesBatch xCB = (XChangesBatch) - UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); + XChangesBatch xCB = UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); xCB.commitChanges(); try { @@ -223,7 +219,7 @@ public class JobExecutor extends TestCase { Status.failed("Couldn't create instance")); } - xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, job); + xNamed = UnoRuntime.queryInterface(XNamed.class, job); log.println("Count = " + xNamed.getName()); TestEnvironment tEnv = new TestEnvironment( oObj ); @@ -251,7 +247,7 @@ class Job implements } public Type[] getTypes() { - Class interfaces[] = getClass().getInterfaces(); + Class<?> interfaces[] = getClass().getInterfaces(); Type types[] = new Type[interfaces.length]; for(int i = 0; i < interfaces.length; ++ i) types[i] = new Type(interfaces[i]); diff --git a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java index 1b538ff0972d..b4b49a37b855 100644 --- a/qadevOOo/tests/java/mod/_fwk/LayoutManager.java +++ b/qadevOOo/tests/java/mod/_fwk/LayoutManager.java @@ -50,7 +50,7 @@ public class LayoutManager extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java index 6562048fa69a..5c781f099c86 100644 --- a/qadevOOo/tests/java/mod/_fwk/ModuleManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleManager.java @@ -91,7 +91,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xTextMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xTextMode1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController xTextController = xTextMode1.getCurrentController(); XFrame xTextFrame = xTextController.getFrame(); @@ -106,7 +106,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xWebMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xWebMode1 = UnoRuntime.queryInterface(XModel.class, xWebDoc); XController xWebController = xWebMode1.getCurrentController(); XFrame xWebFrame = xWebController.getFrame(); @@ -120,7 +120,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xGlobalMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xGlobalMode1 = UnoRuntime.queryInterface(XModel.class, xGlobalDoc); XController xGlobalController = xGlobalMode1.getCurrentController(); XFrame xGlobalFrame = xGlobalController.getFrame(); @@ -133,7 +133,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xSheetMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xSheetMode1 = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xSheetController = xSheetMode1.getCurrentController(); @@ -146,7 +146,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xDrawMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xDrawMode1 = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xDrawController = xDrawMode1.getCurrentController(); XFrame xDrawFrame = xDrawController.getFrame(); @@ -159,7 +159,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xImpressMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xImpressMode1 = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xImpressController = xImpressMode1.getCurrentController(); XFrame xImpressFrame = xImpressController.getFrame(); @@ -172,7 +172,7 @@ public class ModuleManager extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't create document ", e); } - XModel xMathMode1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xMathMode1 = UnoRuntime.queryInterface(XModel.class, xMathDoc); XController xMathController = xMathMode1.getCurrentController(); XFrame xMathFrame = xMathController.getFrame(); diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java index 4c896fb3ab6f..c46f356d0429 100644 --- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java @@ -63,7 +63,7 @@ public class ModuleUIConfigurationManager extends TestCase { log.println(" disposing xTextDoc "); if (xTextDoc != null) { try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -91,8 +91,7 @@ public class ModuleUIConfigurationManager extends TestCase { xTextDoc = WriterTools.createTextDoc(xMSF); Object o = (XInterface)xMSF.createInstance("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"); - XModuleUIConfigurationManagerSupplier xMUICMS = (XModuleUIConfigurationManagerSupplier) - UnoRuntime.queryInterface(XModuleUIConfigurationManagerSupplier.class, o); + XModuleUIConfigurationManagerSupplier xMUICMS = UnoRuntime.queryInterface(XModuleUIConfigurationManagerSupplier.class, o); util.dbg.printInterfaces(xMUICMS); oObj = xMUICMS.getUIConfigurationManager("com.sun.star.text.TextDocument"); @@ -113,7 +112,7 @@ public class ModuleUIConfigurationManager extends TestCase { props[0] = aFile; props[1] = new Integer(ElementModes.READWRITE); - xStore = (XStorage)UnoRuntime.queryInterface(XStorage.class, xStorageService.createInstanceWithArguments(props)); + xStore = UnoRuntime.queryInterface(XStorage.class, xStorageService.createInstanceWithArguments(props)); PropertyValue[] initProps = new PropertyValue[4]; PropertyValue propVal = new PropertyValue(); @@ -130,7 +129,7 @@ public class ModuleUIConfigurationManager extends TestCase { initProps[2] = propVal; propVal = new PropertyValue(); propVal.Name = "UserRootCommit"; - propVal.Value = (XTransactedObject)UnoRuntime.queryInterface(XTransactedObject.class, xStore); + propVal.Value = UnoRuntime.queryInterface(XTransactedObject.class, xStore); initProps[3] = propVal; @@ -146,7 +145,7 @@ public class ModuleUIConfigurationManager extends TestCase { "private:resource/menubar/menubar"); tEnv.addObjRelation("XUIConfiguration.XUIConfigurationListenerImpl", new ConfigurationListener(log, - (XUIConfigurationManager)UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XUIConfigurationManager.class, oObj), xMSF)); tEnv.addObjRelation("XModuleUIConfigurationManagerSupplier.ConfigManagerImplementationName", "com.sun.star.comp.framework.ModuleUIConfigurationManager"); @@ -185,9 +184,9 @@ public class ModuleUIConfigurationManager extends TestCase { PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry( "Trigger Event", xMenuBarSettings, xMSF, log); _XUIConfigurationManager.createMenuBarItem("Click for Macro", - (XIndexContainer)UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); + XIndexContainer x = UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); x.insertByIndex(x.getCount(), prop); xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings); xUIManager.reset(); diff --git a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java index 55e80602b2c9..b9bdc2e9f959 100644 --- a/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java +++ b/qadevOOo/tests/java/mod/_fwk/ObjectMenuController.java @@ -46,7 +46,7 @@ public class ObjectMenuController extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java index ce97ac8523e2..322091d923d1 100644 --- a/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java +++ b/qadevOOo/tests/java/mod/_fwk/PopupMenuControllerFactory.java @@ -48,7 +48,7 @@ public class PopupMenuControllerFactory extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -101,8 +101,7 @@ public class PopupMenuControllerFactory extends TestCase { } // register one controller, so it can be instantiated - XUIControllerRegistration xReg = (XUIControllerRegistration) - UnoRuntime.queryInterface(XUIControllerRegistration.class, xInst); + XUIControllerRegistration xReg = UnoRuntime.queryInterface(XUIControllerRegistration.class, xInst); xReg.registerController(".uno:MyCommandUrl", "", "com.sun.star.comp.framework.FooterMenuController"); tEnv.addObjRelation("XUIControllerRegistration.RegisteredController", ".uno:MyCommandUrl"); diff --git a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java index 4e60af16bbe4..4e41c5a345ca 100644 --- a/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java +++ b/qadevOOo/tests/java/mod/_fwk/UIConfigurationManager.java @@ -65,7 +65,7 @@ public class UIConfigurationManager extends TestCase { log.println("Creating instance..."); try { - xManager = (XUIConfigurationManager)UnoRuntime.queryInterface( + xManager = UnoRuntime.queryInterface( XUIConfigurationManager.class, xMSF.createInstance( "com.sun.star.comp.framework.UIConfigurationManager")); } @@ -87,10 +87,10 @@ public class UIConfigurationManager extends TestCase { Object[] props = new Object[2]; props[0] = deleteCfg; props[1] = new Integer(ElementModes.READWRITE); - XStorage xRootStorage = (XStorage)UnoRuntime.queryInterface(XStorage.class, xSSF.createInstanceWithArguments(props)); + XStorage xRootStorage = UnoRuntime.queryInterface(XStorage.class, xSSF.createInstanceWithArguments(props)); xSubStorage = xRootStorage.openStorageElement("Configurations2", ElementModes.READWRITE); - XUIConfigurationStorage xConfigStorage =(XUIConfigurationStorage)UnoRuntime.queryInterface(XUIConfigurationStorage.class, xManager); + XUIConfigurationStorage xConfigStorage =UnoRuntime.queryInterface(XUIConfigurationStorage.class, xManager); xConfigStorage.setStorage(xSubStorage); tEnv.addObjRelation("XUIConfigurationStorage.Storage", xSubStorage); } @@ -141,9 +141,9 @@ public class UIConfigurationManager extends TestCase { PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry( "Trigger Event", xMenuBarSettings, xMSF, log); _XUIConfigurationManager.createMenuBarItem("Click for Macro", - (XIndexContainer)UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIndexContainer.class, prop[3].Value), log); - XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); + XIndexContainer x = UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings); x.insertByIndex(x.getCount(), prop); xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings); xUIManager.reset(); diff --git a/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java b/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java index 5e4f7f814a5e..3d34c9dc58ed 100644 --- a/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java +++ b/qadevOOo/tests/java/mod/_fwk/UIElementFactoryManager.java @@ -46,7 +46,7 @@ public class UIElementFactoryManager extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { diff --git a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java index 1e8bae332788..bedbb6a9e4c3 100644 --- a/qadevOOo/tests/java/mod/_fwl/FilterFactory.java +++ b/qadevOOo/tests/java/mod/_fwl/FilterFactory.java @@ -119,8 +119,8 @@ public class FilterFactory extends TestCase { // XMSF - ArrayList vFTypes = new ArrayList(); - ArrayList vFArgs = new ArrayList(); + ArrayList<String> vFTypes = new ArrayList<String>(); + ArrayList<Object[]> vFArgs = new ArrayList<Object[]>(); for (int i = 0; i < filterNames.length; i++) { PropertyValue[] filterProps = null; try { diff --git a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java index 94284953abd6..4f5ad37b75aa 100644 --- a/qadevOOo/tests/java/mod/_fwl/TypeDetection.java +++ b/qadevOOo/tests/java/mod/_fwl/TypeDetection.java @@ -149,7 +149,7 @@ public class TypeDetection extends TestCase { fileURL = utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF() ); fileURL = fileURL + "bookmarks.oot"; - XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDoc); + XStorable store = UnoRuntime.queryInterface(XStorable.class, xTextDoc); System.out.println(fileURL); store.storeToURL(fileURL, new PropertyValue[0]); diff --git a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java index 84e0863216f9..07a3dab8d988 100644 --- a/qadevOOo/tests/java/mod/_i18n/BreakIterator.java +++ b/qadevOOo/tests/java/mod/_i18n/BreakIterator.java @@ -94,7 +94,7 @@ public class BreakIterator extends TestCase { tEnv.addObjRelation("Locale", new Locale("en", "US", "")); - XTextDocument xDoc = (XTextDocument)UnoRuntime.queryInterface + XTextDocument xDoc = UnoRuntime.queryInterface (XTextDocument.class, xTextDoc); XTextRange xTextRange = (XTextRange)xDoc.getText(); tEnv.addObjRelation("UnicodeString", xTextRange.getString()); diff --git a/qadevOOo/tests/java/mod/_lng/DicList.java b/qadevOOo/tests/java/mod/_lng/DicList.java index 4aebb61d601e..d5b93ce3f5be 100644 --- a/qadevOOo/tests/java/mod/_lng/DicList.java +++ b/qadevOOo/tests/java/mod/_lng/DicList.java @@ -83,7 +83,7 @@ public class DicList extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); //creating a user defined dictionary for XSearchableDictionaryList - XDictionaryList xDicList = (XDictionaryList) UnoRuntime.queryInterface( + XDictionaryList xDicList = UnoRuntime.queryInterface( XDictionaryList.class, oObj); xDicList.removeDictionary(xDicList.getDictionaryByName("MyDictionary")); XDictionary xDic = xDicList.createDictionary("NegativDic",new Locale( diff --git a/qadevOOo/tests/java/mod/_lnn/SpellChecker.java b/qadevOOo/tests/java/mod/_lnn/SpellChecker.java index 017f66a999f2..85fa590e6c0c 100644 --- a/qadevOOo/tests/java/mod/_lnn/SpellChecker.java +++ b/qadevOOo/tests/java/mod/_lnn/SpellChecker.java @@ -90,7 +90,7 @@ public class SpellChecker extends TestCase { log.println("Implementation Name: "+Iname); TestEnvironment tEnv = new TestEnvironment(oObj); - XLinguServiceManager xLinguServiceManager = (XLinguServiceManager) UnoRuntime.queryInterface(XLinguServiceManager.class, LinguServiceManager); + XLinguServiceManager xLinguServiceManager = UnoRuntime.queryInterface(XLinguServiceManager.class, LinguServiceManager); tEnv.addObjRelation("AlternativeChecker",xLinguServiceManager.getSpellChecker()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java index 16fd5d2e65e1..0697b99e2d59 100644 --- a/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java +++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspector.java @@ -104,19 +104,17 @@ public class ObjectInspector extends TestCase { try { XInterface oInspector = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspector"); - XObjectInspector xInspector = (XObjectInspector) UnoRuntime.queryInterface(XObjectInspector.class, oInspector); + XObjectInspector xInspector = UnoRuntime.queryInterface(XObjectInspector.class, oInspector); log.println("ImplementationName '" + utils.getImplName(xInspector) + "'"); XInterface oInspectorModel = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel"); - XObjectInspectorModel xInspectorModel = (XObjectInspectorModel) - UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModel); + XObjectInspectorModel xInspectorModel = UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModel); XInterface oInspectorModelToSet = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel"); - XObjectInspectorModel xInspectorModelToSet = (XObjectInspectorModel) - UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModelToSet); + XObjectInspectorModel xInspectorModelToSet = UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModelToSet); log.println("create a floating frame..."); @@ -126,7 +124,7 @@ public class ObjectInspector extends TestCase { XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF); - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer); + xWindow = UnoRuntime.queryInterface(XWindow.class, xWindowPeer); } catch (StatusException e){ throw new StatusException("Coud not create test object", e); @@ -139,7 +137,7 @@ public class ObjectInspector extends TestCase { xFrame.setName("ObjectInspector"); xFrame.initialize(xWindow); - XFramesSupplier xFramesSup = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, StarDesktop); + XFramesSupplier xFramesSup = UnoRuntime.queryInterface(XFramesSupplier.class, StarDesktop); XFrames xFrames = xFramesSup.getFrames(); xFrames.append(xFrame); @@ -147,7 +145,7 @@ public class ObjectInspector extends TestCase { log.println("attach ObjectInspector to floating frame..."); - XInitialization xOII = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, xInspectorModel); + XInitialization xOII = UnoRuntime.queryInterface(XInitialization.class, xInspectorModel); xOII.initialize(new Object[0]); @@ -194,7 +192,7 @@ public class ObjectInspector extends TestCase { existentInspector = xFrame.findFrame( "ObjectInspector", 255 ); if ( existentInspector != null ){ - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, existentInspector); try{ closer.close(true); diff --git a/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java index 86e580b2c0e2..84718294f536 100644 --- a/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java +++ b/qadevOOo/tests/java/mod/_pcr/ObjectInspectorModel.java @@ -153,7 +153,7 @@ public class ObjectInspectorModel extends TestCase { existentInspector = xFrame.findFrame( "ObjectInspector", 255 ); if ( existentInspector != null ){ - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, existentInspector); try{ closer.close(true); diff --git a/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java b/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java index d70b7cfe1d70..ed464e0630f4 100644 --- a/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java +++ b/qadevOOo/tests/java/mod/_proxyset/SOffice52ProxySettings.java @@ -96,7 +96,7 @@ public class SOffice52ProxySettings extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); // extracting parameters to proxy settings - HashMap proxySettings = new HashMap(12); + HashMap<String, String> proxySettings = new HashMap<String, String>(12); String prefix = "test.proxy.soffice52."; diff --git a/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java b/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java index 006b42697fc3..a72ca716f627 100644 --- a/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java +++ b/qadevOOo/tests/java/mod/_proxyset/SystemProxySettings.java @@ -98,7 +98,7 @@ public class SystemProxySettings extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); // extracting parameters to proxy settings - HashMap proxySettings = new HashMap(12); + HashMap<String, String> proxySettings = new HashMap<String, String>(12); String prefix = "test.proxy.system."; diff --git a/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java index d83c1b1d1b18..443bc69957b2 100644 --- a/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java +++ b/qadevOOo/tests/java/mod/_rdbtdp/RegistryTypeDescriptionProvider.java @@ -88,8 +88,7 @@ public class RegistryTypeDescriptionProvider extends TestCase { Object o = xContext.getValueByName("/singletons/" + "com.sun.star.reflection.theTypeDescriptionManager"); // the manager contains all providers - XEnumerationAccess aProviderAccess = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, o); + XEnumerationAccess aProviderAccess = UnoRuntime.queryInterface(XEnumerationAccess.class, o); // collect enumeration XEnumeration xProviderEnum; if (aProviderAccess.hasElements()) diff --git a/qadevOOo/tests/java/mod/_remotebridge/various.java b/qadevOOo/tests/java/mod/_remotebridge/various.java index 22462c6a026c..04f4a24349d0 100644 --- a/qadevOOo/tests/java/mod/_remotebridge/various.java +++ b/qadevOOo/tests/java/mod/_remotebridge/various.java @@ -202,19 +202,18 @@ public class various extends TestCase { XInterface oAcctr = (XInterface)xMSF.createInstance( "com.sun.star.connection.Acceptor") ; - xAcctr = (XAcceptor)UnoRuntime.queryInterface( + xAcctr = UnoRuntime.queryInterface( XAcceptor.class, oAcctr); // create connector XInterface oCntr = (XInterface)xMSF.createInstance( "com.sun.star.connection.Connector") ; - xCntr = (XConnector)UnoRuntime.queryInterface( + xCntr = UnoRuntime.queryInterface( XConnector.class, oCntr); // create bridge factory XInterface oBrdg = (XInterface)xMSF.createInstance( "com.sun.star.bridge.BridgeFactory") ; - xBrdgFctr = (XBridgeFactory) - UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg); + xBrdgFctr = UnoRuntime.queryInterface(XBridgeFactory.class, oBrdg); // create own implementation of XInstanceProvider XInstanceProvider xInstProv = new MyInstanceProvider(xMSF); @@ -266,20 +265,20 @@ public class various extends TestCase { if (accThread.isAlive()) { accThread.interrupt(); } - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xAcctr); if (xComp != null) xComp.dispose(); - xComp = (XComponent)UnoRuntime.queryInterface( + xComp = UnoRuntime.queryInterface( XComponent.class, xCntr); if (xComp != null) xComp.dispose(); - xComp = (XComponent)UnoRuntime.queryInterface( + xComp = UnoRuntime.queryInterface( XComponent.class, xBrdgFctr); if (xComp != null) xComp.dispose(); - xComp = (XComponent)UnoRuntime.queryInterface( + xComp = UnoRuntime.queryInterface( XComponent.class, bridge); if (xComp != null) { System.out.println("######## Dispose bridge"); diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java index 95cc1f36a5a0..9013668a1efe 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java @@ -64,7 +64,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); util.utils.shortWait(Param.getInt("ShortWait")); @@ -76,7 +76,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -98,13 +98,13 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, ok_button); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); - XAccessibleEditableText eText = (XAccessibleEditableText) UnoRuntime.queryInterface( + XAccessibleEditableText eText = UnoRuntime.queryInterface( XAccessibleEditableText.class, oObj); @@ -152,7 +152,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { try { SOfficeFactory SOF = SOfficeFactory.getFactory(msf); - xCalcDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, + xCalcDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc( null)); } catch (com.sun.star.uno.Exception e) { @@ -174,7 +174,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { } public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xCalcDoc); XController xController = aModel.getCurrentController(); @@ -182,10 +182,10 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { //Opening HeaderFooterDialog try { String aSlotID = ".uno:EditHeaderAndFooter"; - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, msf.createInstance( "com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java index 42f7b5b5cb99..ac90e5bd70ba 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java @@ -74,7 +74,7 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -92,8 +92,7 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -115,18 +114,15 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java index 7d8b914cffff..743e8388cee6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCell.java @@ -102,8 +102,7 @@ public class ScAccessibleCell extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -120,8 +119,7 @@ public class ScAccessibleCell extends TestCase { final String text = "XAccessibleText"; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -131,11 +129,9 @@ public class ScAccessibleCell extends TestCase { } xCell = oSheet.getCellByPosition(1, 0) ; xCell.setFormula(text); - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, oSheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oColumns); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); XPropertySet column = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class,oIndexAccess.getByIndex(1)); column.setPropertyValue("OptimalWidth", new Boolean(true)); @@ -184,8 +180,7 @@ public class ScAccessibleCell extends TestCase { */ protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java index 72312dc9167f..4c3e6bf97e66 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java @@ -72,11 +72,9 @@ public class ScAccessibleCsvCell extends TestCase { } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -84,15 +82,14 @@ public class ScAccessibleCsvCell extends TestCase { oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj); + accAction = UnoRuntime.queryInterface(XAccessibleAction.class, oObj); oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.TABLE, true); //util.dbg.printInterfaces(oObj); - XAccessibleContext cont = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); String name = ""; try { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java index 5b05d2857276..68bfad242f14 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java @@ -72,19 +72,17 @@ public class ScAccessibleCsvGrid extends TestCase { } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); oObj = AccessibilityTools.getAccessibleObjectForRole (xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface(XAccessibleAction.class, oObj); + accAction = UnoRuntime.queryInterface(XAccessibleAction.class, oObj); /*int count = accAction.getAccessibleActionCount(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java index aafb0ecdc0f9..76650681f007 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java @@ -74,10 +74,10 @@ public class ScAccessibleCsvRuler extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -85,7 +85,7 @@ public class ScAccessibleCsvRuler extends TestCase { oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - accAction = (XAccessibleAction) UnoRuntime.queryInterface( + accAction = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); XAccessibleContext acc = AccessibilityTools.getAccessibleObjectForRole(xRoot, @@ -93,7 +93,7 @@ public class ScAccessibleCsvRuler extends TestCase { log.println("Click on: " + acc.getAccessibleName()); - XAccessibleAction accAction2 = (XAccessibleAction) UnoRuntime.queryInterface( + XAccessibleAction accAction2 = UnoRuntime.queryInterface( XAccessibleAction.class, acc); try { @@ -114,7 +114,7 @@ public class ScAccessibleCsvRuler extends TestCase { tEnv.addObjRelation("EditOnly", "This method isn't supported in this dialog"); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); int lastone = 100; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java index e16ed229db11..9b29d9e4bc08 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java @@ -83,8 +83,7 @@ public class ScAccessibleDocument extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java index 2dc64ba5da0e..645a05a3fa96 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java @@ -92,8 +92,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,18 +127,15 @@ public class ScAccessibleDocumentPagePreview extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -171,7 +167,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XDesktop desk = (XDesktop) UnoRuntime.queryInterface( + XDesktop desk = UnoRuntime.queryInterface( XDesktop.class,util.DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF())); final XWindow win = desk.getCurrentFrame().getComponentWindow(); @@ -197,8 +193,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { */ protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -220,7 +215,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { log.println("creating a spreadsheetdocument"); String url = utils.getFullTestURL("calcshapes.sxc"); log.println("loading document "+url); - xSpreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( + xSpreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,SOF.loadDocument(url)); try { Thread.sleep(500); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java index ee521f78ff5b..548b7b94e72e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeader.java @@ -96,8 +96,7 @@ public class ScAccessiblePageHeader extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -115,18 +114,15 @@ public class ScAccessiblePageHeader extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -158,10 +154,9 @@ public class ScAccessiblePageHeader extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); XStyle StdStyle = null; @@ -240,8 +235,7 @@ public class ScAccessiblePageHeader extends TestCase { protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); try { - XCloseable oComp = (XCloseable) - UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; + XCloseable oComp = UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; oComp.close(true); } catch(com.sun.star.util.CloseVetoException e) { log.println("Couldn't close document: "+e.getMessage()); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java index 02a57d6bbabd..a334b7c1f30e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -93,8 +93,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { XCell xCell = null; try { XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); xCell = oSheet.getCellByPosition(0, 0) ; @@ -110,18 +109,15 @@ public class ScAccessiblePageHeaderArea extends TestCase { e.printStackTrace(log); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xController = aModel.getCurrentController(); // switching to 'Page Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -148,8 +144,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { try { oObj = at.getAccessibleObjectForRole (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0); - XAccessibleContext cont = (XAccessibleContext) - UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + XAccessibleContext cont = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); XAccessibleStateSet StateSet = cont.getAccessibleStateSet(); if (StateSet.contains((short)27)) { log.println("Object is transient"); @@ -166,8 +161,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { XAccessibleContext zoomIn = at.getAccessibleObjectForRole(xRoot,AccessibleRole.PUSH_BUTTON, "Zoom In"); - final XAccessibleAction pressZoom = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); + final XAccessibleAction pressZoom = UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { @@ -191,8 +185,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { protected void cleanup( TestParameters Param, PrintWriter log) { log.println( " disposing xSheetDoc " ); try { - XCloseable oComp = (XCloseable) - UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; + XCloseable oComp = UnoRuntime.queryInterface (XCloseable.class, xSpreadsheetDoc) ; oComp.close(true); }catch(com.sun.star.util.CloseVetoException e) { log.println("Couldn't close document: "+e.getMessage()); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java index f96dec4c849d..93565d80ec77 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewCell.java @@ -98,7 +98,7 @@ public class ScAccessiblePreviewCell extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,8 +116,7 @@ public class ScAccessiblePreviewCell extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -139,18 +138,15 @@ public class ScAccessiblePreviewCell extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java index 39e755afa0ec..34f86a372354 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewHeaderCell.java @@ -96,7 +96,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { if (xSheetDoc != null) { try { - XCloseable oComp = (XCloseable) UnoRuntime.queryInterface( + XCloseable oComp = UnoRuntime.queryInterface( XCloseable.class, xSheetDoc); oComp.close(true); xSheetDoc = null; @@ -121,7 +121,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { XInterface oObj = null; if (xSheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -137,7 +137,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); @@ -149,7 +149,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { log.println("Getting spreadsheet"); XSpreadsheets oSheets = xSheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), @@ -174,7 +174,7 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { xCell.setFormula("Value"); //setting property 'PrintHeaders' of the style 'Default' - XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier) UnoRuntime.queryInterface( + XStyleFamiliesSupplier xSFS = UnoRuntime.queryInterface( XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess xNA = xSFS.getStyleFamilies(); @@ -218,10 +218,10 @@ public class ScAccessiblePreviewHeaderCell extends TestCase { //switching to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, ( (XMultiServiceFactory) Param.getMSF()) .createInstance("com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java index 899a8950c394..9560d4628ea2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java @@ -101,7 +101,7 @@ public class ScAccessiblePreviewTable extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -119,8 +119,7 @@ public class ScAccessiblePreviewTable extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -142,18 +141,15 @@ public class ScAccessiblePreviewTable extends TestCase { xCell.setFormula("Value"); - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xModel.getCurrentController(); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); aParseURL[0].Complete = ".uno:PrintPreview"; @@ -189,8 +185,7 @@ public class ScAccessiblePreviewTable extends TestCase { log.println("Getting "+ zoomIn.getAccessibleName()); - final XAccessibleAction pressZoom = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); + final XAccessibleAction pressZoom = UnoRuntime.queryInterface(XAccessibleAction.class, zoomIn); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java index 748116e91526..9e1d545cf579 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet.java @@ -89,7 +89,7 @@ public class ScAccessibleSpreadsheet extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent)UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -105,8 +105,7 @@ public class ScAccessibleSpreadsheet extends TestCase { XInterface oObj = null; - XModel xModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); AccessibilityTools at = new AccessibilityTools(); @@ -126,8 +125,7 @@ public class ScAccessibleSpreadsheet extends TestCase { final String text = "Text for testing of the interface XAccessibleText"; try { XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); xCell = oSheet.getCellByPosition(5, 5) ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java index 7642e33e4958..2cc6362caf6b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationObj.java @@ -87,7 +87,7 @@ public class ScAnnotationObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,12 +122,10 @@ public class ScAnnotationObj extends TestCase { log.println("Getting test object ") ; - XSpreadsheetDocument xArea = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); - XIndexAccess XAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell oCell = null; try { XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -149,8 +147,7 @@ public class ScAnnotationObj extends TestCase { "Error getting test object from spreadsheet document",e); } - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); oObj = oAnno; diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java index e3b57c735c52..c3f8ba5e1ba7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj.java @@ -84,7 +84,7 @@ public class ScAnnotationShapeObj extends TestCase { log.println("Loading: "+utils.getFullTestURL( "ScAnnotationShapeObj.sxc")); xSheetDoc = - (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, + UnoRuntime.queryInterface(XSpreadsheetDocument.class, SOF.loadDocument(utils.getFullTestURL( "ScAnnotationShapeObj.sxc"))); } catch (com.sun.star.uno.Exception e) { @@ -101,8 +101,8 @@ public class ScAnnotationShapeObj extends TestCase { log.println(" disposing xSheetDoc "); XComponent oComp = - (XComponent) UnoRuntime.queryInterface(XComponent.class, - xSheetDoc); + UnoRuntime.queryInterface(XComponent.class, + xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -133,13 +133,13 @@ public class ScAnnotationShapeObj extends TestCase { log.println("Getting test object "); XSpreadsheetDocument xArea = - (XSpreadsheetDocument) UnoRuntime.queryInterface(XSpreadsheetDocument.class, - xSheetDoc); + UnoRuntime.queryInterface(XSpreadsheetDocument.class, + xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); XIndexAccess XAccess = - (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, - oSheets); + UnoRuntime.queryInterface(XIndexAccess.class, + oSheets); XCell oCell = null; try { @@ -167,18 +167,18 @@ public class ScAnnotationShapeObj extends TestCase { } XSheetAnnotationAnchor oAnnoA = - (XSheetAnnotationAnchor) UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, - oCell); + UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, + oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); XSimpleText xAnnoText = - (XSimpleText) UnoRuntime.queryInterface(XSimpleText.class, - oAnno); + UnoRuntime.queryInterface(XSimpleText.class, + oAnno); xAnnoText.setString("ScAnnotationShapeObj"); XSheetAnnotationShapeSupplier xSheetAnnotationShapeSupplier = - (XSheetAnnotationShapeSupplier) UnoRuntime.queryInterface(XSheetAnnotationShapeSupplier.class, - oAnno); + UnoRuntime.queryInterface(XSheetAnnotationShapeSupplier.class, + oAnno); oObj = xSheetAnnotationShapeSupplier.getAnnotationShape(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java index c4b44c982298..bbb2f12bc65b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor.java @@ -78,7 +78,7 @@ public class ScAnnotationTextCursor extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -102,13 +102,11 @@ public class ScAnnotationTextCursor extends TestCase { try { log.println("Getting test object ") ; - XSpreadsheetDocument xArea = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xArea = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets(); - XIndexAccess XAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess XAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet); @@ -117,12 +115,10 @@ public class ScAnnotationTextCursor extends TestCase { XCell oCell = oCRange.getCellByPosition(cellPos.Column, cellPos.Row); - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); - XSimpleText aText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class,oAnno); + XSimpleText aText = UnoRuntime.queryInterface(XSimpleText.class,oAnno); aText.setString("A nice little Test"); oObj = aText.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java index 3ad9076be7f7..c341d016c67e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAnnotationsObj.java @@ -88,8 +88,7 @@ public class ScAnnotationsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -110,8 +109,7 @@ public class ScAnnotationsObj extends TestCase { log.println("Getting test object ") ; - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets(); XNameAccess oNames = (XNameAccess) @@ -144,16 +142,13 @@ public class ScAnnotationsObj extends TestCase { "Error getting test object from spreadsheet document",e) ; } - XSheetAnnotationAnchor oAnnoA = (XSheetAnnotationAnchor) - UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); + XSheetAnnotationAnchor oAnnoA = UnoRuntime.queryInterface(XSheetAnnotationAnchor.class, oCell); XSheetAnnotation oAnno = oAnnoA.getAnnotation(); - XSimpleText sText = ((XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oAnno)); + XSimpleText sText = UnoRuntime.queryInterface(XSimpleText.class, oAnno); sText.setString("ScAnnotationsObj"); - XSheetAnnotationsSupplier supp = (XSheetAnnotationsSupplier) - UnoRuntime.queryInterface( - XSheetAnnotationsSupplier.class, oSheet); + XSheetAnnotationsSupplier supp = UnoRuntime.queryInterface( + XSheetAnnotationsSupplier.class, oSheet); oObj = supp.getAnnotations(); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java index 4e47887791c2..002ca496ccac 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java @@ -87,7 +87,7 @@ public class ScAreaLinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java index 0a73858c7828..45bae04e30f0 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAreaLinksObj.java @@ -83,7 +83,7 @@ public class ScAreaLinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java index 5f1e85a1924b..1e7ccb439711 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj.java @@ -74,11 +74,11 @@ public class ScAutoFormatFieldObj extends TestCase { // creation of testobject here XInterface formats = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance ("com.sun.star.sheet.TableAutoFormats"); - XIndexAccess formatsIndex = (XIndexAccess)UnoRuntime.queryInterface + XIndexAccess formatsIndex = UnoRuntime.queryInterface (XIndexAccess.class, formats); XInterface format = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatsIndex.getByIndex(0)); - XIndexAccess formatIndex = (XIndexAccess) UnoRuntime.queryInterface + XIndexAccess formatIndex = UnoRuntime.queryInterface (XIndexAccess.class, format); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatIndex.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java index 1e31eb197345..411334cf5e2f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatObj.java @@ -78,14 +78,12 @@ public class ScAutoFormatObj extends TestCase { try { XInterface formats = (XInterface)oMSF.createInstance ("com.sun.star.sheet.TableAutoFormats"); - XIndexAccess formatsIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, formats); + XIndexAccess formatsIndex = UnoRuntime.queryInterface(XIndexAccess.class, formats); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),formatsIndex.getByIndex (formatsIndex.getCount() - 1)); - XNamed objNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, oObj) ; + XNamed objNamed = UnoRuntime.queryInterface(XNamed.class, oObj) ; log.println("AutoFormat name is '" + objNamed.getName() + "'") ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java index 3b9b634be40b..58c0510b30e8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj.java @@ -83,7 +83,7 @@ public class ScAutoFormatsObj extends TestCase{ */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -111,7 +111,7 @@ public class ScAutoFormatsObj extends TestCase{ try { // creation of testobject here // get AutoFormats - XComponent xComp = (XComponent)UnoRuntime.queryInterface + XComponent xComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),((XMultiServiceFactory)Param.getMSF()).createInstance diff --git a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java index 270018c1afda..a9a732ac16dd 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellCursorObj.java @@ -123,7 +123,7 @@ public class ScCellCursorObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); @@ -156,9 +156,9 @@ public class ScCellCursorObj extends TestCase { // first we write what we are intend to do to log file log.println("Creating a test environment"); - XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface( + XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, - xSheetDoc)).getSheets(); + xSheetDoc).getSheets(); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -168,7 +168,7 @@ public class ScCellCursorObj extends TestCase { testRange = oSheet.getCellRangeByName("$A$1:$D$4"); - XSheetCellRange testSheetRange = (XSheetCellRange) UnoRuntime.queryInterface( + XSheetCellRange testSheetRange = UnoRuntime.queryInterface( XSheetCellRange.class, testRange); oObj = oSheet.createCursorByRange(testSheetRange); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java index edfb5437bf61..2d9cfaf9508a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java @@ -88,8 +88,7 @@ public class ScCellFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -123,8 +122,7 @@ public class ScCellFieldObj extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); // Now create the instance of com.sun.star.text.TextField. // This object has type ScCellFieldObj. @@ -134,26 +132,23 @@ public class ScCellFieldObj extends TestCase { aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); - XTextContent oTextContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + XTextContent oTextContent = UnoRuntime.queryInterface(XTextContent.class, oObj); oText.insertTextContent( oText.createTextCursor(), oTextContent, true); oCell = oSheet.getCellByPosition(1,4); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); } catch (com.sun.star.lang.WrappedTargetException e) { log.println("Exception occurred while creating test Object."); e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java index 389e327c39ca..e02dbc6d9dd3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFieldsObj.java @@ -83,8 +83,7 @@ public class ScCellFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -107,28 +106,24 @@ public class ScCellFieldsObj extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); oText.insertTextContent( oText.createTextCursor(), oContent, true); - XTextFieldsSupplier xTextFieldsSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); + XTextFieldsSupplier xTextFieldsSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); oObj = xTextFieldsSupp.getTextFields(); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java index 493a4d884ded..8aa19354cff7 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsEnumeration.java @@ -75,8 +75,7 @@ public class ScCellFormatsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -108,8 +107,7 @@ public class ScCellFormatsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -127,13 +125,11 @@ public class ScCellFormatsEnumeration extends TestCase { log.println("getting CellFormats"); - XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier) - UnoRuntime.queryInterface(XCellFormatRangesSupplier.class,oSheet); + XCellFormatRangesSupplier xCFRS = UnoRuntime.queryInterface(XCellFormatRangesSupplier.class,oSheet); XIndexAccess formats = xCFRS.getCellFormatRanges(); log.println("getting Enumeration"); - XEnumerationAccess oEnum = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,formats); + XEnumerationAccess oEnum = UnoRuntime.queryInterface(XEnumerationAccess.class,formats); oObj = oEnum.createEnumeration(); log.println("creating a new environment for object"); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java index 0e68d501fb80..c6ffccbd1160 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellFormatsObj.java @@ -77,8 +77,7 @@ public class ScCellFormatsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -100,8 +99,7 @@ public class ScCellFormatsObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -117,8 +115,7 @@ public class ScCellFormatsObj extends TestCase { } log.println("getting CellFormats"); - XCellFormatRangesSupplier xCFRS = (XCellFormatRangesSupplier) - UnoRuntime.queryInterface(XCellFormatRangesSupplier.class, oSheet); + XCellFormatRangesSupplier xCFRS = UnoRuntime.queryInterface(XCellFormatRangesSupplier.class, oSheet); XIndexAccess formats = xCFRS.getCellFormatRanges(); oObj = formats; diff --git a/qadevOOo/tests/java/mod/_sc/ScCellObj.java b/qadevOOo/tests/java/mod/_sc/ScCellObj.java index a210e0b63615..51e85aa9006e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellObj.java @@ -104,8 +104,7 @@ public class ScCellObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -134,14 +133,13 @@ public class ScCellObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); log.println("Getting a cell from sheet") ; oObj = oSheet.getCellByPosition(2, 3) ; - cell = (XCell)UnoRuntime.queryInterface(XCell.class, oObj); + cell = UnoRuntime.queryInterface(XCell.class, oObj); } catch (com.sun.star.lang.WrappedTargetException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java index 1a84654b24e3..c16d4fff4761 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangeObj.java @@ -110,7 +110,7 @@ public class ScCellRangeObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -139,9 +139,9 @@ public class ScCellRangeObj extends TestCase { // first we write what we are intend to do to log file log.println("Creating a test environment"); - XSpreadsheets oSpreadsheets = ((XSpreadsheetDocument) UnoRuntime.queryInterface( + XSpreadsheets oSpreadsheets = UnoRuntime.queryInterface( XSpreadsheetDocument.class, - xSheetDoc)).getSheets(); + xSheetDoc).getSheets(); XNameAccess oNames = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, oSpreadsheets); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java index 703592c5fcc7..e50a26489464 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellRangesObj.java @@ -109,7 +109,7 @@ public class ScCellRangesObj extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); XComponent oComp = - (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -145,15 +145,13 @@ public class ScCellRangesObj extends TestCase { log.println("Getting test object "); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges"); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndSheets = (XIndexAccess) - UnoRuntime.queryInterface (XIndexAccess.class, oSheets); + XIndexAccess oIndSheets = UnoRuntime.queryInterface (XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java index 10377ca55393..1708d297bced 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellSearchObj.java @@ -84,8 +84,7 @@ public class ScCellSearchObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -111,8 +110,7 @@ public class ScCellSearchObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,8 +126,7 @@ public class ScCellSearchObj extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSearchable xSearch = (XSearchable) - UnoRuntime.queryInterface(XSearchable.class,oSheet); + XSearchable xSearch = UnoRuntime.queryInterface(XSearchable.class,oSheet); oObj = xSearch.createSearchDescriptor(); // create testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java index 06e560026ed6..3632ce344116 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellTextCursor.java @@ -113,8 +113,7 @@ public class ScCellTextCursor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -147,8 +146,7 @@ public class ScCellTextCursor extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -169,7 +167,7 @@ public class ScCellTextCursor extends TestCase { "Error getting cell object from spreadsheet document",e) ; } - XText aText = (XText) UnoRuntime.queryInterface(XText.class, aCell); + XText aText = UnoRuntime.queryInterface(XText.class, aCell); aText.setString("ScCellTextCursor"); oObj = aText.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java index 8c9664746085..7547e35cb464 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsEnumeration.java @@ -77,8 +77,7 @@ public class ScCellsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,24 +108,21 @@ public class ScCellsEnumeration extends TestCase { // creation of testobject here XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); - XTextRange oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_1); + XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("Test string 1"); XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1); oCell_2.setValue(15); XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); - oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_3); + oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("test 2"); cellArr[0] = oCell_1; cellArr[1] = oCell_2; @@ -145,8 +141,7 @@ public class ScCellsEnumeration extends TestCase { throw new StatusException("Couldn't create test object", e); } - XCellRangesQuery oCellRangesQuery = (XCellRangesQuery) - UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); + XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); oEnum = (XEnumerationAccess) oSheetCellRanges.getCells(); oObj = oSheetCellRanges.getCells().createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java index 084e70d24072..33efd3dd4916 100644 --- a/qadevOOo/tests/java/mod/_sc/ScCellsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScCellsObj.java @@ -81,8 +81,7 @@ public class ScCellsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -103,16 +102,14 @@ public class ScCellsObj extends TestCase { // creation of testobject here XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCellRange oSheet = null; try { oSheet = (XCellRange) AnyConverter.toObject( new Type(XCellRange.class),oIndexAccess.getByIndex(0)); XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0); - XTextRange oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_1); + XTextRange oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_1); oTextRange.setString("ScCellsObj test 1"); @@ -120,8 +117,7 @@ public class ScCellsObj extends TestCase { oCell_2.setValue(15); XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9); - oTextRange = (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCell_3); + oTextRange = UnoRuntime.queryInterface(XTextRange.class, oCell_3); oTextRange.setString("ScCellsObj test 2"); @@ -142,8 +138,7 @@ public class ScCellsObj extends TestCase { throw new StatusException("Couldn't create test object", e); } - XCellRangesQuery oCellRangesQuery = (XCellRangesQuery) - UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); + XCellRangesQuery oCellRangesQuery = UnoRuntime.queryInterface(XCellRangesQuery.class, oSheet); XSheetCellRanges oSheetCellRanges = oCellRangesQuery.queryVisibleCells(); oObj = oSheetCellRanges.getCells(); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java b/qadevOOo/tests/java/mod/_sc/ScChartObj.java index 8473bd436bf5..a68749b44f9e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartObj.java @@ -87,8 +87,7 @@ public class ScChartObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -114,8 +113,7 @@ public class ScChartObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -202,14 +200,12 @@ public class ScChartObj extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); diff --git a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java index 2ea878bed22c..baf429e8ef3f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScChartsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScChartsObj.java @@ -88,8 +88,7 @@ public class ScChartsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -122,8 +121,7 @@ public class ScChartsObj extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -209,14 +207,12 @@ public class ScChartsObj extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); diff --git a/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java index f31608b2da01..c505bd95ec51 100644 --- a/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java +++ b/qadevOOo/tests/java/mod/_sc/ScConsolidationDescriptor.java @@ -69,8 +69,7 @@ public class ScConsolidationDescriptor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -92,8 +91,7 @@ public class ScConsolidationDescriptor extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); - XConsolidatable xConsolidate = (XConsolidatable) - UnoRuntime.queryInterface(XConsolidatable.class, xSheetDoc); + XConsolidatable xConsolidate = UnoRuntime.queryInterface(XConsolidatable.class, xSheetDoc); oObj = xConsolidate.createConsolidationDescriptor(true); // create testobject here diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java index c79ae7f6902d..5c7767ece6d3 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinkObj.java @@ -85,8 +85,7 @@ public class ScDDELinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); if (oDoc != null) { util.DesktopTools.closeDoc(oDoc); @@ -155,8 +154,7 @@ public class ScDDELinkObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java index 1be07a968bd1..f2490f3f2bd8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDDELinksObj.java @@ -83,7 +83,7 @@ public class ScDDELinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); util.DesktopTools.closeDoc(oDoc); @@ -134,8 +134,7 @@ public class ScDDELinksObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index 8d89b7e6eba6..df2b4a5cc841 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -87,7 +87,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -122,7 +122,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -215,7 +215,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -278,11 +278,11 @@ public class ScDataPilotFieldGroupItemObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -307,14 +307,14 @@ public class ScDataPilotFieldGroupItemObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -335,13 +335,13 @@ public class ScDataPilotFieldGroupItemObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); } } groups = dpgi.Groups; - XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups); + XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); } diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java index d104ef2b6fc2..7f650e391669 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupObj.java @@ -86,7 +86,7 @@ public class ScDataPilotFieldGroupObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -121,7 +121,7 @@ public class ScDataPilotFieldGroupObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -214,7 +214,7 @@ public class ScDataPilotFieldGroupObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -277,11 +277,11 @@ public class ScDataPilotFieldGroupObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -306,14 +306,14 @@ public class ScDataPilotFieldGroupObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -334,13 +334,13 @@ public class ScDataPilotFieldGroupObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); } } groups = dpgi.Groups; - XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups); + XIndexAccess groupAccess = UnoRuntime.queryInterface(XIndexAccess.class, groups); oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupAccess.getByIndex(0)); } catch (Exception e) diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java index d7d4d255d7a5..7805d7d9ed70 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupsObj.java @@ -86,7 +86,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase { log.println (" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface ( + XComponent oComp = UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } @@ -121,7 +121,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -214,7 +214,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase // create the test objects log.println ("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); @@ -277,11 +277,11 @@ public class ScDataPilotFieldGroupsObj extends TestCase } DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + XIndexAccess xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); //getSRange(IA); System.out.println ("COUNT: "+IA.getCount ()); @@ -306,14 +306,14 @@ public class ScDataPilotFieldGroupsObj extends TestCase try { - XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); + XDataPilotFieldGrouping dpfg = UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); String[] elements = new String[]{"aName","otherName"}; dpfg.createNameGroup (elements); DataPilotFieldGroupInfo dpgi=null; - xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); + xIA = UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); try { - XDataPilotDescriptor xDPT = (XDataPilotDescriptor) UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); + XDataPilotDescriptor xDPT = UnoRuntime.queryInterface (XDataPilotDescriptor.class,xIA.getByIndex (0)); IA = xDPT.getRowFields (); } catch (com.sun.star.lang.WrappedTargetException e) @@ -334,7 +334,7 @@ public class ScDataPilotFieldGroupsObj extends TestCase if (((Boolean)xPropertySet.getPropertyValue ("IsGroupField")).booleanValue ()) { xPropertySet = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, datapilotfield); - XNamed xNamed = (XNamed) UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); + XNamed xNamed = UnoRuntime.queryInterface (XNamed.class, IA.getByIndex (i)); System.out.println ("name: "+xNamed.getName ()); dpgi = (DataPilotFieldGroupInfo) xPropertySet.getPropertyValue ("GroupInfo"); } diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java index d1bef71fe6f7..0e07ddfb1e4f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldObj.java @@ -95,7 +95,7 @@ public class ScDataPilotFieldObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -143,7 +143,7 @@ public class ScDataPilotFieldObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -212,7 +212,7 @@ public class ScDataPilotFieldObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -311,7 +311,7 @@ public class ScDataPilotFieldObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java index 8af51bbadcfe..dd91506fc6fe 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldsObj.java @@ -81,8 +81,7 @@ public class ScDataPilotFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -115,8 +114,7 @@ public class ScDataPilotFieldsObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -147,8 +145,7 @@ public class ScDataPilotFieldsObj extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java index fde5b26c1400..eec1c97364ff 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj.java @@ -96,7 +96,7 @@ public class ScDataPilotItemObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -144,7 +144,7 @@ public class ScDataPilotItemObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -213,7 +213,7 @@ public class ScDataPilotItemObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -281,7 +281,7 @@ public class ScDataPilotItemObj extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); XIndexAccess xIA = xDataPilotField.getItems(); @@ -329,7 +329,7 @@ public class ScDataPilotItemObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java index 5cf917621745..60f40eefa7b8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotItemsObj.java @@ -96,7 +96,7 @@ public class ScDataPilotItemsObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -144,7 +144,7 @@ public class ScDataPilotItemsObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -213,7 +213,7 @@ public class ScDataPilotItemsObj extends TestCase { // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -281,7 +281,7 @@ public class ScDataPilotItemsObj extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); oObj = xDataPilotField.getItems(); @@ -317,7 +317,7 @@ public class ScDataPilotItemsObj extends TestCase { return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java index d0eb5774275e..e5301fe94080 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java @@ -87,8 +87,7 @@ public class ScDataPilotTableObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -137,8 +136,7 @@ public class ScDataPilotTableObj extends TestCase { log.println( "Creating a test environment" ); log.println("getting sheets"); XSpreadsheets xSpreadsheets = xSheetDoc.getSheets(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet oSheet = null; Object oChangeCell = null; Object oCheckCell = null; @@ -196,8 +194,7 @@ public class ScDataPilotTableObj extends TestCase { filterFields[1].NumericValue = 12; filterFields[1].Operator = com.sun.star.sheet.FilterOperator.LESS_EQUAL; - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object"); XDataPilotTables DPT = DPTS.getDataPilotTables(); XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor(); @@ -283,8 +280,7 @@ public class ScDataPilotTableObj extends TestCase { */ private void createTable2(XSpreadsheet oSheet, CellRangeAddress srcRange, TestEnvironment tEnv) { - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Creating test table object"); XDataPilotTables DPT = DPTS.getDataPilotTables(); XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java index 597c96dcf3a4..a4afcd727729 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java @@ -84,8 +84,7 @@ public class ScDataPilotTablesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,8 +121,7 @@ public class ScDataPilotTablesObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -155,8 +153,7 @@ public class ScDataPilotTablesObj extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java index f852b4d4347f..80a614fb7e4e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj.java @@ -95,7 +95,7 @@ public class ScDatabaseRangeObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -140,7 +140,7 @@ public class ScDatabaseRangeObj extends TestCase { try { Object sheet = sheets.getByName(names[0]); - xImp = (XImportable) UnoRuntime.queryInterface(XImportable.class, + xImp = UnoRuntime.queryInterface(XImportable.class, sheet); dbRanges = (XDatabaseRanges) AnyConverter.toObject( new Type(XDatabaseRanges.class), @@ -180,14 +180,14 @@ public class ScDatabaseRangeObj extends TestCase { // we need to add it dbRanges.addNewByName(dbName,new CellRangeAddress((short)0, 0, 0, 0, 5)); - xNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class, + xNamed = UnoRuntime.queryInterface(XNamed.class, dbrNA.getByName( dbName)); - XCellRangeReferrer aReferrer = (XCellRangeReferrer) UnoRuntime.queryInterface( + XCellRangeReferrer aReferrer = UnoRuntime.queryInterface( XCellRangeReferrer.class, dbrNA.getByName(dbName)); - XCellRangeAddressable aRangeA = (XCellRangeAddressable) UnoRuntime.queryInterface( + XCellRangeAddressable aRangeA = UnoRuntime.queryInterface( XCellRangeAddressable.class, aReferrer.getReferredCells()); aRange = aRangeA.getRangeAddress(); diff --git a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java index 792ce420ac40..915579e496f4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDatabaseRangesObj.java @@ -79,8 +79,7 @@ public class ScDatabaseRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java index 9b735d2da460..e444bf25b771 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java +++ b/qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration.java @@ -61,7 +61,7 @@ public class ScDocumentConfiguration extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory docMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xSheetDoc); Object oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java index 5036a207fed0..ea4bf9c9b0ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java @@ -67,8 +67,7 @@ public class ScDrawPageObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xDoc); util.DesktopTools.closeDoc(xComp); } @@ -97,16 +96,14 @@ public class ScDrawPageObj extends TestCase { XShape oShape = null ; XDrawPages oDP = null; - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xDoc); // creation of testobject here // first we write what we are intend to do to log file log.println( "creating a test environment" ); try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDoc); oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java index cd8ad64a4da0..f2ae638a3fb8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDrawPagesObj.java @@ -83,8 +83,7 @@ public class ScDrawPagesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,8 +108,7 @@ public class ScDrawPagesObj extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xSheetDoc); oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java index 22757d77d626..8b8daaab782b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScFilterDescriptorBase.java @@ -81,8 +81,7 @@ public class ScFilterDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -106,8 +105,7 @@ public class ScFilterDescriptorBase extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -134,8 +132,7 @@ public class ScFilterDescriptorBase extends TestCase { "Exception occurred while filling cells", e); } - SF = (XSheetFilterable) - UnoRuntime.queryInterface(XSheetFilterable.class, oSheet); + SF = UnoRuntime.queryInterface(XSheetFilterable.class, oSheet); oObj = SF.createFilterDescriptor(true); diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java index 5a4890544efe..85cfc2bad05e 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionDescriptionObj.java @@ -53,7 +53,7 @@ public class ScFunctionDescriptionObj extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java index 0dd27aaf7759..6aa95553f323 100644 --- a/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScFunctionListObj.java @@ -77,8 +77,7 @@ public class ScFunctionListObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java index 38f8fbf3f356..af8b1d08cbca 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj.java @@ -90,8 +90,7 @@ public class ScHeaderFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -130,10 +129,9 @@ public class ScHeaderFieldObj extends TestCase { XTextContent oContent = null; XInterface aField = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ @@ -177,18 +175,16 @@ public class ScHeaderFieldObj extends TestCase { XText left = RPHC.getLeftText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, - xSpreadsheetDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + xSpreadsheetDoc ); XTextContent the_Field = null; try { oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextField.Time" ); - the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); aField = (XInterface) oDocMSF.createInstance("com.sun.star.text.TextField.Date"); @@ -197,8 +193,7 @@ public class ScHeaderFieldObj extends TestCase { throw new StatusException("Couldn't create instance", e); } - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XTextCursor the_Cursor = left.createTextCursor(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java index b881e1d8eb93..b87925cdfabb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj.java @@ -86,8 +86,7 @@ public class ScHeaderFieldsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,9 +115,8 @@ public class ScHeaderFieldsObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ @@ -162,18 +160,16 @@ public class ScHeaderFieldsObj extends TestCase { XText left = RPHC.getLeftText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, - xSpreadsheetDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, + xSpreadsheetDoc ); XTextContent the_Field = null; try { oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextField.Time" ); - the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); } catch(com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -199,8 +195,7 @@ public class ScHeaderFieldsObj extends TestCase { throw new StatusException("Couldn't create a test environment", e); } - XTextFieldsSupplier xTFSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, left); + XTextFieldsSupplier xTFSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, left); oObj = xTFSupp.getTextFields(); diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java index 5b2746c216b7..bbadda64e346 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterContentObj.java @@ -76,8 +76,7 @@ public class ScHeaderFooterContentObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -102,10 +101,9 @@ public class ScHeaderFooterContentObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ PageStyles = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java index 949c47a4e8bf..15be879ddf39 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor.java @@ -114,8 +114,7 @@ public class ScHeaderFooterTextCursor extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -140,10 +139,9 @@ public class ScHeaderFooterTextCursor extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ diff --git a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java index 3bda23924de0..530f54120ed1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextObj.java @@ -104,8 +104,7 @@ public class ScHeaderFooterTextObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -145,10 +144,9 @@ public class ScHeaderFooterTextObj extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, - xSpreadsheetDoc ); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, + xSpreadsheetDoc ); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); try{ PageStyles = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java index f68d90d31c4d..edd2911df097 100644 --- a/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScImportDescriptorBase.java @@ -83,7 +83,7 @@ public class ScImportDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -119,8 +119,7 @@ public class ScImportDescriptorBase extends TestCase { if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); @@ -128,7 +127,7 @@ public class ScImportDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - xIMP = (XImportable) UnoRuntime.queryInterface(XImportable.class,oObj); + xIMP = UnoRuntime.queryInterface(XImportable.class,oObj); TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("xIMP",xIMP); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java index c2c2362d017e..dbf755481643 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAnnotationsEnumeration.java @@ -66,8 +66,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -80,8 +79,7 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -107,12 +105,10 @@ public class ScIndexEnumeration_CellAnnotationsEnumeration extends TestCase { "Exception occurred while filling cells", e); } - XSheetAnnotationsSupplier sas = (XSheetAnnotationsSupplier) - UnoRuntime.queryInterface(XSheetAnnotationsSupplier.class, oSheet); + XSheetAnnotationsSupplier sas = UnoRuntime.queryInterface(XSheetAnnotationsSupplier.class, oSheet); XSheetAnnotations anno = sas.getAnnotations(); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, anno); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class, anno); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java index 482a840a0549..d63546f09d10 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_CellAreaLinksEnumeration.java @@ -63,7 +63,7 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -90,8 +90,7 @@ public class ScIndexEnumeration_CellAreaLinksEnumeration extends TestCase { String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); links.insertAtPosition (addr, aSourceArea, "a2:b5", "", "") ; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java index 437820c29ef3..66cb82de4e63 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java @@ -66,7 +66,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime. + XComponent oComp = UnoRuntime. queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); util.DesktopTools.closeDoc(oDoc); @@ -104,8 +104,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -159,8 +158,7 @@ public class ScIndexEnumeration_DDELinksEnumeration extends TestCase { "Error getting test object from spreadsheet document", e) ; } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java index c4f7b3c1ae28..734c735f0e61 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotFieldsEnumeration.java @@ -68,8 +68,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -88,8 +87,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; @@ -137,8 +134,7 @@ public class ScIndexEnumeration_DataPilotFieldsEnumeration extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java index bdc815fffe3c..3c2e8d8c5707 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotItemsEnumeration.java @@ -98,7 +98,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -146,7 +146,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets(); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); // Make sure there are at least two sheets xSpreadsheets.insertNewByName("Some Sheet", (short)0); @@ -215,7 +215,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration // create the test objects log.println("Getting test objects"); - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface( + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables(); @@ -283,10 +283,10 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XDataPilotField xDataPilotField = (XDataPilotField) UnoRuntime.queryInterface( + XDataPilotField xDataPilotField = UnoRuntime.queryInterface( XDataPilotField.class, oObj); - XEnumerationAccess xEnumerationAccess = (XEnumerationAccess) UnoRuntime.queryInterface( + XEnumerationAccess xEnumerationAccess = UnoRuntime.queryInterface( XEnumerationAccess.class, xDataPilotField.getItems()); @@ -323,7 +323,7 @@ public class ScIndexEnumeration_DataPilotItemsEnumeration return; } - XNamed named = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed named = UnoRuntime.queryInterface(XNamed.class, field); String name = named.getName(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java index 8f1730e786e5..be0ae0c276ef 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java @@ -68,8 +68,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -88,8 +87,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { throw new StatusException("Couldn't fill some cells", e); } - XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) - UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); + XDataPilotTablesSupplier DPTS = UnoRuntime.queryInterface(XDataPilotTablesSupplier.class, oSheet); log.println("Getting test object ") ; @@ -138,8 +135,7 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase { log.println("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java index bf530d9e805b..0f0b2854ae0b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DatabaseRangesEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScIndexEnumeration_DatabaseRangesEnumeration extends TestCase { } oObj = dbRanges; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java index 7930165ad743..b877bd73d49f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_FunctionDescriptionEnumeration.java @@ -58,8 +58,7 @@ public class ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -85,8 +84,7 @@ public class ScIndexEnumeration_FunctionDescriptionEnumeration extends TestCase "Error getting test object from spreadsheet document", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java index c5904986ac2f..207a7c427a19 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_LabelRangesEnumeration.java @@ -61,8 +61,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -79,8 +78,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); @@ -99,8 +97,7 @@ public class ScIndexEnumeration_LabelRangesEnumeration extends TestCase { } log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java index 0aed1468b55f..1b3165192202 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_NamedRangesEnumeration.java @@ -61,8 +61,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -90,8 +89,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2); CellAddress base = new CellAddress(DataArea.Sheet, @@ -105,8 +103,7 @@ public class ScIndexEnumeration_NamedRangesEnumeration extends TestCase { oObj = xNamedRanges; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java index ffc1fff7bbf2..a8bd4f0ab663 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_ScenariosEnumeration.java @@ -66,8 +66,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -77,8 +76,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -103,13 +101,11 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { throw new StatusException("Couldn't fill some cell", e); } - XScenariosSupplier xSupp = (XScenariosSupplier) - UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); + XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; @@ -119,8 +115,7 @@ public class ScIndexEnumeration_ScenariosEnumeration extends TestCase { XInterface oObj = xSupp.getScenarios(); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java index 49711118a32c..0cdbf4821317 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetCellRangesEnumeration.java @@ -66,7 +66,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); XComponent oComp = - (XComponent) UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -84,15 +84,13 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { log.println("Getting test object "); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); oObj = (XInterface) SOF.createInstance(oComp, "com.sun.star.sheet.SheetCellRanges"); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndSheets = (XIndexAccess) - UnoRuntime.queryInterface (XIndexAccess.class, oSheets); + XIndexAccess oIndSheets = UnoRuntime.queryInterface (XIndexAccess.class, oSheets); XSpreadsheet oSheet = null; try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -140,8 +138,7 @@ public class ScIndexEnumeration_SheetCellRangesEnumeration extends TestCase { "Exception occurred while filling cells", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java index 43d3fae76098..823825791feb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SheetLinksEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -80,8 +79,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -96,8 +94,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc"); @@ -121,8 +118,7 @@ public class ScIndexEnumeration_SheetLinksEnumeration extends TestCase { oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, links); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java index b1ba1d98b59b..162d677b69bc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetViewPanesEnumeration.java @@ -64,18 +64,15 @@ public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - XModel xm = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel xm = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xc = xm.getCurrentController(); - XIndexAccess xIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xc); + XIndexAccess xIA = UnoRuntime.queryInterface(XIndexAccess.class, xc); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xIA.getByIndex(0)); @@ -90,8 +87,7 @@ public class ScIndexEnumeration_SpreadsheetViewPanesEnumeration extends TestCase throw new StatusException("Couldn't get by index", e); } - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,xIA); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,xIA); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java index d4826a37e901..ec6601197b1b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SpreadsheetsEnumeration.java @@ -58,8 +58,7 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -72,8 +71,7 @@ public class ScIndexEnumeration_SpreadsheetsEnumeration extends TestCase { UnoRuntime.queryInterface(XInterface.class, xSpreadsheets); log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java index 40395fb74093..28e3faef0325 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_SubTotalFieldsEnumeration.java @@ -70,8 +70,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -98,8 +96,7 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true); @@ -110,13 +107,11 @@ public class ScIndexEnumeration_SubTotalFieldsEnumeration extends TestCase { columns[0] = column; xSTD.addNew(columns, 1); - XIndexAccess oDescIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSTD); + XIndexAccess oDescIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSTD); XInterface oObj = null; - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oDescIndex); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oDescIndex); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java index 961a3f297525..ae1fea9f4f14 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableAutoFormatEnumeration.java @@ -58,7 +58,7 @@ public class ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{ */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -73,8 +73,7 @@ public class ScIndexEnumeration_TableAutoFormatEnumeration extends TestCase{ oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance ("com.sun.star.sheet.TableAutoFormats"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java index a6f8842cc0a4..dad41188204c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableChartsEnumeration.java @@ -70,8 +70,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { try { log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -169,14 +167,12 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); @@ -184,8 +180,7 @@ public class ScIndexEnumeration_TableChartsEnumeration extends TestCase { oCharts.addNewByName("ScChartObj", oRect, oAddr, true, true); log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oCharts); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oCharts); XInterface oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java index ea86a5b2e1e1..a907f195f65b 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableColumnsEnumeration.java @@ -65,8 +65,7 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -98,14 +97,12 @@ public class ScIndexEnumeration_TableColumnsEnumeration extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); oObj = oColumns; log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java index 1a4a6ae21322..c457d7ef77eb 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration.java @@ -69,8 +69,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -82,8 +81,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -128,8 +126,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas } try { - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); xSCE.addNew(Conditions()); Props.setPropertyValue("ConditionalFormat", xSCE); oObj = xSCE; @@ -152,8 +149,7 @@ public class ScIndexEnumeration_TableConditionalEntryEnumeration extends TestCas } log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java index 7c3954621f3f..2c12cd2dc40c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration.java @@ -64,8 +64,7 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -94,16 +93,14 @@ public class ScIndexEnumeration_TableRowsEnumeration extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); oObj = oRows; log.println("creating a new environment for object"); - XEnumerationAccess ea = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); + XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj); oObj = ea.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java index a998d054aeed..e4b3947f61f2 100644 --- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration.java @@ -78,8 +78,7 @@ public class ScIndexEnumeration_TextFieldEnumeration extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -104,28 +103,24 @@ public class ScIndexEnumeration_TextFieldEnumeration extends TestCase { // we want to create an instance of ScCellFieldObj. // to do this we must get an MultiServiceFactory. - XMultiServiceFactory _oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); + XMultiServiceFactory _oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc); aField = (XInterface) _oMSF.createInstance("com.sun.star.text.TextField.URL"); - oContent = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, aField); + oContent = UnoRuntime.queryInterface(XTextContent.class, aField); XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); XCell oCell = oSheet.getCellByPosition(2,3); - oText = (XText)UnoRuntime.queryInterface(XText.class, oCell); + oText = UnoRuntime.queryInterface(XText.class, oCell); oText.insertTextContent( oText.createTextCursor(), oContent, true); - xTextFieldsSupp = (XTextFieldsSupplier) - UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); + xTextFieldsSupp = UnoRuntime.queryInterface(XTextFieldsSupplier.class, oCell); oObj = xTextFieldsSupp.getTextFields().createEnumeration(); } catch (com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java index 70d0cf16fbe6..babd30b14efe 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java @@ -74,8 +74,7 @@ public class ScLabelRangeObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScLabelRangeObj extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java index e8e868c697b9..d9db0e49d36d 100644 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScLabelRangesObj.java @@ -77,8 +77,7 @@ public class ScLabelRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScLabelRangesObj extends TestCase { XPropertySet docProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = (XLabelRanges) - UnoRuntime.queryInterface(XLabelRanges.class, ranges); + XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); log.println("Adding at least one element for ElementAccess interface"); CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); diff --git a/qadevOOo/tests/java/mod/_sc/ScModelObj.java b/qadevOOo/tests/java/mod/_sc/ScModelObj.java index fa49117bcf3e..25925e0b6854 100644 --- a/qadevOOo/tests/java/mod/_sc/ScModelObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScModelObj.java @@ -84,11 +84,11 @@ public class ScModelObj extends TestCase { protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); - oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, + oComp = UnoRuntime.queryInterface(XComponent.class, xSecondsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -126,13 +126,13 @@ public class ScModelObj extends TestCase { (XMultiServiceFactory) Param.getMSF()); if (xSpreadsheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } if (xSecondsheetDoc != null) { - XComponent oComp = (XComponent) UnoRuntime.queryInterface( + XComponent oComp = UnoRuntime.queryInterface( XComponent.class, xSecondsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -146,9 +146,9 @@ public class ScModelObj extends TestCase { throw new StatusException("Couldn't create document ", e); } - XModel model1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model1 = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); - XModel model2 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model2 = UnoRuntime.queryInterface(XModel.class, xSecondsheetDoc); XInterface oObj = model1; @@ -159,7 +159,7 @@ public class ScModelObj extends TestCase { cont1.getFrame().setName("cont1"); cont2.getFrame().setName("cont2"); - XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier sel = UnoRuntime.queryInterface( XSelectionSupplier.class, cont1); XCell toSel = null; @@ -168,7 +168,7 @@ public class ScModelObj extends TestCase { log.println("Getting spreadsheet"); XSpreadsheets oSheets = xSpreadsheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexSheets = UnoRuntime.queryInterface( XIndexAccess.class, oSheets); XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java index 687ee4919192..a4dd4a158b7f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangeObj.java @@ -80,8 +80,7 @@ public class ScNamedRangeObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -124,8 +123,7 @@ public class ScNamedRangeObj extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 1, 1); CellAddress base = new CellAddress(DataArea.Sheet, diff --git a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java index 64e472fb1757..20e24abd113a 100644 --- a/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScNamedRangesObj.java @@ -82,8 +82,7 @@ public class ScNamedRangesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -113,8 +112,7 @@ public class ScNamedRangesObj extends TestCase { log.println("Getting test object "); XSpreadsheets oSheets = xSheetDoc.getSheets(); - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -143,8 +141,7 @@ public class ScNamedRangesObj extends TestCase { throw new StatusException("Couldn't get NamedRanges", e); } - XNamedRanges xNamedRanges = (XNamedRanges) - UnoRuntime.queryInterface(XNamedRanges.class, ranges); + XNamedRanges xNamedRanges = UnoRuntime.queryInterface(XNamedRanges.class, ranges); CellRangeAddress DataArea = new CellRangeAddress((short)0, 0, 0, 2, 2); CellAddress base = new CellAddress(DataArea.Sheet, diff --git a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java index ac06c2f76bfc..4e89e744c1dc 100644 --- a/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScRecentFunctionsObj.java @@ -68,8 +68,7 @@ public class ScRecentFunctionsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java index 2b1789acf0b5..6d8668237226 100644 --- a/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScScenariosObj.java @@ -82,8 +82,7 @@ public class ScScenariosObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -110,8 +109,7 @@ public class ScScenariosObj extends TestCase { XSpreadsheets xSpreadsheets = (XSpreadsheets)xSpreadsheetDoc.getSheets(); log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet)AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -136,13 +134,11 @@ public class ScScenariosObj extends TestCase { throw new StatusException("Couldn't fill some cell", e); } - XScenariosSupplier xSupp = (XScenariosSupplier) - UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); + XScenariosSupplier xSupp = UnoRuntime.queryInterface(XScenariosSupplier.class, oSheet); XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; diff --git a/qadevOOo/tests/java/mod/_sc/ScShapeObj.java b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java index a6f95df61e1e..8533557383df 100644 --- a/qadevOOo/tests/java/mod/_sc/ScShapeObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScShapeObj.java @@ -43,7 +43,7 @@ public class ScShapeObj extends TestCase { try { log.println( "creating a sheetdoc" ); - xSheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null)); + xSheetDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null)); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java index 3b2cabd674af..9658c523cc7c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java @@ -89,8 +89,7 @@ public class ScSheetLinkObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -116,8 +115,7 @@ public class ScSheetLinkObj extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -132,8 +130,7 @@ public class ScSheetLinkObj extends TestCase { throw new StatusException("Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. Doesn't matter that it refers to unexistant object. // this is for proper work of XAccess tests. diff --git a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java index b76ed04a5779..6ff3902346f1 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSheetLinksObj.java @@ -77,8 +77,7 @@ public class ScSheetLinksObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScSheetLinksObj extends TestCase { log.println("Getting test object ") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScSheetLinksObj extends TestCase { throw new StatusException("Couldn't get a spreadsheet", e); } - XSheetLinkable SL = (XSheetLinkable) - UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); + XSheetLinkable SL = UnoRuntime.queryInterface(XSheetLinkable.class, oSheet); // creating link. Doesn't matter that it refers to unexistant object. // this is for proper work of X*Access tests. diff --git a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java index e264c3c4379a..936bb8c5ffd9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSortDescriptorBase.java @@ -85,7 +85,7 @@ public class ScSortDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) UnoRuntime.queryInterface + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -121,8 +121,7 @@ public class ScSortDescriptorBase extends TestCase { if (xSpreadsheets == null) log.println("FAILED"); else log.println("OK"); log.println("getting a sheet"); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class,oIndexAccess.getByIndex(0)); @@ -130,7 +129,7 @@ public class ScSortDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - xSORT = (XSortable) UnoRuntime.queryInterface(XSortable.class,oObj); + xSORT = UnoRuntime.queryInterface(XSortable.class,oObj); TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("xSORT",xSORT); diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java index 58c003304a17..495f46a423f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj.java @@ -70,8 +70,7 @@ public class ScSpreadsheetSettingsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java index 1d1fdd35c134..28ae5ef1df05 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamiliesObj.java @@ -74,8 +74,7 @@ public class ScStyleFamiliesObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -98,9 +97,8 @@ public class ScStyleFamiliesObj extends TestCase { XNameAccess oStyleFamilies=null; // create testobject here log.println("getting style families"); - XStyleFamiliesSupplier oStyleFamiliesSupplier =(XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier =UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java index 6d40cd56f107..410535d129db 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj.java @@ -85,8 +85,7 @@ public class ScStyleFamilyObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -122,13 +121,11 @@ public class ScStyleFamilyObj extends TestCase { XNameAccess oStyleFamilyNameAccess = null; // create testobject here log.println("getting style"); - XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); - XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); + XIndexAccess oStyleFamiliesIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); try { oStyleFamilyNameAccess = (XNameAccess) AnyConverter.toObject( new Type(XNameAccess.class), @@ -148,8 +145,7 @@ public class ScStyleFamilyObj extends TestCase { } SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); XInterface oInstance = (XInterface) SOF.createInstance(xComp,"com.sun.star.style.CellStyle"); diff --git a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java index 2b929a966925..e5d782628a06 100644 --- a/qadevOOo/tests/java/mod/_sc/ScStyleObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScStyleObj.java @@ -87,8 +87,7 @@ public class ScStyleObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -123,12 +122,10 @@ public class ScStyleObj extends TestCase { log.println("creating a test environment"); log.println("getting style"); - XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSpreadsheetDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSpreadsheetDoc); XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); - XIndexAccess oStyleFamiliesIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); + XIndexAccess oStyleFamiliesIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oStyleFamilies); XNameAccess oStyleFamilyNameAccess = null; XStyle oStyle = null; try { @@ -136,9 +133,8 @@ public class ScStyleObj extends TestCase { new Type(XNameAccess.class), oStyleFamiliesIndexAccess.getByIndex(0)); - XIndexAccess oStyleFamilyIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, - oStyleFamilyNameAccess); + XIndexAccess oStyleFamilyIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, + oStyleFamilyNameAccess); oStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oStyleFamilyIndexAccess.getByIndex(0)); } catch(com.sun.star.lang.WrappedTargetException e) { @@ -153,9 +149,8 @@ public class ScStyleObj extends TestCase { } log.println("Creating a user-defined style"); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( - XMultiServiceFactory.class, xSpreadsheetDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface( + XMultiServiceFactory.class, xSpreadsheetDoc); XInterface oInt = null; try { @@ -194,8 +189,7 @@ public class ScStyleObj extends TestCase { //using the style log.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); XCell aCell = null; try { @@ -247,7 +241,7 @@ public class ScStyleObj extends TestCase { public String[] getPropertyNames(XPropertySet props) { Property[] the_props = props.getPropertySetInfo().getProperties(); - ArrayList names = new ArrayList() ; + ArrayList<String> names = new ArrayList<String>() ; for (int i=0;i<the_props.length;i++) { boolean isWritable = @@ -256,6 +250,6 @@ public class ScStyleObj extends TestCase { names.add(the_props[i].Name); } } - return (String[]) names.toArray(new String[names.size()]) ; + return names.toArray(new String[names.size()]) ; } } // finish class ScStyleObj diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java index e90dfd29782d..091d68ad3d80 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalDescriptorBase.java @@ -86,8 +86,7 @@ public class ScSubTotalDescriptorBase extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -107,8 +106,7 @@ public class ScSubTotalDescriptorBase extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -123,8 +121,7 @@ public class ScSubTotalDescriptorBase extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); SubTotalColumn[] columns = new SubTotalColumn[1]; SubTotalColumn column = new SubTotalColumn(); diff --git a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java index efbddd2c7b2a..1f5416ab8d99 100644 --- a/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScSubTotalFieldObj.java @@ -81,8 +81,7 @@ public class ScSubTotalFieldObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -104,8 +103,7 @@ public class ScSubTotalFieldObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type (XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -120,8 +118,7 @@ public class ScSubTotalFieldObj extends TestCase { throw new StatusException( "Couldn't get a spreadsheet", e); } - XSubTotalCalculatable xSTC = (XSubTotalCalculatable) - UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); + XSubTotalCalculatable xSTC = UnoRuntime.queryInterface(XSubTotalCalculatable.class, oSheet); XSubTotalDescriptor xSTD = xSTC.createSubTotalDescriptor(true); @@ -132,8 +129,7 @@ public class ScSubTotalFieldObj extends TestCase { columns[0] = column; xSTD.addNew(columns, 1); - XIndexAccess oDescIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSTD); + XIndexAccess oDescIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSTD); XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java index 97cd11129307..f7fd3415bff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -113,11 +113,9 @@ public class ScTabViewObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); - XComponent oComp2 = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc2) ; + XComponent oComp2 = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc2) ; util.DesktopTools.closeDoc(oComp2); } @@ -139,11 +137,9 @@ public class ScTabViewObj extends TestCase { protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { XDrawPage oDrawPage = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); - XModel aSecondModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc2); + XModel aSecondModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc2); XInterface oObj = aModel.getCurrentController(); @@ -152,8 +148,7 @@ public class ScTabViewObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class), oIndexAccess.getByIndex(1)); @@ -201,10 +196,8 @@ public class ScTabViewObj extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XCellRangeAddressable adr1 = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); - XCellRangeAddressable adr2 = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); + XCellRangeAddressable adr1 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o1); + XCellRangeAddressable adr2 = UnoRuntime.queryInterface(XCellRangeAddressable.class, o2); if (adr1 == null || adr2 == null) return -1; CellRangeAddress range1 = adr1.getRangeAddress(); CellRangeAddress range2 = adr2.getRangeAddress(); @@ -223,7 +216,7 @@ public class ScTabViewObj extends TestCase { XShape aShape = null; try{ log.println("adding contol shape '" + kindOfControl + "'"); - XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl); @@ -236,8 +229,7 @@ public class ScTabViewObj extends TestCase { log.println("adding relation for com.sun.star.view.XFormLayerAccess: XForm"); try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java index d8837d19c676..fd674b3da5ab 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnObj.java @@ -84,8 +84,7 @@ public class ScTableColumnObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -133,11 +132,9 @@ public class ScTableColumnObj extends TestCase { throw new StatusException("Couldn't get element by name", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oColumns); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oColumns); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(10)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java index b8f33f913604..bdaa454deff5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableColumnsObj.java @@ -85,8 +85,7 @@ public class ScTableColumnsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -127,8 +126,7 @@ public class ScTableColumnsObj extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableColumns oColumns = (XTableColumns) oColumnRowRange.getColumns(); oObj = oColumns; diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java index 55b21b7e028a..5ee191eba153 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalEntry.java @@ -83,8 +83,7 @@ public class ScTableConditionalEntry extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -109,8 +108,7 @@ public class ScTableConditionalEntry extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( @@ -155,8 +153,7 @@ public class ScTableConditionalEntry extends TestCase { } try { - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, CFormat); xSCE.addNew(Conditions()); Props.setPropertyValue("ConditionalFormat", xSCE); oObj = (XSheetConditionalEntry) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java index b1f41c89f642..47b893ad0814 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableConditionalFormat.java @@ -88,8 +88,7 @@ public class ScTableConditionalFormat extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -113,8 +112,7 @@ public class ScTableConditionalFormat extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); @@ -156,8 +154,7 @@ public class ScTableConditionalFormat extends TestCase { throw new StatusException("Couldn't get ConditionalFromat", e); } - XSheetConditionalEntries xSCE = (XSheetConditionalEntries) - UnoRuntime.queryInterface(XSheetConditionalEntries.class, oObj); + XSheetConditionalEntries xSCE = UnoRuntime.queryInterface(XSheetConditionalEntries.class, oObj); xSCE.addNew(Conditions(5)); xSCE.addNew(Conditions(2)); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java index 983ce908597e..91609c52a7f4 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowObj.java @@ -81,8 +81,7 @@ public class ScTableRowObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -118,11 +117,9 @@ public class ScTableRowObj extends TestCase { new Type(XSpreadsheet.class), oNames.getByName(oNames.getElementNames()[0])); - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oRows); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, oRows); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oIndexAccess.getByIndex(6)); } catch(com.sun.star.lang.WrappedTargetException e) { diff --git a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java index 2e01c06c5999..4e4f9276b063 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableRowsObj.java @@ -81,8 +81,7 @@ public class ScTableRowsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -120,8 +119,7 @@ public class ScTableRowsObj extends TestCase { throw new StatusException("Couldn't get spreadsheet", e); } - XColumnRowRange oColumnRowRange = (XColumnRowRange) - UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); + XColumnRowRange oColumnRowRange = UnoRuntime.queryInterface(XColumnRowRange.class, xSpreadsheet); XTableRows oRows = (XTableRows) oColumnRowRange.getRows(); oObj = oRows; diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java index 6b4080dc651c..2b053a5c3e8c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java @@ -148,7 +148,7 @@ public class ScTableSheetObj extends TestCase { log.println(" disposing xSheetDoc "); try { - XCloseable oCloser = (XCloseable) UnoRuntime.queryInterface( + XCloseable oCloser = UnoRuntime.queryInterface( XCloseable.class, xSheetDoc); oCloser.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -192,7 +192,7 @@ public class ScTableSheetObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oIndexAccess = UnoRuntime.queryInterface( XIndexAccess.class, xSpreadsheets); try { @@ -250,7 +250,7 @@ public class ScTableSheetObj extends TestCase { tEnv.addObjRelation("XSheetLinkable.LinkSheet", "ScSheetLinksObj.ods"); //adding Scenario and with that a ScenarioSheet-Relation for Scenario and XScenarioEnhanced - XScenariosSupplier scene = (XScenariosSupplier) UnoRuntime.queryInterface( + XScenariosSupplier scene = UnoRuntime.queryInterface( XScenariosSupplier.class, tEnv.getTestObject()); scene.getScenarios() diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java index d03bc08d756b..fd2e151c0a73 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetsObj.java @@ -84,8 +84,7 @@ public class ScTableSheetsObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } diff --git a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java index 3dd98ebaae01..8c0c1d6ca6ce 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableValidationObj.java @@ -79,8 +79,7 @@ public class ScTableValidationObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println( " disposing xSheetDoc " ); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc) ; util.DesktopTools.closeDoc(oComp); } @@ -101,8 +100,7 @@ public class ScTableValidationObj extends TestCase { log.println("getting a sheet"); XSpreadsheet oSheet = null; - XIndexAccess oIndexAccess = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess oIndexAccess = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0)); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java index 4a353a17ace6..f2a37f9fb723 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java @@ -73,7 +73,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { PrintWriter log) { log.println("Getting the first sheet"); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess xIA = UnoRuntime.queryInterface( XIndexAccess.class, xSheetDoc.getSheets()); try { @@ -95,11 +95,11 @@ public class ScUniqueCellFormatsEnumeration extends TestCase { changeColor("C1:C10", 0, 0, 255); changeColor("D1:D10", 0, 255, 0); - XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface( + XUniqueCellFormatRangesSupplier xUCRS = UnoRuntime.queryInterface( XUniqueCellFormatRangesSupplier.class, oSheet); - XEnumerationAccess xEnum = (XEnumerationAccess) UnoRuntime.queryInterface( + XEnumerationAccess xEnum = UnoRuntime.queryInterface( XEnumerationAccess.class, xUCRS.getUniqueCellFormatRanges()); XInterface oObj = xEnum.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java index 7c83e6a87968..9d7b706668e9 100644 --- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java @@ -72,7 +72,7 @@ public class ScUniqueCellFormatsObj extends TestCase { PrintWriter log) { log.println("Getting the first sheet"); - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess xIA = UnoRuntime.queryInterface( XIndexAccess.class, xSheetDoc.getSheets()); try { @@ -94,7 +94,7 @@ public class ScUniqueCellFormatsObj extends TestCase { changeColor("C1:C10", 0, 0, 255); changeColor("D1:D10", 0, 255, 0); - XUniqueCellFormatRangesSupplier xUCRS = (XUniqueCellFormatRangesSupplier) UnoRuntime.queryInterface( + XUniqueCellFormatRangesSupplier xUCRS = UnoRuntime.queryInterface( XUniqueCellFormatRangesSupplier.class, oSheet); diff --git a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java index 8982389de7ec..bdda48d7ad76 100644 --- a/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java @@ -88,8 +88,7 @@ public class ScViewPaneObj extends TestCase { */ protected void cleanup( TestParameters tParam, PrintWriter log ) { log.println("disposing xSpreadsheetDocument"); - XComponent oComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc); util.DesktopTools.closeDoc(oComp); } @@ -111,11 +110,9 @@ public class ScViewPaneObj extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { XDrawPage oDrawPage; - XModel xm = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel xm = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); XController xc = xm.getCurrentController(); - XIndexAccess xIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xc); + XIndexAccess xIA = UnoRuntime.queryInterface(XIndexAccess.class, xc); try { oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xIA.getByIndex(0)); @@ -136,8 +133,7 @@ public class ScViewPaneObj extends TestCase { tEnv.addObjRelation("DOCUMENT", UnoRuntime.queryInterface(XComponent.class,xSpreadsheetDoc)); tEnv.addObjRelation("XControlAccess.isSheet", Boolean.TRUE); - XViewPane VP = (XViewPane) - UnoRuntime.queryInterface(XViewPane.class, oObj); + XViewPane VP = UnoRuntime.queryInterface(XViewPane.class, oObj); CellRangeAddress dataArea = VP.getVisibleRange(); tEnv.addObjRelation("DATAAREA", dataArea); @@ -149,7 +145,7 @@ public class ScViewPaneObj extends TestCase { XShape aShape = null; try{ log.println("adding contol shape '" + kindOfControl + "'"); - XComponent oComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; + XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSpreadsheetDoc) ; aShape = FormTools.createControlShape(oComp, 3000, 4500, 15000, 10000, kindOfControl); @@ -161,8 +157,7 @@ public class ScViewPaneObj extends TestCase { try { log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xSpreadsheetDoc); XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java index 9c95abfd3a12..d0781266a3f3 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLContentExporter.java @@ -124,16 +124,14 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLContentExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Setting some string to a cell - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XIndexAccess xSheetsIndexArray = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0)); XCell xCell = xSheet.getCellByPosition(0, 0); diff --git a/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java index 175692bdeba4..ce2456205772 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLContentImporter.java @@ -73,7 +73,7 @@ public class XMLContentImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -126,7 +126,7 @@ public class XMLContentImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLContentImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_sc/XMLExporter.java b/qadevOOo/tests/java/mod/_sc/XMLExporter.java index 5b8ec92f1f5b..3bf56304bb5e 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLExporter.java @@ -121,20 +121,17 @@ public class XMLExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); //set name of sheet - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets(); - XIndexAccess xSheetsIndexArray = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); + XIndexAccess xSheetsIndexArray = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets); XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0)); - XNamed xSheetNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, xSheet); + XNamed xSheetNamed = UnoRuntime.queryInterface(XNamed.class, xSheet); xSheetNamed.setName(SHEET_NAME); log.println("fill sheet with contnet..."); diff --git a/qadevOOo/tests/java/mod/_sc/XMLImporter.java b/qadevOOo/tests/java/mod/_sc/XMLImporter.java index 63f112d1c889..9071cdde78e8 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLImporter.java @@ -72,7 +72,7 @@ public class XMLImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); XSpreadsheetDocument xSpreadsheetDoc = SOF.createCalcDoc( null ); - xSheetDoc = (XComponent) UnoRuntime.queryInterface + xSheetDoc = UnoRuntime.queryInterface (XComponent.class, xSpreadsheetDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -124,7 +124,7 @@ public class XMLImporter extends TestCase { try { oInt = xMSF.createInstance("com.sun.star.comp.Calc.XMLImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(xSheetDoc); } catch (com.sun.star.uno.Exception e) { @@ -159,8 +159,7 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; final PrintWriter fLog = log ; - XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument) - UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); + XSpreadsheetDocument xSpreadsheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc); final XSpreadsheets sheets = xSpreadsheetDoc.getSheets() ; log.println("Sheets before importing :") ; String[] names = sheets.getElementNames() ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java index f265662ebf8e..7793b5d07673 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaExporter.java @@ -128,14 +128,13 @@ public class XMLMetaExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLMetaExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Obtaining and changing property values - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface (XDocumentInfoSupplier.class, - xSheetDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, + xSheetDoc) ; XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", "TestDocument"); diff --git a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java index e2358a4788e5..30875b90af74 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLMetaImporter.java @@ -74,7 +74,7 @@ public class XMLMetaImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -128,7 +128,7 @@ public class XMLMetaImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLMetaImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; } catch (com.sun.star.uno.Exception e) { @@ -160,8 +160,7 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xSheetDoc) ; final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java index 86917b4d7274..a8fba99670ec 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsExporter.java @@ -121,13 +121,12 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLSettingsExporter", new Object[] {arg} ); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); //set some settings - XModel xSheetModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java index fbc98c77d6a3..72218cfb741e 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLSettingsImporter.java @@ -75,7 +75,7 @@ public class XMLSettingsImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -129,12 +129,11 @@ public class XMLSettingsImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLSettingsImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; - XModel xSheetModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSheetDoc); + XModel xSheetModel = UnoRuntime.queryInterface(XModel.class, xSheetDoc); XController xController = xSheetModel.getCurrentController(); xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java index 0382235a6ae5..ff310e27d168 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesExporter.java @@ -128,14 +128,12 @@ public class XMLStylesExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Calc.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xSheetDoc); // Obtaining and changing property values - XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface( - XStyleFamiliesSupplier.class, xSheetDoc); + XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface( + XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess StyleFamilies = styleSup.getStyleFamilies(); String[] styleFamiliesNames = StyleFamilies.getElementNames(); XNameContainer StyleFamilyName = (XNameContainer) diff --git a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java index b8810295e235..a83e770ac51b 100644 --- a/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_sc/XMLStylesImporter.java @@ -74,7 +74,7 @@ public class XMLStylesImporter extends TestCase { try { log.println( "creating a Spreadsheet document" ); xSheetDoc = SOF.createCalcDoc( null ); - comp = (XComponent) UnoRuntime.queryInterface + comp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -127,7 +127,7 @@ public class XMLStylesImporter extends TestCase { try { oInt = xMSF.createInstance ("com.sun.star.comp.Calc.XMLStylesImporter") ; - XImporter imp = (XImporter) UnoRuntime.queryInterface + XImporter imp = UnoRuntime.queryInterface (XImporter.class, oInt) ; imp.setTargetDocument(comp) ; } catch (com.sun.star.uno.Exception e) { @@ -170,9 +170,8 @@ public class XMLStylesImporter extends TestCase { XNameAccess styles = null ; try { - XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface - (XStyleFamiliesSupplier.class, xSheetDoc); + XStyleFamiliesSupplier sup = UnoRuntime.queryInterface + (XStyleFamiliesSupplier.class, xSheetDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("CellStyles") ; styles = (XNameAccess) UnoRuntime.queryInterface diff --git a/qadevOOo/tests/java/mod/_sch/AccArea.java b/qadevOOo/tests/java/mod/_sch/AccArea.java index 6d9559cffb70..117297f5aa16 100644 --- a/qadevOOo/tests/java/mod/_sch/AccArea.java +++ b/qadevOOo/tests/java/mod/_sch/AccArea.java @@ -59,8 +59,7 @@ public class AccArea extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -80,9 +79,8 @@ public class AccArea extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccAxis.java b/qadevOOo/tests/java/mod/_sch/AccAxis.java index 972b4f1ef7c5..8599cd35e086 100644 --- a/qadevOOo/tests/java/mod/_sch/AccAxis.java +++ b/qadevOOo/tests/java/mod/_sch/AccAxis.java @@ -59,8 +59,7 @@ public class AccAxis extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -78,9 +77,8 @@ public class AccAxis extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccDataPoint.java b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java index fab8c7903c59..77a32d7c32ce 100644 --- a/qadevOOo/tests/java/mod/_sch/AccDataPoint.java +++ b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java @@ -59,8 +59,7 @@ public class AccDataPoint extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -79,9 +78,8 @@ public class AccDataPoint extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccDataSeries.java b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java index d2d4f4616dd1..397a55211946 100644 --- a/qadevOOo/tests/java/mod/_sch/AccDataSeries.java +++ b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java @@ -59,8 +59,7 @@ public class AccDataSeries extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -79,9 +78,8 @@ public class AccDataSeries extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccDiagram.java b/qadevOOo/tests/java/mod/_sch/AccDiagram.java index 916059ec7964..7ab5ae9f7763 100644 --- a/qadevOOo/tests/java/mod/_sch/AccDiagram.java +++ b/qadevOOo/tests/java/mod/_sch/AccDiagram.java @@ -59,8 +59,7 @@ public class AccDiagram extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -79,9 +78,8 @@ public class AccDiagram extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccFloor.java b/qadevOOo/tests/java/mod/_sch/AccFloor.java index 98a44f154c3f..ea2c3138b9d1 100644 --- a/qadevOOo/tests/java/mod/_sch/AccFloor.java +++ b/qadevOOo/tests/java/mod/_sch/AccFloor.java @@ -83,8 +83,7 @@ public class AccFloor extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -104,9 +103,8 @@ public class AccFloor extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccGrid.java b/qadevOOo/tests/java/mod/_sch/AccGrid.java index 24fef9faa4e6..38a0bf4cea39 100644 --- a/qadevOOo/tests/java/mod/_sch/AccGrid.java +++ b/qadevOOo/tests/java/mod/_sch/AccGrid.java @@ -59,8 +59,7 @@ public class AccGrid extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -80,9 +79,8 @@ public class AccGrid extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccLegend.java b/qadevOOo/tests/java/mod/_sch/AccLegend.java index 5d6e59c2abaa..276f97c98463 100644 --- a/qadevOOo/tests/java/mod/_sch/AccLegend.java +++ b/qadevOOo/tests/java/mod/_sch/AccLegend.java @@ -59,8 +59,7 @@ public class AccLegend extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -78,9 +77,8 @@ public class AccLegend extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java index 010941e3ce4e..404375c47f50 100644 --- a/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java +++ b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java @@ -59,8 +59,7 @@ public class AccLegendEntry extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -78,9 +77,8 @@ public class AccLegendEntry extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java index 4af35f8fd0db..e895caf34aa0 100644 --- a/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java +++ b/qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java @@ -64,8 +64,7 @@ public class AccStatisticsObject extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -83,9 +82,8 @@ public class AccStatisticsObject extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccTitle.java b/qadevOOo/tests/java/mod/_sch/AccTitle.java index 4564565041f6..d20037cd2d86 100644 --- a/qadevOOo/tests/java/mod/_sch/AccTitle.java +++ b/qadevOOo/tests/java/mod/_sch/AccTitle.java @@ -59,8 +59,7 @@ public class AccTitle extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -78,9 +77,8 @@ public class AccTitle extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccWall.java b/qadevOOo/tests/java/mod/_sch/AccWall.java index b7574e5dc7da..e33ffdfb10e4 100644 --- a/qadevOOo/tests/java/mod/_sch/AccWall.java +++ b/qadevOOo/tests/java/mod/_sch/AccWall.java @@ -83,8 +83,7 @@ public class AccWall extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); @@ -103,9 +102,8 @@ public class AccWall extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acc = (XAccessibleComponent) - UnoRuntime.queryInterface( - XAccessibleComponent.class,oObj); + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java index a6ac13730c3b..73d927810a70 100644 --- a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java +++ b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java @@ -47,8 +47,7 @@ public class AccessibleDocumentView extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xChartDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java index 355105e3daf9..55e831e12da2 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java @@ -105,8 +105,7 @@ public class ChXChartAxis extends TestCase { // get the Axis log.println( "getting ChartAxis" ); - XAxisYSupplier oAxisSup = (XAxisYSupplier) - UnoRuntime.queryInterface(XAxisYSupplier.class,oDiagram); + XAxisYSupplier oAxisSup = UnoRuntime.queryInterface(XAxisYSupplier.class,oDiagram); oObj = (XPropertySet) oAxisSup.getYAxis(); log.println( "creating a new environment for chartdocument object" ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java index 9bffc8c44725..e492aafe68df 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java @@ -135,7 +135,7 @@ public class ChXChartDocument extends TestCase { cont1.getFrame().setName("cont1"); cont2.getFrame().setName("cont2"); - XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier sel = UnoRuntime.queryInterface( XSelectionSupplier.class, cont1); log.println("creating a new environment for chartdocument object"); diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartView.java b/qadevOOo/tests/java/mod/_sch/ChXChartView.java index 0a650d671541..7938637108ea 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXChartView.java +++ b/qadevOOo/tests/java/mod/_sch/ChXChartView.java @@ -101,7 +101,7 @@ public class ChXChartView extends TestCase { // get the ChartView log.println( "getting ChartView" ); - oModel = (XModel)UnoRuntime.queryInterface(XModel.class, xChartDoc); + oModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); oObj = (XController)oModel.getCurrentController(); log.println( "creating a new environment for chartdocument object" ); @@ -113,10 +113,8 @@ public class ChXChartView extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XShapeDescriptor descr1 = (XShapeDescriptor) - UnoRuntime.queryInterface(XShapeDescriptor.class, o1); - XShapeDescriptor descr2 = (XShapeDescriptor) - UnoRuntime.queryInterface(XShapeDescriptor.class, o2); + XShapeDescriptor descr1 = UnoRuntime.queryInterface(XShapeDescriptor.class, o1); + XShapeDescriptor descr2 = UnoRuntime.queryInterface(XShapeDescriptor.class, o2); if (descr1 == null || descr2 == null) { return -1; } diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java index ba10fd55c67a..ff65263bf7b4 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java @@ -79,8 +79,7 @@ public class ChXDataPoint extends TestCase { log.println( "creating a chartdocument" ); XComponent xComp = SOF.loadDocument( utils.getFullTestURL("TransparencyChart.sxs")); - xChartDoc = (XChartDocument) - UnoRuntime.queryInterface(XChartDocument.class,xComp); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); } catch (com.sun.star.uno.Exception e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java index 217656b86f5e..325328b07493 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java @@ -85,8 +85,7 @@ public class ChXDataRow extends TestCase { log.println( "creating a chartdocument" ); XComponent xComp = SOF.loadDocument( utils.getFullTestURL("TransparencyChart.sxs")); - xChartDoc = (XChartDocument) - UnoRuntime.queryInterface(XChartDocument.class,xComp); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); } catch (com.sun.star.uno.Exception e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java index d9cea0ca3bd3..7df995ee5bc3 100644 --- a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java +++ b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java @@ -217,8 +217,7 @@ public class ChXDiagram extends TestCase { System.out.println("Getting spreadsheet") ; XSpreadsheets oSheets = xSheetDoc.getSheets() ; - XIndexAccess oIndexSheets = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); try { oSheet = (XSpreadsheet) AnyConverter.toObject( new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); @@ -302,14 +301,12 @@ public class ChXDiagram extends TestCase { XCellRange oRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, oSheet); XCellRange myRange = oRange.getCellRangeByName("A1:N4"); - XCellRangeAddressable oRangeAddr = (XCellRangeAddressable) - UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); CellRangeAddress[] oAddr = new CellRangeAddress[1]; oAddr[0] = myAddr; - XTableChartsSupplier oSupp = (XTableChartsSupplier) - UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); log.println("Insert Chart"); XTableCharts oCharts = oSupp.getCharts(); @@ -337,11 +334,9 @@ public class ChXDiagram extends TestCase { throw new StatusException("Couldn't get TableChart", e); } - XEmbeddedObjectSupplier oEOS = (XEmbeddedObjectSupplier) - UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, oChart); + XEmbeddedObjectSupplier oEOS = UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, oChart); XInterface oInt = oEOS.getEmbeddedObject(); - xChartDoc = (XChartDocument) - UnoRuntime.queryInterface(XChartDocument.class,oInt); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,oInt); oObj = (XDiagram) xChartDoc.getDiagram(); log.println( "creating a new environment for chartdocument object" ); @@ -350,8 +345,7 @@ public class ChXDiagram extends TestCase { log.println( "adding ChartDocument as mod relation to environment" ); tEnv.addObjRelation("CHARTDOC", xChartDoc); - XChartDataArray da = (XChartDataArray) - UnoRuntime.queryInterface(XChartDataArray.class, xChartDoc.getData()); + XChartDataArray da = UnoRuntime.queryInterface(XChartDataArray.class, xChartDoc.getData()); int cols = da.getColumnDescriptions().length; int rows = da.getRowDescriptions().length; diff --git a/qadevOOo/tests/java/mod/_sch/ChartArea.java b/qadevOOo/tests/java/mod/_sch/ChartArea.java index df09759390ec..8609c5757547 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartArea.java +++ b/qadevOOo/tests/java/mod/_sch/ChartArea.java @@ -70,8 +70,7 @@ public class ChartArea extends TestCase { log.println( "creating a chartdocument" ); XComponent xComp = SOF.loadDocument( utils.getFullTestURL("TransparencyChart.sxs")); - xChartDoc = (XChartDocument) - UnoRuntime.queryInterface(XChartDocument.class,xComp); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); } catch (com.sun.star.uno.Exception e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartGrid.java b/qadevOOo/tests/java/mod/_sch/ChartGrid.java index 440e0ec91993..97d2de65e797 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartGrid.java +++ b/qadevOOo/tests/java/mod/_sch/ChartGrid.java @@ -98,8 +98,7 @@ public class ChartGrid extends TestCase { // get the Grid log.println( "getting ChartGrid" ); - XAxisXSupplier oAxisSup = (XAxisXSupplier) - UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram); + XAxisXSupplier oAxisSup = UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram); oObj = (XPropertySet) oAxisSup.getXMainGrid(); log.println( "creating a new environment for chartdocument object" ); diff --git a/qadevOOo/tests/java/mod/_sch/ChartLegend.java b/qadevOOo/tests/java/mod/_sch/ChartLegend.java index 93c7824b8d1b..f54ae9ee14a2 100644 --- a/qadevOOo/tests/java/mod/_sch/ChartLegend.java +++ b/qadevOOo/tests/java/mod/_sch/ChartLegend.java @@ -87,8 +87,7 @@ public class ChartLegend extends TestCase { log.println( "creating a chartdocument" ); XComponent xComp = SOF.loadDocument( utils.getFullTestURL("TransparencyChart.sxs")); - xChartDoc = (XChartDocument) - UnoRuntime.queryInterface(XChartDocument.class,xComp); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); } catch (com.sun.star.uno.Exception e) { // Some exception occures.FAILED e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java index daf6da89a16f..fd938266465d 100644 --- a/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java +++ b/qadevOOo/tests/java/mod/_sd/AccessibleDrawDocumentView.java @@ -72,12 +72,10 @@ public class AccessibleDrawDocumentView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); final XDrawPage fDP2 = oDPn.insertNewByIndex(1); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class, oDPn); XDrawPage oDP = null; try { oDP = (XDrawPage) AnyConverter.toObject( @@ -98,8 +96,7 @@ public class AccessibleDrawDocumentView extends TestCase { XShape oShape = SOF.createShape(xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); AccessibilityTools at = new AccessibilityTools(); @@ -118,7 +115,7 @@ public class AccessibleDrawDocumentView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XDrawView xView = (XDrawView) UnoRuntime.queryInterface + final XDrawView xView = UnoRuntime.queryInterface (XDrawView.class, aModel.getCurrentController()) ; final XDrawPage fDP1 = oDP; diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java index f30597461f33..a867d5877260 100644 --- a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java @@ -78,8 +78,7 @@ public class AccessibleOutlineView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel); final XDrawPages oDPn = oDPS.getDrawPages(); tEnv.addObjRelation("EventMsg","Inserting a drawpage via API has no "+ @@ -133,20 +132,17 @@ public class AccessibleOutlineView extends TestCase { throw new StatusException("Couldn't create document", e); } - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XInterface oObj = aModel.getCurrentController(); //Change to Outline view try { String aSlotID = "slot:27010"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()). - createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()). + createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java index 70edede70b8b..05d3472fa2c3 100644 --- a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java +++ b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java @@ -66,8 +66,7 @@ public class AccessibleSlideView extends TestCase { AccessibilityTools at = new AccessibilityTools(); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, aModel); XDrawPages oDPn = oDPS.getDrawPages(); oDPn.insertNewByIndex(0); @@ -141,19 +140,16 @@ public class AccessibleSlideView extends TestCase { shortWait(); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); //Change to Outline view try { String aSlotID = "slot:27011"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, - aModel.getCurrentController() ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()). - createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, + aModel.getCurrentController() ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()). + createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index 878cd4894955..eee7fd14cc05 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -150,11 +150,9 @@ public class DrawController_DrawView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -173,8 +171,7 @@ public class DrawController_DrawView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -186,16 +183,14 @@ public class DrawController_DrawView extends TestCase { oShapes.add(shape3); shortWait(); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); XController aController2 = aModel2.getCurrentController(); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class, aController2); log.println( "creating a new environment for impress view object" ); @@ -217,10 +212,8 @@ public class DrawController_DrawView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -231,10 +224,8 @@ public class DrawController_DrawView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -270,8 +261,7 @@ public class DrawController_DrawView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java index 7497b4189660..fbe9eea1f4f1 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java @@ -89,10 +89,9 @@ public class DrawController_HandoutView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -166,14 +165,12 @@ public class DrawController_HandoutView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); for (int i = 1; i < 10; i++){ the_pages.insertNewByIndex(i); } - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -192,8 +189,7 @@ public class DrawController_HandoutView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -215,18 +211,16 @@ public class DrawController_HandoutView extends TestCase { utils.shortWait(500); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); log.println("bring first document to front..."); DesktopTools.bringWindowToFront(aModel); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -248,10 +242,8 @@ public class DrawController_HandoutView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -261,10 +253,8 @@ public class DrawController_HandoutView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -287,8 +277,7 @@ public class DrawController_HandoutView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -303,8 +292,7 @@ public class DrawController_HandoutView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java index 43b67c42bedf..70a1c5aa4df2 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java @@ -89,10 +89,9 @@ public class DrawController_NotesView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -166,11 +165,9 @@ public class DrawController_NotesView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -189,8 +186,7 @@ public class DrawController_NotesView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -212,18 +208,16 @@ public class DrawController_NotesView extends TestCase { utils.shortWait(500); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); log.println("bring first document to front..."); DesktopTools.bringWindowToFront(aModel); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -245,10 +239,8 @@ public class DrawController_NotesView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -258,10 +250,8 @@ public class DrawController_NotesView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -284,8 +274,7 @@ public class DrawController_NotesView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -300,8 +289,7 @@ public class DrawController_NotesView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index 44af97713ce0..7595155fafa4 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -89,10 +89,9 @@ public class DrawController_OutlineView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -166,11 +165,9 @@ public class DrawController_OutlineView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -189,8 +186,7 @@ public class DrawController_OutlineView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -212,18 +208,16 @@ public class DrawController_OutlineView extends TestCase { utils.shortWait(500); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); log.println("bring first document to front..."); DesktopTools.bringWindowToFront(aModel); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -245,10 +239,8 @@ public class DrawController_OutlineView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -258,10 +250,8 @@ public class DrawController_OutlineView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -284,8 +274,7 @@ public class DrawController_OutlineView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -300,8 +289,7 @@ public class DrawController_OutlineView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java index 52b20ffc7594..c2c2f5f2c5c2 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java @@ -89,10 +89,9 @@ public class DrawController_PresentationView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -166,11 +165,9 @@ public class DrawController_PresentationView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -189,8 +186,7 @@ public class DrawController_PresentationView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -212,18 +208,16 @@ public class DrawController_PresentationView extends TestCase { utils.shortWait(500); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); log.println("bring first document to front..."); DesktopTools.bringWindowToFront(aModel); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -245,10 +239,8 @@ public class DrawController_PresentationView extends TestCase { throw new StatusException(Status.failed("Couldn't create instance")); } - XShapes xShapes1 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol1); - XShapes xShapes2 = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oShapeCol2); + XShapes xShapes1 = UnoRuntime.queryInterface(XShapes.class, oShapeCol1); + XShapes xShapes2 = UnoRuntime.queryInterface(XShapes.class, oShapeCol2); xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); @@ -258,10 +250,8 @@ public class DrawController_PresentationView extends TestCase { oDrawPage, oShapeCol1, oShapeCol2}); tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -284,8 +274,7 @@ public class DrawController_PresentationView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -300,8 +289,7 @@ public class DrawController_PresentationView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java index 47ff4967f106..773a3615b830 100644 --- a/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java +++ b/qadevOOo/tests/java/mod/_sd/SdDocLinkTargets.java @@ -88,8 +88,7 @@ public class SdDocLinkTargets extends TestCase { // get the Links here log.println( "getting Links" ); - XLinkTargetSupplier oLTS = (XLinkTargetSupplier) - UnoRuntime.queryInterface(XLinkTargetSupplier.class,xDrawDoc); + XLinkTargetSupplier oLTS = UnoRuntime.queryInterface(XLinkTargetSupplier.class,xDrawDoc); XInterface oObj = oLTS.getLinks(); log.println( "creating a new environment for drawpage object" ); diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPage.java b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java index 78aa6ada3c8a..780c56ce4a17 100644 --- a/qadevOOo/tests/java/mod/_sd/SdDrawPage.java +++ b/qadevOOo/tests/java/mod/_sd/SdDrawPage.java @@ -150,11 +150,9 @@ public class SdDrawPage extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,oDPn); try { oObj = (XDrawPage) AnyConverter.toObject( new Type(XDrawPage.class),oDPi.getByIndex(0)); @@ -171,7 +169,7 @@ public class SdDrawPage extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) UnoRuntime.queryInterface + XShapes oShapes = UnoRuntime.queryInterface (XShapes.class,oObj); oShapes.add(SOF.createShape (xDrawDoc, 2000, 1500, 1000, 1000, "Line")); @@ -182,8 +180,7 @@ public class SdDrawPage extends TestCase { //get the XMasterPagesSupplier log.println("get XMasterPagesSupplier"); - XMasterPagesSupplier oMPS = (XMasterPagesSupplier) - UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc); + XMasterPagesSupplier oMPS = UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc); XDrawPages oGroup = oMPS.getMasterPages(); log.println( "creating a new environment for drawpage object" ); diff --git a/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java index 094b029ef527..b148ccbb5d5d 100644 --- a/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java +++ b/qadevOOo/tests/java/mod/_sd/SdDrawPagesAccess.java @@ -102,8 +102,7 @@ public class SdDrawPagesAccess extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpages" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); oDP.insertNewByIndex(2); diff --git a/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java b/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java index f846664fc241..e893f869680e 100644 --- a/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java +++ b/qadevOOo/tests/java/mod/_sd/SdGenericDrawPage.java @@ -139,10 +139,9 @@ public class SdGenericDrawPage extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) UnoRuntime.queryInterface + XIndexAccess oDPi = UnoRuntime.queryInterface (XIndexAccess.class,oDPn); try { oObj = (XDrawPage) AnyConverter.toObject( @@ -154,7 +153,7 @@ public class SdGenericDrawPage extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class,oObj); + oShapes = UnoRuntime.queryInterface(XShapes.class,oObj); oShapes.add(SOF.createShape (xDrawDoc, 2000, 1500, 1000, 1000, "Line")); oShapes.add(SOF.createShape diff --git a/qadevOOo/tests/java/mod/_sd/SdLayer.java b/qadevOOo/tests/java/mod/_sd/SdLayer.java index c264f265692a..19d919110276 100644 --- a/qadevOOo/tests/java/mod/_sd/SdLayer.java +++ b/qadevOOo/tests/java/mod/_sd/SdLayer.java @@ -98,13 +98,10 @@ public class SdLayer extends TestCase { // get the drawpage of drawing here log.println( "getting LayerManager" ); - XLayerSupplier oLS = (XLayerSupplier) - UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc); + XLayerSupplier oLS = UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc); XNameAccess oNA = oLS.getLayerManager(); - oLM = (XLayerManager) - UnoRuntime.queryInterface(XLayerManager.class, oNA); - XIndexAccess oIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,oLM); + oLM = UnoRuntime.queryInterface(XLayerManager.class, oNA); + XIndexAccess oIA = UnoRuntime.queryInterface(XIndexAccess.class,oLM); log.println( "getting LayerManager" ); try { oObj = (XLayer) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sd/SdLayerManager.java b/qadevOOo/tests/java/mod/_sd/SdLayerManager.java index c783e864eb0c..584435d70f1a 100644 --- a/qadevOOo/tests/java/mod/_sd/SdLayerManager.java +++ b/qadevOOo/tests/java/mod/_sd/SdLayerManager.java @@ -114,8 +114,7 @@ public class SdLayerManager extends TestCase { log.println( "creating a test environment" ); // create testobject here - XLayerSupplier oLS = (XLayerSupplier) - UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc); + XLayerSupplier oLS = UnoRuntime.queryInterface(XLayerSupplier.class, xDrawDoc); XInterface oObj = oLS.getLayerManager(); log.println( "creating a new environment for XLayerManager object" ); @@ -128,11 +127,9 @@ public class SdLayerManager extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,oDPn); XDrawPage oDP = null; try { @@ -149,8 +146,7 @@ public class SdLayerManager extends TestCase { throw new StatusException("Couldn't get by index", e); } - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDP); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDP); log.println( "adding Shapes as mod relation to environment" ); tEnv.addObjRelation("Shapes", oShapes); diff --git a/qadevOOo/tests/java/mod/_sd/SdMasterPage.java b/qadevOOo/tests/java/mod/_sd/SdMasterPage.java index 392f4d2c85a7..5d0fbcfa3020 100644 --- a/qadevOOo/tests/java/mod/_sd/SdMasterPage.java +++ b/qadevOOo/tests/java/mod/_sd/SdMasterPage.java @@ -132,11 +132,9 @@ public class SdMasterPage extends TestCase { // get the MasterPages here log.println( "getting MasterPages" ); - XMasterPagesSupplier oMPS = (XMasterPagesSupplier) - UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc); + XMasterPagesSupplier oMPS = UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDrawDoc); XDrawPages oMPn = oMPS.getMasterPages(); - XIndexAccess oMPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oMPn); + XIndexAccess oMPi = UnoRuntime.queryInterface(XIndexAccess.class, oMPn); log.println( "getting MasterPage" ); XInterface oObj = null; @@ -160,8 +158,7 @@ public class SdMasterPage extends TestCase { //put something on the masterpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oObj); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oObj); oShapes.add(SOF.createShape(xDrawDoc, 2000, 1500, 1000, 1000, "Line")); oShapes.add(SOF.createShape (xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse")); diff --git a/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java b/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java index 86f5555d93b9..71326f9cf9bd 100644 --- a/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java +++ b/qadevOOo/tests/java/mod/_sd/SdMasterPagesAccess.java @@ -95,8 +95,7 @@ public class SdMasterPagesAccess extends TestCase { // get the MasterPages here log.println( "getting MasterPages" ); - XMasterPagesSupplier oMPS = (XMasterPagesSupplier) - UnoRuntime.queryInterface( XMasterPagesSupplier.class, xDrawDoc); + XMasterPagesSupplier oMPS = UnoRuntime.queryInterface( XMasterPagesSupplier.class, xDrawDoc); XDrawPages oMP = oMPS.getMasterPages(); log.println( "insert MasterPages" ); oMP.insertNewByIndex(1); diff --git a/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java index 38876ab5614a..7020cff676d9 100644 --- a/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java +++ b/qadevOOo/tests/java/mod/_sd/SdPageLinkTargets.java @@ -99,15 +99,13 @@ public class SdPageLinkTargets extends TestCase { // create testobject here XDrawPage the_page = DrawTools.getDrawPage(xDrawDoc, 0); - XLinkTargetSupplier oLTS = (XLinkTargetSupplier) - UnoRuntime.queryInterface(XLinkTargetSupplier.class, the_page); + XLinkTargetSupplier oLTS = UnoRuntime.queryInterface(XLinkTargetSupplier.class, the_page); XInterface oObj = oLTS.getLinks(); SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class,the_page); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class,the_page); XShape oShape = SOF.createShape(xDrawDoc, 15000, 13500, 5000, 5000, "OLE2"); oShapes.add(oShape); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java index aff9edcb8bfc..881a2c17526d 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java @@ -88,10 +88,9 @@ public class SdUnoDrawView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -164,11 +163,9 @@ public class SdUnoDrawView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; try { @@ -187,8 +184,7 @@ public class SdUnoDrawView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xDrawDoc, 3000, 4500, 15000, 1000, "Ellipse"); XShape shape2 = SOF.createShape( @@ -200,15 +196,13 @@ public class SdUnoDrawView extends TestCase { oShapes.add(shape3); shortWait(); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XInterface oObj = aModel.getCurrentController(); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -233,8 +227,7 @@ public class SdUnoDrawView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -249,8 +242,7 @@ public class SdUnoDrawView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xDrawDoc); tEnv.addObjRelation("Modifiable",modify); @@ -258,10 +250,8 @@ public class SdUnoDrawView extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java index c788092f8a2d..bcf423f105ee 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java @@ -82,10 +82,9 @@ public class SdUnoOutlineView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -143,25 +142,20 @@ public class SdUnoOutlineView extends TestCase { throw new StatusException("Couldn't create document", e); } - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XInterface oObj = aModel.getCurrentController(); //Change to Outline view try { String aSlotID = "slot:27010"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -184,10 +178,9 @@ public class SdUnoOutlineView extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); oObj = aModel.getCurrentController(); @@ -208,8 +201,7 @@ public class SdUnoOutlineView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java index 6352a44c8d2f..80e1afefd65f 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java @@ -86,10 +86,9 @@ public class SdUnoPresView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -160,11 +159,9 @@ public class SdUnoPresView extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages the_pages = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,the_pages); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,the_pages); XDrawPage oDrawPage = null; XDrawPage secondDrawPage = null; @@ -190,27 +187,23 @@ public class SdUnoPresView extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - XShapes oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, oDrawPage); + XShapes oShapes = UnoRuntime.queryInterface(XShapes.class, oDrawPage); XShape shape1 = SOF.createShape( xImpressDoc, 5000, 3500, 7500, 5000, "Rectangle"); oShapes.add(shape1); - oShapes = (XShapes) - UnoRuntime.queryInterface(XShapes.class, secondDrawPage); + oShapes = UnoRuntime.queryInterface(XShapes.class, secondDrawPage); shape1 = SOF.createShape( xImpressDoc, 3000, 4500, 15000, 1000, "Ellipse"); oShapes.add(shape1); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XInterface oObj = aModel.getCurrentController(); - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); log.println( "creating a new environment for impress view object" ); @@ -225,10 +218,8 @@ public class SdUnoPresView extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 == null || indAc2 == null) return -1; if (indAc1.getCount() == indAc2.getCount()) { return 0; @@ -255,8 +246,7 @@ public class SdUnoPresView extends TestCase { XFrame the_frame = the_Desk.getCurrentFrame(); tEnv.addObjRelation("Frame", the_frame); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); //Adding ObjRelations for XController tEnv.addObjRelation("SecondModel", aModel); @@ -267,8 +257,7 @@ public class SdUnoPresView extends TestCase { log.println("Implementation Name: "+utils.getImplName(oObj)); - XModifiable modify = (XModifiable) - UnoRuntime.queryInterface(XModifiable.class,xImpressDoc); + XModifiable modify = UnoRuntime.queryInterface(XModifiable.class,xImpressDoc); tEnv.addObjRelation("Modifiable",modify); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java index ec319d443f5c..5c1e5697c47a 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java @@ -54,10 +54,9 @@ public class SdUnoSlideView extends TestCase { * @see com.sun.star.frame.Desktop */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) - UnoRuntime.queryInterface( - XDesktop.class, DesktopTools.createDesktop( - (XMultiServiceFactory)Param.getMSF()) ); + the_Desk = UnoRuntime.queryInterface( + XDesktop.class, DesktopTools.createDesktop( + (XMultiServiceFactory)Param.getMSF()) ); } /** @@ -118,19 +117,16 @@ public class SdUnoSlideView extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XInterface oObj = aModel.getCurrentController(); //Change to Slide view try { String aSlotID = "slot:27011"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, oObj ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -153,10 +149,9 @@ public class SdUnoSlideView extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel2 = (XModel) - UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); + XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); - XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface( + XWindow anotherWindow = UnoRuntime.queryInterface( XWindow.class,aModel2.getCurrentController()); oObj = aModel.getCurrentController(); diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java index 4d49cd86afbf..2beb29244e9d 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java +++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentation.java @@ -122,9 +122,8 @@ public class SdXCustomPresentation extends TestCase { log.println( "creating a test environment" ); log.println( "get presentation" ); - XCustomPresentationSupplier oPS = (XCustomPresentationSupplier) - UnoRuntime.queryInterface( - XCustomPresentationSupplier.class, xImpressDoc); + XCustomPresentationSupplier oPS = UnoRuntime.queryInterface( + XCustomPresentationSupplier.class, xImpressDoc); XInterface oObj = oPS.getCustomPresentations(); XSingleServiceFactory oSingleMSF = (XSingleServiceFactory) @@ -156,11 +155,9 @@ public class SdXCustomPresentation extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class, oDPn); XDrawPage oDrawPage = null; try { @@ -177,8 +174,7 @@ public class SdXCustomPresentation extends TestCase { throw new StatusException("Couldn't get by index", e); } - XIndexContainer aIContainer = (XIndexContainer) - UnoRuntime.queryInterface(XIndexContainer.class,oInstance); + XIndexContainer aIContainer = UnoRuntime.queryInterface(XIndexContainer.class,oInstance); try { aIContainer.insertByIndex(0, oDrawPage); diff --git a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java index b5bd2ec6ed9e..b0e10ade3ad5 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java +++ b/qadevOOo/tests/java/mod/_sd/SdXCustomPresentationAccess.java @@ -120,9 +120,8 @@ public class SdXCustomPresentationAccess extends TestCase { log.println( "creating a test environment" ); log.println( "get presentation" ); - XCustomPresentationSupplier oPS = (XCustomPresentationSupplier) - UnoRuntime.queryInterface( - XCustomPresentationSupplier.class, xImpressDoc); + XCustomPresentationSupplier oPS = UnoRuntime.queryInterface( + XCustomPresentationSupplier.class, xImpressDoc); XInterface oObj = oPS.getCustomPresentations(); diff --git a/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java index 1fc4ae4fafa2..1fe938760f40 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java +++ b/qadevOOo/tests/java/mod/_sd/SdXImpressDocument.java @@ -125,9 +125,9 @@ public class SdXImpressDocument extends TestCase { throw new StatusException("Couldn't create documents", e); } - XModel xModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xModel1 = UnoRuntime.queryInterface(XModel.class, xImpressDoc); - XModel xModel2 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel xModel2 = UnoRuntime.queryInterface(XModel.class, xImpressDoc2); XController cont1 = xModel1.getCurrentController(); @@ -136,7 +136,7 @@ public class SdXImpressDocument extends TestCase { cont1.getFrame().setName("cont1"); cont2.getFrame().setName("cont2"); - XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier sel = UnoRuntime.queryInterface( XSelectionSupplier.class, cont1); XShape aShape = SOF.createShape(xImpressDoc, 5000, 3500, 7500, 5000, diff --git a/qadevOOo/tests/java/mod/_sd/SdXPresentation.java b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java index d8f538b8dccb..a8f754690a59 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXPresentation.java +++ b/qadevOOo/tests/java/mod/_sd/SdXPresentation.java @@ -105,14 +105,12 @@ public class SdXPresentation extends TestCase { log.println( "creating a test environment" ); log.println( "get presentation" ); - XPresentationSupplier oPS = (XPresentationSupplier) - UnoRuntime.queryInterface(XPresentationSupplier.class, xImpressDoc); + XPresentationSupplier oPS = UnoRuntime.queryInterface(XPresentationSupplier.class, xImpressDoc); XInterface oObj = oPS.getPresentation(); log.println( "get custom presentation" ); - XCustomPresentationSupplier oCPS = (XCustomPresentationSupplier) - UnoRuntime.queryInterface( - XCustomPresentationSupplier.class, xImpressDoc); + XCustomPresentationSupplier oCPS = UnoRuntime.queryInterface( + XCustomPresentationSupplier.class, xImpressDoc); XNameContainer xCP = oCPS.getCustomPresentations(); XInterface oInstance = null; diff --git a/qadevOOo/tests/java/mod/_sd/SdXShape.java b/qadevOOo/tests/java/mod/_sd/SdXShape.java index 2822d1406e26..41c3b55b9ef7 100644 --- a/qadevOOo/tests/java/mod/_sd/SdXShape.java +++ b/qadevOOo/tests/java/mod/_sd/SdXShape.java @@ -124,11 +124,9 @@ public class SdXShape extends TestCase { // get the drawpage of drawing here log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class, oDPn); XDrawPage oDP = null; try { oDP = (XDrawPage) AnyConverter.toObject( @@ -146,7 +144,7 @@ public class SdXShape extends TestCase { //get a Shape log.println( "getting Shape" ); - XShapes oShapes = (XShapes) UnoRuntime.queryInterface + XShapes oShapes = UnoRuntime.queryInterface (XShapes.class, oDP); XInterface oObj = SOF.createShape (xDrawDoc, 5000, 3500, 7500, 5000, "Rectangle"); diff --git a/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java b/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java index 0520b3d13828..db5078d76dfc 100644 --- a/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java +++ b/qadevOOo/tests/java/mod/_sfx/DocumentTemplates.java @@ -70,7 +70,7 @@ public class DocumentTemplates extends TestCase { try { oObj = (XInterface)xMSF.createInstance ("com.sun.star.frame.DocumentTemplates"); - store = (XStorable) UnoRuntime.queryInterface + store = UnoRuntime.queryInterface (XStorable.class,xTextDoc); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java b/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java index de1c791fc35e..f3ec7a1cbe6a 100644 --- a/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java +++ b/qadevOOo/tests/java/mod/_sfx/StandaloneDocumentInfo.java @@ -108,8 +108,7 @@ public class StandaloneDocumentInfo extends TestCase { String Iname = util.utils.getImplName(oObj); log.println("Implementation Name: "+Iname); TestEnvironment tEnv = new TestEnvironment(oObj); - XStandaloneDocumentInfo the_info = (XStandaloneDocumentInfo) - UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oObj); + XStandaloneDocumentInfo the_info = UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oObj); try { the_info.loadFromURL(destUrl); } catch (com.sun.star.io.IOException e) { diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java index 77620c7e26e9..4b2645799f2f 100644 --- a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java @@ -105,8 +105,7 @@ public class SmEditAccessible extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xMathDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xMathDoc); AccessibilityTools at = new AccessibilityTools(); @@ -123,7 +122,7 @@ public class SmEditAccessible extends TestCase { tEnv.addObjRelation("Destroy", new Boolean(true)); - final XAccessibleContext con = (XAccessibleContext) UnoRuntime.queryInterface(XAccessibleContext.class, oObj); + final XAccessibleContext con = UnoRuntime.queryInterface(XAccessibleContext.class, oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){ public void fireEvent() { diff --git a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java index 1e2efc280db2..0b76f49b22f2 100644 --- a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java @@ -107,8 +107,7 @@ public class SmGraphicAccessible extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xMathDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xMathDoc); AccessibilityTools at = new AccessibilityTools(); @@ -121,8 +120,7 @@ public class SmGraphicAccessible extends TestCase { log.println("ImplementationName " + utils.getImplName(oObj)); - final XAccessibleComponent xAC = (XAccessibleComponent) - UnoRuntime.queryInterface(XAccessibleComponent.class, oObj); + final XAccessibleComponent xAC = UnoRuntime.queryInterface(XAccessibleComponent.class, oObj); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sm/XMLExporter.java b/qadevOOo/tests/java/mod/_sm/XMLExporter.java index 3ce0be7268d2..19258ba75eb0 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLExporter.java @@ -120,7 +120,7 @@ public class XMLExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Math.XMLExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xMathDoc); diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java index fc6a7b3a4be8..9c961854c6e4 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLMetaExporter.java @@ -121,13 +121,12 @@ public class XMLMetaExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Math.XMLMetaExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xMathDoc); // setting a new name and value for user info field - XDocumentInfoSupplier xDocInfoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xMathDoc) ; + XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xMathDoc) ; XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo() ; xDocInfo.setUserFieldName((short) 0, expName) ; xDocInfo.setUserFieldValue((short) 0, expValue) ; diff --git a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java index 5b9e7e17535b..ea7b67127b03 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLMetaImporter.java @@ -119,7 +119,7 @@ public class XMLMetaImporter extends TestCase { oObj = (XInterface)xMSF.createInstance( "com.sun.star.comp.Math.XMLMetaImporter"); - xDocInfoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface + xDocInfoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xMathDoc) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java index d18ae70f428a..4f96126fe95b 100644 --- a/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sm/XMLSettingsExporter.java @@ -121,7 +121,7 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Math.XMLSettingsExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xMathDoc); diff --git a/qadevOOo/tests/java/mod/_stm/DataInputStream.java b/qadevOOo/tests/java/mod/_stm/DataInputStream.java index 3affe2fd325a..a16475076e98 100644 --- a/qadevOOo/tests/java/mod/_stm/DataInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataInputStream.java @@ -96,8 +96,7 @@ public class DataInputStream extends TestCase { // creating and connecting DataOutputStream to the // DataInputStream created through the Pipe - XActiveDataSink xDataSink = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, oObj); + XActiveDataSink xDataSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj); XInterface oPipe = null; try { @@ -110,8 +109,7 @@ public class DataInputStream extends TestCase { XInputStream xPipeInput = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, oPipe); - XOutputStream xPipeOutput = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, oPipe); + XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe); XInterface oDataOutput = null; try { @@ -122,16 +120,14 @@ public class DataInputStream extends TestCase { throw new StatusException("Couldn't create instance", e); } - XDataOutputStream xDataOutput = (XDataOutputStream) - UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ; - XActiveDataSource xDataSource = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ; + XDataOutputStream xDataOutput = UnoRuntime.queryInterface(XDataOutputStream.class, oDataOutput) ; + XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oDataOutput) ; xDataSource.setOutputStream(xPipeOutput) ; xDataSink.setInputStream(xPipeInput) ; // all data types for writing to an XDataInputStream - ArrayList data = new ArrayList() ; + ArrayList<Object> data = new ArrayList<Object>(); data.add(new Boolean(true)) ; data.add(new Byte((byte)123)) ; data.add(new Character((char)1234)) ; diff --git a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java index df8007d06ab8..225aaa13a69a 100644 --- a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java @@ -96,16 +96,14 @@ public class DataOutputStream extends TestCase { oObj = (XInterface) oInterface; - final XOutputStream xPipeOutput = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, oPipe); + final XOutputStream xPipeOutput = UnoRuntime.queryInterface(XOutputStream.class, oPipe); - XActiveDataSource xDataSource = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, oObj); + XActiveDataSource xDataSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj); xDataSource.setOutputStream(xPipeOutput); // all data types for writing to an XDataInputStream - ArrayList data = new ArrayList() ; + ArrayList<Object> data = new ArrayList<Object>() ; data.add(new Boolean(true)) ; data.add(new Byte((byte)123)) ; data.add(new Character((char)1234)) ; @@ -158,9 +156,8 @@ public class DataOutputStream extends TestCase { return null; } - XActiveDataSink xDataSink = (XActiveDataSink) - UnoRuntime.queryInterface( - XActiveDataSink.class, xInStream); + XActiveDataSink xDataSink = UnoRuntime.queryInterface( + XActiveDataSink.class, xInStream); xDataSink.setInputStream(xPipeInput); return xInStream; diff --git a/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java index 373509761f28..85b00ddcdafc 100644 --- a/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/MarkableInputStream.java @@ -101,18 +101,15 @@ public class MarkableInputStream extends TestCase { // Creating construction : // MarkableOutputStream -> Pipe -> MarkableInputStream - XActiveDataSource xdSmo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, mostream); + XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); - XOutputStream PipeOut = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, aPipe); + XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe); XInputStream PipeIn = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, aPipe); xdSmo.setOutputStream(PipeOut); - XActiveDataSink xmSi = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, mistream); + XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); xmSi.setInputStream(PipeIn) ; diff --git a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java index eb9b398cf934..1ee7ddbc1b6b 100644 --- a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java @@ -112,25 +112,22 @@ public class MarkableOutputStream extends TestCase { // Creating construction : // MarkableOutputStream -> Pipe -> MarkableInputStream - XActiveDataSource xdSmo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, mostream); + XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); - final XOutputStream PipeOut = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class,aPipe); + final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); final XInputStream PipeIn = (XInputStream) UnoRuntime.queryInterface(XInputStream.class,aPipe); xdSmo.setOutputStream(PipeOut); - XActiveDataSink xmSi = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, mistream); + XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); xmSi.setInputStream(PipeIn) ; oObj = (XInterface) mostream; // all data types for writing to an XDataInputStream - ArrayList data = new ArrayList() ; + ArrayList<Object> data = new ArrayList<Object>() ; data.add(new Boolean(true)) ; data.add(new Byte((byte)123)) ; data.add(new Character((char)1234)) ; @@ -182,9 +179,8 @@ public class MarkableOutputStream extends TestCase { return null; } - XActiveDataSink xDataSink = (XActiveDataSink) - UnoRuntime.queryInterface( - XActiveDataSink.class, xInStream); + XActiveDataSink xDataSink = UnoRuntime.queryInterface( + XActiveDataSink.class, xInStream); xDataSink.setInputStream(PipeIn); return xInStream; diff --git a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java index d2a3925818b9..1ca8772b3a05 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java @@ -98,9 +98,8 @@ public class ObjectInputStream extends TestCase { try { Object o = xMSF.createInstance( "com.sun.star.registry.ImplementationRegistration"); - xir = (XImplementationRegistration) - UnoRuntime.queryInterface( - XImplementationRegistration.class, o); + xir = UnoRuntime.queryInterface( + XImplementationRegistration.class, o); } catch (com.sun.star.uno.Exception e) { @@ -202,35 +201,28 @@ public class ObjectInputStream extends TestCase { // Creating construction : // ObjectOutputStream -> MarkableOutputStream -> Pipe -> // -> MarkableInputStream -> ObjectInputStream - XActiveDataSource xdSo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, ostream); + XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream); - XActiveDataSource xdSmo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, mostream); + XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); - XOutputStream moStream = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, mostream); + XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream); - XOutputStream PipeOut = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, aPipe); + XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class, aPipe); XInputStream PipeIn = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, aPipe); xdSo.setOutputStream(moStream); xdSmo.setOutputStream(PipeOut); - XObjectInputStream iStream = (XObjectInputStream) - UnoRuntime.queryInterface(XObjectInputStream.class, istream); + XObjectInputStream iStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream); XObjectOutputStream oStream = null; - oStream = (XObjectOutputStream) - UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); + oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); - XActiveDataSink xmSi = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, mistream); + XActiveDataSink xmSi = UnoRuntime.queryInterface(XActiveDataSink.class, mistream); XInputStream xmIstream = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, mistream); - XActiveDataSink xdSi = (XActiveDataSink) UnoRuntime.queryInterface + XActiveDataSink xdSi = UnoRuntime.queryInterface (XActiveDataSink.class, istream); xdSi.setInputStream(xmIstream); xmSi.setInputStream(PipeIn); @@ -250,7 +242,7 @@ public class ObjectInputStream extends TestCase { // all data types for writing to an XDataInputStream - ArrayList data = new ArrayList() ; + ArrayList<Object> data = new ArrayList<Object>() ; data.add(new Boolean(true)) ; data.add(new Byte((byte)123)) ; data.add(new Character((char)1234)) ; diff --git a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java index bccf7540de6b..ca180e3868c4 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java @@ -95,9 +95,8 @@ public class ObjectOutputStream extends TestCase { try { Object o = xMSF.createInstance( "com.sun.star.registry.ImplementationRegistration"); - xir = (XImplementationRegistration) - UnoRuntime.queryInterface( - XImplementationRegistration.class, o); + xir = UnoRuntime.queryInterface( + XImplementationRegistration.class, o); } catch (com.sun.star.uno.Exception e) { System.err.println( @@ -194,36 +193,28 @@ public class ObjectOutputStream extends TestCase { } // creating the pipe where object has to be written to - XActiveDataSource xdSo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, ostream); + XActiveDataSource xdSo = UnoRuntime.queryInterface(XActiveDataSource.class, ostream); - XActiveDataSource xdSmo = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, mostream); + XActiveDataSource xdSmo = UnoRuntime.queryInterface(XActiveDataSource.class, mostream); - XOutputStream moStream = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class, mostream); + XOutputStream moStream = UnoRuntime.queryInterface(XOutputStream.class, mostream); - XActiveDataSink markIn = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, minstream); - XActiveDataSink inStream = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, istream); + XActiveDataSink markIn = UnoRuntime.queryInterface(XActiveDataSink.class, minstream); + XActiveDataSink inStream = UnoRuntime.queryInterface(XActiveDataSink.class, istream); XInputStream markInStream = (XInputStream) UnoRuntime.queryInterface(XInputStream.class, minstream); - final XOutputStream PipeOut = (XOutputStream) - UnoRuntime.queryInterface(XOutputStream.class,aPipe); + final XOutputStream PipeOut = UnoRuntime.queryInterface(XOutputStream.class,aPipe); final XInputStream PipeIn = (XInputStream) UnoRuntime.queryInterface(XInputStream.class,aPipe); markIn.setInputStream(PipeIn); inStream.setInputStream(markInStream); - XObjectInputStream objInputStream = (XObjectInputStream) - UnoRuntime.queryInterface(XObjectInputStream.class, istream); + XObjectInputStream objInputStream = UnoRuntime.queryInterface(XObjectInputStream.class, istream); xdSo.setOutputStream(moStream); xdSmo.setOutputStream(PipeOut); - oStream = (XObjectOutputStream) - UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); + oStream = UnoRuntime.queryInterface(XObjectOutputStream.class, ostream); // creating Persistent object which has to be written XPersistObject xPersObj = null ; @@ -240,7 +231,7 @@ public class ObjectOutputStream extends TestCase { oObj = oStream; // all data types for writing to an XDataInputStream - ArrayList data = new ArrayList() ; + ArrayList<Object> data = new ArrayList<Object>() ; data.add(new Boolean(true)) ; data.add(new Byte((byte)123)) ; data.add(new Character((char)1234)) ; @@ -295,9 +286,8 @@ public class ObjectOutputStream extends TestCase { return null; } - XActiveDataSink xDataSink = (XActiveDataSink) - UnoRuntime.queryInterface( - XActiveDataSink.class, xInStream); + XActiveDataSink xDataSink = UnoRuntime.queryInterface( + XActiveDataSink.class, xInStream); xDataSink.setInputStream(PipeIn); return xInStream; diff --git a/qadevOOo/tests/java/mod/_stm/Pump.java b/qadevOOo/tests/java/mod/_stm/Pump.java index e486abf511e5..4dce2e930073 100644 --- a/qadevOOo/tests/java/mod/_stm/Pump.java +++ b/qadevOOo/tests/java/mod/_stm/Pump.java @@ -86,10 +86,8 @@ public class Pump extends TestCase { XInterface oObj = (XInterface) oInterface; // setting up input and output streams for pump - XActiveDataSink xSink = (XActiveDataSink) - UnoRuntime.queryInterface(XActiveDataSink.class, oObj); - XActiveDataSource xSource = (XActiveDataSource) - UnoRuntime.queryInterface(XActiveDataSource.class, oObj); + XActiveDataSink xSink = UnoRuntime.queryInterface(XActiveDataSink.class, oObj); + XActiveDataSource xSource = UnoRuntime.queryInterface(XActiveDataSource.class, oObj); XInputStream xInput = new MyInput(); XOutputStream xOutput = new MyOutput(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java index 3c94af99e26a..200336ec6634 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java @@ -53,7 +53,7 @@ public class AccessibleBrowseBox extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface( + the_Desk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory) Param.getMSF())); } @@ -102,12 +102,12 @@ public class AccessibleBrowseBox extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(XDispatchProvider.class, + XDispatchProvider aProv = UnoRuntime.queryInterface(XDispatchProvider.class, secondController); XDispatch getting = null; @@ -133,7 +133,7 @@ public class AccessibleBrowseBox extends TestCase { XInterface oObj = null; - final XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface( + final XSelectionSupplier xSelect = UnoRuntime.queryInterface( XSelectionSupplier.class, the_frame2.getController()); PropertyValue[] params = new PropertyValue[]{new PropertyValue(), new PropertyValue(), new PropertyValue()}; diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java index 7ec505f22e9b..858727a0699c 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java @@ -73,7 +73,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -132,12 +132,12 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -183,7 +183,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { XController xCont = the_frame2.getController(); - XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier xSelect = UnoRuntime.queryInterface( XSelectionSupplier.class, xCont); try { @@ -209,7 +209,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { shortWait(); - XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); final Point point = accComp.getLocationOnScreen(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java index 4b9e816459c1..b0e0401a2331 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java @@ -71,7 +71,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface( + the_Desk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF())); } @@ -132,12 +132,11 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { shortWait(); - XModel aModel1 = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider)UnoRuntime. + XDispatchProvider aProv = UnoRuntime. queryInterface(XDispatchProvider.class, secondController); XDispatch getting = null; @@ -163,9 +162,8 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { XInterface oObj = null; - final XInitialization xInit = (XInitialization) - UnoRuntime.queryInterface( - XInitialization.class, the_frame2.getController()); + final XInitialization xInit = UnoRuntime.queryInterface( + XInitialization.class, the_frame2.getController()); PropertyValue[] params = new PropertyValue[3]; PropertyValue param1 = new PropertyValue(); @@ -183,7 +181,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { XController xCont = the_frame2.getController(); - XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier xSelect = UnoRuntime.queryInterface( XSelectionSupplier.class, xCont); try { diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java index 74d83800538e..f07bf5dd3191 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java @@ -69,7 +69,7 @@ public class AccessibleBrowseBoxTable extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory)Param.getMSF())); } @@ -132,12 +132,12 @@ public class AccessibleBrowseBoxTable extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider)UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -181,7 +181,7 @@ public class AccessibleBrowseBoxTable extends TestCase { param3.Value = "biblio"; params[2] = param3; - final XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface( + final XSelectionSupplier xSelect = UnoRuntime.queryInterface( XSelectionSupplier.class, xCont); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java index 80670d06c986..754f74884502 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java @@ -70,7 +70,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface( + the_Desk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF()) ); } @@ -129,14 +129,12 @@ public class AccessibleBrowseBoxTableCell extends TestCase { shortWait(); - XModel aModel1 = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class,secondController); + XDispatchProvider aProv = UnoRuntime.queryInterface(XDispatchProvider.class,secondController); XDispatch getting = null; @@ -161,9 +159,8 @@ public class AccessibleBrowseBoxTableCell extends TestCase { XInterface oObj = null; - final XInitialization xInit = (XInitialization) - UnoRuntime.queryInterface( - XInitialization.class, the_frame2.getController()); + final XInitialization xInit = UnoRuntime.queryInterface( + XInitialization.class, the_frame2.getController()); Object[] params = new Object[3]; PropertyValue param1 = new PropertyValue(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java index a64515cfe7c7..6c21e77c57f3 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java @@ -80,7 +80,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -152,12 +152,12 @@ public class AccessibleIconChoiceCtrl extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -166,7 +166,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { try { XInterface transf = (XInterface) ( (XMultiServiceFactory) tParam.getMSF()) .createInstance("com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -198,14 +198,14 @@ public class AccessibleIconChoiceCtrl extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -216,7 +216,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { AccessibleRole.PUSH_BUTTON, "Close"); - accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface( + accCloseButton = UnoRuntime.queryInterface( XAccessibleAction.class, closeButton); log.println("ImplementationName: " + util.utils.getImplName(oObj)); @@ -246,7 +246,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { tEnv.addObjRelation("expectedStateNames", expectedStateNames); tEnv.addObjRelation("expectedStates", expectedStates); - final XAccessibleSelection selection = (XAccessibleSelection) (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection selection = (XAccessibleSelection) UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java index bacb3d428dd8..9005cd51c430 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java @@ -80,7 +80,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface( + the_Desk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF())); } @@ -156,12 +156,11 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { shortWait(); - XModel aModel1 = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider)UnoRuntime. + XDispatchProvider aProv = UnoRuntime. queryInterface(XDispatchProvider.class, secondController); XURLTransformer urlTransf = null; @@ -169,7 +168,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { try { XInterface transf = (XInterface)((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer)UnoRuntime.queryInterface + urlTransf = UnoRuntime.queryInterface (XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -198,15 +197,13 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { throw new StatusException("Couldn't get toolkit", e ); } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -216,8 +213,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { XAccessibleContext closeButton = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Close"); - accCloseButton = (XAccessibleAction) - UnoRuntime.queryInterface(XAccessibleAction.class, closeButton); + accCloseButton = UnoRuntime.queryInterface(XAccessibleAction.class, closeButton); log.println("ImplementationName: "+ util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java index 2a92cc19b7b1..af8a80c73e50 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java @@ -86,7 +86,7 @@ public class AccessibleTabBar extends TestCase { try { log.println("creating a calc document"); - xDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, + xDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc( null)); } catch (com.sun.star.uno.Exception e) { @@ -139,7 +139,7 @@ public class AccessibleTabBar extends TestCase { } protected void closeDoc(XComponent xDoc) { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDoc); try { diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java index 3833f0ae2feb..659ce9b2522d 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java @@ -110,7 +110,7 @@ public class AccessibleTabBarPage extends TestCase { try { log.println( "creating a calc document" ); - xDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null));// SOF.createDrawDoc(null); + xDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null));// SOF.createDrawDoc(null); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED e.printStackTrace( log ); @@ -131,22 +131,20 @@ public class AccessibleTabBarPage extends TestCase { } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Sheet1"); XAccessibleContext acc = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Sheet2"); - XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, acc); final Point point = accComp.getLocationOnScreen(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java index 65fd70aad94b..c6354443b7c8 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java @@ -132,14 +132,14 @@ public class AccessibleTabBarPageList extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -157,10 +157,9 @@ public class AccessibleTabBarPageList extends TestCase { tEnv.addObjRelation("XAccessibleSelection.OneAlwaysSelected", new Boolean(true)); - XLayerSupplier oLS = (XLayerSupplier) - UnoRuntime.queryInterface(XLayerSupplier.class, xDoc); + XLayerSupplier oLS = UnoRuntime.queryInterface(XLayerSupplier.class, xDoc); XInterface oLM = oLS.getLayerManager(); - final XLayerManager xLM = (XLayerManager) UnoRuntime.queryInterface(XLayerManager.class, oLM); + final XLayerManager xLM = UnoRuntime.queryInterface(XLayerManager.class, oLM); tEnv.addObjRelation("EventProducer", @@ -186,7 +185,7 @@ public class AccessibleTabBarPageList extends TestCase { } protected void closeDoc() { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDoc); try { diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java index 573afe6214ec..9134ed856ef1 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java @@ -76,7 +76,7 @@ public class AccessibleTreeListBox extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface( + the_Desk = UnoRuntime.queryInterface( XDesktop.class, DesktopTools.createDesktop((XMultiServiceFactory)Param.getMSF())); } @@ -138,12 +138,11 @@ public class AccessibleTreeListBox extends TestCase { shortWait(); - XModel aModel1 = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider)UnoRuntime. + XDispatchProvider aProv = UnoRuntime. queryInterface(XDispatchProvider.class, secondController); XDispatch getting = null; @@ -181,9 +180,8 @@ public class AccessibleTreeListBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XInitialization xInit = (XInitialization) - UnoRuntime.queryInterface( - XInitialization.class, the_frame2.getController()); + final XInitialization xInit = UnoRuntime.queryInterface( + XInitialization.class, the_frame2.getController()); Object[] params = new Object[3]; PropertyValue param1 = new PropertyValue(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java index 1b8d7c836283..a83aa2689c30 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java @@ -85,7 +85,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -156,12 +156,12 @@ public class AccessibleTreeListBoxEntry extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -190,7 +190,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { XInterface oObj = null; - XInitialization xInit = (XInitialization) UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, the_frame2.getController()); @@ -212,7 +212,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { XController xCont = the_frame2.getController(); - XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier xSelect = UnoRuntime.queryInterface( XSelectionSupplier.class, xCont); try { @@ -272,7 +272,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { } protected void closeDoc() { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); try { diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java index b6a3dc2bea53..acae9da9a4fc 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java @@ -52,8 +52,7 @@ public class AccessibleControlShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createDrawDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java index 6a714cd8413c..cb6267576f54 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java @@ -61,8 +61,7 @@ public class AccessibleEditableTextPara extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc); AccessibilityTools at = new AccessibilityTools(); @@ -74,7 +73,7 @@ public class AccessibleEditableTextPara extends TestCase { XAccessibleContext InputLine = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME,"Input line"); try { oObj = InputLine.getAccessibleChild(0); - XAccessibleEditableText et = (XAccessibleEditableText) UnoRuntime.queryInterface(XAccessibleEditableText.class, oObj); + XAccessibleEditableText et = UnoRuntime.queryInterface(XAccessibleEditableText.class, oObj); et.setText("AccessibleEditablePara"); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { @@ -83,8 +82,7 @@ public class AccessibleEditableTextPara extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleEditableText edText = (XAccessibleEditableText) - UnoRuntime.queryInterface(XAccessibleEditableText.class,oObj) ; + final XAccessibleEditableText edText = UnoRuntime.queryInterface(XAccessibleEditableText.class,oObj) ; tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { @@ -130,7 +128,7 @@ public class AccessibleEditableTextPara extends TestCase { try { log.println("creating a spreadsheetdocument"); - xSpreadsheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null)); + xSpreadsheetDoc = UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null)); shortWait(); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java index e04d46e1aa73..b149734aaba0 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java @@ -52,8 +52,7 @@ public class AccessibleGraphicShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createDrawDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java index c98c0e2a4f17..6ccca61e0087 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java @@ -53,8 +53,7 @@ public class AccessibleOLEShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createDrawDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java index 08df0c16f20f..c84cebb013a9 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java @@ -52,8 +52,7 @@ public class AccessiblePageShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createDrawDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java index b1462febe345..43c9df187313 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java @@ -53,8 +53,7 @@ public class AccessiblePresentationGraphicShape extends TestCase { try { log.println( "creating a drawdoc" ); xDoc = SOF.createImpressDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -81,10 +80,9 @@ public class AccessiblePresentationGraphicShape extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); - XMultiServiceFactory docMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDoc); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDoc); try { - oShape = (XShape) UnoRuntime.queryInterface(XShape.class, + oShape = UnoRuntime.queryInterface(XShape.class, docMSF.createInstance ("com.sun.star.presentation.GraphicObjectShape")); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java index 7daf19f471b8..3e9773585f19 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java @@ -53,8 +53,7 @@ public class AccessiblePresentationOLEShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createImpressDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -81,10 +80,9 @@ public class AccessiblePresentationOLEShape extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); - XMultiServiceFactory docMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc); try { - oShape = (XShape) UnoRuntime.queryInterface(XShape.class, + oShape = UnoRuntime.queryInterface(XShape.class, docMSF.createInstance("com.sun.star.presentation.OLE2Shape")); } catch (com.sun.star.uno.Exception e) { throw new StatusException("couldn't create component", e); diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java index 79f62ffd5303..42beb8b234a7 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java @@ -53,8 +53,7 @@ public class AccessiblePresentationShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createImpressDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED @@ -81,10 +80,9 @@ public class AccessiblePresentationShape extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); - XMultiServiceFactory docMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc); try { - oShape = (XShape) UnoRuntime.queryInterface(XShape.class, + oShape = UnoRuntime.queryInterface(XShape.class, docMSF.createInstance ("com.sun.star.presentation.HandoutShape")); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java index 403908a84592..683a1bb5a3bc 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java @@ -52,8 +52,7 @@ public class AccessibleShape extends TestCase { try { log.println( "creating a drawdoc" ); xDrawDoc = SOF.createDrawDoc(null); - aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); } catch ( com.sun.star.uno.Exception e ) { // Some exception occures.FAILED diff --git a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java index d42619ac225c..bbabd04c83e9 100644 --- a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java +++ b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java @@ -149,10 +149,10 @@ public class GraphicExporter extends TestCase { oShapeProps.setPropertyValue("GraphicURL", util.utils.getFullTestURL( "space-metal.jpg")); - xComp = (XComponent) UnoRuntime.queryInterface(XComponent.class, + xComp = UnoRuntime.queryInterface(XComponent.class, oShape); - XExporter xEx = (XExporter) UnoRuntime.queryInterface( + XExporter xEx = UnoRuntime.queryInterface( XExporter.class, (XInterface) go); xEx.setSourceDocument(xComp); } catch (com.sun.star.lang.WrappedTargetException e) { @@ -179,7 +179,7 @@ public class GraphicExporter extends TestCase { try { Object oFAcc = ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.ucb.SimpleFileAccess"); - fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface( + fAcc = UnoRuntime.queryInterface( XSimpleFileAccess.class, oFAcc); if (fAcc.exists(aURL.Complete)) { diff --git a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java index 25f4131b4876..ba2b953cbe23 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java +++ b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java @@ -142,7 +142,7 @@ public class SvxDrawPage extends TestCase { XShape oShape = null; XDrawPages oDP = null; - XComponent xComp = (XComponent) UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xDoc); @@ -153,7 +153,7 @@ public class SvxDrawPage extends TestCase { try { log.println("getting Drawpages"); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) UnoRuntime.queryInterface( + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface( XDrawPagesSupplier.class, xDoc); oDP = (XDrawPages) oDPS.getDrawPages(); oDP.insertNewByIndex(1); @@ -191,7 +191,7 @@ public class SvxDrawPage extends TestCase { //adding a controlButton to have a Form FormTools.insertControlShape( - (XComponent) UnoRuntime.queryInterface(XComponent.class, xDoc), + UnoRuntime.queryInterface(XComponent.class, xDoc), 3000, 4500, 15000, 1000, "CommandButton"); // relation for XShapes interface diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java index 9e60e58e6c0f..cc70da81de69 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java +++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java @@ -76,8 +76,7 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = aModel.getCurrentController(); @@ -111,11 +110,9 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ //Opening ImageMapDialog try { String aSlotID = "slot:10371"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, xController ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -140,14 +137,12 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ throw new StatusException("Couldn't get toolkit", e ); } - XExtendedToolkit tk = (XExtendedToolkit) - UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,oObj); AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) - UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -160,8 +155,7 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ TestEnvironment tEnv = new TestEnvironment(oObj); //selecting the inserted shape - final XSelectionSupplier SelSupp = (XSelectionSupplier) - UnoRuntime.queryInterface(XSelectionSupplier.class,xController); + final XSelectionSupplier SelSupp = UnoRuntime.queryInterface(XSelectionSupplier.class,xController); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { @@ -187,19 +181,16 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ */ protected void cleanup( TestParameters Param, PrintWriter log) { - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = aModel.getCurrentController(); //Closing ImageMapDialog try { String aSlotID = "slot:10371"; - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface( XDispatchProvider.class, xController ); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController ); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java index efcf61e63611..716bbf97290c 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java +++ b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java @@ -226,8 +226,7 @@ public class SvxGraphicObject extends TestCase { tEnv.addObjRelation("Bitmap2",aBitmap); try { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc); imap = oDocMSF.createInstance ( "com.sun.star.image.ImageMapRectangleObject" ); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java index 5981efc85727..d2d09ca20d66 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java @@ -106,7 +106,7 @@ public class SvxShapeCollection extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); Object col = ((XMultiServiceFactory)tParam.getMSF()).createInstance ("com.sun.star.drawing.ShapeCollection"); - XShapes shapes = (XShapes) UnoRuntime.queryInterface + XShapes shapes = UnoRuntime.queryInterface (XShapes.class,col); oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse"); diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java index aef1688525f8..4ce666cf608e 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java @@ -128,12 +128,11 @@ public class SvxShapeConnector extends TestCase { // first we write what we are intend to do to log file log.println( "creating a test environment" ); try { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc); Object oInt = oDocMSF.createInstance ( "com.sun.star.drawing.ConnectorShape" ); - oShape = (XShape)UnoRuntime.queryInterface( XShape.class, oInt ); + oShape = UnoRuntime.queryInterface( XShape.class, oInt ); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java index c880e47671fb..d0902ae695ad 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java @@ -104,11 +104,9 @@ public class SvxShapeGroup extends TestCase { // get the drawpage of drawing here try { log.println( "getting Drawpage" ); - XDrawPagesSupplier oDPS = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); + XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc); XDrawPages oDPn = oDPS.getDrawPages(); - XIndexAccess oDPi = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,oDPn); + XIndexAccess oDPi = UnoRuntime.queryInterface(XIndexAccess.class,oDPn); oObj = (XDrawPage) AnyConverter.toObject( new Type(XDrawPage.class),oDPi.getByIndex(0)); } catch ( Exception e ) { @@ -125,7 +123,7 @@ public class SvxShapeGroup extends TestCase { //put something on the drawpage log.println( "inserting some Shapes" ); - oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class,oObj); + oShapes = UnoRuntime.queryInterface(XShapes.class,oObj); XShape Shape1 = SOF.createShape(xDrawDoc, 3000,4500,15000,1000,"Ellipse"); oShapes.add(SOF.createShape(xDrawDoc, @@ -155,7 +153,7 @@ public class SvxShapeGroup extends TestCase { //get the XShapeGrouper try{ log.println("get XShapeGroup"); - XShapeGrouper oSG = (XShapeGrouper)UnoRuntime.queryInterface + XShapeGrouper oSG = UnoRuntime.queryInterface (XShapeGrouper.class, oObj); oObj = oSG.group(oShapes); } catch ( Exception e) { diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java index a27baec2827e..7dd897328c8b 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java @@ -182,11 +182,10 @@ public class SvxShapePolyPolygon extends TestCase { // adding some shapes for testing. //SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); //oShape = SOF.createShape(xDrawDoc,6000,6000,5000,5000,"PolyPolygon"); - XMultiServiceFactory xMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ; + XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ; XInterface oInst = (XInterface) xMSF.createInstance ("com.sun.star.drawing.PolyPolygonShape") ; - oShape = (XShape) UnoRuntime.queryInterface + oShape = UnoRuntime.queryInterface (XShape.class, oInst) ; oShape.setSize(new Size(0,0)) ; diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java index ac21b8302220..abc012ae6477 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java +++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java @@ -184,12 +184,11 @@ public class SvxShapePolyPolygonBezier extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF()); - XMultiServiceFactory xMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ; + XMultiServiceFactory xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ; XInterface oInst = (XInterface) xMSF.createInstance ("com.sun.star.drawing.ClosedBezierShape") ; - oShape = (XShape) UnoRuntime.queryInterface + oShape = UnoRuntime.queryInterface (XShape.class, oInst) ; Point[] points = new Point[2]; diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java index 43a115834d6a..5da9c7679330 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java @@ -45,7 +45,7 @@ public class SvxUnoNumberingRules extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { - XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory docMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc); XInterface oObj = null; @@ -65,7 +65,7 @@ public class SvxUnoNumberingRules extends TestCase { Object NewRules=null; try{ - XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oObj); + XIndexAccess xIA = UnoRuntime.queryInterface(XIndexAccess.class, oObj); NewRules = xIA.getByIndex(2); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { log.println("Couldn't get new Rules for XIndexReplace"); diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoText.java b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java index 18ac712cf720..6b1245952244 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoText.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java @@ -115,7 +115,7 @@ public class SvxUnoText extends TestCase { (xDrawDoc,5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); - XSimpleText text = (XSimpleText) UnoRuntime.queryInterface + XSimpleText text = UnoRuntime.queryInterface (XSimpleText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; @@ -152,7 +152,7 @@ public class SvxUnoText extends TestCase { tEnv.addObjRelation("XTextRange", oObj); // adding relation for XTextRangeComapre - tEnv.addObjRelation("TEXT", (XText) UnoRuntime.queryInterface(XText.class, oShape)) ; + tEnv.addObjRelation("TEXT", UnoRuntime.queryInterface(XText.class, oShape)) ; return tEnv; } // finish method getTestEnvironment diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java index f87ee5d31f36..3a63d7af185a 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java @@ -105,7 +105,7 @@ public class SvxUnoTextContent extends TestCase { 5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; - XSimpleText text = (XSimpleText) UnoRuntime.queryInterface + XSimpleText text = UnoRuntime.queryInterface (XSimpleText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; @@ -120,7 +120,7 @@ public class SvxUnoTextContent extends TestCase { text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false) ; - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, text) ; oObj = (XInterface) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java index d5898c53caec..f44ef7206b3d 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java @@ -105,7 +105,7 @@ public class SvxUnoTextContentEnum extends TestCase { (xDrawDoc,5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; - XSimpleText text = (XSimpleText) UnoRuntime.queryInterface + XSimpleText text = UnoRuntime.queryInterface (XSimpleText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; @@ -120,7 +120,7 @@ public class SvxUnoTextContentEnum extends TestCase { text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false) ; - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, text) ; oObj = xEA.createEnumeration() ; diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java index 3712fb9b5772..dfcc285a1213 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java @@ -103,7 +103,7 @@ public class SvxUnoTextCursor extends TestCase { (xDrawDoc,5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; - XText text = (XText) UnoRuntime.queryInterface(XText.class, oShape) ; + XText text = UnoRuntime.queryInterface(XText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java index f17b70980c63..2007455fc594 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java @@ -123,14 +123,12 @@ public class SvxUnoTextField extends TestCase { // create testobject here try { - XText the_Text = (XText) UnoRuntime.queryInterface(XText.class,oShape); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc ); + XText the_Text = UnoRuntime.queryInterface(XText.class,oShape); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc ); the_Cursor = the_Text.createTextCursor(); oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextField.DateTime" ); - XTextContent the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + XTextContent the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); the_Text.insertTextContent(the_Cursor,the_Field,false); diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java index 7d11a2843489..dc566e449ce6 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java @@ -105,7 +105,7 @@ public class SvxUnoTextRange extends TestCase { (xDrawDoc,5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; - XSimpleText text = (XSimpleText) UnoRuntime.queryInterface + XSimpleText text = UnoRuntime.queryInterface (XSimpleText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; @@ -120,13 +120,13 @@ public class SvxUnoTextRange extends TestCase { text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false) ; - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, text) ; XInterface oTextContent = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xEA.createEnumeration().nextElement()); - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, oTextContent) ; oObj = (XInterface) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java index e58e3ca6a358..681ba4988d41 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java +++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java @@ -105,7 +105,7 @@ public class SvxUnoTextRangeEnumeration extends TestCase { (xDrawDoc,5000,3500,7500,5000,"Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ; - XSimpleText text = (XSimpleText) UnoRuntime.queryInterface + XSimpleText text = UnoRuntime.queryInterface (XSimpleText.class, oShape) ; XTextCursor cursor = text.createTextCursor() ; @@ -120,13 +120,13 @@ public class SvxUnoTextRangeEnumeration extends TestCase { text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false) ; - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, text) ; XInterface oTextContent = (XInterface) AnyConverter.toObject( new Type(XInterface.class),xEA.createEnumeration().nextElement()); - xEA = (XEnumerationAccess) UnoRuntime.queryInterface + xEA = UnoRuntime.queryInterface (XEnumerationAccess.class, oTextContent) ; oObj = xEA.createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java index e0eb2a51654f..8a72e83f4680 100644 --- a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java +++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java @@ -100,16 +100,13 @@ public class CharacterStyle extends TestCase { try { log.println("getting style"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - XIndexAccess oSFsIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSF); + XIndexAccess oSFsIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF); oSFNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class,oSFsIA.getByIndex(0)); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); oStyle = (XStyle) UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(0)); } catch ( com.sun.star.lang.WrappedTargetException e ) { @@ -124,8 +121,7 @@ public class CharacterStyle extends TestCase { try { log.print("Creating a user-defined style... "); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.CharacterStyle"); oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); diff --git a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java index 686f4e598311..e9bc64e1ab2b 100644 --- a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java +++ b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java @@ -89,14 +89,12 @@ public class ConditionalParagraphStyle extends TestCase { try { log.println("getting style"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); oSFNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("ParagraphStyles")); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); oStyle = (XStyle) UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(1)); } catch ( com.sun.star.lang.WrappedTargetException e ) { @@ -115,8 +113,7 @@ public class ConditionalParagraphStyle extends TestCase { try { log.print("Creating a user-defined style... "); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.ConditionalParagraphStyle"); oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); diff --git a/qadevOOo/tests/java/mod/_sw/PageStyle.java b/qadevOOo/tests/java/mod/_sw/PageStyle.java index 8751a28cb9ba..0f7564035a5e 100644 --- a/qadevOOo/tests/java/mod/_sw/PageStyle.java +++ b/qadevOOo/tests/java/mod/_sw/PageStyle.java @@ -82,14 +82,12 @@ public class PageStyle extends TestCase { try { log.println("getting style"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); oSFNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("PageStyles")); // get the page style - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); oStyle = (XStyle) UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(0)); log.println("Chosen pool style: "+oStyle.getName()); @@ -110,8 +108,7 @@ public class PageStyle extends TestCase { try { log.print("Creating a user-defined style... "); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.PageStyle"); // oMSF.createInstanceWithArguments("com.sun.star.style.PageStyle",new Object[]{oStyle}); diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java index 0dc7c858b5cd..c0d95a6163be 100644 --- a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java +++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java @@ -82,14 +82,12 @@ public class ParagraphStyle extends TestCase { try { log.println("getting style"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); oSFNA = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("ParagraphStyles")); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); String[] els = oSFNA.getElementNames(); oStyle = (XStyle) UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(1)); @@ -109,8 +107,7 @@ public class ParagraphStyle extends TestCase { try { log.print("Creating a user-defined style... "); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.ParagraphStyle"); oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java index b4107e65da88..4c4a63104286 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java @@ -93,16 +93,13 @@ public class SwAccessibleDocumentPageView extends TestCase { XController xController = xTextDoc.getCurrentController(); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ( (XMultiServiceFactory) Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java index b83497c564f5..dfdb74e55711 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentView.java @@ -95,8 +95,7 @@ public class SwAccessibleDocumentView extends TestCase { throw new StatusException( "Couldn't insert lines", e ); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -113,7 +112,7 @@ public class SwAccessibleDocumentView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR); - final XAccessibleValue xAccVal = (XAccessibleValue) UnoRuntime.queryInterface + final XAccessibleValue xAccVal = UnoRuntime.queryInterface (XAccessibleValue.class, SearchedContext) ; tEnv.addObjRelation("EventProducer", diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java index e16e1346f2ea..007f6a3171e8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleEndnoteView.java @@ -66,8 +66,7 @@ public class SwAccessibleEndnoteView extends TestCase { XInterface oEndnote = null; log.println( "Creating a test environment" ); - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a endnote"); try { oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class, @@ -81,8 +80,7 @@ public class SwAccessibleEndnoteView extends TestCase { XTextCursor oCursor = oText.createTextCursor(); log.println("inserting the footnote into text document"); - XTextContent xTC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oEndnote); + XTextContent xTC = UnoRuntime.queryInterface(XTextContent.class, oEndnote); try { oText.insertTextContent(oCursor, xTC, false); } catch (com.sun.star.lang.IllegalArgumentException e) { @@ -91,9 +89,8 @@ public class SwAccessibleEndnoteView extends TestCase { } XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); XPropertySet xPropSet = xViewSetSup.getViewSettings(); try { @@ -114,8 +111,7 @@ public class SwAccessibleEndnoteView extends TestCase { throw new StatusException("Couldn't set propertyValue...", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java index 1bc425afb69c..95ecd52424e5 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java @@ -77,8 +77,7 @@ public class SwAccessibleFooterView extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); // obtains style 'Standard' from style family 'PageStyles' @@ -109,9 +108,8 @@ public class SwAccessibleFooterView extends TestCase { //change zoom value to 10% //footer should be in the vissible area of the document XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); XPropertySet xPropSet = xViewSetSup.getViewSettings(); xPropSet.setPropertyValue("ZoomValue", new Short("20")); } catch ( com.sun.star.lang.WrappedTargetException e ) { @@ -128,8 +126,7 @@ public class SwAccessibleFooterView extends TestCase { throw new StatusException("Couldn't set propertyValue...", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java index b7e08e4241d9..757a4c7aac1b 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleFootnoteView.java @@ -67,12 +67,11 @@ public class SwAccessibleFootnoteView extends TestCase { log.println( "Creating a test environment" ); // get a soffice factory object - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a footnote"); try { - oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class, + oFootnote = UnoRuntime.queryInterface(XFootnote.class, msf.createInstance("com.sun.star.text.Footnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -91,9 +90,8 @@ public class SwAccessibleFootnoteView extends TestCase { } XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); XPropertySet xPropSet = xViewSetSup.getViewSettings(); try { @@ -114,8 +112,7 @@ public class SwAccessibleFootnoteView extends TestCase { throw new StatusException("Couldn't set propertyValue...", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java index 3727505703d3..544e27b1279c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java @@ -75,8 +75,7 @@ public class SwAccessibleHeaderView extends TestCase { XNameAccess PageStyles = null; XStyle StdStyle = null; - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); // obtains style 'Standatd' from style family 'PageStyles' @@ -117,8 +116,7 @@ public class SwAccessibleHeaderView extends TestCase { throw new StatusException("Couldn't set propertyValue...", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java index d4cb6e768d25..8c183b6d41ec 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java @@ -103,15 +103,13 @@ public class SwAccessiblePageView extends TestCase { } // Enumeration - XEnumerationAccess oEnumA = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, oText ); + XEnumerationAccess oEnumA = UnoRuntime.queryInterface(XEnumerationAccess.class, oText ); XEnumeration oEnum = oEnumA.createEnumeration(); try { para = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oEnum.nextElement()); - XEnumerationAccess oEnumB = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, para ); + XEnumerationAccess oEnumB = UnoRuntime.queryInterface( XEnumerationAccess.class, para ); XEnumeration oEnum2 = oEnumB.createEnumeration(); port = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oEnum2.nextElement()); @@ -154,16 +152,13 @@ public class SwAccessiblePageView extends TestCase { XController xController = xTextDoc.getCurrentController(); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); //switch to 'Print Preview' mode try { - XDispatchProvider xDispProv = (XDispatchProvider) - UnoRuntime.queryInterface(XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) - UnoRuntime.queryInterface(XURLTransformer.class, - ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); + XDispatchProvider xDispProv = UnoRuntime.queryInterface(XDispatchProvider.class, xController); + XURLTransformer xParser = UnoRuntime.queryInterface(XURLTransformer.class, + ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer")); // Because it's an in/out parameter we must use an array of URL objects. URL[] aParseURL = new URL[1]; aParseURL[0] = new URL(); @@ -197,7 +192,7 @@ public class SwAccessiblePageView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR); - final XAccessibleValue xAccVal = (XAccessibleValue) UnoRuntime.queryInterface + final XAccessibleValue xAccVal = UnoRuntime.queryInterface (XAccessibleValue.class, SearchedContext) ; tEnv.addObjRelation("EventProducer", diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java index 71899aa0da43..199ef24592fa 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleParagraphView.java @@ -67,8 +67,7 @@ public class SwAccessibleParagraphView extends TestCase { XText oText = xTextDoc.getText(); oText.setString("XAccessibleText"); - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java index b4fa283569f2..cef4cacd2c8d 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableCellView.java @@ -86,7 +86,7 @@ public class SwAccessibleTableCellView extends TestCase { e.getMessage(), e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -103,7 +103,7 @@ public class SwAccessibleTableCellView extends TestCase { at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleSelection accSel = (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection accSel = UnoRuntime.queryInterface( XAccessibleSelection.class, at.SearchedContext.getAccessibleParent()); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java index 1a661d35a063..a50d88912aa2 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTableView.java @@ -88,8 +88,7 @@ public class SwAccessibleTableView extends TestCase { + e.getMessage(), e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -106,9 +105,8 @@ public class SwAccessibleTableView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); final XPropertySet PropSet = xViewSetSup.getViewSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java index cc686fdb3883..4c3985871672 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextEmbeddedObject.java @@ -66,8 +66,7 @@ public class SwAccessibleTextEmbeddedObject extends TestCase { XInterface oObj = null; - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -84,9 +83,8 @@ public class SwAccessibleTextEmbeddedObject extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); final XPropertySet PropSet = xViewSetSup.getViewSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java index 82b20821010b..36679927caf4 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextFrameView.java @@ -92,16 +92,14 @@ public class SwAccessibleTextFrameView extends TestCase { oCursor = oText.createTextCursor(); log.println( "inserting Frame1" ); - XTextContent the_content = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oFrame1); + XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class, oFrame1); oText.insertTextContent(oCursor, the_content, true); } catch (Exception e) { e.printStackTrace(log); throw new StatusException("Couldn't insert TextFrame", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -118,9 +116,8 @@ public class SwAccessibleTextFrameView extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); final XPropertySet PropSet = xViewSetSup.getViewSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java index 0d7a2af5a243..d5687731e435 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java @@ -78,8 +78,7 @@ public class SwAccessibleTextGraphicObject extends TestCase { XText the_text = xTextDoc.getText(); XTextCursor the_cursor = the_text.createTextCursor(); - XTextContent the_content = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oGraphObj); + XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class, oGraphObj); log.println( "inserting graphic" ); try { @@ -89,8 +88,7 @@ public class SwAccessibleTextGraphicObject extends TestCase { throw new StatusException("Couldn't insert Content", e); } - XModel aModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); AccessibilityTools at = new AccessibilityTools(); @@ -107,9 +105,8 @@ public class SwAccessibleTextGraphicObject extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); final XPropertySet PropSet = xViewSetSup.getViewSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java index b1eeb10e780a..934616fb2fec 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextContainer.java @@ -64,7 +64,7 @@ public class SwXAutoTextContainer extends TestCase { XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF(); Object oInst = myMSF.createInstance ("com.sun.star.text.AutoTextContainer"); - oContainer = (XAutoTextContainer)UnoRuntime.queryInterface + oContainer = UnoRuntime.queryInterface (XAutoTextContainer.class,oInst); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java index bc2666fe5377..0fdacdebbf3e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextEntry.java @@ -130,8 +130,7 @@ public class SwXAutoTextEntry extends TestCase { XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF(); Object oInst = myMSF.createInstance ("com.sun.star.text.AutoTextContainer"); - oContainer = (XAutoTextContainer) - UnoRuntime.queryInterface(XAutoTextContainer.class,oInst); + oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Couldn't create AutoTextContainer", e); @@ -151,7 +150,7 @@ public class SwXAutoTextEntry extends TestCase { throw new StatusException("Couldn't get AutoTextGroup", e); } - oGroup = (XAutoTextGroup) UnoRuntime.queryInterface + oGroup = UnoRuntime.queryInterface (XAutoTextGroup.class, oObj); String[] oENames = oGroup.getElementNames(); for (int i=0; i<oENames.length; i++) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java index 9d36689322b5..232e634c2a90 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java @@ -108,14 +108,14 @@ public class SwXAutoTextGroup extends TestCase { try { XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF(); Object oInst = myMSF.createInstance("com.sun.star.text.AutoTextContainer"); - oContainer = (XAutoTextContainer) UnoRuntime.queryInterface(XAutoTextContainer.class,oInst); + oContainer = UnoRuntime.queryInterface(XAutoTextContainer.class,oInst); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Couldn't create AutoTextContainer", e); } String myGroupName="myNewGroup2*1"; - XAutoTextContainer xATC = (XAutoTextContainer) UnoRuntime.queryInterface(XAutoTextContainer.class, oContainer); + XAutoTextContainer xATC = UnoRuntime.queryInterface(XAutoTextContainer.class, oContainer); try { log.println("removing element with name '" + myGroupName + "'"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXBookmark.java b/qadevOOo/tests/java/mod/_sw/SwXBookmark.java index 6e3d44f9a186..72fbd60e1f0a 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXBookmark.java +++ b/qadevOOo/tests/java/mod/_sw/SwXBookmark.java @@ -101,8 +101,7 @@ public class SwXBookmark extends TestCase { util.dbg.printInterfaces((XInterface) instance); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); return tEnv; } // finish method getTestEnvironment diff --git a/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java b/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java index 11aa0c8e98d2..3307b8a7ac9a 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java +++ b/qadevOOo/tests/java/mod/_sw/SwXBookmarks.java @@ -96,8 +96,7 @@ public class SwXBookmarks extends TestCase { throw new StatusException( "Couldn't create Bookmark", e ); } - XBookmarksSupplier oBSupp = (XBookmarksSupplier) - UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc); + XBookmarksSupplier oBSupp = UnoRuntime.queryInterface(XBookmarksSupplier.class, xTextDoc); XNameAccess oBookNA = oBSupp.getBookmarks(); oObj = oBookNA; log.println( "creating a new environment for Bookmarks object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXCell.java b/qadevOOo/tests/java/mod/_sw/SwXCell.java index bee7e774d483..a6f3aefc08f1 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXCell.java +++ b/qadevOOo/tests/java/mod/_sw/SwXCell.java @@ -108,8 +108,7 @@ public class SwXCell extends TestCase { log.println( " creating a new environment for bodytext object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); try { XInterface oTS = (XInterface) oDocMSF.createInstance ("com.sun.star.text.TextSection"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java index c4b5ee832291..2d2c386e08b1 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXCellRange.java +++ b/qadevOOo/tests/java/mod/_sw/SwXCellRange.java @@ -124,8 +124,7 @@ public class SwXCellRange extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); log.println("ImplName: " + util.utils.getImplName(oObj)); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); try { XInterface oTS = (XInterface) oDocMSF.createInstance("com.sun.star.text.TextSection"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java b/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java index 9a238fb84908..75b0a49b8285 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java +++ b/qadevOOo/tests/java/mod/_sw/SwXChapterNumbering.java @@ -87,8 +87,7 @@ public class SwXChapterNumbering extends TestCase { TestParameters tParam, PrintWriter log ) throws StatusException { XInterface oObj = null; - XChapterNumberingSupplier oCNSupp = (XChapterNumberingSupplier) - UnoRuntime.queryInterface(XChapterNumberingSupplier.class,xTextDoc); + XChapterNumberingSupplier oCNSupp = UnoRuntime.queryInterface(XChapterNumberingSupplier.class,xTextDoc); oObj = oCNSupp.getChapterNumberingRules(); PropertyValue[] instance1 = null; diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java index 034ba37e86a6..046dc9e29992 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java @@ -119,11 +119,9 @@ public class SwXDocumentIndex extends TestCase { TestEnvironment tEnv = new TestEnvironment(xTC); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); oCursor.gotoEnd(false); - tEnv.addObjRelation("RANGE", (XTextRange) - UnoRuntime.queryInterface(XTextRange.class, oCursor)); + tEnv.addObjRelation("RANGE", UnoRuntime.queryInterface(XTextRange.class, oCursor)); // relation for XDocumentIndex tEnv.addObjRelation("TextDoc", xTextDoc); diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java index 5287d80017c6..0bc8ce938378 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java @@ -97,8 +97,7 @@ public class SwXDocumentIndexMark extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object oDIM = null; Object instance = null; @@ -111,8 +110,7 @@ public class SwXDocumentIndexMark extends TestCase { log.println("Error:" + e); } - XDocumentIndexMark xDIM = (XDocumentIndexMark) - UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM); + XDocumentIndexMark xDIM = UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM); try { oText.insertTextContent(oCursor, xDIM, false); @@ -124,8 +122,7 @@ public class SwXDocumentIndexMark extends TestCase { TestEnvironment tEnv = new TestEnvironment(xDIM); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java index 9ba11de06c12..b2dd757a2521 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexes.java @@ -113,8 +113,7 @@ public class SwXDocumentIndexes extends TestCase { throw new StatusException("Couldn't insert the Index", e); } - XDocumentIndexesSupplier xDocInd = (XDocumentIndexesSupplier) - UnoRuntime.queryInterface(XDocumentIndexesSupplier.class,xTextDoc); + XDocumentIndexesSupplier xDocInd = UnoRuntime.queryInterface(XDocumentIndexesSupplier.class,xTextDoc); oObj = xDocInd.getDocumentIndexes(); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java b/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java index 88208cdaf5da..45cc2daf6f7c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDrawPage.java @@ -126,7 +126,7 @@ public class SwXDrawPage extends TestCase { log.println( "creating a test environment" ); SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF() ); - XDPSupp = (XDrawPageSupplier) UnoRuntime.queryInterface + XDPSupp = UnoRuntime.queryInterface (XDrawPageSupplier.class, xTextDoc); xDP = XDPSupp.getDrawPage(); oObj = xDP; @@ -135,7 +135,7 @@ public class SwXDrawPage extends TestCase { //System.exit(0); log.println( "inserting some Shapes" ); - oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oObj); + oShapes = UnoRuntime.queryInterface(XShapes.class, oObj); oShapes.add(SOF.createShape(xTextDoc,2000,1500,1000,1000,"Line")); oShapes.add(SOF.createShape(xTextDoc,3000,4500,15000,1000,"Ellipse")); oShapes.add(SOF.createShape(xTextDoc,5000,3500,7500,5000,"Rectangle")); diff --git a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java index f455886e4b62..2e1e7d20e000 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java +++ b/qadevOOo/tests/java/mod/_sw/SwXEndnoteProperties.java @@ -88,8 +88,7 @@ public class SwXEndnoteProperties extends TestCase { XInterface oEndnote; log.println( "Creating a test environment" ); - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a endnote"); try { oEndnote = (XInterface) UnoRuntime.queryInterface(XInterface.class, @@ -103,8 +102,7 @@ public class SwXEndnoteProperties extends TestCase { XTextCursor oCursor = oText.createTextCursor(); log.println("inserting the footnote into text document"); - XTextContent xTC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oEndnote); + XTextContent xTC = UnoRuntime.queryInterface(XTextContent.class, oEndnote); try { oText.insertTextContent(oCursor, xTC, false); } catch (com.sun.star.lang.IllegalArgumentException e) { @@ -112,8 +110,7 @@ public class SwXEndnoteProperties extends TestCase { throw new StatusException("Couldn't insert the endnote", e); } - oInterface = (XEndnotesSupplier) - UnoRuntime.queryInterface(XEndnotesSupplier.class, xTextDoc); + oInterface = UnoRuntime.queryInterface(XEndnotesSupplier.class, xTextDoc); oObj = oInterface.getEndnoteSettings(); dbg.printPropertiesNames((XPropertySet) oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java index 38ae17446269..39f4999e4a7f 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFieldEnumeration.java @@ -102,8 +102,7 @@ public class SwXFieldEnumeration extends TestCase { XTextContent the_Field; log.println( "creating a test environment" ); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc ); try { FieldMaster = oDocMSF.createInstance @@ -112,8 +111,7 @@ public class SwXFieldEnumeration extends TestCase { (XPropertySet.class,(XInterface) FieldMaster); oObj = (XInterface) oDocMSF.createInstance("com.sun.star.text.TextField.Database"); - xTF = (XDependentTextField) - UnoRuntime.queryInterface(XDependentTextField.class,oObj); + xTF = UnoRuntime.queryInterface(XDependentTextField.class,oObj); } catch ( com.sun.star.uno.Exception e ) { e.printStackTrace(log); } @@ -138,8 +136,7 @@ public class SwXFieldEnumeration extends TestCase { the_Text = xTextDoc.getText(); the_Cursor = the_Text.createTextCursor(); - the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + the_Field = UnoRuntime.queryInterface(XTextContent.class, oObj); try { xTF.attachTextFieldMaster(PFieldMaster); @@ -150,8 +147,7 @@ public class SwXFieldEnumeration extends TestCase { } // create testobject here - XTextFieldsSupplier oTFS = (XTextFieldsSupplier) - UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); + XTextFieldsSupplier oTFS = UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); xFEA = oTFS.getTextFields(); oObj = oTFS.getTextFields().createEnumeration(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java b/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java index 44af7e26ac31..b570ad3d322f 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFieldMaster.java @@ -84,8 +84,7 @@ public class SwXFieldMaster extends TestCase { log.println( "creating a test environment" ); try { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc ); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc ); oObj = (XInterface) oDocMSF.createInstance( "com.sun.star.text.FieldMaster.Database" ); } catch ( com.sun.star.uno.Exception e ) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnote.java b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java index e470bb83bd86..c650a67d6d35 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFootnote.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFootnote.java @@ -107,12 +107,11 @@ public class SwXFootnote extends TestCase { log.println( "Creating a test environment" ); // get a soffice factory object - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a footnote"); Object instance = null; try { - oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class, + oFootnote = UnoRuntime.queryInterface(XFootnote.class, msf.createInstance("com.sun.star.text.Footnote")); instance = msf.createInstance("com.sun.star.text.Footnote"); } catch (com.sun.star.uno.Exception e) { @@ -133,8 +132,7 @@ public class SwXFootnote extends TestCase { TestEnvironment tEnv = new TestEnvironment(oFootnote); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); log.println( "adding InstDescriptor object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java index 343cf421e32b..4659f0198e93 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteProperties.java @@ -88,12 +88,11 @@ public class SwXFootnoteProperties extends TestCase { log.println( "Creating a test environment" ); // get a soffice factory object - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a footnote"); try { - oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class, + oFootnote = UnoRuntime.queryInterface(XFootnote.class, msf.createInstance("com.sun.star.text.Footnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -111,8 +110,7 @@ public class SwXFootnoteProperties extends TestCase { throw new StatusException("Couldn't insert the footnote", e); } - oInterface = (XFootnotesSupplier) - UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc); + oInterface = UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc); oObj = oInterface.getFootnoteSettings(); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java index 7bd14b8a4f19..6a563a6977a2 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFootnoteText.java @@ -118,12 +118,11 @@ public class SwXFootnoteText extends TestCase { XFootnote oFootnote; log.println( "creating a test environment" ); - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a footnote"); try { - oFootnote = (XFootnote)UnoRuntime.queryInterface(XFootnote.class, + oFootnote = UnoRuntime.queryInterface(XFootnote.class, msf.createInstance("com.sun.star.text.Footnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -141,8 +140,7 @@ public class SwXFootnoteText extends TestCase { throw new StatusException("Couldn't insert the footnote", e); } - XSimpleText oFootText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oFootnote); + XSimpleText oFootText = UnoRuntime.queryInterface(XSimpleText.class, oFootnote); oFootText.setString("SwXFootnoteText"); oObj = oFootText.getText(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java index cbfd2475ac9d..d9a7215b8887 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFootnotes.java @@ -89,13 +89,12 @@ public class SwXFootnotes extends TestCase { XInterface oObj = null; log.println( "Creating a test environment" ); - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); log.println("creating a footnote"); XFootnote oFootnote; try { - oFootnote = (XFootnote) UnoRuntime.queryInterface(XFootnote.class, + oFootnote = UnoRuntime.queryInterface(XFootnote.class, msf.createInstance("com.sun.star.text.Footnote")); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -112,8 +111,7 @@ public class SwXFootnotes extends TestCase { e.printStackTrace(log); throw new StatusException("Couldn't insert the footnote", e); } - oInterface = (XFootnotesSupplier) - UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc); + oInterface = UnoRuntime.queryInterface(XFootnotesSupplier.class, xTextDoc); oObj = oInterface.getFootnotes(); log.println( "creating a new environment for Foontnotes object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXFrames.java b/qadevOOo/tests/java/mod/_sw/SwXFrames.java index 35e7c6b877a2..50050ea5c048 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXFrames.java +++ b/qadevOOo/tests/java/mod/_sw/SwXFrames.java @@ -97,11 +97,9 @@ public class SwXFrames extends TestCase { log.println( "creating a test environment" ); try { - oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object oInt = oDocMSF.createInstance("com.sun.star.text.TextFrame"); - oFrame1 = (XTextFrame) - UnoRuntime.queryInterface( XTextFrame.class, oInt ); + oFrame1 = UnoRuntime.queryInterface( XTextFrame.class, oInt ); } catch ( com.sun.star.uno.Exception e ) { e.printStackTrace(log); throw new StatusException @@ -119,8 +117,7 @@ public class SwXFrames extends TestCase { ("Error: can't insert text content to text document", e); } - oInterface = (XTextFramesSupplier) - UnoRuntime.queryInterface( XTextFramesSupplier.class, xTextDoc ); + oInterface = UnoRuntime.queryInterface( XTextFramesSupplier.class, xTextDoc ); oObj = oInterface.getTextFrames(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java index f26c9e7b9a28..580b7b95c260 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXHeadFootText.java @@ -121,8 +121,7 @@ public class SwXHeadFootText extends TestCase { XStyle StdStyle = null; log.println( "creating a test environment" ); - XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier StyleFam = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess StyleFamNames = StyleFam.getStyleFamilies(); // obtains style 'Standatd' from style family 'PageStyles' @@ -152,7 +151,7 @@ public class SwXHeadFootText extends TestCase { log.println( "Switching on footer" ); PropSet.setPropertyValue("FooterIsOn", new Boolean(true)); log.println( "Get header text" ); - oObj = (XText) UnoRuntime.queryInterface( + oObj = UnoRuntime.queryInterface( XText.class, PropSet.getPropertyValue("HeaderText")); } catch ( com.sun.star.lang.WrappedTargetException e ) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java b/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java index c6348472b0de..ff07a8cfc46e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java +++ b/qadevOOo/tests/java/mod/_sw/SwXLineNumberingProperties.java @@ -97,8 +97,7 @@ public class SwXLineNumberingProperties extends TestCase { log.println("Exception occurred: " + e); } - XLineNumberingProperties oLNP = (XLineNumberingProperties) - UnoRuntime.queryInterface(XLineNumberingProperties.class,xTextDoc); + XLineNumberingProperties oLNP = UnoRuntime.queryInterface(XLineNumberingProperties.class,xTextDoc); XPropertySet lineNumProps = oLNP.getLineNumberingProperties(); dbg.printPropertiesNames(lineNumProps); TestEnvironment tEnv = new TestEnvironment(lineNumProps); diff --git a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java index 19ba95632732..cdf3d693425f 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java +++ b/qadevOOo/tests/java/mod/_sw/SwXMailMerge.java @@ -107,8 +107,7 @@ public class SwXMailMerge extends TestCase { } XPropertySet oRowSetProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRowSet); - XRowSet xRowSet = (XRowSet) - UnoRuntime.queryInterface(XRowSet.class, oRowSet); + XRowSet xRowSet = UnoRuntime.queryInterface(XRowSet.class, oRowSet); try { oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName); oRowSetProps.setPropertyValue("Command",cDataCommand); @@ -128,8 +127,7 @@ public class SwXMailMerge extends TestCase { throw new StatusException("Can't execute oRowSet", e); } - XResultSet oResultSet = (XResultSet) - UnoRuntime.queryInterface(XResultSet.class, oRowSet); + XResultSet oResultSet = UnoRuntime.queryInterface(XResultSet.class, oRowSet); @@ -137,7 +135,7 @@ public class SwXMailMerge extends TestCase { // <create Bookmarks> log.println("create bookmarks"); try { - XRowLocate oRowLocate = (XRowLocate) UnoRuntime.queryInterface( + XRowLocate oRowLocate = UnoRuntime.queryInterface( XRowLocate.class, oResultSet); oResultSet.first(); myBookMarks[0] = oRowLocate.getBookmark(); @@ -245,7 +243,7 @@ public class SwXMailMerge extends TestCase { } oRowSetProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRowSet); - xRowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, oRowSet); + xRowSet = UnoRuntime.queryInterface(XRowSet.class, oRowSet); try { oRowSetProps.setPropertyValue("DataSourceName",cDataSourceName); @@ -266,16 +264,14 @@ public class SwXMailMerge extends TestCase { throw new StatusException("Can't execute oRowSet", e); } - oResultSet = (XResultSet) - UnoRuntime.queryInterface(XResultSet.class, oRowSet); + oResultSet = UnoRuntime.queryInterface(XResultSet.class, oRowSet); XResultSet oMMXResultSet = null; try { - oMMXResultSet = (XResultSet) - UnoRuntime.queryInterface(XResultSet.class, - ( (XInterface) - ( (XMultiServiceFactory) - Param.getMSF()).createInstance("com.sun.star.sdb.RowSet"))); + oMMXResultSet = UnoRuntime.queryInterface(XResultSet.class, + ( (XInterface) + ( (XMultiServiceFactory) + Param.getMSF()).createInstance("com.sun.star.sdb.RowSet"))); } catch (Exception e) { throw new StatusException("Can't create com.sun.star.sdb.RowSet", e); @@ -384,8 +380,7 @@ public class SwXMailMerge extends TestCase { try{ Object oDataBase = xNADataCont.getByName(dataName); - XDataSource xDataSource = (XDataSource) - UnoRuntime.queryInterface(XDataSource.class, oDataBase); + XDataSource xDataSource = UnoRuntime.queryInterface(XDataSource.class, oDataBase); return xDataSource.getConnection("",""); diff --git a/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java index 0ed693034f47..f2700b03095c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java +++ b/qadevOOo/tests/java/mod/_sw/SwXNumberingRules.java @@ -114,16 +114,14 @@ public class SwXNumberingRules extends TestCase { e.printStackTrace(log); } - XStyleFamiliesSupplier oStyleFamiliesSupplier = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier oStyleFamiliesSupplier = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); try { XNameAccess oStyleFamilies = oStyleFamiliesSupplier.getStyleFamilies(); XNameContainer NumStyles = (XNameContainer) AnyConverter.toObject( new Type(XNameContainer.class), oStyleFamilies.getByName("NumberingStyles")); - NumStyleI = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class,NumStyles); + NumStyleI = UnoRuntime.queryInterface(XIndexAccess.class,NumStyles); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error, exception occurred..."); e.printStackTrace(log); @@ -144,7 +142,7 @@ public class SwXNumberingRules extends TestCase { UnoRuntime.queryInterface(XPropertySet.class, oObj); oObj = (XInterface) AnyConverter.toObject( new Type(XInterface.class),props.getPropertyValue("NumberingRules")); - XIndexAccess nRules = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, props.getPropertyValue("NumberingRules")); + XIndexAccess nRules = UnoRuntime.queryInterface(XIndexAccess.class, props.getPropertyValue("NumberingRules")); instance1 = nRules.getByIndex(0); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error, exception occurred..."); diff --git a/qadevOOo/tests/java/mod/_sw/SwXParagraph.java b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java index e34768c5a901..3520338d5b0c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXParagraph.java +++ b/qadevOOo/tests/java/mod/_sw/SwXParagraph.java @@ -97,7 +97,7 @@ public class SwXParagraph extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -136,7 +136,7 @@ public class SwXParagraph extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -190,15 +190,13 @@ public class SwXParagraph extends TestCase { } // Enumeration - XEnumerationAccess oEnumA = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, oText ); + XEnumerationAccess oEnumA = UnoRuntime.queryInterface(XEnumerationAccess.class, oText ); XEnumeration oEnum = oEnumA.createEnumeration(); try { para = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oEnum.nextElement()); - XEnumerationAccess oEnumB = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, para ); + XEnumerationAccess oEnumB = UnoRuntime.queryInterface( XEnumerationAccess.class, para ); XEnumeration oEnum2 = oEnumB.createEnumeration(); port = (XInterface) AnyConverter.toObject( new Type(XInterface.class),oEnum2.nextElement()); diff --git a/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java index 8a6916c92a1b..ace70b24c369 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java +++ b/qadevOOo/tests/java/mod/_sw/SwXParagraphEnumeration.java @@ -127,8 +127,7 @@ public class SwXParagraphEnumeration extends TestCase { } // Enumeration - XEnumerationAccess oEnumA = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); + XEnumerationAccess oEnumA = UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); XEnumeration oEnum = oEnumA.createEnumeration(); oObj = oEnum; diff --git a/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java b/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java index 38b0adf60ada..0c08a925bf00 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java +++ b/qadevOOo/tests/java/mod/_sw/SwXPrintSettings.java @@ -89,8 +89,7 @@ public class SwXPrintSettings extends TestCase { e.printStackTrace( log ); throw new StatusException( "Couldn't create instance!", e ); } - XPrintSettingsSupplier xPSS = (XPrintSettingsSupplier) - UnoRuntime.queryInterface(XPrintSettingsSupplier.class, oInst); + XPrintSettingsSupplier xPSS = UnoRuntime.queryInterface(XPrintSettingsSupplier.class, oInst); oObj = xPSS.getPrintSettings(); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java index c424e7fd1e77..6fc12bc9ad31 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java +++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java @@ -94,8 +94,7 @@ public class SwXReferenceMark extends TestCase { log.println( "creating a test environment" ); oText = xTextDoc.getText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object instance = null; try { oObj = (XInterface) oDocMSF.createInstance @@ -107,10 +106,9 @@ public class SwXReferenceMark extends TestCase { throw new StatusException( "Couldn't get ReferenceMark", e); } - XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj); + XNamed oObjN = UnoRuntime.queryInterface(XNamed.class, oObj); oObjN.setName(Name); - XTextContent oObjTC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + XTextContent oObjTC = UnoRuntime.queryInterface(XTextContent.class, oObj); XTextCursor oCursor = oText.createTextCursor(); try { @@ -122,8 +120,7 @@ public class SwXReferenceMark extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java b/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java index 55be83e23f3f..273ca44ceb3b 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java +++ b/qadevOOo/tests/java/mod/_sw/SwXReferenceMarks.java @@ -99,8 +99,7 @@ public class SwXReferenceMarks extends TestCase { log.println( "creating a test environment" ); oText = xTextDoc.getText(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); // Creation and insertion of ReferenceMark01 try { @@ -110,10 +109,9 @@ public class SwXReferenceMarks extends TestCase { e.printStackTrace( log ); throw new StatusException( "Couldn't get ReferenceMark", e); } - XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj); + XNamed oObjN = UnoRuntime.queryInterface(XNamed.class, oObj); oObjN.setName(Name); - XTextContent oObjTC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + XTextContent oObjTC = UnoRuntime.queryInterface(XTextContent.class, oObj); XTextCursor oCursor = oText.createTextCursor(); try { oText.insertTextContent(oCursor, oObjTC, false); @@ -130,11 +128,10 @@ public class SwXReferenceMarks extends TestCase { e.printStackTrace( log ); throw new StatusException( "Couldn't get ReferenceMark", e); } - XNamed oObjN2 = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj); + XNamed oObjN2 = UnoRuntime.queryInterface(XNamed.class, oObj); oObjN2.setName(Name2); - XTextContent oObjTC2 = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oObj); + XTextContent oObjTC2 = UnoRuntime.queryInterface(XTextContent.class, oObj); try { oText.insertTextContent(oCursor, oObjTC2, false); } catch ( com.sun.star.lang.IllegalArgumentException e ){ @@ -143,8 +140,7 @@ public class SwXReferenceMarks extends TestCase { } // getting ReferenceMarks from text document - XReferenceMarksSupplier oRefSupp = (XReferenceMarksSupplier) - UnoRuntime.queryInterface(XReferenceMarksSupplier.class, xTextDoc); + XReferenceMarksSupplier oRefSupp = UnoRuntime.queryInterface(XReferenceMarksSupplier.class, xTextDoc); oObj = oRefSupp.getReferenceMarks(); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXShape.java b/qadevOOo/tests/java/mod/_sw/SwXShape.java index bca7545e2c9a..dc7ca25d0dcd 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXShape.java +++ b/qadevOOo/tests/java/mod/_sw/SwXShape.java @@ -99,12 +99,11 @@ public class SwXShape extends TestCase { log.println( "creating a test environment" ); log.println( "getting Drawpage" ); - XDrawPageSupplier oDPS = (XDrawPageSupplier) - UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDoc); + XDrawPageSupplier oDPS = UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDoc); oDP = oDPS.getDrawPage(); log.println( "getting Shape" ); - oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class, oDP); + oShapes = UnoRuntime.queryInterface(XShapes.class, oDP); oObj = SOF.createShape(xTextDoc,5000,3500,7500,5000,"Rectangle"); oShapes.add((XShape) oObj); diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyle.java b/qadevOOo/tests/java/mod/_sw/SwXStyle.java index 36d1627c520b..640295b53ebe 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyle.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyle.java @@ -118,16 +118,13 @@ public class SwXStyle extends TestCase { try { log.println("getting style"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - XIndexAccess oSFsIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSF); + XIndexAccess oSFsIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF); oSFNA = (XNameAccess) AnyConverter.toObject( new Type(XNameAccess.class),oSFsIA.getByIndex(0)); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); oStyle = (XStyle) AnyConverter.toObject( new Type(XStyle.class),oSFIA.getByIndex(10)); } catch ( com.sun.star.lang.WrappedTargetException e ) { @@ -146,8 +143,7 @@ public class SwXStyle extends TestCase { try { log.print("Creating a user-defined style... "); - XMultiServiceFactory oMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.CharacterStyle"); oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java b/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java index c66e6671cbc0..bd77d4cabe99 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamilies.java @@ -87,10 +87,8 @@ public class SwXStyleFamilies extends TestCase { log.println( "Creating a test environment" ); - XTextDocument xArea = (XTextDocument) - UnoRuntime.queryInterface(XTextDocument.class, xTextDoc); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xArea); + XTextDocument xArea = UnoRuntime.queryInterface(XTextDocument.class, xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xArea); XNameAccess oSF = oSFS.getStyleFamilies(); TestEnvironment tEnv = new TestEnvironment(oSF); diff --git a/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java index bbac63996dbc..3ba157938b76 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java +++ b/qadevOOo/tests/java/mod/_sw/SwXStyleFamily.java @@ -121,15 +121,12 @@ public class SwXStyleFamily extends TestCase { log.println( "Creating Test Environment..." ); SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF()); - XComponent xComp = (XComponent) - UnoRuntime.queryInterface(XComponent.class, xTextDoc); + XComponent xComp = UnoRuntime.queryInterface(XComponent.class, xTextDoc); XInterface oInstance = (XInterface) SOF.createInstance(xComp, "com.sun.star.style.CharacterStyle"); - XStyleFamiliesSupplier oSFsS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier oSFsS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFsS.getStyleFamilies(); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSF); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF); try { oSFNA = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java index ab24657dc5b6..cc59873ab331 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTableCellText.java @@ -136,8 +136,7 @@ public class SwXTableCellText extends TestCase { } XCell oCell = oTable.getCellByName("A1"); - XSimpleText oCellText = (XSimpleText) - UnoRuntime.queryInterface(XSimpleText.class, oCell); + XSimpleText oCellText = UnoRuntime.queryInterface(XSimpleText.class, oCell); oCellText.setString("SwXTableCellText"); oObj = oCellText.getText(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java index 624252556917..98a073d32dad 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextColumns.java @@ -99,11 +99,9 @@ public class SwXTextColumns extends TestCase { log.println( "creating a test environment" ); log.println("getting PageStyle"); - XStyleFamiliesSupplier oSFS = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); + XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - XIndexAccess oSFIA = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oSF); + XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSF); try { XNameAccess oSFNA = (XNameAccess) AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java index 2053403a6e5d..7f943e2bca76 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java @@ -179,7 +179,7 @@ public class SwXTextCursor extends TestCase { tEnv.addObjRelation("PropertyNames", getPropertyNames(xCursorProp)); //Adding relation for util.XSortable - final XParagraphCursor paragrCursor = (XParagraphCursor) UnoRuntime.queryInterface( + final XParagraphCursor paragrCursor = UnoRuntime.queryInterface( XParagraphCursor.class, oObj); final PrintWriter finalLog = log; @@ -292,7 +292,7 @@ public class SwXTextCursor extends TestCase { public String[] getPropertyNames(XPropertySet props) { Property[] the_props = props.getPropertySetInfo().getProperties(); - ArrayList names = new ArrayList(); + ArrayList<String> names = new ArrayList<String>(); for (int i = 0; i < the_props.length; i++) { boolean isWritable = ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0); @@ -302,6 +302,6 @@ public class SwXTextCursor extends TestCase { } } - return (String[]) names.toArray(new String[names.size()]); + return names.toArray(new String[names.size()]); } } // finish class SwXTextCursor diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java b/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java index e91b2d1cc2e6..e39a409b98d8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextDefaults.java @@ -75,8 +75,7 @@ public class SwXTextDefaults extends TestCase { XInterface oObj = null; - XMultiServiceFactory docMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class,xTextDoc); + XMultiServiceFactory docMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class,xTextDoc); try { oObj = (XInterface) diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java index 60b1358795ff..b6c1d07c7fa9 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextDocument.java @@ -111,14 +111,14 @@ public class SwXTextDocument extends TestCase { } //insert two sections parent and child - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, xTextDoc); XInterface oTS; XTextSection xTS; - XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier) UnoRuntime.queryInterface( + XTextSectionsSupplier oTSSupp = UnoRuntime.queryInterface( XTextSectionsSupplier.class, xTextDoc); XNameAccess oTSSuppName = oTSSupp.getTextSections(); @@ -126,11 +126,11 @@ public class SwXTextDocument extends TestCase { oTS = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextSection"); - XTextContent oTSC = (XTextContent) UnoRuntime.queryInterface( + XTextContent oTSC = UnoRuntime.queryInterface( XTextContent.class, oTS); oText.insertTextContent(oCursor, oTSC, false); - XWordCursor oWordC = (XWordCursor) UnoRuntime.queryInterface( + XWordCursor oWordC = UnoRuntime.queryInterface( XWordCursor.class, oCursor); oCursor.setString("End of TextSection"); oCursor.gotoStart(false); @@ -139,11 +139,11 @@ public class SwXTextDocument extends TestCase { XInterface oTS2 = (XInterface) oDocMSF.createInstance( "com.sun.star.text.TextSection"); - oTSC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, + oTSC = UnoRuntime.queryInterface(XTextContent.class, oTS2); oText.insertTextContent(oCursor, oTSC, false); - XIndexAccess oTSSuppIndex = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oTSSuppIndex = UnoRuntime.queryInterface( XIndexAccess.class, oTSSuppName); log.println( @@ -151,14 +151,14 @@ public class SwXTextDocument extends TestCase { xTS = (XTextSection) UnoRuntime.queryInterface(XTextSection.class, oTSSuppIndex.getByIndex(0)); - XNamed xTSName = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed xTSName = UnoRuntime.queryInterface(XNamed.class, xTS); xTSName.setName("SwXTextSection"); log.println(" adding TextTable"); the_table = SOfficeFactory.createTextTable(xTextDoc, 6, 4); - XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class, + XNamed the_name = UnoRuntime.queryInterface(XNamed.class, the_table); the_name.setName("SwXTextDocument"); SOfficeFactory.insertTextContent(xTextDoc, @@ -168,10 +168,10 @@ public class SwXTextDocument extends TestCase { XInterface aMark = (XInterface) oDocMSF.createInstance( "com.sun.star.text.ReferenceMark"); - the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class, aMark); + the_name = UnoRuntime.queryInterface(XNamed.class, aMark); the_name.setName("SwXTextDocument"); - XTextContent oTC = (XTextContent) UnoRuntime.queryInterface( + XTextContent oTC = UnoRuntime.queryInterface( XTextContent.class, aMark); SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); @@ -184,7 +184,7 @@ public class SwXTextDocument extends TestCase { XInterface aEndNote = (XInterface) oDocMSF.createInstance( "com.sun.star.text.Endnote"); - oTC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, + oTC = UnoRuntime.queryInterface(XTextContent.class, aEndNote); SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); @@ -202,7 +202,7 @@ public class SwXTextDocument extends TestCase { XTextFrame frame = SOfficeFactory.createTextFrame(xTextDoc, 500, 500); - oTC = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, + oTC = UnoRuntime.queryInterface(XTextContent.class, frame); SOfficeFactory.insertTextContent(xTextDoc, (XTextContent) oTC); @@ -232,9 +232,9 @@ public class SwXTextDocument extends TestCase { return tEnv; } - XModel model1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); - XModel model2 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel model2 = UnoRuntime.queryInterface(XModel.class, xSecondTextDoc); XController cont1 = model1.getCurrentController(); @@ -243,7 +243,7 @@ public class SwXTextDocument extends TestCase { cont1.getFrame().setName("cont1"); cont2.getFrame().setName("cont2"); - XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface( + XSelectionSupplier sel = UnoRuntime.queryInterface( XSelectionSupplier.class, cont1); log.println("Adding SelectionSupplier and Shape to select for XModel"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java index 4b4843797175..3fcbd3687ba8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObject.java @@ -71,7 +71,7 @@ public class SwXTextEmbeddedObject extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -107,10 +107,9 @@ public class SwXTextEmbeddedObject extends TestCase { XTextCursor xCursor = xTextDoc.getText().createTextCursor(); try { - XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory xMultiServiceFactory = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" ); - XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, o); + XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, o); String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e"; XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextContent); @@ -122,12 +121,12 @@ public class SwXTextEmbeddedObject extends TestCase { e.printStackTrace((java.io.PrintWriter)log); } - XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier) UnoRuntime.queryInterface( + XTextEmbeddedObjectsSupplier oTEOS = UnoRuntime.queryInterface( XTextEmbeddedObjectsSupplier.class, xTextDoc); XNameAccess oEmObj = oTEOS.getEmbeddedObjects(); - XIndexAccess oEmIn = (XIndexAccess) UnoRuntime.queryInterface( + XIndexAccess oEmIn = UnoRuntime.queryInterface( XIndexAccess.class, oEmObj); try { @@ -145,7 +144,7 @@ public class SwXTextEmbeddedObject extends TestCase { XTextFrame aFrame = SOF.createTextFrame(xTextDoc, 500, 500); XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XTextContent the_content = (XTextContent) UnoRuntime.queryInterface( + XTextContent the_content = UnoRuntime.queryInterface( XTextContent.class, aFrame); try { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java index ec21d9fb625d..b1e209575d03 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextEmbeddedObjects.java @@ -99,10 +99,9 @@ public class SwXTextEmbeddedObjects extends TestCase { // create testobject here XTextCursor xCursor = oDoc.getText().createTextCursor(); try { - XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); + XMultiServiceFactory xMultiServiceFactory = UnoRuntime.queryInterface(XMultiServiceFactory.class, oDoc); Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" ); - XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, o); + XTextContent xTextContent = UnoRuntime.queryInterface(XTextContent.class, o); String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e"; XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextContent); @@ -114,8 +113,7 @@ public class SwXTextEmbeddedObjects extends TestCase { e.printStackTrace((java.io.PrintWriter)log); } - XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier) - UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, oDoc); + XTextEmbeddedObjectsSupplier oTEOS = UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, oDoc); oObj = oTEOS.getEmbeddedObjects(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextField.java b/qadevOOo/tests/java/mod/_sw/SwXTextField.java index 9d29e59add8d..3de89f88e159 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextField.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextField.java @@ -113,8 +113,7 @@ public class SwXTextField extends TestCase { // create testobject here try { - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); Object FieldMaster = oDocMSF.createInstance ( "com.sun.star.text.FieldMaster.Database" ); @@ -126,16 +125,14 @@ public class SwXTextField extends TestCase { instance = (XInterface) oDocMSF.createInstance ( "com.sun.star.text.TextField.DateTime" ); - XDependentTextField xTF = (XDependentTextField) - UnoRuntime.queryInterface(XDependentTextField.class,oObj); + XDependentTextField xTF = UnoRuntime.queryInterface(XDependentTextField.class,oObj); PFieldMaster.setPropertyValue("DataBaseName","Address Book File"); PFieldMaster.setPropertyValue("DataTableName","address"); PFieldMaster.setPropertyValue("DataColumnName","FIRSTNAME"); XText the_Text = xTextDoc.getText(); XTextCursor the_Cursor = the_Text.createTextCursor(); - XTextContent the_Field = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + XTextContent the_Field = UnoRuntime.queryInterface(XTextContent.class,oObj); xTF.attachTextFieldMaster(PFieldMaster); the_Text.insertTextContent(the_Cursor,the_Field,false); @@ -149,8 +146,7 @@ public class SwXTextField extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java b/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java index 8b71b639f7ba..a212f8c2a617 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldMasters.java @@ -111,8 +111,7 @@ public class SwXTextFieldMasters extends TestCase { // create testobject here try { - XTextFieldsSupplier oTFS = (XTextFieldsSupplier) - UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); + XTextFieldsSupplier oTFS = UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); oObj = oTFS.getTextFieldMasters(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java b/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java index cde0303e3045..45684ade15fe 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFieldTypes.java @@ -109,8 +109,7 @@ public class SwXTextFieldTypes extends TestCase { // create testobject here try { - XTextFieldsSupplier oTFS = (XTextFieldsSupplier) - UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); + XTextFieldsSupplier oTFS = UnoRuntime.queryInterface( XTextFieldsSupplier.class, xTextDoc ); oObj = oTFS.getTextFields(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java index 68ce266a1559..05127431b3a5 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrame.java @@ -107,12 +107,12 @@ public class SwXTextFrame extends TestCase { log.println("inserting Frame1"); - XTextContent the_content = (XTextContent) UnoRuntime.queryInterface( + XTextContent the_content = UnoRuntime.queryInterface( XTextContent.class, oFrame1); oText.insertTextContent(oCursor, the_content, true); log.println("inserting Frame2"); - the_content = (XTextContent) UnoRuntime.queryInterface( + the_content = UnoRuntime.queryInterface( XTextContent.class, oFrame2); oText.insertTextContent(oCursor, the_content, true); @@ -134,7 +134,7 @@ public class SwXTextFrame extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("CONTENT", - (XTextContent) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XTextContent.class, instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java index be7024444073..a083cf58a378 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextFrameText.java @@ -118,7 +118,7 @@ public class SwXTextFrameText extends TestCase { throw new StatusException("Couldn't insert TextFrame ", Ex); } - XText oFText = (XText)UnoRuntime.queryInterface(XText.class, oFrame1); + XText oFText = UnoRuntime.queryInterface(XText.class, oFrame1); XTextCursor oFCursor = oFText.createTextCursor(); oFText.insertString(oFCursor, "SwXTextFrameText", false); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java index 7658326e5a07..9956a8f93fd3 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObject.java @@ -118,12 +118,11 @@ public class SwXTextGraphicObject extends TestCase { XText the_text = xTextDoc.getText(); XTextCursor the_cursor = the_text.createTextCursor(); - XTextContent the_content = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class,oObj); log.println("inserting Frame"); try{ - XTextContent Framecontent = (XTextContent) UnoRuntime.queryInterface( + XTextContent Framecontent = UnoRuntime.queryInterface( XTextContent.class, xTextFrame); the_text.insertTextContent(the_cursor, Framecontent, true); } catch (Exception e) { @@ -171,9 +170,8 @@ public class SwXTextGraphicObject extends TestCase { //creating ObjectRelation for the property // 'ImageMap' of 'TextGraphicObject' try { - XMultiServiceFactory xDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface - (XMultiServiceFactory.class,xTextDoc); + XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface + (XMultiServiceFactory.class,xTextDoc); ImgMap = xDocMSF.createInstance ("com.sun.star.image.ImageMapRectangleObject"); } @@ -183,8 +181,7 @@ public class SwXTextGraphicObject extends TestCase { tEnv.addObjRelation("IMGMAP",ImgMap); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); //object relation for text.BaseFrameProperties diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java index 74d4081f7eac..3a0ec080f562 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextGraphicObjects.java @@ -113,8 +113,7 @@ public class SwXTextGraphicObjects extends TestCase { XText the_text = xTextDoc.getText(); XTextCursor the_cursor = the_text.createTextCursor(); - XTextContent the_content = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,oObj); + XTextContent the_content = UnoRuntime.queryInterface(XTextContent.class,oObj); log.println( "inserting graphic" ); try { @@ -141,9 +140,8 @@ public class SwXTextGraphicObjects extends TestCase { throw new StatusException("Couldn't set property 'GraphicURL'", e ); } - XTextGraphicObjectsSupplier xTGS = (XTextGraphicObjectsSupplier) - UnoRuntime.queryInterface(XTextGraphicObjectsSupplier.class, - xTextDoc); + XTextGraphicObjectsSupplier xTGS = UnoRuntime.queryInterface(XTextGraphicObjectsSupplier.class, + xTextDoc); oObj = xTGS.getGraphicObjects(); TestEnvironment tEnv = new TestEnvironment( oObj ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java index 1255703ff113..b5c816ca3dfc 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortion.java @@ -120,8 +120,7 @@ public class SwXTextPortion extends TestCase { } // Enumeration - XEnumerationAccess oEnumA = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); + XEnumerationAccess oEnumA = UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); XEnumeration oEnum = oEnumA.createEnumeration(); int n = 0; @@ -138,8 +137,7 @@ public class SwXTextPortion extends TestCase { n++; } - XEnumerationAccess oEnumP = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, param ); + XEnumerationAccess oEnumP = UnoRuntime.queryInterface( XEnumerationAccess.class, param ); XEnumeration oEnum2 = oEnumP.createEnumeration(); try { oObj = (XInterface)AnyConverter.toObject( diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java b/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java index 4a5896af38fc..97700079e63e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextPortionEnumeration.java @@ -117,8 +117,7 @@ public class SwXTextPortionEnumeration extends TestCase { } // Enumeration - XEnumerationAccess oEnumA = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); + XEnumerationAccess oEnumA = UnoRuntime.queryInterface( XEnumerationAccess.class, oText ); XEnumeration oEnum = oEnumA.createEnumeration(); int n = 0; @@ -134,8 +133,7 @@ public class SwXTextPortionEnumeration extends TestCase { n++; } - XEnumerationAccess oEnumP = (XEnumerationAccess) - UnoRuntime.queryInterface( XEnumerationAccess.class, param ); + XEnumerationAccess oEnumP = UnoRuntime.queryInterface( XEnumerationAccess.class, param ); XEnumeration oEnum2 = oEnumP.createEnumeration(); log.println( "creating a new environment for TextPortionEnumeration object" ); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java b/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java index 3457098fb8aa..25fa596433d8 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextRanges.java @@ -100,7 +100,7 @@ public class SwXTextRanges extends TestCase { } } - XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface + XSearchable oSearch = UnoRuntime.queryInterface (XSearchable.class, xTextDoc); XSearchDescriptor xSDesc = oSearch.createSearchDescriptor(); xSDesc.setSearchString("SwXTextRanges"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java b/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java index d38ad5a9b400..974adea3208e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextSearch.java @@ -102,7 +102,7 @@ public class SwXTextSearch extends TestCase { } } - XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface + XSearchable oSearch = UnoRuntime.queryInterface (XSearchable.class, xTextDoc); XSearchDescriptor xSDesc = oSearch.createSearchDescriptor(); xSDesc.setSearchString("SwXTextSearch"); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSection.java b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java index f807398aecfb..e8ff1259a720 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextSection.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextSection.java @@ -91,12 +91,10 @@ public class SwXTextSection extends TestCase { oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); try { - XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier) - UnoRuntime.queryInterface + XTextSectionsSupplier oTSSupp = UnoRuntime.queryInterface ( XTextSectionsSupplier.class, xTextDoc ); XNameAccess oTSSuppName = oTSSupp.getTextSections(); @@ -105,8 +103,7 @@ public class SwXTextSection extends TestCase { XTextSection old = (XTextSection) AnyConverter.toObject( new Type(XTextSection.class), oTSSuppName.getByName("SwXTextSection")); - XComponent oldC = (XComponent) - UnoRuntime.queryInterface(XComponent.class,old); + XComponent oldC = UnoRuntime.queryInterface(XComponent.class,old); oldC.dispose(); oText.setString(""); } @@ -115,28 +112,24 @@ public class SwXTextSection extends TestCase { oTS = (XInterface) oDocMSF.createInstance ("com.sun.star.text.TextSection"); instance = oDocMSF.createInstance("com.sun.star.text.TextSection"); - XTextContent oTSC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oTS); + XTextContent oTSC = UnoRuntime.queryInterface(XTextContent.class, oTS); oText.insertTextContent(oCursor, oTSC, false); - XWordCursor oWordC = (XWordCursor) - UnoRuntime.queryInterface(XWordCursor.class, oCursor); + XWordCursor oWordC = UnoRuntime.queryInterface(XWordCursor.class, oCursor); oCursor.setString("End of TextSection"); oCursor.gotoStart(false); oCursor.setString("Start of TextSection "); oWordC.gotoEndOfWord(false); XInterface oTS2 = (XInterface) oDocMSF.createInstance ("com.sun.star.text.TextSection"); - oTSC = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, oTS2); + oTSC = UnoRuntime.queryInterface(XTextContent.class, oTS2); oText.insertTextContent(oCursor, oTSC, false); - XIndexAccess oTSSuppIndex = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, oTSSuppName); + XIndexAccess oTSSuppIndex = UnoRuntime.queryInterface(XIndexAccess.class, oTSSuppName); log.println( "getting a TextSection with the XTextSectionSupplier()" ); xTS = (XTextSection) AnyConverter.toObject( new Type(XTextSection.class),oTSSuppIndex.getByIndex(0)); - XNamed xTSName = (XNamed) - UnoRuntime.queryInterface( XNamed.class, xTS); + XNamed xTSName = UnoRuntime.queryInterface( XNamed.class, xTS); xTSName.setName("SwXTextSection"); } catch(Exception e){ @@ -166,8 +159,7 @@ public class SwXTextSection extends TestCase { } tEnv.addObjRelation("TC",TC); - tEnv.addObjRelation("CONTENT", (XTextContent) - UnoRuntime.queryInterface(XTextContent.class,instance)); + tEnv.addObjRelation("CONTENT", UnoRuntime.queryInterface(XTextContent.class,instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); return tEnv; diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextSections.java b/qadevOOo/tests/java/mod/_sw/SwXTextSections.java index ca4bbb6244c0..4745242a875e 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextSections.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextSections.java @@ -86,15 +86,13 @@ public class SwXTextSections extends TestCase { log.println( "inserting TextSections" ); - XMultiServiceFactory oDocMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XMultiServiceFactory oDocMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); // First TextSection try { oTS = (XInterface) oDocMSF.createInstance ("com.sun.star.text.TextSection"); - XTextContent oTSC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oTS); + XTextContent oTSC = UnoRuntime.queryInterface(XTextContent.class, oTS); oText.insertTextContent(oCursor, oTSC, false); } catch(Exception e){ @@ -106,8 +104,7 @@ public class SwXTextSections extends TestCase { try { oTS = (XInterface) oDocMSF.createInstance ("com.sun.star.text.TextSection"); - XTextContent oTSC = (XTextContent) - UnoRuntime.queryInterface(XTextContent.class, oTS); + XTextContent oTSC = UnoRuntime.queryInterface(XTextContent.class, oTS); oText.insertTextContent(oCursor, oTSC, false); } catch(Exception e){ @@ -119,9 +116,8 @@ public class SwXTextSections extends TestCase { log.println( "try to get a TextSection with the XTextSectionSupplier()" ); try{ - XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier) - UnoRuntime.queryInterface( XTextSectionsSupplier.class, - xTextDoc ); + XTextSectionsSupplier oTSSupp = UnoRuntime.queryInterface( XTextSectionsSupplier.class, + xTextDoc ); oTSSuppName = oTSSupp.getTextSections(); } catch(Exception e){ diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTable.java b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java index d3653d8c2859..db5f8d3b4a97 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextTable.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextTable.java @@ -153,17 +153,17 @@ public class SwXTextTable extends TestCase { public void prepareToSort() { oTable.getCellByName("A1").setValue(4); - XTextRange textRange = (XTextRange) UnoRuntime.queryInterface( + XTextRange textRange = UnoRuntime.queryInterface( XTextRange.class, oTable.getCellByName("A2")); textRange.setString("b"); oTable.getCellByName("A3").setValue(3); - textRange = (XTextRange) UnoRuntime.queryInterface( + textRange = UnoRuntime.queryInterface( XTextRange.class, oTable.getCellByName("A4")); textRange.setString("a"); oTable.getCellByName("A5").setValue(23); - textRange = (XTextRange) UnoRuntime.queryInterface( + textRange = UnoRuntime.queryInterface( XTextRange.class, oTable.getCellByName("A6")); textRange.setString("ab"); @@ -179,7 +179,7 @@ public class SwXTextTable extends TestCase { for (int i = 0; i < 6; i++) { XCell cell = oTable.getCellByName("A" + (i + 1)); - XTextRange textRange = (XTextRange) UnoRuntime.queryInterface( + XTextRange textRange = UnoRuntime.queryInterface( XTextRange.class, cell); value[i] = textRange.getString(); } @@ -243,7 +243,7 @@ public class SwXTextTable extends TestCase { }); tEnv.addObjRelation("CONTENT", - (XTextContent) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XTextContent.class, instance)); tEnv.addObjRelation("RANGE", xTextDoc.getText().createTextCursor()); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java index 3e87f369a938..d1ed329ee344 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextTableRow.java @@ -96,7 +96,7 @@ public class SwXTextTableRow extends TestCase { try { log.println("getting table row"); XTableRows oTRn = oTable.getRows(); - XIndexAccess oIA = (XIndexAccess) UnoRuntime.queryInterface + XIndexAccess oIA = UnoRuntime.queryInterface (XIndexAccess.class,oTRn); oObj = (XPropertySet) AnyConverter.toObject( new Type(XPropertySet.class),oIA.getByIndex(1)); diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextTables.java b/qadevOOo/tests/java/mod/_sw/SwXTextTables.java index f4c3c1caf4d8..4b32dde504d4 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextTables.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextTables.java @@ -114,10 +114,8 @@ public class SwXTextTables extends TestCase { + uE.getMessage(), uE); } - XMultiServiceFactory msf = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); - XTextTablesSupplier oTTSupp = (XTextTablesSupplier) - UnoRuntime.queryInterface(XTextTablesSupplier.class, msf); + XMultiServiceFactory msf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); + XTextTablesSupplier oTTSupp = UnoRuntime.queryInterface(XTextTablesSupplier.class, msf); oObj = oTTSupp.getTextTables(); if ( oTable != null ) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextView.java b/qadevOOo/tests/java/mod/_sw/SwXTextView.java index 6d5798ef1349..b27c77da8510 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextView.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextView.java @@ -144,12 +144,12 @@ public class SwXTextView extends TestCase { XTextCursor oCursor = oText.createTextCursor(); oFrame1 = SOF.createInstance (xTextDoc, "com.sun.star.text.TextFrame" ); - first = (XTextFrame)UnoRuntime.queryInterface + first = UnoRuntime.queryInterface ( XTextFrame.class, oFrame1); oText.insertTextContent(oCursor,first, false); first.getText().setString("Frame 1"); oFrame2 = SOF.createInstance(xTextDoc, "com.sun.star.text.TextFrame" ); - second = (XTextFrame)UnoRuntime.queryInterface + second = UnoRuntime.queryInterface ( XTextFrame.class, oFrame2); oText.insertTextContent(oCursor,second, false); second.getText().setString("Frame 2"); @@ -164,7 +164,7 @@ public class SwXTextView extends TestCase { throw new StatusException("Couldn't insert text table ", Ex); } - XSearchable oSearch = (XSearchable)UnoRuntime.queryInterface + XSearchable oSearch = UnoRuntime.queryInterface (XSearchable.class, xTextDoc); XSearchDescriptor xSDesc = oSearch.createSearchDescriptor(); xSDesc.setSearchString("SwXTextRanges"); @@ -188,10 +188,8 @@ public class SwXTextView extends TestCase { return -1; } - XIndexAccess indAc1 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o1); - XIndexAccess indAc2 = (XIndexAccess) - UnoRuntime.queryInterface(XIndexAccess.class, o2); + XIndexAccess indAc1 = UnoRuntime.queryInterface(XIndexAccess.class, o1); + XIndexAccess indAc2 = UnoRuntime.queryInterface(XIndexAccess.class, o2); if (indAc1 != null && indAc2 != null) { int c1 = indAc1.getCount(); @@ -199,10 +197,8 @@ public class SwXTextView extends TestCase { return c1 == c2 ? 0 : 1; } - XText text1 = (XText) - UnoRuntime.queryInterface(XText.class, o1); - XText text2 = (XText) - UnoRuntime.queryInterface(XText.class, o2); + XText text1 = UnoRuntime.queryInterface(XText.class, o1); + XText text2 = UnoRuntime.queryInterface(XText.class, o2); if (text1 != null && text2 != null) { return text1.getString().equals(text2.getString()) ? 0 : 1; @@ -214,8 +210,7 @@ public class SwXTextView extends TestCase { return compare(this, obj) == 0; } }); - XSelectionSupplier xsel = (XSelectionSupplier) - UnoRuntime.queryInterface(XSelectionSupplier.class,xContr); + XSelectionSupplier xsel = UnoRuntime.queryInterface(XSelectionSupplier.class,xContr); try { xsel.select(second); } catch (Exception e) { diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java index 3a160a55c901..00b6af83262c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java +++ b/qadevOOo/tests/java/mod/_sw/SwXTextViewCursor.java @@ -94,8 +94,7 @@ public class SwXTextViewCursor extends TestCase { // create testobject here oObj = xTextDoc.getCurrentController(); - XTextViewCursorSupplier oTVCSupp = (XTextViewCursorSupplier) - UnoRuntime.queryInterface(XTextViewCursorSupplier.class, oObj); + XTextViewCursorSupplier oTVCSupp = UnoRuntime.queryInterface(XTextViewCursorSupplier.class, oObj); oObj = oTVCSupp.getViewCursor(); diff --git a/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java index 3f7765d76631..93b67a715d84 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java +++ b/qadevOOo/tests/java/mod/_sw/SwXViewSettings.java @@ -84,8 +84,7 @@ public class SwXViewSettings extends TestCase { // create testobject here oObj = xTextDoc.getCurrentController(); - XViewSettingsSupplier oVSSupp = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, oObj); + XViewSettingsSupplier oVSSupp = UnoRuntime.queryInterface(XViewSettingsSupplier.class, oObj); oObj = oVSSupp.getViewSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java index 853d8aaa9f46..b5ce7ab8412c 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLContentExporter.java @@ -123,7 +123,7 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Writer.XMLContentExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xTextDoc); diff --git a/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java b/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java index eccb4306245e..760c9b1049c9 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLContentImporter.java @@ -151,7 +151,7 @@ public class XMLContentImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - final XTextDocument textDoc = (XTextDocument) UnoRuntime.queryInterface + final XTextDocument textDoc = UnoRuntime.queryInterface (XTextDocument.class, xTextDoc) ; final PrintWriter fLog = log ; tEnv.addObjRelation("XDocumentHandler.ImportChecker", diff --git a/qadevOOo/tests/java/mod/_sw/XMLExporter.java b/qadevOOo/tests/java/mod/_sw/XMLExporter.java index b40d6fde1cf4..66bcc8971825 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLExporter.java @@ -123,7 +123,7 @@ public class XMLExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Writer.XMLExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xTextDoc); diff --git a/qadevOOo/tests/java/mod/_sw/XMLImporter.java b/qadevOOo/tests/java/mod/_sw/XMLImporter.java index f15fcda68848..c6707c59bf11 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLImporter.java @@ -112,7 +112,7 @@ public class XMLImporter extends TestCase { try { oObj = (XInterface) xMSF.createInstance ("com.sun.star.comp.Writer.XMLImporter"); - XImporter xIm = (XImporter) UnoRuntime.queryInterface + XImporter xIm = UnoRuntime.queryInterface (XImporter.class,oObj); xIm.setTargetDocument(xTextDoc); } catch (com.sun.star.uno.Exception e) { @@ -142,7 +142,7 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("TargetDocument",xTextDoc); log.println("Implementation Name: "+util.utils.getImplName(oObj)); - final XTextDocument textDoc = (XTextDocument) UnoRuntime.queryInterface + final XTextDocument textDoc = UnoRuntime.queryInterface (XTextDocument.class, xTextDoc) ; final PrintWriter fLog = log ; tEnv.addObjRelation("XDocumentHandler.ImportChecker", diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java index 77cf1db58bc7..52df6783e384 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java @@ -124,14 +124,13 @@ public class XMLMetaExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Writer.XMLMetaExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xTextDoc); //set some meta data - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xTextDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface + (XDocumentInfoSupplier.class, xTextDoc) ; XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", TITLE); diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java index 705260fa02d2..6b24e0232efb 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java @@ -153,7 +153,7 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xTextDoc) ; final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; diff --git a/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java index 9a0ec50b4e07..2950cc7a6de2 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsExporter.java @@ -127,15 +127,14 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Writer.XMLSettingsExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xTextDoc); //set some settings XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, + xController); XPropertySet xPropSet = xViewSetSup.getViewSettings(); xPropSet.setPropertyValue("ZoomValue", new Short(ZOOM)); diff --git a/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java index f4bcc2f2b32c..db1ebaff1ba0 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLSettingsImporter.java @@ -174,8 +174,7 @@ public class XMLSettingsImporter extends TestCase { final PrintWriter logF = log ; XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = (XViewSettingsSupplier) - UnoRuntime.queryInterface(XViewSettingsSupplier.class, xController); + XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, xController); final XPropertySet xPropSet = xViewSetSup.getViewSettings(); tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { diff --git a/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java index 37a8186dcdbc..b854e9fd0ac6 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLStylesExporter.java @@ -121,7 +121,7 @@ public class XMLStylesExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Writer.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) UnoRuntime.queryInterface + XExporter xEx = UnoRuntime.queryInterface (XExporter.class,oObj); xEx.setSourceDocument(xTextDoc); } catch (com.sun.star.uno.Exception e) { @@ -139,7 +139,7 @@ public class XMLStylesExporter extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); // Obtain Footnotes properties - XFootnotesSupplier supp = (XFootnotesSupplier) UnoRuntime.queryInterface + XFootnotesSupplier supp = UnoRuntime.queryInterface (XFootnotesSupplier.class, xTextDoc); XPropertySet set = supp.getFootnoteSettings(); diff --git a/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java index e039d5ab4a4b..07de7aa86b0b 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLStylesImporter.java @@ -153,7 +153,7 @@ public class XMLStylesImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XFootnotesSupplier supp = (XFootnotesSupplier) UnoRuntime.queryInterface + XFootnotesSupplier supp = UnoRuntime.queryInterface (XFootnotesSupplier.class, xTextDoc); final XPropertySet set = supp.getFootnoteSettings(); final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java index 940a06a012c8..b8870c431417 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java @@ -96,7 +96,7 @@ public class AccessibleButton extends lib.TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); util.utils.shortWait(Param.getInt("ShortWait")); @@ -112,7 +112,7 @@ public class AccessibleButton extends lib.TestCase { Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -126,10 +126,10 @@ public class AccessibleButton extends lib.TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); @@ -141,7 +141,7 @@ public class AccessibleButton extends lib.TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); @@ -200,7 +200,7 @@ public class AccessibleButton extends lib.TestCase { } public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController xController = aModel.getCurrentController(); @@ -208,10 +208,10 @@ public class AccessibleButton extends lib.TestCase { //Opening PrinterSetupDialog try { String aSlotID = ".uno:Zoom"; - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, msf.createInstance( "com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java index c127b6531d62..a0a860d6f4aa 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java @@ -116,7 +116,7 @@ public class AccessibleCheckBox extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); util.utils.shortWait(Param.getInt("ShortWait")); @@ -134,7 +134,7 @@ public class AccessibleCheckBox extends TestCase { log.println("Getting the active TopWindow"); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -144,7 +144,7 @@ public class AccessibleCheckBox extends TestCase { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.CHECK_BOX); @@ -153,7 +153,7 @@ public class AccessibleCheckBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); @@ -165,7 +165,7 @@ public class AccessibleCheckBox extends TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); @@ -216,7 +216,7 @@ public class AccessibleCheckBox extends TestCase { } public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController xController = aModel.getCurrentController(); @@ -224,10 +224,10 @@ public class AccessibleCheckBox extends TestCase { //Opening PrinterSetupDialog try { String aSlotID = ".uno:InsertTable"; - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, msf.createInstance( "com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java index 5d90c32720a5..0f8af59271d9 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java @@ -90,7 +90,7 @@ public class AccessibleComboBox extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); DiagThread psDiag = new DiagThread(xTextDoc, @@ -105,20 +105,20 @@ public class AccessibleComboBox extends TestCase { Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = at.getAccessibleObject(xWindow); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Cancel"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB_LIST); - XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface( + XAccessibleSelection xAccSel = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); @@ -137,10 +137,10 @@ public class AccessibleComboBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); - final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp1 = UnoRuntime.queryInterface( XAccessibleComponent.class, action); @@ -201,7 +201,7 @@ public class AccessibleComboBox extends TestCase { } public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController xController = aModel.getCurrentController(); @@ -209,10 +209,10 @@ public class AccessibleComboBox extends TestCase { //Opening PrinterSetupDialog try { String aSlotID = ".uno:FontDialog"; - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider xDispProv = UnoRuntime.queryInterface( XDispatchProvider.class, xController); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer xParser = UnoRuntime.queryInterface( XURLTransformer.class, msf.createInstance( "com.sun.star.util.URLTransformer")); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java index 23611e7a10ec..77264b04a7ff 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownComboBox.java @@ -89,7 +89,7 @@ public class AccessibleDropDownComboBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleAction editAction = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction editAction = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java index b1b08878bbb0..6ec4eb7ffc9c 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java @@ -94,7 +94,7 @@ public class AccessibleDropDownListBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleAction acomp = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction acomp = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java index 9f5e09295e83..9d0f616fa329 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java @@ -99,15 +99,15 @@ public class AccessibleEdit extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -116,7 +116,7 @@ public class AccessibleEdit extends TestCase { try { XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -139,14 +139,14 @@ public class AccessibleEdit extends TestCase { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Close"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT); @@ -155,7 +155,7 @@ public class AccessibleEdit extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleEditableText edText = (XAccessibleEditableText) UnoRuntime.queryInterface( + final XAccessibleEditableText edText = UnoRuntime.queryInterface( XAccessibleEditableText.class, oObj); edText.setText("AccessibleEdit"); @@ -171,7 +171,7 @@ public class AccessibleEdit extends TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java index 30b9aef03a1e..4f88a2ccf515 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java @@ -87,40 +87,40 @@ public class AccessibleFixedText extends TestCase { XControlModel txtModel = null; try { - dlgModel = (XControlModel) UnoRuntime.queryInterface( + dlgModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlDialogModel")); - XControl dlgControl = (XControl) UnoRuntime.queryInterface( + XControl dlgControl = UnoRuntime.queryInterface( XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlDialog")); dlgControl.setModel(dlgModel); - txtModel = (XControlModel) UnoRuntime.queryInterface( + txtModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlFixedTextModel")); - txtControl = (XControl) UnoRuntime.queryInterface(XControl.class, + txtControl = UnoRuntime.queryInterface(XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlFixedText")); txtControl.setModel(txtModel); - XFixedText xFT = (XFixedText) UnoRuntime.queryInterface( + XFixedText xFT = UnoRuntime.queryInterface( XFixedText.class, txtControl); xFT.setText("FxedText"); - XControlContainer ctrlCont = (XControlContainer) UnoRuntime.queryInterface( + XControlContainer ctrlCont = UnoRuntime.queryInterface( XControlContainer.class, dlgControl); ctrlCont.addControl("Text", txtControl); - xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class, + xWinDlg = UnoRuntime.queryInterface(XWindow.class, dlgControl); xWinDlg.setVisible(true); @@ -154,7 +154,7 @@ public class AccessibleFixedText extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XWindow xWin = (XWindow) UnoRuntime.queryInterface(XWindow.class, + final XWindow xWin = UnoRuntime.queryInterface(XWindow.class, txtControl); tEnv.addObjRelation("EventProducer", @@ -165,7 +165,7 @@ public class AccessibleFixedText extends TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java index 51f452a829a9..6c560ba84ece 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java @@ -74,17 +74,17 @@ public class AccessibleList extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -93,7 +93,7 @@ public class AccessibleList extends TestCase { try { XInterface transf = (XInterface) msf.createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -116,7 +116,7 @@ public class AccessibleList extends TestCase { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -126,14 +126,14 @@ public class AccessibleList extends TestCase { // obtaining 'Close' button oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Close"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); // Selecting 'New Document' tab try { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE); - XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface( + XAccessibleSelection xAccSel = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); @@ -163,10 +163,10 @@ public class AccessibleList extends TestCase { tEnv.addObjRelation("XAccessibleSelection.multiSelection", new Boolean(false)); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); - final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp1 = UnoRuntime.queryInterface( XAccessibleComponent.class, action); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java index 57cb790a125a..7e911be8f7fd 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java @@ -98,17 +98,17 @@ public class AccessibleListBox extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -117,7 +117,7 @@ public class AccessibleListBox extends TestCase { try { XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -140,7 +140,7 @@ public class AccessibleListBox extends TestCase { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -151,14 +151,14 @@ public class AccessibleListBox extends TestCase { // obtaining 'Close' button oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Close"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); // Selecting 'New Document' tab try { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE); - XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface( + XAccessibleSelection xAccSel = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); @@ -177,10 +177,10 @@ public class AccessibleListBox extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, list); - final XAccessibleComponent acomp1 = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp1 = UnoRuntime.queryInterface( XAccessibleComponent.class, action); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java index c42c0bd2538d..b8cc440fdb93 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java @@ -95,17 +95,17 @@ public class AccessibleListItem extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -114,7 +114,7 @@ public class AccessibleListItem extends TestCase { try { XInterface transf = (XInterface) msf.createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -137,7 +137,7 @@ public class AccessibleListItem extends TestCase { AccessibilityTools at = new AccessibilityTools(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -147,14 +147,14 @@ public class AccessibleListItem extends TestCase { // obtaining 'Close' button oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Close"); - action = (XAccessibleAction) UnoRuntime.queryInterface( + action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); // Selecting 'New Document' tab try { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TREE); - XAccessibleSelection xAccSel = (XAccessibleSelection) UnoRuntime.queryInterface( + XAccessibleSelection xAccSel = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); @@ -174,7 +174,7 @@ public class AccessibleListItem extends TestCase { tEnv.addObjRelation("LimitedBounds", "yes"); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); tEnv.addObjRelation("EventProducer", diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java index 8ae3595185a6..6a644754b8c8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java @@ -118,9 +118,9 @@ public class AccessibleMenu extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleAction act1 = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction act1 = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); - final XAccessibleAction act2 = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction act2 = UnoRuntime.queryInterface( XAccessibleAction.class, menu2); tEnv.addObjRelation("EventProducer", @@ -140,7 +140,7 @@ public class AccessibleMenu extends TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java index a3ab54baf3de..2ef80e46a4a2 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java @@ -91,7 +91,7 @@ public class AccessibleMenuBar extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java index 23032a678260..990c5eca843a 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java @@ -92,7 +92,7 @@ public class AccessibleMenuItem extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); shortWait(); @@ -101,7 +101,7 @@ public class AccessibleMenuItem extends TestCase { Object atw = tk.getActiveTopWindow(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -113,7 +113,7 @@ public class AccessibleMenuItem extends TestCase { try { //activate Edit-Menu XAccessible Menu = MenuBar.getAccessibleChild(1); - XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface( + XAccessibleAction act = UnoRuntime.queryInterface( XAccessibleAction.class, Menu); act.doAccessibleAction(0); shortWait(); @@ -130,7 +130,7 @@ public class AccessibleMenuItem extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction action = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); tEnv.addObjRelation("EventProducer", @@ -143,7 +143,7 @@ public class AccessibleMenuItem extends TestCase { } }); - XAccessibleText text = (XAccessibleText) UnoRuntime.queryInterface( + XAccessibleText text = UnoRuntime.queryInterface( XAccessibleText.class, oObj); tEnv.addObjRelation("XAccessibleText.Text", text.getText()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java index 948c161d62e8..68bbc21bfc7e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java @@ -92,7 +92,7 @@ public class AccessibleMenuSeparator extends TestCase { try { //activate Edit-Menu XAccessible Menu = MenuBar.getAccessibleChild(1); - act = (XAccessibleAction) UnoRuntime.queryInterface( + act = UnoRuntime.queryInterface( XAccessibleAction.class, Menu); act.doAccessibleAction(0); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java index ca78597be9c9..9b5ef49c81e0 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java @@ -56,7 +56,7 @@ public class AccessiblePopupMenu extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -136,7 +136,7 @@ public class AccessiblePopupMenu extends TestCase { shortWait(tParam); - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XInterface oObj = null; @@ -151,7 +151,7 @@ public class AccessiblePopupMenu extends TestCase { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent window = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); point = window.getLocationOnScreen(); @@ -170,11 +170,11 @@ public class AccessiblePopupMenu extends TestCase { shortWait(tParam); - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); try { - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getTopWindow(0)); xRoot = at.getAccessibleObject(xWindow); @@ -193,7 +193,7 @@ public class AccessiblePopupMenu extends TestCase { tEnv.addObjRelation("XAccessibleSelection.multiSelection", new Boolean(false)); - final XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection sel = UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java index 9d0393b9b329..b346eb1076cb 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java @@ -93,7 +93,7 @@ public class AccessibleRadioButton extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -169,12 +169,12 @@ public class AccessibleRadioButton extends TestCase { util.utils.shortWait(2000); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -183,7 +183,7 @@ public class AccessibleRadioButton extends TestCase { try { XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -215,14 +215,14 @@ public class AccessibleRadioButton extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); util.utils.shortWait(2000); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -231,7 +231,7 @@ public class AccessibleRadioButton extends TestCase { xRoot, AccessibleRole.TREE, "IconChoiceControl"); - XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface( + XAccessibleSelection sel = UnoRuntime.queryInterface( XAccessibleSelection.class, iconChoiceCtrl); @@ -257,7 +257,7 @@ public class AccessibleRadioButton extends TestCase { "Close"); - accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface( + accCloseButton = UnoRuntime.queryInterface( XAccessibleAction.class, closeButton); log.println("ImplementationName: " + util.utils.getImplName(oObj)); @@ -269,7 +269,7 @@ public class AccessibleRadioButton extends TestCase { tEnv.addObjRelation("LimitedBounds", "yes"); - final XAccessibleComponent acomp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent acomp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); @@ -285,7 +285,7 @@ public class AccessibleRadioButton extends TestCase { tEnv.addObjRelation("EditOnly", "Can't change or select Text in AccessibleRadioButton"); - XAccessibleValue anotherButtonValue = (XAccessibleValue) UnoRuntime.queryInterface( + XAccessibleValue anotherButtonValue = UnoRuntime.queryInterface( XAccessibleValue.class, anotherButton); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java index 018aa7df6b4c..ba9ce4ee6d9e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleScrollBar.java @@ -80,7 +80,7 @@ public class AccessibleScrollBar extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -137,7 +137,7 @@ public class AccessibleScrollBar extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc); + XModel aModel = UnoRuntime.queryInterface(XModel.class, xDoc); XInterface oObj = null; @@ -151,7 +151,7 @@ public class AccessibleScrollBar extends TestCase { oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLL_BAR); - final XAccessibleAction act = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction act = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); log.println("ImplementationName: " + util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java index 0d67925ea928..85f77a8e1c8d 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBar.java @@ -151,7 +151,7 @@ public class AccessibleStatusBar extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + final XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); tEnv.addObjRelation("EventProducer", diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java index 2b74b10cfbe0..7ee8dafc7181 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleStatusBarItem.java @@ -80,7 +80,7 @@ public class AccessibleStatusBarItem extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -140,7 +140,7 @@ public class AccessibleStatusBarItem extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java index b50f6ef1118d..8810e79b33ff 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java @@ -87,7 +87,7 @@ public class AccessibleTabControl extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -163,12 +163,12 @@ public class AccessibleTabControl extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -177,7 +177,7 @@ public class AccessibleTabControl extends TestCase { try { XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -209,14 +209,14 @@ public class AccessibleTabControl extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -228,14 +228,14 @@ public class AccessibleTabControl extends TestCase { AccessibleRole.PUSH_BUTTON, "Close"); - accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface( + accCloseButton = UnoRuntime.queryInterface( XAccessibleAction.class, closeButton); log.println("ImplementationName: " + util.utils.getImplName(oObj)); TestEnvironment tEnv = new TestEnvironment(oObj); - final XAccessibleSelection selection = (XAccessibleSelection) (XAccessibleSelection) UnoRuntime.queryInterface( + final XAccessibleSelection selection = (XAccessibleSelection) UnoRuntime.queryInterface( XAccessibleSelection.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java index 7f0526a697e0..bd5f29f57b93 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java @@ -84,7 +84,7 @@ public class AccessibleTabPage extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -169,12 +169,12 @@ public class AccessibleTabPage extends TestCase { shortWait(); - XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); XController secondController = aModel1.getCurrentController(); - XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider aProv = UnoRuntime.queryInterface( XDispatchProvider.class, secondController); @@ -183,7 +183,7 @@ public class AccessibleTabPage extends TestCase { try { XInterface transf = (XInterface) ((XMultiServiceFactory) tParam.getMSF()).createInstance( "com.sun.star.util.URLTransformer"); - urlTransf = (XURLTransformer) UnoRuntime.queryInterface( + urlTransf = UnoRuntime.queryInterface( XURLTransformer.class, transf); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); @@ -215,14 +215,14 @@ public class AccessibleTabPage extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); AccessibilityTools at = new AccessibilityTools(); shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -231,7 +231,7 @@ public class AccessibleTabPage extends TestCase { AccessibleRole.PUSH_BUTTON, "Close"); - accCloseButton = (XAccessibleAction) UnoRuntime.queryInterface( + accCloseButton = UnoRuntime.queryInterface( XAccessibleAction.class, closeButton); oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB); @@ -243,7 +243,7 @@ public class AccessibleTabPage extends TestCase { tEnv.addObjRelation("EditOnly", "toolkit.AccessibleTabPage"); tEnv.addObjRelation("LimitedBounds", "toolkit.AccessibleTabPage"); - XAccessibleComponent accComp = (XAccessibleComponent) UnoRuntime.queryInterface( + XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); final Point point = accComp.getLocationOnScreen(); @@ -251,7 +251,7 @@ public class AccessibleTabPage extends TestCase { shortWait(); XInterface xEventInt = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables"); - final XAccessibleComponent eventAccComp = (XAccessibleComponent) UnoRuntime.queryInterface( + final XAccessibleComponent eventAccComp = UnoRuntime.queryInterface( XAccessibleComponent.class, xEventInt); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java index 91d42eeeb99a..f634a024ef5e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBox.java @@ -70,7 +70,7 @@ public class AccessibleToolBox extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -159,7 +159,7 @@ public class AccessibleToolBox extends TestCase { util.dbg.printInterfaces(child); - final XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction action = UnoRuntime.queryInterface( XAccessibleAction.class, child); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java index 04e9491a0790..244a158894e7 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleToolBoxItem.java @@ -84,7 +84,7 @@ public class AccessibleToolBoxItem extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -145,7 +145,7 @@ public class AccessibleToolBoxItem extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XInterface oObj = null; @@ -173,7 +173,7 @@ public class AccessibleToolBoxItem extends TestCase { tEnv.addObjRelation("LimitedBounds", "yes"); - final XAccessibleAction oAction = (XAccessibleAction) UnoRuntime.queryInterface( + final XAccessibleAction oAction = UnoRuntime.queryInterface( XAccessibleAction.class, oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java index fd72dbd2e70e..d43c66b164a4 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleWindow.java @@ -86,7 +86,7 @@ public class AccessibleWindow extends TestCase { * Creates the Desktop service (<code>com.sun.star.frame.Desktop</code>). */ protected void initialize(TestParameters Param, PrintWriter log) { - the_Desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, + the_Desk = UnoRuntime.queryInterface(XDesktop.class, DesktopTools.createDesktop( (XMultiServiceFactory) Param.getMSF())); } @@ -154,7 +154,7 @@ public class AccessibleWindow extends TestCase { throw new StatusException("Couldn't create document", e); } - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XInterface oObj = null; @@ -175,13 +175,13 @@ public class AccessibleWindow extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - final XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( + final XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { - XWindow xWin = (XWindow) UnoRuntime.queryInterface( + XWindow xWin = UnoRuntime.queryInterface( XWindow.class, tk.getActiveTopWindow()); Rectangle newPosSize = xWin.getPosSize(); newPosSize.Width = newPosSize.Width - 20; diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java index 6838e6fe3157..778970733c52 100644 --- a/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java +++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeDataModel.java @@ -82,7 +82,7 @@ public class MutableTreeDataModel extends TestCase { public void fireEvent(){ - XMutableTreeDataModel xModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class, oObj); + XMutableTreeDataModel xModel = UnoRuntime.queryInterface(XMutableTreeDataModel.class, oObj); XMutableTreeNode node = xModel.createNode("EventNode", true); try { xModel.setRoot(node); diff --git a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java index 1a3a50f30df8..41fd13b6b435 100644 --- a/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java +++ b/qadevOOo/tests/java/mod/_toolkit/MutableTreeNode.java @@ -71,7 +71,7 @@ public class MutableTreeNode extends TestCase { XMutableTreeNode xNode; try { - mXTreeDataModel = (XMutableTreeDataModel) UnoRuntime.queryInterface(XMutableTreeDataModel.class, + mXTreeDataModel = UnoRuntime.queryInterface(XMutableTreeDataModel.class, mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel")); } catch (com.sun.star.uno.Exception ex) { throw new StatusException(Status.failed("ERROR: could not create instance of" + @@ -129,8 +129,7 @@ public class MutableTreeNode extends TestCase { } catch (com.sun.star.uno.Exception ex) { ex.printStackTrace(); } - XSimpleFileAccess sA = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); + XSimpleFileAccess sA = UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); dirlist(officeUserPath, xNode); @@ -145,8 +144,7 @@ public class MutableTreeNode extends TestCase { } catch (com.sun.star.uno.Exception ex) { ex.printStackTrace(); } - XSimpleFileAccess sfa = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); + XSimpleFileAccess sfa = UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); XMutableTreeNode xChildNode = null; try { xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir)); diff --git a/qadevOOo/tests/java/mod/_toolkit/TabController.java b/qadevOOo/tests/java/mod/_toolkit/TabController.java index da98a08e2200..8730b99cd2e9 100644 --- a/qadevOOo/tests/java/mod/_toolkit/TabController.java +++ b/qadevOOo/tests/java/mod/_toolkit/TabController.java @@ -86,7 +86,7 @@ public class TabController extends TestCase { WriterTools.getDrawPage(xTextDoc).add((XShape) aShape); XControlModel model = aShape.getControl(); - XControlAccess access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -108,10 +108,10 @@ public class TabController extends TestCase { e.printStackTrace(log); } - tabCtrlModel = (XTabControllerModel) UnoRuntime.queryInterface( + tabCtrlModel = UnoRuntime.queryInterface( XTabControllerModel.class, form); - aCtrlContainer = (XControlContainer) UnoRuntime.queryInterface( + aCtrlContainer = UnoRuntime.queryInterface( XControlContainer.class, xCtrl1.getContext()); // create object diff --git a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java index cab81aa588dc..e4e3ddc36bdb 100644 --- a/qadevOOo/tests/java/mod/_toolkit/Toolkit.java +++ b/qadevOOo/tests/java/mod/_toolkit/Toolkit.java @@ -90,10 +90,10 @@ public class Toolkit extends TestCase { XControlModel the_Model = aShape.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); - XController cntrlr = (XController) UnoRuntime.queryInterface( + XController cntrlr = UnoRuntime.queryInterface( XController.class, xTextDoc.getCurrentController()); @@ -112,7 +112,7 @@ public class Toolkit extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); log.println(" creating a new environment for toolkit object"); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java index c7c534cb8c6b..30247d29dbee 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlButton.java @@ -94,7 +94,7 @@ public class UnoControlButton extends TestCase { XControlModel the_Model = aShape.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java index ad4c168057c1..b5a67eb9acde 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCheckBox.java @@ -95,7 +95,7 @@ public class UnoControlCheckBox extends TestCase { XControlModel the_Model = aShape.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -130,7 +130,7 @@ public class UnoControlCheckBox extends TestCase { // adding object relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener(); - XCheckBox check = (XCheckBox) UnoRuntime.queryInterface( + XCheckBox check = UnoRuntime.queryInterface( XCheckBox.class, oObj); check.addItemListener(listener); tEnv.addObjRelation("TestItemListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java index e5690362eda1..9994981195fa 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlComboBox.java @@ -97,7 +97,7 @@ util.DesktopTools.closeDoc(xTextDoc); XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -130,7 +130,7 @@ util.DesktopTools.closeDoc(xTextDoc); tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -139,7 +139,7 @@ util.DesktopTools.closeDoc(xTextDoc); // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java index 0d76cc30d1df..8886950357af 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java @@ -101,7 +101,7 @@ public class UnoControlContainer extends TestCase { 10000, "TextField"); WriterTools.getDrawPage(xTextDoc).add((XShape) shape); model = shape.getControl(); - access = (XControlAccess) UnoRuntime.queryInterface( + access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); try { @@ -117,7 +117,7 @@ public class UnoControlContainer extends TestCase { 10000, "TextField"); WriterTools.getDrawPage(xTextDoc).add((XShape) shape); model = shape.getControl(); - access = (XControlAccess) UnoRuntime.queryInterface( + access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); try { @@ -133,7 +133,7 @@ public class UnoControlContainer extends TestCase { 10000, "CommandButton"); WriterTools.getDrawPage(xTextDoc).add((XShape) shape); model = shape.getControl(); - access = (XControlAccess) UnoRuntime.queryInterface( + access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); try { @@ -156,7 +156,7 @@ public class UnoControlContainer extends TestCase { XControlModel the_Model = aShape.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTD2.getCurrentController()); @@ -188,11 +188,11 @@ public class UnoControlContainer extends TestCase { oObj = (XInterface) ((XMultiServiceFactory) param.getMSF()).createInstance( "com.sun.star.awt.UnoControlContainer"); - XControl xCtrl = (XControl) UnoRuntime.queryInterface( + XControl xCtrl = UnoRuntime.queryInterface( XControl.class, oObj); xCtrl.setModel(the_Model); - ctrlCont = (XControlContainer) UnoRuntime.queryInterface( + ctrlCont = UnoRuntime.queryInterface( XControlContainer.class, oObj); ctrlCont.addControl("jupp", access.getControl(aShape.getControl())); } catch (Exception e) { @@ -205,7 +205,7 @@ public class UnoControlContainer extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, oObj); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, oObj); Rectangle ps = xWindow.getPosSize(); xWindow.setPosSize(ps.X+10, ps.Y+10, ps.Width+10, ps.Height+10, PosSize.POSSIZE); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java index 883e12d7bba3..6950343d205f 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlCurrencyField.java @@ -98,7 +98,7 @@ public class UnoControlCurrencyField extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -132,7 +132,7 @@ public class UnoControlCurrencyField extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -141,7 +141,7 @@ public class UnoControlCurrencyField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java index ecd74f642f7b..0beb53871adc 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDateField.java @@ -95,7 +95,7 @@ public class UnoControlDateField extends TestCase { XControlModel the_Model = aShape.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -147,7 +147,7 @@ public class UnoControlDateField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java index 9c002b349a20..c16b2e2b5ef4 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialog.java @@ -106,24 +106,24 @@ public class UnoControlDialog extends TestCase { } try { - dlgModel = (XControlModel) UnoRuntime.queryInterface( + dlgModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlDialogModel")); - XControl dlgControl = (XControl) UnoRuntime.queryInterface( + XControl dlgControl = UnoRuntime.queryInterface( XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlDialog")); dlgControl.setModel(dlgModel); - XControlModel butModel = (XControlModel) UnoRuntime.queryInterface( + XControlModel butModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButtonModel")); - butControl = (XControl) UnoRuntime.queryInterface(XControl.class, + butControl = UnoRuntime.queryInterface(XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButton")); @@ -131,44 +131,44 @@ public class UnoControlDialog extends TestCase { // creating additional controls for XUnoControlContainer - tabControl1 = (XTabController) UnoRuntime.queryInterface( + tabControl1 = UnoRuntime.queryInterface( XTabController.class, xMSF.createInstance( "com.sun.star.awt.TabController")); - tabControl2 = (XTabController) UnoRuntime.queryInterface( + tabControl2 = UnoRuntime.queryInterface( XTabController.class, xMSF.createInstance( "com.sun.star.awt.TabController")); // creating additional controls for XControlContainer - butModel = (XControlModel) UnoRuntime.queryInterface( + butModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButtonModel")); - butControl1 = (XControl) UnoRuntime.queryInterface(XControl.class, + butControl1 = UnoRuntime.queryInterface(XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButton")); butControl1.setModel(butModel); - butModel = (XControlModel) UnoRuntime.queryInterface( + butModel = UnoRuntime.queryInterface( XControlModel.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButtonModel")); - butControl2 = (XControl) UnoRuntime.queryInterface(XControl.class, + butControl2 = UnoRuntime.queryInterface(XControl.class, xMSF.createInstance( "com.sun.star.awt.UnoControlButton")); butControl2.setModel(butModel); - ctrlCont = (XControlContainer) UnoRuntime.queryInterface( + ctrlCont = UnoRuntime.queryInterface( XControlContainer.class, dlgControl); - xWinDlg = (XWindow) UnoRuntime.queryInterface(XWindow.class, + xWinDlg = UnoRuntime.queryInterface(XWindow.class, dlgControl); xWinDlg.setVisible(true); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java index 0857a6e07f01..f254bf745f33 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlDialogModel.java @@ -95,7 +95,7 @@ public class UnoControlDialogModel extends TestCase { // get the service manager from the dialog model - xMultiServiceFactory = (XMultiServiceFactory) UnoRuntime.queryInterface( + xMultiServiceFactory = UnoRuntime.queryInterface( XMultiServiceFactory.class, dialogModel); @@ -133,13 +133,13 @@ public class UnoControlDialogModel extends TestCase { xNameCont.insertByName(_labelName, labelModel); // create the dialog control and set the model - XControl dialog = (XControl) UnoRuntime.queryInterface( + XControl dialog = UnoRuntime.queryInterface( XControl.class, ((XMultiServiceFactory) Param.getMSF()).createInstance( "com.sun.star.awt.UnoControlDialog")); - XControl xControl = (XControl) UnoRuntime.queryInterface( + XControl xControl = UnoRuntime.queryInterface( XControl.class, dialog); - XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface( + XControlModel xControlModel = UnoRuntime.queryInterface( XControlModel.class, dialogModel); xControl.setModel(xControlModel); @@ -151,7 +151,7 @@ public class UnoControlDialogModel extends TestCase { log.println("creating a new environment for object"); - XMultiServiceFactory oMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( + XMultiServiceFactory oMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, oObj); TestEnvironment tEnv = new TestEnvironment(oObj); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java index 46c91df97749..8815295c239c 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlEdit.java @@ -98,7 +98,7 @@ public class UnoControlEdit extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -131,7 +131,7 @@ public class UnoControlEdit extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -140,7 +140,7 @@ public class UnoControlEdit extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java index e799e291a634..d259ffdc90bd 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFileControl.java @@ -98,7 +98,7 @@ public class UnoControlFileControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -132,7 +132,7 @@ public class UnoControlFileControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -141,7 +141,7 @@ public class UnoControlFileControl extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java index b8318c23a7a6..18d3c00d67d5 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFixedText.java @@ -97,7 +97,7 @@ public class UnoControlFixedText extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -131,7 +131,7 @@ public class UnoControlFixedText extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java index 0bbfc7269c95..c46b879f8ed6 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlFormattedField.java @@ -102,7 +102,7 @@ public class UnoControlFormattedField extends TestCase { XPropertySet.class, the_Model); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -137,7 +137,7 @@ public class UnoControlFormattedField extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -146,7 +146,7 @@ public class UnoControlFormattedField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java index bd270c939415..86761173d7d6 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlGroupBox.java @@ -97,7 +97,7 @@ public class UnoControlGroupBox extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -130,7 +130,7 @@ public class UnoControlGroupBox extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java index 32b03e9cdb87..ea60ce757147 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlImageControl.java @@ -101,7 +101,7 @@ public class UnoControlImageControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -139,7 +139,7 @@ public class UnoControlImageControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java index 189846ca3a6e..5d027152af12 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlListBox.java @@ -98,7 +98,7 @@ public class UnoControlListBox extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -134,12 +134,12 @@ public class UnoControlListBox extends TestCase { // adding object relation for XItemListener ifc.awt._XItemListener.TestItemListener listener = new ifc.awt._XItemListener.TestItemListener(); - XListBox list = (XListBox) UnoRuntime.queryInterface(XListBox.class, + XListBox list = UnoRuntime.queryInterface(XListBox.class, oObj); list.addItemListener(listener); tEnv.addObjRelation("TestItemListener", listener); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java index fc2d27a28740..a49384e924f2 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlNumericField.java @@ -66,7 +66,7 @@ public class UnoControlNumericField extends TestCase { log.println(" disposing xTextDoc "); try { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( + XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); closer.close(true); } catch (com.sun.star.util.CloseVetoException e) { @@ -105,7 +105,7 @@ public class UnoControlNumericField extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -139,7 +139,7 @@ public class UnoControlNumericField extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -148,7 +148,7 @@ public class UnoControlNumericField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java index 2123d3581479..766d1eb07839 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlPatternField.java @@ -98,7 +98,7 @@ public class UnoControlPatternField extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -132,7 +132,7 @@ public class UnoControlPatternField extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -141,7 +141,7 @@ public class UnoControlPatternField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java index a23650d746d8..593bd53cdd70 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlRadioButton.java @@ -97,7 +97,7 @@ public class UnoControlRadioButton extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -131,7 +131,7 @@ public class UnoControlRadioButton extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java index 34d01fc20ccb..de9cf193df10 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlTimeField.java @@ -98,7 +98,7 @@ public class UnoControlTimeField extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -132,7 +132,7 @@ public class UnoControlTimeField extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); @@ -141,7 +141,7 @@ public class UnoControlTimeField extends TestCase { // Adding relation for XTextListener ifc.awt._XTextListener.TestTextListener listener = new ifc.awt._XTextListener.TestTextListener(); - XTextComponent textComp = (XTextComponent) UnoRuntime.queryInterface( + XTextComponent textComp = UnoRuntime.queryInterface( XTextComponent.class, oObj); textComp.addTextListener(listener); tEnv.addObjRelation("TestTextListener", listener); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java index b896dec76380..c331429494b3 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoScrollBarControl.java @@ -62,7 +62,7 @@ public class UnoScrollBarControl extends TestCase { xTextDoc = SOF.createTextDoc(null); log.println("maximize the window size"); - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XFrame xFrame = xModel.getCurrentController().getFrame(); XWindow xWin = xFrame.getContainerWindow(); @@ -120,7 +120,7 @@ public class UnoScrollBarControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -158,7 +158,7 @@ public class UnoScrollBarControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java index c19c86862211..8f10bfa41104 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoSpinButtonControl.java @@ -88,7 +88,7 @@ public class UnoSpinButtonControl extends TestCase { XControlModel the_Model2 = aShape2.getControl(); //Try to query XControlAccess - XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface( + XControlAccess the_access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); @@ -126,7 +126,7 @@ public class UnoSpinButtonControl extends TestCase { tEnv.addObjRelation("TOOLKIT", the_kit); tEnv.addObjRelation("MODEL", the_Model); - XWindow forObjRel = (XWindow) UnoRuntime.queryInterface(XWindow.class, + XWindow forObjRel = UnoRuntime.queryInterface(XWindow.class, aControl); tEnv.addObjRelation("XWindow.AnotherWindow", forObjRel); diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java index 1d78ffef0254..eee6fa0f5000 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoTreeControl.java @@ -91,9 +91,8 @@ public class UnoTreeControl extends TestCase { try { - mXTreeDataModel = (XMutableTreeDataModel ) - UnoRuntime.queryInterface(XMutableTreeDataModel.class, - mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel")); + mXTreeDataModel = UnoRuntime.queryInterface(XMutableTreeDataModel.class, + mxMSF.createInstance("com.sun.star.awt.tree.MutableTreeDataModel")); xNode = mXTreeDataModel.createNode("UnoTreeControl", false); @@ -105,9 +104,8 @@ public class UnoTreeControl extends TestCase { mXTreeDataModel.setRoot(xNode); - XControlModel xDialogModel = (XControlModel) - UnoRuntime.queryInterface(XControlModel.class, - mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel")); + XControlModel xDialogModel = UnoRuntime.queryInterface(XControlModel.class, + mxMSF.createInstance("com.sun.star.awt.UnoControlDialogModel")); XPropertySet xDialogPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDialogModel); xDialogPropertySet.setPropertyValue( "PositionX", new Integer(50) ); @@ -116,12 +114,10 @@ public class UnoTreeControl extends TestCase { xDialogPropertySet.setPropertyValue( "Height", new Integer(256) ); xDialogPropertySet.setPropertyValue( "Title", "Tree Control Test"); - XMultiServiceFactory xDialogMSF = (XMultiServiceFactory) - UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); + XMultiServiceFactory xDialogMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); - XControlModel xTreeControlModel = (XControlModel) - UnoRuntime.queryInterface(XControlModel.class, - xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel")); + XControlModel xTreeControlModel = UnoRuntime.queryInterface(XControlModel.class, + xDialogMSF.createInstance("com.sun.star.awt.tree.TreeControlModel")); XPropertySet XTreeControlModelSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTreeControlModel); @@ -141,28 +137,25 @@ public class UnoTreeControl extends TestCase { xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel); - XControl xDialogControl = (XControl) - UnoRuntime.queryInterface(XControl.class, + XControl xDialogControl = UnoRuntime.queryInterface(XControl.class, mxMSF.createInstance("com.sun.star.awt.UnoControlDialog")); xDialogControl.setModel( xDialogModel ); - XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, + XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, mxMSF.createInstance("com.sun.star.awt.Toolkit" )); xDialogControl.createPeer( xToolkit, null ); // get the peers of the sub controls from the dialog peer container - XControlContainer xDialogContainer = (XControlContainer) - UnoRuntime.queryInterface(XControlContainer.class ,xDialogControl); + XControlContainer xDialogContainer = UnoRuntime.queryInterface(XControlContainer.class ,xDialogControl); - XTreeControl xTreeControl = (XTreeControl) - UnoRuntime.queryInterface(XTreeControl.class, xDialogContainer.getControl( sTreeControlName )); + XTreeControl xTreeControl = UnoRuntime.queryInterface(XTreeControl.class, xDialogContainer.getControl( sTreeControlName )); xTreeControl.expandNode(xNode); oObj = xTreeControl; - XDialog xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xDialogControl); + XDialog xDialog = UnoRuntime.queryInterface(XDialog.class, xDialogControl); execurteDialog aDialog = new execurteDialog(xDialog); @@ -190,7 +183,7 @@ public class UnoTreeControl extends TestCase { tEnv.addObjRelation("Comparer", new Comparator() { public int compare(Object o1, Object o2) { - XMutableTreeNode xNode1 = (XMutableTreeNode) UnoRuntime.queryInterface( + XMutableTreeNode xNode1 = UnoRuntime.queryInterface( XMutableTreeNode.class, o1); XTreeNode xNode2a = null; try { @@ -199,7 +192,7 @@ public class UnoTreeControl extends TestCase { ex.printStackTrace(); } - XMutableTreeNode xNode2 = (XMutableTreeNode) UnoRuntime.queryInterface( + XMutableTreeNode xNode2 = UnoRuntime.queryInterface( XMutableTreeNode.class, xNode2a); if (((String) xNode1.getDataValue()).equals((String)xNode2.getDataValue())) { @@ -227,8 +220,7 @@ public class UnoTreeControl extends TestCase { } catch (com.sun.star.uno.Exception ex) { ex.printStackTrace(); } - XSimpleFileAccess sA = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); + XSimpleFileAccess sA = UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); dirlist(officeUserPath, xNode); @@ -243,8 +235,7 @@ public class UnoTreeControl extends TestCase { } catch (com.sun.star.uno.Exception ex) { ex.printStackTrace(); } - XSimpleFileAccess sfa = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); + XSimpleFileAccess sfa = UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc); XMutableTreeNode xChildNode = null; try { xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir)); diff --git a/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java b/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java index 7e9f930d0a71..25e33f88769d 100644 --- a/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java +++ b/qadevOOo/tests/java/mod/_ucb/UniversalContentBroker.java @@ -58,8 +58,7 @@ public class UniversalContentBroker extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj); System.out.println("ImplementationName: "+util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java b/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java index dfe283e777d1..91a49cfe2738 100644 --- a/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucpchelp/CHelpContentProvider.java @@ -52,8 +52,7 @@ public class CHelpContentProvider extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB); System.out.println("ImplementationName: "+util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java index b86b5b25f3f0..cdd9b2a5e102 100644 --- a/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucpdav/WebDAVContentProvider.java @@ -61,7 +61,7 @@ public class WebDAVContentProvider extends TestCase { XContentIdentifierFactory xCIF; try { - xCIF = (XContentIdentifierFactory)UnoRuntime.queryInterface( + xCIF = UnoRuntime.queryInterface( XContentIdentifierFactory.class, xMSF.createInstance( "com.sun.star.comp.ucb.UniversalContentBroker")); diff --git a/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java b/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java index 47c4fea2759a..3a69920f01ad 100644 --- a/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java +++ b/qadevOOo/tests/java/mod/_ucpfile/FileProvider.java @@ -49,8 +49,7 @@ public class FileProvider extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,oObj); System.out.println("ImplementationName: "+util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java b/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java index 7d2c61616b49..2e0dd6743a5c 100644 --- a/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucpftp/FTPContentProvider.java @@ -52,8 +52,7 @@ public class FTPContentProvider extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,aUCB); log.println("ImplementationName: "+util.utils.getImplName(oObj)); util.dbg.printInterfaces(oObj); diff --git a/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java index 0aba05931b2a..cc5771b16f7a 100644 --- a/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucphier/HierarchyContentProvider.java @@ -52,8 +52,7 @@ public class HierarchyContentProvider extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb); System.out.println("ImplementationName: "+util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java b/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java index e01878282584..08868472b295 100644 --- a/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucppkg/PackageContentProvider.java @@ -52,8 +52,7 @@ public class PackageContentProvider extends TestCase { oObj = (XInterface) oInterface; - XContentIdentifierFactory CIF = (XContentIdentifierFactory) - UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb); + XContentIdentifierFactory CIF = UnoRuntime.queryInterface(XContentIdentifierFactory.class,ucb); System.out.println("ImplementationName: "+util.utils.getImplName(oObj)); diff --git a/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java b/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java index d17de51c2ae2..0d6736158a72 100644 --- a/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java +++ b/qadevOOo/tests/java/mod/_ucprmt/ContentProvider.java @@ -81,7 +81,7 @@ public class ContentProvider extends TestCase { try { oObj = (XInterface) xMSF.createInstance ("com.sun.star.ucb.RemoteAccessContentProvider"); - cntIDFac = (XContentIdentifierFactory) UnoRuntime.queryInterface + cntIDFac = UnoRuntime.queryInterface (XContentIdentifierFactory.class, oObj) ; } catch( com.sun.star.uno.Exception e ) { diff --git a/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java b/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java index bdc2f71d3cd8..6d677ca8518f 100644 --- a/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java +++ b/qadevOOo/tests/java/mod/_ucprmt/ProviderAcceptor.java @@ -51,8 +51,7 @@ public class ProviderAcceptor extends TestCase { TestEnvironment tEnv = new TestEnvironment( oObj ); //adding ObjRelation for XRemoteContentProviderAcceptor - XRemoteContentProviderAcceptor xRCPA = (XRemoteContentProviderAcceptor) - UnoRuntime.queryInterface(XRemoteContentProviderAcceptor.class,oObj); + XRemoteContentProviderAcceptor xRCPA = UnoRuntime.queryInterface(XRemoteContentProviderAcceptor.class,oObj); tEnv.addObjRelation("RCPA",xRCPA); diff --git a/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java b/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java index a1cd72355e09..c8aa65ab3479 100644 --- a/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java +++ b/qadevOOo/tests/java/mod/_ucprmt/ProxyProvider.java @@ -43,7 +43,7 @@ public class ProxyProvider extends TestCase { try { oObj = (XInterface) xMSF.createInstance ("com.sun.star.ucb.RemoteProxyContentProvider"); - cntIDFac = (XContentIdentifierFactory) UnoRuntime.queryInterface + cntIDFac = UnoRuntime.queryInterface (XContentIdentifierFactory.class, oObj) ; } catch( com.sun.star.uno.Exception e ) { log.println("Can't create an object." ); diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java index 796778b964a6..c7922f7f342f 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java @@ -126,8 +126,7 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Chart.XMLContentExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java index 4399639889de..82b1a43a5f95 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java @@ -127,8 +127,7 @@ public class XMLExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Chart.XMLExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java index 56f2174aa35a..206a717c7f40 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesExporter.java @@ -122,8 +122,7 @@ public class XMLStylesExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Chart.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xChartDoc); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java index 93f9b2ce16b1..287695778987 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java @@ -132,12 +132,10 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Draw.XMLContentExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); //xEx.setSourceDocument(xDrawDoc); - XDrawPagesSupplier supp = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier supp = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages set = supp.getDrawPages(); // This is an XML-export BUG (new slide named "NewSlide2" @@ -146,13 +144,11 @@ public class XMLContentExporter extends TestCase { XDrawPage page1 = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); - XNamed NPage1 = (XNamed) - UnoRuntime.queryInterface(XNamed.class,page1); + XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); XDrawPage page2 = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); - XNamed NPage2 = (XNamed) - UnoRuntime.queryInterface(XNamed.class,page2); + XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); xEx.setSourceDocument(xDrawDoc); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java index 85fdbd78ab60..42b181d44cda 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentImporter.java @@ -167,14 +167,13 @@ public class XMLContentImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { public boolean checkImport() { - XDrawPagesSupplier supp = (XDrawPagesSupplier) - UnoRuntime.queryInterface - (XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier supp = UnoRuntime.queryInterface + (XDrawPagesSupplier.class, xDrawDoc); final XDrawPages xPages = supp.getDrawPages(); XNamed[] pageArray = new XNamed[ xPages.getCount() ]; for (int i=0; i < xPages.getCount(); i++) { try { - pageArray[i] = (XNamed) UnoRuntime.queryInterface + pageArray[i] = UnoRuntime.queryInterface (XNamed.class, xPages.getByIndex(i)); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(fLog) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java index 3dd8fc7defa4..9bce636bb357 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java @@ -135,8 +135,7 @@ public class XMLExporter extends TestCase { "com.sun.star.comp.Draw.XMLExporter", new Object[] {arg}); - XDrawPagesSupplier supp = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier supp = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xDrawDoc); XDrawPages set = supp.getDrawPages(); // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML) @@ -144,17 +143,14 @@ public class XMLExporter extends TestCase { XDrawPage page1 = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); - XNamed NPage1 = (XNamed) - UnoRuntime.queryInterface(XNamed.class,page1); + XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); XDrawPage page2 = (XDrawPage) UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); - XNamed NPage2 = (XNamed) - UnoRuntime.queryInterface(XNamed.class,page2); + XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xDrawDoc); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java index 90b8fcd55492..c0c52136a8b2 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLImporter.java @@ -166,14 +166,13 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { public boolean checkImport() { - XDrawPagesSupplier supp = (XDrawPagesSupplier) - UnoRuntime.queryInterface - (XDrawPagesSupplier.class, xDrawDoc); + XDrawPagesSupplier supp = UnoRuntime.queryInterface + (XDrawPagesSupplier.class, xDrawDoc); final XDrawPages xPages = supp.getDrawPages(); XNamed[] pageArray = new XNamed[ xPages.getCount() ]; for (int i=0; i < xPages.getCount(); i++) { try { - pageArray[i] = (XNamed) UnoRuntime.queryInterface + pageArray[i] = UnoRuntime.queryInterface (XNamed.class, xPages.getByIndex(i)); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(fLog) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java index 6e5b49735611..e572aeb7c13f 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java @@ -124,14 +124,12 @@ public class XMLMetaExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Draw.XMLMetaExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class, oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class, oObj); xEx.setSourceDocument(xDrawDoc); //set some meta data - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface(XDocumentInfoSupplier.class, - xDrawDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, + xDrawDoc) ; XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", TITLE); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java index 038bc1b25cb3..7c951ad28ab8 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java @@ -152,9 +152,8 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; //set some meta data - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xDrawDoc); + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface + (XDocumentInfoSupplier.class, xDrawDoc); final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()); final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java index fcb0927c8f9a..5b6ff5b1df0b 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java @@ -125,13 +125,11 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Draw.XMLSettingsExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class, oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class, oObj); xEx.setSourceDocument(xDrawDoc); //set some settings - XModel xDrawModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java index 810caccf4a30..1872604bba32 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java @@ -162,8 +162,7 @@ public class XMLSettingsImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml); final PrintWriter logF = log; - XModel xDrawModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xDrawDoc); + XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); final XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java index 5559faa383e1..c964b0c31a61 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java @@ -127,13 +127,11 @@ public class XMLStylesExporter extends TestCase { try { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Draw.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xDrawDoc); //obtain style families - XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xDrawDoc); + XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xDrawDoc); XNameAccess StyleFamilies = styleSup.getStyleFamilies(); //obtain all style family names String[] styleFamiliesNames = StyleFamilies.getElementNames(); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java index 0ca5f193ba8c..aa067b04b939 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java @@ -157,8 +157,7 @@ public class XMLStylesImporter extends TestCase { final PrintWriter logF = log; //obtain style families - XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface (XStyleFamiliesSupplier.class, xDrawDoc) ; + XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface (XStyleFamiliesSupplier.class, xDrawDoc) ; final XNameAccess StyleFamilies = styleSup.getStyleFamilies(); tEnv.addObjRelation("XDocumentHandler.ImportChecker", diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java index 28e9f4723ada..56cb9d95af78 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java @@ -126,16 +126,14 @@ public class XMLContentExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Impress.XMLContentExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xImpressDoc); // assigning a draw page a new name - XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier) - UnoRuntime.queryInterface - (XDrawPagesSupplier.class, xImpressDoc) ; + XDrawPagesSupplier xPagesSup = UnoRuntime.queryInterface + (XDrawPagesSupplier.class, xImpressDoc) ; XDrawPages xPages = xPagesSup.getDrawPages() ; - XNamed xPageName = (XNamed) UnoRuntime.queryInterface + XNamed xPageName = UnoRuntime.queryInterface (XNamed.class, xPages.getByIndex(0)) ; xPageName.setName(expPageName) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java index 6ce36a7e0657..8989623c8229 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java @@ -189,11 +189,10 @@ public class XMLContentImporter extends TestCase { new ifc.xml.sax._XDocumentHandler.ImportChecker() { public boolean checkImport() { try { - XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier) - UnoRuntime.queryInterface - (XDrawPagesSupplier.class, xImpressDoc) ; + XDrawPagesSupplier xPagesSup = UnoRuntime.queryInterface + (XDrawPagesSupplier.class, xImpressDoc) ; XDrawPages xPages = xPagesSup.getDrawPages() ; - XNamed xPageName = (XNamed) UnoRuntime.queryInterface + XNamed xPageName = UnoRuntime.queryInterface (XNamed.class, xPages.getByIndex(0)) ; String gName = xPageName.getName() ; logF.println("Page name returned = '" + gName + "'") ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java index c42a2afc94db..eac90e92e370 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java @@ -129,17 +129,14 @@ public class XMLExporter extends TestCase { "com.sun.star.comp.Impress.XMLExporter", new Object[] {arg}); //get draw pages - XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages drawPages = drawPagesSupplier.getDrawPages(); //insert new draw page XDrawPage newDrawPage = drawPages.insertNewByIndex(0); //set specific test name - XNamed newPageNamed = (XNamed) - UnoRuntime.queryInterface(XNamed.class, newDrawPage); + XNamed newPageNamed = UnoRuntime.queryInterface(XNamed.class, newDrawPage); newPageNamed.setName(NAME); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xImpressDoc); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java index 61e38481ff39..70835e11bf40 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java @@ -153,8 +153,7 @@ public class XMLImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml); //get draw pages - XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier) - UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); + XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages drawPages = drawPagesSupplier.getDrawPages(); final XNameAccess xNamePages = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, drawPages); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java index 9585db046ca9..569a91dfaee4 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java @@ -125,14 +125,12 @@ public class XMLMetaExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Impress.XMLMetaExporter", new Object[]{arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xImpressDoc); //change title name - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xImpressDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface + (XDocumentInfoSupplier.class, xImpressDoc) ; XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", NAME); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java index d09a5573f514..8330a9396847 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java @@ -151,9 +151,8 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) - UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xImpressDoc) ; + XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface + (XDocumentInfoSupplier.class, xImpressDoc) ; final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java index b19c493ee69a..21d4493480f6 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java @@ -122,13 +122,11 @@ public class XMLSettingsExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Impress.XMLSettingsExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xImpressDoc); //set some settings - XModel xImpressModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java index 413b25472534..95707e671239 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java @@ -163,8 +163,7 @@ public class XMLSettingsImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; // get property before import - XModel xImpressModel = (XModel) - UnoRuntime.queryInterface(XModel.class, xImpressDoc); + XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); final XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xController); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java index 4de8ce056410..8affc0d2ae4d 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java @@ -133,14 +133,12 @@ public class XMLStylesExporter extends TestCase { oObj = (XInterface) xMSF.createInstanceWithArguments( "com.sun.star.comp.Impress.XMLStylesExporter", new Object[] {arg}); - XExporter xEx = (XExporter) - UnoRuntime.queryInterface(XExporter.class,oObj); + XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj); xEx.setSourceDocument(xImpressDoc); // Obtaining and changing property values - XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface - (XStyleFamiliesSupplier.class, xImpressDoc) ; + XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface + (XStyleFamiliesSupplier.class, xImpressDoc) ; XNameAccess styleFamilies = styleSup.getStyleFamilies(); String[] styleFamiliesNames = styleFamilies.getElementNames(); XNameContainer StyleFamilyName = (XNameContainer) diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java index 3345f7752303..c96ba75498d0 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java @@ -157,9 +157,8 @@ public class XMLStylesImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; XNameAccess styles = null ; try { - XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier) - UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, - xImpressDoc); + XStyleFamiliesSupplier sup = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, + xImpressDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("graphics") ; styles = (XNameAccess) UnoRuntime.queryInterface |