summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/text
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-27 15:40:17 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-29 22:03:01 +0200
commitb65017a2a7af290f6681da7b197a52efe83d5185 (patch)
tree06f71a435ba200d044109469b13be7c8f5dbe950 /qadevOOo/tests/java/ifc/text
parent33ec740d1438c3dddf8e1974757ed05bb76425ca (diff)
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/tests/java/ifc/text')
-rw-r--r--qadevOOo/tests/java/ifc/text/_BaseIndex.java4
-rw-r--r--qadevOOo/tests/java/ifc/text/_MailMerge.java6
-rw-r--r--qadevOOo/tests/java/ifc/text/_NumberingLevel.java4
-rw-r--r--qadevOOo/tests/java/ifc/text/_TextGraphicObject.java4
-rw-r--r--qadevOOo/tests/java/ifc/text/_XDocumentIndex.java5
-rw-r--r--qadevOOo/tests/java/ifc/text/_XRelativeTextContentInsert.java3
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextFieldsSupplier.java14
-rw-r--r--qadevOOo/tests/java/ifc/text/_XTextRangeCompare.java2
8 files changed, 18 insertions, 24 deletions
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();
}