[Libreoffice-commits] core.git: bridges/test chart2/qa connectivity/com dbaccess/qa desktop/test extensions/qa extensions/test forms/qa nlpsolver/src odk/examples
Noel Grandin
noel at peralex.com
Fri Apr 19 00:52:01 PDT 2013
bridges/test/java_uno/acquire/TestAcquire.java | 12 -
bridges/test/testclient.java | 2
chart2/qa/TestCaseOldAPI.java | 70 +++++-----
connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java | 1
dbaccess/qa/complex/dbaccess/PropertyBag.java | 2
dbaccess/qa/complex/dbaccess/UISettings.java | 6
desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java | 20 +-
extensions/qa/integration/extensions/ConsoleWait.java | 2
extensions/qa/integration/extensions/Frame.java | 12 -
extensions/qa/integration/extensions/MethodHandler.java | 4
extensions/qa/integration/extensions/ObjectInspector.java | 8 -
extensions/qa/integration/extensions/ServicesHandler.java | 6
extensions/test/pgp/TestPGP.java | 6
forms/qa/integration/forms/CellBinding.java | 40 ++---
forms/qa/integration/forms/ControlValidation.java | 2
forms/qa/integration/forms/DocumentHelper.java | 36 ++---
forms/qa/integration/forms/DocumentViewHelper.java | 12 -
forms/qa/integration/forms/FormComponent.java | 18 +-
forms/qa/integration/forms/FormControlTest.java | 26 +--
forms/qa/integration/forms/FormLayer.java | 10 -
forms/qa/integration/forms/ListSelection.java | 16 +-
forms/qa/integration/forms/RadioButtons.java | 4
forms/qa/integration/forms/SingleControlValidation.java | 6
forms/qa/integration/forms/SpreadsheetDocument.java | 10 -
forms/qa/integration/forms/SpreadsheetView.java | 8 -
forms/qa/integration/forms/TableCellTextBinding.java | 2
forms/qa/integration/forms/ValueBinding.java | 6
forms/qa/integration/forms/XMLFormSettings.java | 10 -
forms/qa/org/openoffice/complex/forms/tools/ResultSet.java | 4
forms/qa/org/openoffice/xforms/Model.java | 6
forms/qa/org/openoffice/xforms/XMLDocument.java | 6
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java | 30 ++--
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java | 4
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java | 20 +-
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java | 2
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java | 8 -
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java | 2
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/ProgressBar.java | 2
odk/examples/DevelopersGuide/Charts/CalcHelper.java | 54 +++----
odk/examples/DevelopersGuide/Charts/ChartHelper.java | 56 +++-----
odk/examples/DevelopersGuide/Charts/ChartInCalc.java | 42 +++---
odk/examples/DevelopersGuide/Charts/ChartInDraw.java | 20 +-
odk/examples/DevelopersGuide/Charts/ChartInWriter.java | 10 -
odk/examples/DevelopersGuide/Charts/Helper.java | 11 -
odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java | 58 ++++----
odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java | 28 ++--
odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java | 26 +--
odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java | 6
48 files changed, 373 insertions(+), 379 deletions(-)
New commits:
commit d62425cc27e04a3237cfec2ea2663b8b11284ec8
Author: Noel Grandin <noel at peralex.com>
Date: Wed Apr 17 13:54:28 2013 +0200
Java cleanup, remove unnecessary casts
Change-Id: Id12089bc7df16631737e6acaee0973fb91dd953f
Reviewed-on: https://gerrit.libreoffice.org/3431
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/bridges/test/java_uno/acquire/TestAcquire.java b/bridges/test/java_uno/acquire/TestAcquire.java
index 33d3605..0aa2b0f 100644
--- a/bridges/test/java_uno/acquire/TestAcquire.java
+++ b/bridges/test/java_uno/acquire/TestAcquire.java
@@ -65,17 +65,17 @@ public final class TestAcquire {
WaitUnreachable u;
u = new WaitUnreachable(new XInterface() {});
- test.setInterfaceToInterface((XInterface) u.get());
+ test.setInterfaceToInterface(u.get());
receive(test.getInterfaceFromInterface());
test.clearInterface();
u.waitUnreachable();
u = new WaitUnreachable(new XBase() {});
- test.setInterfaceToInterface((XBase) u.get());
+ test.setInterfaceToInterface(u.get());
receive(test.getInterfaceFromInterface());
test.clearInterface();
u.waitUnreachable();
u = new WaitUnreachable(new XDerived() {});
- test.setInterfaceToInterface((XDerived) u.get());
+ test.setInterfaceToInterface(u.get());
receive(test.getInterfaceFromInterface());
test.clearInterface();
u.waitUnreachable();
@@ -126,13 +126,13 @@ public final class TestAcquire {
u.waitUnreachable();
u = new WaitUnreachable(new XInterface() {});
- receive(test.roundTripInterfaceToInterface((XInterface) u.get()));
+ receive(test.roundTripInterfaceToInterface(u.get()));
u.waitUnreachable();
u = new WaitUnreachable(new XBase() {});
- receive(test.roundTripInterfaceToInterface((XBase) u.get()));
+ receive(test.roundTripInterfaceToInterface(u.get()));
u.waitUnreachable();
u = new WaitUnreachable(new XDerived() {});
- receive(test.roundTripInterfaceToInterface((XDerived) u.get()));
+ receive(test.roundTripInterfaceToInterface(u.get()));
u.waitUnreachable();
u = new WaitUnreachable(new XBase() {});
diff --git a/bridges/test/testclient.java b/bridges/test/testclient.java
index 135030c..e52b703 100644
--- a/bridges/test/testclient.java
+++ b/bridges/test/testclient.java
@@ -117,7 +117,7 @@ public class testclient
{
System.out.println( "after connect" );
String rootOid = "OfficeDaemon.Factory";
- com.sun.star.uno.IBridge bridge = (IBridge ) UnoRuntime.getBridgeByName(
+ com.sun.star.uno.IBridge bridge = UnoRuntime.getBridgeByName(
"java",
null,
"remote",
diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java
index 5792f52..be1f911 100644
--- a/chart2/qa/TestCaseOldAPI.java
+++ b/chart2/qa/TestCaseOldAPI.java
@@ -113,7 +113,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
else
mxChartModel = createChartModel();
- mxOldDoc = (XChartDocument) UnoRuntime.queryInterface(
+ mxOldDoc = UnoRuntime.queryInterface(
XChartDocument.class, mxChartModel );
}
@@ -121,7 +121,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
public void after()
{
- XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable xCloseable = UnoRuntime.queryInterface(
XCloseable.class, mxChartModel );
assure( "document is no XCloseable", xCloseable != null );
@@ -146,7 +146,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
try
{
- XPropertySet xDocProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDocProp = UnoRuntime.queryInterface(
XPropertySet.class, mxOldDoc );
assure( "Chart Document is no XPropertySet", xDocProp != null );
xDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
@@ -154,7 +154,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xDocProp.getPropertyValue( "HasMainTitle" )));
XShape xTitleShape = mxOldDoc.getTitle();
- XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xTitleProp = UnoRuntime.queryInterface(
XPropertySet.class, xTitleShape );
// set property via old API
@@ -196,7 +196,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
try
{
- XPropertySet xDocProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDocProp = UnoRuntime.queryInterface(
XPropertySet.class, mxOldDoc );
assure( "Chart Document is no XPropertySet", xDocProp != null );
xDocProp.setPropertyValue( "HasSubTitle", new Boolean( true ));
@@ -204,7 +204,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xDocProp.getPropertyValue( "HasSubTitle" )));
XShape xTitleShape = mxOldDoc.getSubTitle();
- XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xTitleProp = UnoRuntime.queryInterface(
XPropertySet.class, xTitleShape );
// set Property via old API
@@ -245,7 +245,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
XDiagram xDia = mxOldDoc.getDiagram();
if( xDia != null )
{
- X3DDisplay xDisp = (X3DDisplay) UnoRuntime.queryInterface(
+ X3DDisplay xDisp = UnoRuntime.queryInterface(
X3DDisplay.class, xDia );
assure( "X3DDisplay not supported", xDisp != null );
@@ -263,7 +263,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
"com.sun.star.chart.BarDiagram" ));
// Diagram properties
- xProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xDia );
+ xProp = UnoRuntime.queryInterface( XPropertySet.class, xDia );
assure( "Diagram is no property set", xProp != null );
// y-axis
@@ -295,7 +295,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xProp.getPropertyValue( "HasSecondaryYAxis" ));
assure( "Adding a second y-axis does not work", bNewSecYAxisValue == bSecondaryYAxis );
- XTwoAxisYSupplier xSecYAxisSuppl = (XTwoAxisYSupplier) UnoRuntime.queryInterface(
+ XTwoAxisYSupplier xSecYAxisSuppl = UnoRuntime.queryInterface(
XTwoAxisYSupplier.class, xDia );
assure( "XTwoAxisYSupplier not implemented", xSecYAxisSuppl != null );
assure( "No second y-axis found", xSecYAxisSuppl.getSecondaryYAxis() != null );
@@ -303,7 +303,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// move diagram
{
- XShape xDiagramShape = (XShape) UnoRuntime.queryInterface(
+ XShape xDiagramShape = UnoRuntime.queryInterface(
XShape.class, xDia );
Point aOldPos = xDiagramShape.getPosition();
@@ -323,7 +323,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// size diagram
{
- XShape xDiagramShape = (XShape) UnoRuntime.queryInterface(
+ XShape xDiagramShape = UnoRuntime.queryInterface(
XShape.class, xDia );
Size aOldSize = xDiagramShape.getSize();
@@ -354,7 +354,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
try
{
- XAxisYSupplier xYAxisSuppl = (XAxisYSupplier) UnoRuntime.queryInterface(
+ XAxisYSupplier xYAxisSuppl = UnoRuntime.queryInterface(
XAxisYSupplier.class, mxOldDoc.getDiagram() );
assure( "Diagram is no y-axis supplier", xYAxisSuppl != null );
@@ -452,7 +452,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
XShape xLegend = mxOldDoc.getLegend();
assure( "No Legend returned", xLegend != null );
- XPropertySet xLegendProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xLegendProp = UnoRuntime.queryInterface(
XPropertySet.class, xLegend );
assure( "Legend is no property set", xLegendProp != null );
@@ -532,7 +532,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
public void testChartType()
{
- XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory xFact = UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxOldDoc );
assure( "document is no factory", xFact != null );
@@ -553,13 +553,13 @@ public class TestCaseOldAPI extends ComplexTestCase {
if( bServiceFound )
{
- XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
+ XDiagram xDia = UnoRuntime.queryInterface(
XDiagram.class, xFact.createInstance( aMyServiceName ));
assure( aMyServiceName + " could not be created", xDia != null );
mxOldDoc.setDiagram( xDia );
- XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDiaProp = UnoRuntime.queryInterface(
XPropertySet.class, xDia );
assure( "Diagram is no XPropertySet", xDiaProp != null );
@@ -599,11 +599,11 @@ public class TestCaseOldAPI extends ComplexTestCase {
public void testAggregation()
{
// query to new type
- XChartDocument xDiaProv = (XChartDocument) UnoRuntime.queryInterface(
+ XChartDocument xDiaProv = UnoRuntime.queryInterface(
XChartDocument.class, mxOldDoc );
assure( "query to new interface failed", xDiaProv != null );
- com.sun.star.chart.XChartDocument xDoc = (com.sun.star.chart.XChartDocument) UnoRuntime.queryInterface(
+ com.sun.star.chart.XChartDocument xDoc = UnoRuntime.queryInterface(
com.sun.star.chart.XChartDocument.class, xDiaProv );
assure( "querying back to old interface failed", xDoc != null );
}
@@ -616,7 +616,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
XDiagram xDia = mxOldDoc.getDiagram();
assure( "Invalid Diagram", xDia != null );
- XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory xFact = UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxOldDoc );
assure( "document is no factory", xFact != null );
@@ -632,7 +632,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// note: the FillGradient property is optional, however it was
// supported in the old chart's API
- XNameContainer xGradientTable = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer xGradientTable = UnoRuntime.queryInterface(
XNameContainer.class,
xFact.createInstance( "com.sun.star.drawing.GradientTable" ));
assure( "no gradient table", xGradientTable != null );
@@ -674,7 +674,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// note: the FillHatch property is optional, however it was
// supported in the old chart's API
- XNameContainer xHatchTable = (XNameContainer) UnoRuntime.queryInterface(
+ XNameContainer xHatchTable = UnoRuntime.queryInterface(
XNameContainer.class,
xFact.createInstance( "com.sun.star.drawing.HatchTable" ));
assure( "no hatch table", xHatchTable != null );
@@ -735,7 +735,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
try
{
- XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDiaProp = UnoRuntime.queryInterface(
XPropertySet.class, mxOldDoc.getDiagram() );
ChartDataRowSource eNewSource = ChartDataRowSource.ROWS;
@@ -766,7 +766,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
XChartData xData = mxOldDoc.getData();
- XChartDataArray xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+ XChartDataArray xDataArray = UnoRuntime.queryInterface(
XChartDataArray.class, xData );
assure( "document has no XChartDataArray", xDataArray != null );
@@ -791,18 +791,18 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
setStockData_Type4();
- XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory xFact = UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxOldDoc );
assure( "document is no factory", xFact != null );
String aMyServiceName = new String( "com.sun.star.chart.StockDiagram" );
- XDiagram xDia = (XDiagram) UnoRuntime.queryInterface(
+ XDiagram xDia = UnoRuntime.queryInterface(
XDiagram.class, xFact.createInstance( aMyServiceName ));
assure( aMyServiceName + " could not be created", xDia != null );
mxOldDoc.setDiagram( xDia );
- XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDiaProp = UnoRuntime.queryInterface(
XPropertySet.class, xDia );
assure( "Diagram is no XPropertySet", xDiaProp != null );
@@ -813,7 +813,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
assure( "Has UpDown", AnyConverter.toBoolean( xDiaProp.getPropertyValue( "UpDown" )));
// MinMaxLine
- XStatisticDisplay xMinMaxProvider = (XStatisticDisplay) UnoRuntime.queryInterface(
+ XStatisticDisplay xMinMaxProvider = UnoRuntime.queryInterface(
XStatisticDisplay.class, xDia );
assure( "Diagram is no XStatisticDisplay", xMinMaxProvider != null );
XPropertySet xMinMaxProp = xMinMaxProvider.getMinMaxLine();
@@ -837,7 +837,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
try
{
- XMultiServiceFactory xFact = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory xFact = UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxOldDoc );
assure( "document is no factory", xFact != null );
@@ -873,7 +873,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
"First Row", "Second Row", "Third Row"
};
- XPropertySet xDiaProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xDiaProp = UnoRuntime.queryInterface(
XPropertySet.class, mxOldDoc.getDiagram() );
ChartDataRowSource eNewSource = ChartDataRowSource.ROWS;
xDiaProp.setPropertyValue( "DataRowSource", eNewSource );
@@ -883,7 +883,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
xDiaProp.getPropertyValue( "DataRowSource" )) == eNewSource );
XChartData xData = mxOldDoc.getData();
- XChartDataArray xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+ XChartDataArray xDataArray = UnoRuntime.queryInterface(
XChartDataArray.class, xData );
assure( "document has no XChartDataArray", xDataArray != null );
@@ -900,7 +900,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
// refetch data
xData = mxOldDoc.getData();
- xDataArray = (XChartDataArray) UnoRuntime.queryInterface(
+ xDataArray = UnoRuntime.queryInterface(
XChartDataArray.class, xData );
assure( "document has no XChartDataArray", xDataArray != null );
@@ -945,11 +945,11 @@ public class TestCaseOldAPI extends ComplexTestCase {
XModel aResult = null;
try
{
- XComponentLoader aLoader = (XComponentLoader) UnoRuntime.queryInterface(
+ XComponentLoader aLoader = UnoRuntime.queryInterface(
XComponentLoader.class,
((XMultiServiceFactory)param.getMSF()).createInstance( "com.sun.star.frame.Desktop" ) );
- aResult = (XModel) UnoRuntime.queryInterface(
+ aResult = UnoRuntime.queryInterface(
XModel.class,
aLoader.loadComponentFromURL( "private:factory/" + sDocType,
"_blank",
@@ -972,7 +972,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
XModel aResult = null;
try
{
- aResult = (XModel) UnoRuntime.queryInterface(
+ aResult = UnoRuntime.queryInterface(
XModel.class,
((XMultiServiceFactory)param.getMSF()).createInstance( "com.sun.star.comp.chart2.ChartModel" ) );
}
@@ -991,7 +991,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
{
XComponentContext xResult = null;
- XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xProp = UnoRuntime.queryInterface(
XPropertySet.class, xFact );
if( xProp != null )
try
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java b/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java
index 13afecf..20a3412 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/StorageAccess.java
@@ -97,6 +97,7 @@ public class StorageAccess implements org.hsqldb.lib.Storage {
return readonly;
}
+ @SuppressWarnings("cast")
public long readLong() throws java.io.IOException {
return (((long) readInt()) << 32) + (((long) readInt()) & 0xFFFFFFFFL);
}
diff --git a/dbaccess/qa/complex/dbaccess/PropertyBag.java b/dbaccess/qa/complex/dbaccess/PropertyBag.java
index 02389a7..83bbee8 100644
--- a/dbaccess/qa/complex/dbaccess/PropertyBag.java
+++ b/dbaccess/qa/complex/dbaccess/PropertyBag.java
@@ -294,7 +294,7 @@ public class PropertyBag extends TestCase
{ "BoolValue", Boolean.TRUE },
{ "StringValue", "" },
{ "IntegerValue", Integer.valueOf( 3 ) },
- { "InterfaceValue", (XInterface)m_bag }
+ { "InterfaceValue", m_bag }
};
for ( int i=0; i<properties.length; ++i )
{
diff --git a/dbaccess/qa/complex/dbaccess/UISettings.java b/dbaccess/qa/complex/dbaccess/UISettings.java
index 14c7d32..2bac9c3 100644
--- a/dbaccess/qa/complex/dbaccess/UISettings.java
+++ b/dbaccess/qa/complex/dbaccess/UISettings.java
@@ -78,9 +78,9 @@ public class UISettings extends TestCase
tableViewController.getCurrentControl().getModel() );
// verify the properties
- assertEquals( "wrong font name", "Andale Sans UI", (String)tableControlModel.getPropertyValue( "FontName" ) );
- assertEquals( "wrong font height", (float)20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue(), 0 );
- assertEquals( "wrong font slant", FontSlant.ITALIC, (FontSlant)tableControlModel.getPropertyValue( "FontSlant" ) );
+ assertEquals( "wrong font name", "Andale Sans UI", tableControlModel.getPropertyValue( "FontName" ) );
+ assertEquals( "wrong font height", 20, ((Float)tableControlModel.getPropertyValue( "FontHeight" )).floatValue(), 0 );
+ assertEquals( "wrong font slant", FontSlant.ITALIC, tableControlModel.getPropertyValue( "FontSlant" ) );
// close the doc
database.saveAndClose();
diff --git a/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java b/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
index 1f758dd..2c420ab 100644
--- a/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
+++ b/desktop/test/deployment/options/handler/com/sun/star/comp/extensionoptions/OptionsEventHandler.java
@@ -89,7 +89,7 @@ public class OptionsEventHandler {
//We get the com.sun.star.container.XNameAccess from the instance of
//ConfigurationUpdateAccess and save it for later use.
try {
- m_xAccessLeaves = (XNameAccess) UnoRuntime.queryInterface(
+ m_xAccessLeaves = UnoRuntime.queryInterface(
XNameAccess.class, xConfig.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", args));
@@ -185,7 +185,7 @@ public class OptionsEventHandler {
//To access the separate controls of the window we need to obtain the
//XControlContainer from the window implementation
- XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer xContainer = UnoRuntime.queryInterface(
XControlContainer.class, aWindow);
if (xContainer == null)
throw new com.sun.star.uno.Exception(
@@ -209,7 +209,7 @@ public class OptionsEventHandler {
//From the control we get the model, which in turn supports the
//XPropertySet interface, which we finally use to get the data from
//the control.
- XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xProp = UnoRuntime.queryInterface(
XPropertySet.class, xControl.getModel());
if (xProp == null)
@@ -235,7 +235,7 @@ public class OptionsEventHandler {
//com.sun.star.container.XNameAccess. The XNameAccess is used to get the
//particular registry node which represents this options page.
//Fortunately the name of the window is the same as the registry node.
- XPropertySet xLeaf = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xLeaf = UnoRuntime.queryInterface(
XPropertySet.class, m_xAccessLeaves.getByName(sWindowName));
if (xLeaf == null)
throw new com.sun.star.uno.Exception(
@@ -247,7 +247,7 @@ public class OptionsEventHandler {
//Committing the changes will cause or changes to be written to the registry.
XChangesBatch xUpdateCommit =
- (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, m_xAccessLeaves);
+ UnoRuntime.queryInterface(XChangesBatch.class, m_xAccessLeaves);
xUpdateCommit.commitChanges();
}
@@ -264,7 +264,7 @@ public class OptionsEventHandler {
//To acces the separate controls of the window we need to obtain the
//XControlContainer from window implementation
- XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
+ XControlContainer xContainer = UnoRuntime.queryInterface(
XControlContainer.class, aWindow);
if (xContainer == null)
throw new com.sun.star.uno.Exception(
@@ -280,7 +280,7 @@ public class OptionsEventHandler {
//of com.sun.star.configuration.ConfigurationUpdateAccess which supports
//com.sun.star.container.XNameAccess. We obtain now the section
//of the registry which is assigned to this options page.
- XPropertySet xLeaf = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xLeaf = UnoRuntime.queryInterface(
XPropertySet.class, m_xAccessLeaves.getByName(sWindowName));
if (xLeaf == null)
throw new com.sun.star.uno.Exception(
@@ -304,7 +304,7 @@ public class OptionsEventHandler {
//From the control we get the model, which in turn supports the
//XPropertySet interface, which we finally use to set the data at the
//control
- XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xProp = UnoRuntime.queryInterface(
XPropertySet.class, xControl.getModel());
if (xProp == null)
@@ -329,7 +329,7 @@ public class OptionsEventHandler {
//We need to get the control model of the window. Therefore the first step is
//to query for it.
- XControl xControlDlg = (XControl) UnoRuntime.queryInterface(
+ XControl xControlDlg = UnoRuntime.queryInterface(
XControl.class, aWindow);
if (xControlDlg == null)
@@ -343,7 +343,7 @@ public class OptionsEventHandler {
"Cannot obtain XControlModel from XWindow in method external_event.", this);
//The model itself does not provide any information except that its
//implementation supports XPropertySet which is used to access the data.
- XPropertySet xPropDlg = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xPropDlg = UnoRuntime.queryInterface(
XPropertySet.class, xModelDlg);
if (xPropDlg == null)
throw new com.sun.star.uno.Exception(
diff --git a/extensions/qa/integration/extensions/ConsoleWait.java b/extensions/qa/integration/extensions/ConsoleWait.java
index 5a46f38..454bd53 100644
--- a/extensions/qa/integration/extensions/ConsoleWait.java
+++ b/extensions/qa/integration/extensions/ConsoleWait.java
@@ -75,7 +75,7 @@ public class ConsoleWait implements com.sun.star.lang.XEventListener
public ConsoleWait( Object _disposable )
{
m_disposable = _disposable;
- XComponent component = (XComponent)UnoRuntime.queryInterface( XComponent.class, _disposable );
+ XComponent component = UnoRuntime.queryInterface( XComponent.class, _disposable );
if ( component != null )
component.addEventListener( this );
}
diff --git a/extensions/qa/integration/extensions/Frame.java b/extensions/qa/integration/extensions/Frame.java
index a3c7b3e..098ffea 100644
--- a/extensions/qa/integration/extensions/Frame.java
+++ b/extensions/qa/integration/extensions/Frame.java
@@ -45,12 +45,12 @@ public class Frame implements XFrame,
{
if ( _frameComponent != null )
{
- m_frame = (XFrame)UnoRuntime.queryInterface( XFrame.class, _frameComponent );
- m_dispatchProvider = (XDispatchProvider)UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
- m_dispatchProviderInterception = (XDispatchProviderInterception)UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
- m_framesSupplier = (XFramesSupplier)UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
- m_statusIndicatorFactory = (XStatusIndicatorFactory)UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
- m_closeable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
+ m_frame = UnoRuntime.queryInterface( XFrame.class, _frameComponent );
+ m_dispatchProvider = UnoRuntime.queryInterface( XDispatchProvider.class, _frameComponent );
+ m_dispatchProviderInterception = UnoRuntime.queryInterface( XDispatchProviderInterception.class, _frameComponent );
+ m_framesSupplier = UnoRuntime.queryInterface( XFramesSupplier.class, _frameComponent );
+ m_statusIndicatorFactory = UnoRuntime.queryInterface( XStatusIndicatorFactory.class, _frameComponent );
+ m_closeable = UnoRuntime.queryInterface( XCloseable.class, _frameComponent );
}
}
diff --git a/extensions/qa/integration/extensions/MethodHandler.java b/extensions/qa/integration/extensions/MethodHandler.java
index 93c9ec8f..8508dca 100644
--- a/extensions/qa/integration/extensions/MethodHandler.java
+++ b/extensions/qa/integration/extensions/MethodHandler.java
@@ -41,7 +41,7 @@ public class MethodHandler implements XPropertyHandler
try
{
- m_introspection = (XIntrospection)UnoRuntime.queryInterface( XIntrospection.class,
+ m_introspection = UnoRuntime.queryInterface( XIntrospection.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", m_context )
);
}
@@ -92,7 +92,7 @@ public class MethodHandler implements XPropertyHandler
descriptor.IndentLevel = 0;
try
{
- XPropertyControl control = (XPropertyControl)UnoRuntime.queryInterface(
+ XPropertyControl control = UnoRuntime.queryInterface(
XPropertyControl.class, _propertyControlFactory.createPropertyControl(
PropertyControlType.TextField, true ) );
diff --git a/extensions/qa/integration/extensions/ObjectInspector.java b/extensions/qa/integration/extensions/ObjectInspector.java
index d42ef16..44f370e 100644
--- a/extensions/qa/integration/extensions/ObjectInspector.java
+++ b/extensions/qa/integration/extensions/ObjectInspector.java
@@ -59,8 +59,8 @@ public class ObjectInspector extends complexlib.ComplexTestCase
public void before() throws com.sun.star.uno.Exception, java.lang.Exception
{
m_orb = (XMultiServiceFactory)param.getMSF();
- m_context = (XComponentContext)UnoRuntime.queryInterface( XComponentContext.class,
- ((XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_orb )).getPropertyValue( "DefaultContext" ) );
+ m_context = UnoRuntime.queryInterface( XComponentContext.class,
+ UnoRuntime.queryInterface( XPropertySet.class, m_orb ).getPropertyValue( "DefaultContext" ) );
m_desktop = new Frame( m_orb.createInstance( "com.sun.star.frame.Desktop" ) );
}
@@ -145,7 +145,7 @@ public class ObjectInspector extends complexlib.ComplexTestCase
/* ------------------------------------------------------------------ */
private com.sun.star.awt.XWindow createFloatingWindow() throws com.sun.star.uno.Exception
{
- com.sun.star.awt.XToolkit toolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
+ com.sun.star.awt.XToolkit toolkit = UnoRuntime.queryInterface(
com.sun.star.awt.XToolkit.class, m_orb.createInstance( "com.sun.star.awt.Toolkit" ) );
com.sun.star.awt.WindowDescriptor windowDescriptor = new com.sun.star.awt.WindowDescriptor();
@@ -161,7 +161,7 @@ public class ObjectInspector extends complexlib.ComplexTestCase
+ com.sun.star.awt.WindowAttribute.CLOSEABLE
+ com.sun.star.awt.VclWindowPeerAttribute.CLIPCHILDREN;
- return (com.sun.star.awt.XWindow)UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
+ return UnoRuntime.queryInterface( com.sun.star.awt.XWindow.class,
toolkit.createWindow( windowDescriptor ) );
}
}
diff --git a/extensions/qa/integration/extensions/ServicesHandler.java b/extensions/qa/integration/extensions/ServicesHandler.java
index 6033b11..87ebb27 100644
--- a/extensions/qa/integration/extensions/ServicesHandler.java
+++ b/extensions/qa/integration/extensions/ServicesHandler.java
@@ -56,7 +56,7 @@ public class ServicesHandler implements XPropertyHandler
// the OpenHyperlink command, to be dispatched to the Desktop
com.sun.star.util.URL dispatchURL[] = { new com.sun.star.util.URL() };
dispatchURL[0].Complete = ".uno:OpenHyperlink";
- com.sun.star.util.XURLTransformer transformer = (com.sun.star.util.XURLTransformer)UnoRuntime.queryInterface(
+ com.sun.star.util.XURLTransformer transformer = UnoRuntime.queryInterface(
com.sun.star.util.XURLTransformer.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.util.URLTransformer", m_context ) );
transformer.parseStrict( dispatchURL );
@@ -123,7 +123,7 @@ public class ServicesHandler implements XPropertyHandler
descriptor.IndentLevel = 0;
try
{
- XHyperlinkControl hyperlinkControl = (XHyperlinkControl)UnoRuntime.queryInterface(
+ XHyperlinkControl hyperlinkControl = UnoRuntime.queryInterface(
XHyperlinkControl.class, _propertyControlFactory.createPropertyControl( PropertyControlType.HyperlinkField, true ) );
hyperlinkControl.addActionListener( new ClickHandler( m_context, _propertyName ) );
@@ -174,7 +174,7 @@ public class ServicesHandler implements XPropertyHandler
public void inspect(Object _component) throws com.sun.star.lang.NullPointerException
{
- XServiceInfo serviceInfo = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, _component );
+ XServiceInfo serviceInfo = UnoRuntime.queryInterface( XServiceInfo.class, _component );
if ( serviceInfo != null )
m_supportedServices = serviceInfo.getSupportedServiceNames();
}
diff --git a/extensions/test/pgp/TestPGP.java b/extensions/test/pgp/TestPGP.java
index 9559f1c..78d4285 100644
--- a/extensions/test/pgp/TestPGP.java
+++ b/extensions/test/pgp/TestPGP.java
@@ -41,18 +41,18 @@ public class TestPGP {
static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException, Exception {
- XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r);
+ XNamingService rName = UnoRuntime.queryInterface(XNamingService.class, r);
if(rName != null) {
System.err.println("got the remote naming service !");
Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
- XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
+ XMultiServiceFactory rSmgr = UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
if(rSmgr != null) {
System.err.println("got the remote service manager !");
}
- XSet set= (XSet)UnoRuntime.queryInterface(XSet.class, rSmgr);
+ XSet set= UnoRuntime.queryInterface(XSet.class, rSmgr);
if( set == null) {
System.err.println(" couldn't get XSet from ServiceFactory");
return;
diff --git a/forms/qa/integration/forms/CellBinding.java b/forms/qa/integration/forms/CellBinding.java
index 7dc9408..f7fcb34 100644
--- a/forms/qa/integration/forms/CellBinding.java
+++ b/forms/qa/integration/forms/CellBinding.java
@@ -80,7 +80,7 @@ public class CellBinding extends complexlib.ComplexTestCase
// close our document
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
m_document.getDocument() );
closeDoc.close( true );
}
@@ -385,7 +385,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private boolean verifyVoidCell( short col, short row, String failErrorMessage ) throws com.sun.star.uno.Exception
{
- XCellRangeData cell = (XCellRangeData)UnoRuntime.queryInterface( XCellRangeData.class,
+ XCellRangeData cell = UnoRuntime.queryInterface( XCellRangeData.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
Object cellContent = cell.getDataArray()[0][0];
@@ -402,7 +402,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private boolean verifyNumericCellContent( short col, short row, double value, String failErrorMessage ) throws com.sun.star.uno.Exception
{
- XCell cell = (XCell)UnoRuntime.queryInterface( XCell.class,
+ XCell cell = UnoRuntime.queryInterface( XCell.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
if ( cell.getValue() != value )
@@ -418,7 +418,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private boolean verifyStringCellContent( short col, short row, String text, String failErrorMessage ) throws com.sun.star.uno.Exception
{
- XTextRange cell = (XTextRange)UnoRuntime.queryInterface( XTextRange.class,
+ XTextRange cell = UnoRuntime.queryInterface( XTextRange.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
if ( !cell.getString().equals( text ) )
@@ -434,7 +434,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void setCellText( short col, short row, String text ) throws com.sun.star.uno.Exception
{
- XTextRange cell = (XTextRange)UnoRuntime.queryInterface( XTextRange.class,
+ XTextRange cell = UnoRuntime.queryInterface( XTextRange.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
cell.setString( text );
@@ -445,7 +445,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void setCellValue( short col, short row, double value ) throws com.sun.star.uno.Exception
{
- XCell cell = (XCell)UnoRuntime.queryInterface( XCell.class,
+ XCell cell = UnoRuntime.queryInterface( XCell.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
cell.setValue( value );
@@ -458,7 +458,7 @@ public class CellBinding extends complexlib.ComplexTestCase
{
// as long as #i29130# is not fixed, we do not set the cell to "empty", but to
// an invalid formular, which serves well for our purpose
- XCellRangeFormula cell = (XCellRangeFormula)UnoRuntime.queryInterface( XCellRangeFormula.class,
+ XCellRangeFormula cell = UnoRuntime.queryInterface( XCellRangeFormula.class,
m_document.getSheet( 0 ).getCellByPosition( col, row )
);
String[][] args = new String[][] { new String[] { "=INVALID_FUNCTION()" } };
@@ -471,7 +471,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void bindToCell( XPropertySet controlModel, short column, short row, String _bindingServiceName ) throws com.sun.star.uno.Exception
{
- XBindableValue bindableModel = (XBindableValue)UnoRuntime.queryInterface( XBindableValue.class,
+ XBindableValue bindableModel = UnoRuntime.queryInterface( XBindableValue.class,
controlModel
);
@@ -484,7 +484,7 @@ public class CellBinding extends complexlib.ComplexTestCase
parameters[0].Name = "BoundCell";
parameters[0].Value = address;
- XValueBinding cellBinding = (XValueBinding)UnoRuntime.queryInterface( XValueBinding.class,
+ XValueBinding cellBinding = UnoRuntime.queryInterface( XValueBinding.class,
m_document.createInstanceWithArguments( _bindingServiceName, parameters )
);
@@ -504,13 +504,13 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void setListSource( XPropertySet _listSink, short _sourceCol, short _rowStart, short _rowEnd ) throws com.sun.star.uno.Exception
{
- CellRangeAddress listSourceAddress = new CellRangeAddress( (short)0, (int)_sourceCol, (int)_rowStart, (int)_sourceCol, (int)_rowEnd );
+ CellRangeAddress listSourceAddress = new CellRangeAddress( (short)0, _sourceCol, _rowStart, _sourceCol, _rowEnd );
NamedValue addressParameter = new NamedValue( "CellRange", listSourceAddress );
- XListEntrySource listSource = (XListEntrySource)UnoRuntime.queryInterface( XListEntrySource.class,
+ XListEntrySource listSource = UnoRuntime.queryInterface( XListEntrySource.class,
m_document.createInstanceWithArguments( "com.sun.star.table.CellRangeListSource", new NamedValue[]{ addressParameter } )
);
- XListEntrySink listSink = (XListEntrySink)UnoRuntime.queryInterface( XListEntrySink.class,
+ XListEntrySink listSink = UnoRuntime.queryInterface( XListEntrySink.class,
_listSink );
listSink.setListEntrySource( listSource );
}
@@ -520,10 +520,10 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void simulateUserRadioCheck( XPropertySet radioModel ) throws com.sun.star.uno.Exception
{
- XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+ XAccessible accessible = UnoRuntime.queryInterface(
XAccessible.class, m_document.getCurrentView().getControl( radioModel ) );
- XAccessibleValue xValue = (XAccessibleValue)UnoRuntime.queryInterface(
+ XAccessibleValue xValue = UnoRuntime.queryInterface(
XAccessibleValue.class, accessible.getAccessibleContext() );
Integer newValue = new Integer( 1 );
@@ -535,10 +535,10 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void simulateUserCheckBoxCheck( XPropertySet checkBox, short state ) throws com.sun.star.uno.Exception
{
- XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+ XAccessible accessible = UnoRuntime.queryInterface(
XAccessible.class, m_document.getCurrentView().getControl( checkBox ) );
- XAccessibleValue xValue = (XAccessibleValue)UnoRuntime.queryInterface(
+ XAccessibleValue xValue = UnoRuntime.queryInterface(
XAccessibleValue.class, accessible.getAccessibleContext() );
xValue.setCurrentValue( new Short( state ) );
@@ -549,7 +549,7 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void simulateUserListBoxSelection( XPropertySet _listBox, String _selectEntry ) throws com.sun.star.uno.Exception
{
- XListBox listBoxControl = (XListBox)UnoRuntime.queryInterface(
+ XListBox listBoxControl = UnoRuntime.queryInterface(
XListBox.class, m_document.getCurrentView().getControl( _listBox ) );
listBoxControl.selectItem( _selectEntry, true );
}
@@ -559,14 +559,14 @@ public class CellBinding extends complexlib.ComplexTestCase
*/
private void simulateUserTextInput( XPropertySet controlModel, String text ) throws com.sun.star.uno.Exception
{
- XAccessible accessible = (XAccessible)UnoRuntime.queryInterface(
+ XAccessible accessible = UnoRuntime.queryInterface(
XAccessible.class, m_document.getCurrentView().getControl( controlModel ) );
XAccessibleContext context = accessible.getAccessibleContext();
- XServiceInfo si = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class,
+ XServiceInfo si = UnoRuntime.queryInterface( XServiceInfo.class,
accessible.getAccessibleContext() );
- XAccessibleEditableText textAccess = (XAccessibleEditableText)UnoRuntime.queryInterface(
+ XAccessibleEditableText textAccess = UnoRuntime.queryInterface(
XAccessibleEditableText.class, accessible.getAccessibleContext() );
textAccess.setText( text );
diff --git a/forms/qa/integration/forms/ControlValidation.java b/forms/qa/integration/forms/ControlValidation.java
index 3842387..55718f7 100644
--- a/forms/qa/integration/forms/ControlValidation.java
+++ b/forms/qa/integration/forms/ControlValidation.java
@@ -87,7 +87,7 @@ public class ControlValidation extends complexlib.ComplexTestCase implements com
// close our document
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
m_document.getDocument() );
closeDoc.close( true );
}
diff --git a/forms/qa/integration/forms/DocumentHelper.java b/forms/qa/integration/forms/DocumentHelper.java
index 1aeefb4..a26434b 100644
--- a/forms/qa/integration/forms/DocumentHelper.java
+++ b/forms/qa/integration/forms/DocumentHelper.java
@@ -67,7 +67,7 @@ public class DocumentHelper
/* ------------------------------------------------------------------ */
protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception
{
- XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(
+ XComponentLoader aLoader = UnoRuntime.queryInterface(
XComponentLoader.class,
orb.createInstance( "com.sun.star.frame.Desktop" )
);
@@ -89,7 +89,7 @@ public class DocumentHelper
{
XComponent document = implLoadAsComponent( orb, documentOrFactoryURL, i_args );
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class,
+ XServiceInfo xSI = UnoRuntime.queryInterface( XServiceInfo.class,
document );
if ( xSI.supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
return new SpreadsheetDocument( orb, document );
@@ -157,7 +157,7 @@ public class DocumentHelper
public DocumentViewHelper getCurrentView( )
{
// get the model interface for the document
- XModel xDocModel = (XModel)UnoRuntime.queryInterface(XModel.class, m_documentComponent );
+ XModel xDocModel = UnoRuntime.queryInterface(XModel.class, m_documentComponent );
// get the current controller for the document - as a controller is tied to a view,
// this gives us the currently active view for the document.
XController xController = xDocModel.getCurrentController();
@@ -188,7 +188,7 @@ public class DocumentHelper
getCurrentView().dispatch( ".uno:Reload" );
- m_documentComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class,
+ m_documentComponent = UnoRuntime.queryInterface( XComponent.class,
frame.getController().getModel() );
XModel newModel = getCurrentView().getController().getModel();
@@ -222,7 +222,7 @@ public class DocumentHelper
}
// outta here
- return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
+ return UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
}
/* ------------------------------------------------------------------ */
@@ -237,7 +237,7 @@ public class DocumentHelper
public XIndexContainer createSubForm( Object aParentContainer, String sInitialName )
throws com.sun.star.uno.Exception
{
- XIndexContainer xParentContainer = (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer xParentContainer = UnoRuntime.queryInterface(
XIndexContainer.class, aParentContainer );
return createSubForm( xParentContainer, sInitialName );
}
@@ -265,13 +265,13 @@ public class DocumentHelper
*/
static public DocumentHelper getDocumentForComponent( Object aFormComponent, XMultiServiceFactory orb )
{
- XChild xChild = (XChild)UnoRuntime.queryInterface( XChild.class, aFormComponent );
+ XChild xChild = UnoRuntime.queryInterface( XChild.class, aFormComponent );
XModel xModel = null;
while ( ( null != xChild ) && ( null == xModel ) )
{
XInterface xParent = (XInterface)xChild.getParent();
- xModel = (XModel)UnoRuntime.queryInterface( XModel.class, xParent );
- xChild = (XChild)UnoRuntime.queryInterface( XChild.class, xParent );
+ xModel = UnoRuntime.queryInterface( XModel.class, xParent );
+ xChild = UnoRuntime.queryInterface( XChild.class, xParent );
}
return new DocumentHelper( orb, xModel );
@@ -298,7 +298,7 @@ public class DocumentHelper
*/
public DocumentType classify( )
{
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
+ XServiceInfo xSI = UnoRuntime.queryInterface(
XServiceInfo.class, m_documentComponent );
if ( xSI.supportsService( "com.sun.star.text.TextDocument" ) )
@@ -321,11 +321,11 @@ public class DocumentHelper
*/
protected XDrawPage getDrawPage( int index ) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException
{
- XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
XDrawPagesSupplier.class, getDocument() );
XDrawPages xPages = xSuppPages.getDrawPages();
- return (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
+ return UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
}
/* ------------------------------------------------------------------ */
@@ -336,18 +336,18 @@ public class DocumentHelper
XDrawPage xReturn;
// in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
- XDrawPageSupplier xSuppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+ XDrawPageSupplier xSuppPage = UnoRuntime.queryInterface(
XDrawPageSupplier.class, getDocument() );
if ( null != xSuppPage )
xReturn = xSuppPage.getDrawPage();
else
{ // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
// (or any other multi-page document)
- XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
XDrawPagesSupplier.class, getDocument() );
XDrawPages xPages = xSuppPages.getDrawPages();
- xReturn = (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
+ xReturn = UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
// Note that this is no really error-proof code: If the document model does not support the
// XDrawPagesSupplier interface, or if the pages collection returned is empty, this will break.
@@ -361,7 +361,7 @@ public class DocumentHelper
*/
protected XNameContainer getFormComponentTreeRoot( ) throws com.sun.star.uno.Exception
{
- XFormsSupplier xSuppForms = (XFormsSupplier)UnoRuntime.queryInterface(
+ XFormsSupplier xSuppForms = UnoRuntime.queryInterface(
XFormsSupplier.class, getMainDrawPage( ) );
XNameContainer xFormsCollection = null;
@@ -377,7 +377,7 @@ public class DocumentHelper
*/
public XInterface createInstance( String serviceSpecifier ) throws com.sun.star.uno.Exception
{
- XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
m_documentComponent );
return (XInterface)xORB.createInstance( serviceSpecifier );
}
@@ -387,7 +387,7 @@ public class DocumentHelper
*/
public XInterface createInstanceWithArguments( String serviceSpecifier, Object[] arguments ) throws com.sun.star.uno.Exception
{
- XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
m_documentComponent );
return (XInterface) xORB.createInstanceWithArguments( serviceSpecifier, arguments );
}
diff --git a/forms/qa/integration/forms/DocumentViewHelper.java b/forms/qa/integration/forms/DocumentViewHelper.java
index 9226afd..66d8f0b 100644
--- a/forms/qa/integration/forms/DocumentViewHelper.java
+++ b/forms/qa/integration/forms/DocumentViewHelper.java
@@ -94,12 +94,12 @@ public class DocumentViewHelper
// go get the current view
XController xController = (XController)query( XController.class );
// go get the dispatch provider of it's frame
- XDispatchProvider xProvider = (XDispatchProvider)UnoRuntime.queryInterface(
+ XDispatchProvider xProvider = UnoRuntime.queryInterface(
XDispatchProvider.class, xController.getFrame() );
if ( null != xProvider )
{
// need an URLTransformer
- XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+ XURLTransformer xTransformer = UnoRuntime.queryInterface(
XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
xTransformer.parseStrict( aURL );
@@ -155,14 +155,14 @@ public class DocumentViewHelper
/* ------------------------------------------------------------------ */
public XControl getControl( Object aModel ) throws com.sun.star.uno.Exception
{
- XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+ XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
return getControl( xModel );
}
/* ------------------------------------------------------------------ */
public Object getControl( Object aModel, Class aInterfaceClass ) throws com.sun.star.uno.Exception
{
- XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+ XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
return UnoRuntime.queryInterface( aInterfaceClass, getControl( xModel ) );
}
@@ -206,7 +206,7 @@ public class DocumentViewHelper
XControl xControl = getControl( xModel );
// the focus can be set to an XWindow only
- XWindow xControlWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class,
+ XWindow xControlWindow = UnoRuntime.queryInterface( XWindow.class,
xControl );
// grab the focus
@@ -229,7 +229,7 @@ public class DocumentViewHelper
XPropertySet xControlProps = dbfTools.queryPropertySet( xForm.getByIndex( i ) );
if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() )
{
- XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
+ XControlModel xControlModel = UnoRuntime.queryInterface(
XControlModel.class, xControlProps );
// set the focus to this control
grabControlFocus( xControlModel );
diff --git a/forms/qa/integration/forms/FormComponent.java b/forms/qa/integration/forms/FormComponent.java
index 1b9cf21..f19ceea 100644
--- a/forms/qa/integration/forms/FormComponent.java
+++ b/forms/qa/integration/forms/FormComponent.java
@@ -47,16 +47,16 @@ public class FormComponent
/* ------------------------------------------------------------------ */
public FormComponent( XDrawPage drawPage )
{
- XFormsSupplier supp = (XFormsSupplier)UnoRuntime.queryInterface(
+ XFormsSupplier supp = UnoRuntime.queryInterface(
XFormsSupplier.class, drawPage );
m_component = supp.getForms();
m_nameAccess = (XNameAccess)m_component;
- m_indexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+ m_indexAccess = UnoRuntime.queryInterface(
XIndexAccess.class, m_component );
- m_child = (XChild)UnoRuntime.queryInterface(
+ m_child = UnoRuntime.queryInterface(
XChild.class, m_component );
- m_named = (XNamed)UnoRuntime.queryInterface(
+ m_named = UnoRuntime.queryInterface(
XNamed.class, m_component );
}
@@ -64,13 +64,13 @@ public class FormComponent
public FormComponent( Object element )
{
m_component = element;
- m_nameAccess = (XNameAccess)UnoRuntime.queryInterface(
+ m_nameAccess = UnoRuntime.queryInterface(
XNameAccess.class, m_component );
- m_indexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+ m_indexAccess = UnoRuntime.queryInterface(
XIndexAccess.class, m_component );
- m_child = (XChild)UnoRuntime.queryInterface(
+ m_child = UnoRuntime.queryInterface(
XChild.class, m_component );
- m_named = (XNamed)UnoRuntime.queryInterface(
+ m_named = UnoRuntime.queryInterface(
XNamed.class, m_component );
}
@@ -179,7 +179,7 @@ public class FormComponent
/* ------------------------------------------------------------------ */
public String getImplementationName()
{
- XServiceInfo si = (XServiceInfo)UnoRuntime.queryInterface(
+ XServiceInfo si = UnoRuntime.queryInterface(
XServiceInfo.class, m_component );
if ( si != null )
return si.getImplementationName();
diff --git a/forms/qa/integration/forms/FormControlTest.java b/forms/qa/integration/forms/FormControlTest.java
index 488c387..8d4ee1e 100644
--- a/forms/qa/integration/forms/FormControlTest.java
+++ b/forms/qa/integration/forms/FormControlTest.java
@@ -453,7 +453,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
// close our document
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
m_document.getDocument() );
closeDoc.close( true );
}
@@ -465,9 +465,9 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
{
m_orb = (XMultiServiceFactory)param.getMSF();
- XNameAccess databaseContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+ XNameAccess databaseContext = UnoRuntime.queryInterface( XNameAccess.class,
m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) );
- XNamingService namingService = (XNamingService)UnoRuntime.queryInterface( XNamingService.class,
+ XNamingService namingService = UnoRuntime.queryInterface( XNamingService.class,
databaseContext );
// revoke the data source, if it previously existed
@@ -479,11 +479,11 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
String documentURL = m_databaseDocument.getDocumentURL();
namingService.registerObject( m_dataSourceName, databaseContext.getByName( documentURL ) );
- m_dataSource = (XDataSource)UnoRuntime.queryInterface( XDataSource.class,
+ m_dataSource = UnoRuntime.queryInterface( XDataSource.class,
databaseContext.getByName( m_dataSourceName ) );
m_dataSourceProps = dbfTools.queryPropertySet( m_dataSource );
- XPropertySet dataSourceSettings = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ XPropertySet dataSourceSettings = UnoRuntime.queryInterface( XPropertySet.class,
m_dataSourceProps.getPropertyValue( "Settings" ) );
dataSourceSettings.setPropertyValue( "FormsCheckRequiredFields", new Boolean( false ) );
@@ -495,9 +495,9 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
*/
private XPropertySet getControlModel( String name ) throws com.sun.star.uno.Exception, java.lang.Exception
{
- XNameAccess nameAccess = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+ XNameAccess nameAccess = UnoRuntime.queryInterface( XNameAccess.class,
m_masterForm );
- return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ return UnoRuntime.queryInterface( XPropertySet.class,
nameAccess.getByName( name ) );
}
@@ -547,7 +547,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
m_document.getCurrentView( ).toggleFormDesignMode( );
m_masterFormController = m_document.getCurrentView().getFormController( m_masterForm );
- XSQLErrorBroadcaster errorBroadcaster = (XSQLErrorBroadcaster)UnoRuntime.queryInterface( XSQLErrorBroadcaster.class,
+ XSQLErrorBroadcaster errorBroadcaster = UnoRuntime.queryInterface( XSQLErrorBroadcaster.class,
m_masterFormController );
errorBroadcaster.addSQLErrorListener( this );
@@ -796,21 +796,21 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
/* ------------------------------------------------------------------ */
private void moveToInsertRow() throws com.sun.star.uno.Exception, java.lang.Exception
{
- XResultSetUpdate xResultSet = (XResultSetUpdate)UnoRuntime.queryInterface( XResultSetUpdate.class, m_masterForm );
+ XResultSetUpdate xResultSet = UnoRuntime.queryInterface( XResultSetUpdate.class, m_masterForm );
xResultSet.moveToInsertRow( );
}
/* ------------------------------------------------------------------ */
private void moveToFirst() throws com.sun.star.uno.Exception, java.lang.Exception
{
- XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
+ XResultSet xResultSet = UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
xResultSet.first( );
}
/* ------------------------------------------------------------------ */
private void moveToNext() throws com.sun.star.uno.Exception, java.lang.Exception
{
- XResultSet xResultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
+ XResultSet xResultSet = UnoRuntime.queryInterface( XResultSet.class, m_masterForm );
xResultSet.next( );
}
@@ -823,7 +823,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
URL[] url = new URL[] { new URL() };
url[0].Complete = slotURL;
- XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+ XURLTransformer xTransformer = UnoRuntime.queryInterface(
XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
xTransformer.parseStrict( url );
@@ -913,7 +913,7 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
XPropertySet xImageModel = getControlModel( "f_blob" );
// check if the image control properly says that there currently is no image on the first record
- XImageProducerSupplier xSuppProducer = (XImageProducerSupplier)UnoRuntime.queryInterface( XImageProducerSupplier.class,
+ XImageProducerSupplier xSuppProducer = UnoRuntime.queryInterface( XImageProducerSupplier.class,
xImageModel );
XImageProducer xProducer = xSuppProducer.getImageProducer();
diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java
index 09ac58d..080d687 100644
--- a/forms/qa/integration/forms/FormLayer.java
+++ b/forms/qa/integration/forms/FormLayer.java
@@ -310,15 +310,15 @@ public class FormLayer
*/
public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception
{
- XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ XIndexAccess indexAcc = UnoRuntime.queryInterface( XIndexAccess.class,
m_document.getFormComponentTreeRoot() );
XPropertySet controlModel = null;
int i=0;
while ( ( indexAcc != null ) && ( i < _accessPath.length ) )
{
- controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ controlModel = UnoRuntime.queryInterface( XPropertySet.class,
indexAcc.getByIndex( _accessPath[i] ) );
- indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ indexAcc = UnoRuntime.queryInterface( XIndexAccess.class,
controlModel );
++i;
}
@@ -335,9 +335,9 @@ public class FormLayer
int i=0;
while ( ( nameAcc != null ) && ( i < _accessPath.length ) )
{
- controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ controlModel = UnoRuntime.queryInterface( XPropertySet.class,
nameAcc.getByName( _accessPath[i] ) );
- nameAcc = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+ nameAcc = UnoRuntime.queryInterface( XNameAccess.class,
controlModel );
++i;
}
diff --git a/forms/qa/integration/forms/ListSelection.java b/forms/qa/integration/forms/ListSelection.java
index a7a0388..5d080cb 100644
--- a/forms/qa/integration/forms/ListSelection.java
+++ b/forms/qa/integration/forms/ListSelection.java
@@ -100,12 +100,12 @@ public class ListSelection extends integration.forms.TestCase
XSpreadsheet activeSheet = view.getActiveSheet();
// Accessibility access to the list box control in this sheet
- XAccessible accessibleListBox = (XAccessible)UnoRuntime.queryInterface(
+ XAccessible accessibleListBox = UnoRuntime.queryInterface(
XAccessible.class, getListBoxControl( activeSheet ) );
XAccessibleContext context = accessibleListBox.getAccessibleContext();
// the first "accessible child" of a list box is its list
- XAccessibleSelection accessibleList = (XAccessibleSelection)UnoRuntime.queryInterface(
+ XAccessibleSelection accessibleList = UnoRuntime.queryInterface(
XAccessibleSelection.class, context.getAccessibleChild( 1 ) );
int selectPosition = generator.nextInt( 5 );
@@ -120,7 +120,7 @@ public class ListSelection extends integration.forms.TestCase
}
catch( java.lang.InterruptedException e ) { }
- XNamed sheetName = (XNamed)UnoRuntime.queryInterface( XNamed.class, view.getActiveSheet() );
+ XNamed sheetName = UnoRuntime.queryInterface( XNamed.class, view.getActiveSheet() );
assure( "sheet was not selected as expected!", sheetName.getName().equals( selectSheetName ) );
}
}
@@ -137,7 +137,7 @@ public class ListSelection extends integration.forms.TestCase
try
{
XPropertySet docProps = dbfTools.queryPropertySet( m_document.getDocument() );
- XLibraryContainer basicLibs = (XLibraryContainer)UnoRuntime.queryInterface(
+ XLibraryContainer basicLibs = UnoRuntime.queryInterface(
XLibraryContainer.class, docProps.getPropertyValue( "BasicLibraries" ) );
XNameContainer basicLib = basicLibs.createLibrary( "default" );
@@ -184,7 +184,7 @@ public class ListSelection extends integration.forms.TestCase
{
XIndexContainer parentForm = (XIndexContainer)dbfTools.getParent( controlModel, XIndexContainer.class );
- XEventAttacherManager manager = (XEventAttacherManager)UnoRuntime.queryInterface(
+ XEventAttacherManager manager = UnoRuntime.queryInterface(
XEventAttacherManager.class, parentForm );
int containerPosition = -1;
@@ -230,7 +230,7 @@ public class ListSelection extends integration.forms.TestCase
String[] newSheetNames = new String[] { "first", "second", "third", "forth", "fifth" };
// give the first one the right name
- XNamed sheet = (XNamed)UnoRuntime.queryInterface( XNamed.class,
+ XNamed sheet = UnoRuntime.queryInterface( XNamed.class,
sheets.getByName( sheetNames[ 0 ] )
);
sheet.setName( newSheetNames[ 0 ] );
@@ -274,7 +274,7 @@ public class ListSelection extends integration.forms.TestCase
/* ------------------------------------------------------------------ */
protected XControlModel getListBoxModel( XSpreadsheet sheet )
{
- XDrawPageSupplier suppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+ XDrawPageSupplier suppPage = UnoRuntime.queryInterface(
XDrawPageSupplier.class, sheet );
FormComponent formsRoot = new FormComponent( suppPage.getDrawPage() );
XControlModel listBoxModel = (XControlModel)formsRoot.getByIndex( 0 ).
@@ -285,7 +285,7 @@ public class ListSelection extends integration.forms.TestCase
/* ------------------------------------------------------------------ */
protected XListBox getListBoxControl( XSpreadsheet sheet ) throws com.sun.star.uno.Exception
{
- return (XListBox)UnoRuntime.queryInterface(
+ return UnoRuntime.queryInterface(
XListBox.class, m_document.getCurrentView().getControl( getListBoxModel( sheet ) ) );
}
}
diff --git a/forms/qa/integration/forms/RadioButtons.java b/forms/qa/integration/forms/RadioButtons.java
index e883f8a6..b2c641c 100644
--- a/forms/qa/integration/forms/RadioButtons.java
+++ b/forms/qa/integration/forms/RadioButtons.java
@@ -255,7 +255,7 @@ public class RadioButtons extends complexlib.ComplexTestCase
// close our document
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
m_document.getDocument() );
closeDoc.close( true );
}
@@ -295,7 +295,7 @@ public class RadioButtons extends complexlib.ComplexTestCase
{
XPropertySet xRadio = getRadioModel( groupName, refValue, form );
- XRadioButton radioButton = (XRadioButton)UnoRuntime.queryInterface(
+ XRadioButton radioButton = UnoRuntime.queryInterface(
XRadioButton.class, m_document.getCurrentView().getControl( xRadio ) );
radioButton.setState( true );
}
diff --git a/forms/qa/integration/forms/SingleControlValidation.java b/forms/qa/integration/forms/SingleControlValidation.java
index ac54510..05b3fa9 100644
--- a/forms/qa/integration/forms/SingleControlValidation.java
+++ b/forms/qa/integration/forms/SingleControlValidation.java
@@ -100,7 +100,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
if ( controls[ i ].getPropertySetInfo().hasPropertyByName( "Border" ) )
controls[ i ].setPropertyValue( "Border", new Short( (short)2 ) );
- XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+ XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
controls[ i ] );
xComp.addFormComponentValidityListener( this );
}
@@ -122,7 +122,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
m_explanationField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null );
m_explanationField.setPropertyValue( "Label", new String( "" ) );
- XValidatable xValidatable = (XValidatable)UnoRuntime.queryInterface( XValidatable.class, m_inputField );
+ XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, m_inputField );
xValidatable.setValidator( m_validator );
}
catch( java.lang.Exception e )
@@ -148,7 +148,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
{
if ( m_inputField.equals( eventObject.Source ) )
{
- XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+ XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
eventObject.Source );
// the current value
Object value = xComp.getCurrentValue();
diff --git a/forms/qa/integration/forms/SpreadsheetDocument.java b/forms/qa/integration/forms/SpreadsheetDocument.java
index cd653a7..e6c7f92 100644
--- a/forms/qa/integration/forms/SpreadsheetDocument.java
+++ b/forms/qa/integration/forms/SpreadsheetDocument.java
@@ -49,7 +49,7 @@ public class SpreadsheetDocument extends DocumentHelper
*/
public XSpreadsheets getSheets() throws com.sun.star.uno.Exception
{
- XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
+ XSpreadsheetDocument spreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,
getDocument()
);
return spreadsheetDoc.getSheets();
@@ -60,10 +60,10 @@ public class SpreadsheetDocument extends DocumentHelper
*/
public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
{
- XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class,
getSheets()
);
- return (XCellRange)UnoRuntime.queryInterface( XCellRange.class,
+ return UnoRuntime.queryInterface( XCellRange.class,
sheets.getByIndex( index )
);
}
@@ -94,7 +94,7 @@ public class SpreadsheetDocument extends DocumentHelper
{
CellAddress address = new CellAddress( sheet, column, row );
Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
- cellBinding = (com.sun.star.form.binding.XValueBinding)UnoRuntime.queryInterface(
+ cellBinding = UnoRuntime.queryInterface(
com.sun.star.form.binding.XValueBinding.class,
createInstanceWithArguments(
supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
@@ -123,7 +123,7 @@ public class SpreadsheetDocument extends DocumentHelper
CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
topRow, column, bottomRow );
Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
- entrySource = (com.sun.star.form.binding.XListEntrySource)UnoRuntime.queryInterface(
+ entrySource = UnoRuntime.queryInterface(
com.sun.star.form.binding.XListEntrySource.class,
createInstanceWithArguments(
"com.sun.star.table.CellRangeListSource", initParam ) );
diff --git a/forms/qa/integration/forms/SpreadsheetView.java b/forms/qa/integration/forms/SpreadsheetView.java
index fd958d5d4..dbc05d8 100644
--- a/forms/qa/integration/forms/SpreadsheetView.java
+++ b/forms/qa/integration/forms/SpreadsheetView.java
@@ -47,16 +47,16 @@ public class SpreadsheetView extends integration.forms.DocumentViewHelper
try
{
// get the sheet to activate
- XSpreadsheetDocument doc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+ XSpreadsheetDocument doc = UnoRuntime.queryInterface(
XSpreadsheetDocument.class, getDocument().getDocument() );
- XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess sheets = UnoRuntime.queryInterface(
XIndexAccess.class, doc.getSheets() );
- XSpreadsheet sheet = (XSpreadsheet)UnoRuntime.queryInterface(
+ XSpreadsheet sheet = UnoRuntime.queryInterface(
XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );
// activate
- XSpreadsheetView view = (XSpreadsheetView)UnoRuntime.queryInterface(
+ XSpreadsheetView view = UnoRuntime.queryInterface(
XSpreadsheetView.class, getController() );
view.setActiveSheet( sheet );
}
diff --git a/forms/qa/integration/forms/TableCellTextBinding.java b/forms/qa/integration/forms/TableCellTextBinding.java
index 04f2434..40a5d69 100644
--- a/forms/qa/integration/forms/TableCellTextBinding.java
+++ b/forms/qa/integration/forms/TableCellTextBinding.java
@@ -53,7 +53,7 @@ public class TableCellTextBinding
/** Creates a new instance of TableCellTextBinding */
public TableCellTextBinding( XCell cell )
{
- m_cellText = (XTextRange)UnoRuntime.queryInterface( XTextRange.class, cell );
+ m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell );
m_newCellText = new String();
m_listeners = new java.util.LinkedList();
diff --git a/forms/qa/integration/forms/ValueBinding.java b/forms/qa/integration/forms/ValueBinding.java
index 33773a0..2f4d58a 100644
--- a/forms/qa/integration/forms/ValueBinding.java
+++ b/forms/qa/integration/forms/ValueBinding.java
@@ -82,11 +82,11 @@ public class ValueBinding extends integration.forms.TestCase
// insert a table with exactly one cell. The content of this table will be synced with
// the content of a form control
- XTextDocument textDoc = (XTextDocument)UnoRuntime.queryInterface( XTextDocument.class, m_document.getDocument() );
+ XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, m_document.getDocument() );
XText documentText = textDoc.getText();
XTextCursor textCursor = documentText.createTextCursor();
- XTextTable table = (XTextTable)UnoRuntime.queryInterface( XTextTable.class,
+ XTextTable table = UnoRuntime.queryInterface( XTextTable.class,
m_document.createInstance( "com.sun.star.text.TextTable" )
);
table.initialize( 1, 1 );
@@ -98,7 +98,7 @@ public class ValueBinding extends integration.forms.TestCase
// create a value binding for the first cell of the table
XValueBinding cellBinding = new TableCellTextBinding( table.getCellByName( "A1" ) );
// and bind it to the control
- XBindableValue bindable = (XBindableValue)UnoRuntime.queryInterface(
+ XBindableValue bindable = UnoRuntime.queryInterface(
XBindableValue.class, textControl
);
bindable.setValueBinding( cellBinding );
diff --git a/forms/qa/integration/forms/XMLFormSettings.java b/forms/qa/integration/forms/XMLFormSettings.java
index 70f9d27..16e766c 100644
--- a/forms/qa/integration/forms/XMLFormSettings.java
+++ b/forms/qa/integration/forms/XMLFormSettings.java
@@ -101,7 +101,7 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
File tempFile = File.createTempFile( "xmlforms", ".odt" );
tempFile.deleteOnExit();
String fileURL = tempFile.toURI().toURL().toExternalForm();
- XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+ XStorable store = UnoRuntime.queryInterface( XStorable.class,
m_document.getDocument() );
store.storeAsURL( fileURL, new PropertyValue[] {} );
assure( "document still modified after saving it", !m_document.isModified() );
@@ -118,7 +118,7 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
{
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
m_document.getDocument() );
closeDoc.close( true );
}
@@ -127,9 +127,9 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
/* ------------------------------------------------------------------ */
private static void impl_bind( XPropertySet _control, XPropertySet _binding ) throws IncompatibleTypesException
{
- XBindableValue bindableControl = (XBindableValue)UnoRuntime.queryInterface(
+ XBindableValue bindableControl = UnoRuntime.queryInterface(
XBindableValue.class, _control );
- XValueBinding binding = (XValueBinding)UnoRuntime.queryInterface(
+ XValueBinding binding = UnoRuntime.queryInterface(
XValueBinding.class, _binding );
bindableControl.setValueBinding( binding );
}
@@ -209,7 +209,7 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
*/
private void impl_storeDocument() throws IOException
{
- XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+ XStorable store = UnoRuntime.queryInterface( XStorable.class,
m_document.getDocument() );
store.store();
assure( "document still modified after saving it", !m_document.isModified() );
diff --git a/forms/qa/org/openoffice/complex/forms/tools/ResultSet.java b/forms/qa/org/openoffice/complex/forms/tools/ResultSet.java
index 04a84fd..7f87db7 100644
--- a/forms/qa/org/openoffice/complex/forms/tools/ResultSet.java
+++ b/forms/qa/org/openoffice/complex/forms/tools/ResultSet.java
@@ -39,8 +39,8 @@ public class ResultSet implements XResultSet, XRow
public ResultSet( final Object _resultSet )
{
- m_resultSet = (XResultSet)UnoRuntime.queryInterface( XResultSet.class, _resultSet );
- m_row = (XRow)UnoRuntime.queryInterface( XRow.class, _resultSet );
+ m_resultSet = UnoRuntime.queryInterface( XResultSet.class, _resultSet );
+ m_row = UnoRuntime.queryInterface( XRow.class, _resultSet );
}
public
diff --git a/forms/qa/org/openoffice/xforms/Model.java b/forms/qa/org/openoffice/xforms/Model.java
index e8d1361..d0af835 100644
--- a/forms/qa/org/openoffice/xforms/Model.java
+++ b/forms/qa/org/openoffice/xforms/Model.java
@@ -32,9 +32,9 @@ public class Model
protected Model( Object _model )
{
- m_model = (XModel)UnoRuntime.queryInterface( XModel.class, _model );
- m_modelProps = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, _model );
- m_helper = (XFormsUIHelper1)UnoRuntime.queryInterface( XFormsUIHelper1.class,
+ m_model = UnoRuntime.queryInterface( XModel.class, _model );
+ m_modelProps = UnoRuntime.queryInterface( XPropertySet.class, _model );
+ m_helper = UnoRuntime.queryInterface( XFormsUIHelper1.class,
m_model );
}
diff --git a/forms/qa/org/openoffice/xforms/XMLDocument.java b/forms/qa/org/openoffice/xforms/XMLDocument.java
index 80d9764..339f14a 100644
--- a/forms/qa/org/openoffice/xforms/XMLDocument.java
+++ b/forms/qa/org/openoffice/xforms/XMLDocument.java
@@ -52,7 +52,7 @@ public class XMLDocument extends integration.forms.DocumentHelper
/* ------------------------------------------------------------------ */
private void impl_initialize( XComponent _document )
{
- m_formsSupplier = (XFormsSupplier)UnoRuntime.queryInterface( XFormsSupplier.class,
+ m_formsSupplier = UnoRuntime.queryInterface( XFormsSupplier.class,
_document );
if ( m_formsSupplier == null )
@@ -86,10 +86,10 @@ public class XMLDocument extends integration.forms.DocumentHelper
XModel newModel = null;
try
{
- newModel = (XModel) UnoRuntime.queryInterface( XModel.class,
+ newModel = UnoRuntime.queryInterface( XModel.class,
getOrb().createInstance( "com.sun.star.xforms.Model" ) );
newModel.setID(_modelName);
- XFormsUIHelper1 modelHelper = (XFormsUIHelper1) UnoRuntime.queryInterface(
+ XFormsUIHelper1 modelHelper = UnoRuntime.queryInterface(
XFormsUIHelper1.class, newModel );
modelHelper.newInstance( "Instance 1", new String(), true );
newModel.initialize();
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
index 520a4ea..60bdcf9 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
@@ -86,7 +86,7 @@ public abstract class BaseNLPSolver extends WeakBase
m_componentFactory = xContext.getServiceManager();
try {
Object toolkit = m_componentFactory.createInstanceWithContext("com.sun.star.awt.Toolkit", xContext);
- m_xReschedule = (XReschedule) UnoRuntime.queryInterface(XReschedule.class, toolkit);
+ m_xReschedule = UnoRuntime.queryInterface(XReschedule.class, toolkit);
} catch (Exception ex) {
Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -145,7 +145,7 @@ public abstract class BaseNLPSolver extends WeakBase
public void setDocument(XSpreadsheetDocument document) {
m_document = document;
- m_xModel = (XModel) UnoRuntime.queryInterface(XModel.class, m_document);
+ m_xModel = UnoRuntime.queryInterface(XModel.class, m_document);
}
public CellAddress getObjective() {
@@ -348,8 +348,8 @@ public abstract class BaseNLPSolver extends WeakBase
protected XCell getCell(int col, int row, int sheet) {
try {
XSpreadsheets xSpreadsheets = m_document.getSheets();
- XIndexAccess xSheetIndex = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
- XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
+ XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
return xSpreadsheet.getCellByPosition(col, row);
} catch (IndexOutOfBoundsException ex) {
Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex);
@@ -368,9 +368,9 @@ public abstract class BaseNLPSolver extends WeakBase
protected XCellRangeData getCellRangeData(int sheet, int startCol, int startRow, int endCol, int endRow) {
try {
XSpreadsheets xSpreadsheets = m_document.getSheets();
- XIndexAccess xSheetIndex = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
- XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
- return (XCellRangeData) UnoRuntime.queryInterface(XCellRangeData.class, xSpreadsheet.getCellRangeByPosition(startCol, startRow, endCol, endRow));
+ XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
+ return UnoRuntime.queryInterface(XCellRangeData.class, xSpreadsheet.getCellRangeByPosition(startCol, startRow, endCol, endRow));
} catch (IndexOutOfBoundsException ex) {
Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex);
} catch (WrappedTargetException ex) {
@@ -388,9 +388,9 @@ public abstract class BaseNLPSolver extends WeakBase
protected XChartDataArray getChartDataArray(int sheet, int startCol, int startRow, int endCol, int endRow) {
try {
XSpreadsheets xSpreadsheets = m_document.getSheets();
- XIndexAccess xSheetIndex = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
- XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
- return (XChartDataArray) UnoRuntime.queryInterface(XChartDataArray.class, xSpreadsheet.getCellRangeByPosition(startCol, startRow, endCol, endRow));
+ XIndexAccess xSheetIndex = UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
+ XSpreadsheet xSpreadsheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetIndex.getByIndex(sheet));
+ return UnoRuntime.queryInterface(XChartDataArray.class, xSpreadsheet.getCellRangeByPosition(startCol, startRow, endCol, endRow));
} catch (IndexOutOfBoundsException ex) {
Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex);
} catch (WrappedTargetException ex) {
@@ -494,17 +494,17 @@ public abstract class BaseNLPSolver extends WeakBase
m_xModel.unlockControllers();
try {
- XIndexAccess xSpreadsheets = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, m_document.getSheets());
+ XIndexAccess xSpreadsheets = UnoRuntime.queryInterface(XIndexAccess.class, m_document.getSheets());
int sheets = xSpreadsheets.getCount();
for (int i = 0; i < sheets; i++) {
Object sheet = xSpreadsheets.getByIndex(i);
- XTableChartsSupplier xTableChartsSupplier = (XTableChartsSupplier) UnoRuntime.queryInterface(XTableChartsSupplier.class, sheet);
- XIndexAccess xCharts = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, xTableChartsSupplier.getCharts());
+ XTableChartsSupplier xTableChartsSupplier = UnoRuntime.queryInterface(XTableChartsSupplier.class, sheet);
+ XIndexAccess xCharts = UnoRuntime.queryInterface(XIndexAccess.class, xTableChartsSupplier.getCharts());
int charts = xCharts.getCount();
for (int j = 0; j < charts; j++) {
Object chart = xCharts.getByIndex(j);
- XEmbeddedObjectSupplier xChartObjects = (XEmbeddedObjectSupplier) UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, chart);
- XModel xChartModel = (XModel) UnoRuntime.queryInterface(XModel.class, xChartObjects.getEmbeddedObject());
+ XEmbeddedObjectSupplier xChartObjects = UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, chart);
+ XModel xChartModel = UnoRuntime.queryInterface(XModel.class, xChartObjects.getEmbeddedObject());
if (lock)
xChartModel.lockControllers();
else
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java
index 61935d2..6780826 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/ResourceManager.java
@@ -60,12 +60,12 @@ public class ResourceManager {
m_resourceBaseUrl = m_oxtRoot + relativeResourceBaseUrl;
try {
- XMultiServiceFactory xConfig = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class,
+ XMultiServiceFactory xConfig = UnoRuntime.queryInterface(XMultiServiceFactory.class,
m_context.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", m_context));
Object[] args = new Object[1];
args[0] = new PropertyValue("nodepath", 0, "/org.openoffice.Setup/L10N", PropertyState.DIRECT_VALUE);
- XPropertySet xConfigProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
+ XPropertySet xConfigProps = UnoRuntime.queryInterface(XPropertySet.class,
xConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args));
String[] locale = AnyConverter.toString(xConfigProps.getPropertyValue("ooLocale")).split("-");
String lang = locale[0];
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
index 45ec08c..b0a1ebd 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
@@ -76,9 +76,9 @@ public abstract class BaseDialog extends BaseControl {
public XFrame getCurrentFrame() {
try {
Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", context);
- XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, oDesktop);
+ XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, oDesktop);
XComponent xComponent = xDesktop.getCurrentComponent();
- XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);
+ XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent);
XController xController = xModel.getCurrentController();
return xController.getFrame();
} catch (Exception e) {
@@ -96,26 +96,26 @@ public abstract class BaseDialog extends BaseControl {
try {
xMCF = context.getServiceManager();
setUnoModel(xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", context));
- xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, getUnoModel());
+ xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, getUnoModel());
setProperty("Title", title);
setPosition(x, y);
setSize(width, height);
unoControl = xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialog", context);
- XControl xControl = (XControl)UnoRuntime.queryInterface(XControl.class, unoControl);
- XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(XControlModel.class, getUnoModel());
+ XControl xControl = UnoRuntime.queryInterface(XControl.class, unoControl);
+ XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, getUnoModel());
xControl.setModel(xControlModel);
toolkit = xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", context);
- XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, toolkit);
- xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, unoControl);
+ XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, toolkit);
+ xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl);
xWindow.setVisible(false);
- XWindowPeer xParentWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, getCurrentFrame().getComponentWindow());
+ XWindowPeer xParentWindowPeer = UnoRuntime.queryInterface(XWindowPeer.class, getCurrentFrame().getComponentWindow());
xControl.createPeer(xToolkit, xParentWindowPeer);
xWindowPeer = xControl.getPeer();
- xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, unoControl);
+ xDialog = UnoRuntime.queryInterface(XDialog.class, unoControl);
//center if necessary
if (x < 0 || y < 0) {
@@ -137,7 +137,7 @@ public abstract class BaseDialog extends BaseControl {
@Override
protected void finalize() throws Throwable {
- XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, unoControl);
+ XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, unoControl);
xComponent.dispose();
super.finalize();
}
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
index 8cf6652..6cb8adf 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
@@ -274,7 +274,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
}
public void dispose() {
- XComponent component = (XComponent) UnoRuntime.queryInterface(XComponent.class, xDialog);
+ XComponent component = UnoRuntime.queryInterface(XComponent.class, xDialog);
component.dispose();
}
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java
index d5c395c..84c38d6 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/BaseControl.java
@@ -62,7 +62,7 @@ public abstract class BaseControl {
*/
protected void setUnoModel(Object unoModel) {
this.unoModel = unoModel;
- properties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, unoModel);
+ properties = UnoRuntime.queryInterface(XPropertySet.class, unoModel);
}
public Object getUnoControl() {
@@ -73,10 +73,10 @@ public abstract class BaseControl {
//TODO : remove from existing parentControl
try {
String name = getName();
- XNameContainer nameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, parentControl.unoModel);
+ XNameContainer nameContainer = UnoRuntime.queryInterface(XNameContainer.class, parentControl.unoModel);
nameContainer.insertByName(name, unoModel);
- XControlContainer controlContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, parentControl.unoControl);
+ XControlContainer controlContainer = UnoRuntime.queryInterface(XControlContainer.class, parentControl.unoControl);
unoControl = controlContainer.getControl(name);
this.parentControl = parentControl;
@@ -138,7 +138,7 @@ public abstract class BaseControl {
}
public void setVisible(boolean visible) {
- XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, unoControl);
+ XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl);
xWindow.setVisible(visible);
}
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java
index 46f60f3..bf59d52 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/controls/Button.java
@@ -59,7 +59,7 @@ public class Button extends LabeledControl {
@Override
public void setParentControl(BaseControl parentControl) {
super.setParentControl(parentControl);
- xButton = (XButton) UnoRuntime.queryInterface(XButton.class, unoControl);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list