summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_xmloff/Impress
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/mod/_xmloff/Impress
parent33ec740d1438c3dddf8e1974757ed05bb76425ca (diff)
Java5 update - usage generics where possible
Change-Id: I12f8c448961919e153047e28fee2a0acf3af1002
Diffstat (limited to 'qadevOOo/tests/java/mod/_xmloff/Impress')
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java10
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java7
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java9
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java3
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java8
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java5
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java6
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java3
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java8
-rw-r--r--qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java5
10 files changed, 24 insertions, 40 deletions
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
index 28e9f4723ada..56cb9d95af78 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentExporter.java
@@ -126,16 +126,14 @@ public class XMLContentExporter extends TestCase {
oObj = (XInterface) xMSF.createInstanceWithArguments(
"com.sun.star.comp.Impress.XMLContentExporter",
new Object[] {arg});
- XExporter xEx = (XExporter)
- UnoRuntime.queryInterface(XExporter.class,oObj);
+ XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
// assigning a draw page a new name
- XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
- UnoRuntime.queryInterface
- (XDrawPagesSupplier.class, xImpressDoc) ;
+ XDrawPagesSupplier xPagesSup = UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xImpressDoc) ;
XDrawPages xPages = xPagesSup.getDrawPages() ;
- XNamed xPageName = (XNamed) UnoRuntime.queryInterface
+ XNamed xPageName = UnoRuntime.queryInterface
(XNamed.class, xPages.getByIndex(0)) ;
xPageName.setName(expPageName) ;
} catch (com.sun.star.uno.Exception e) {
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
index 6ce36a7e0657..8989623c8229 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLContentImporter.java
@@ -189,11 +189,10 @@ public class XMLContentImporter extends TestCase {
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
try {
- XDrawPagesSupplier xPagesSup = (XDrawPagesSupplier)
- UnoRuntime.queryInterface
- (XDrawPagesSupplier.class, xImpressDoc) ;
+ XDrawPagesSupplier xPagesSup = UnoRuntime.queryInterface
+ (XDrawPagesSupplier.class, xImpressDoc) ;
XDrawPages xPages = xPagesSup.getDrawPages() ;
- XNamed xPageName = (XNamed) UnoRuntime.queryInterface
+ XNamed xPageName = UnoRuntime.queryInterface
(XNamed.class, xPages.getByIndex(0)) ;
String gName = xPageName.getName() ;
logF.println("Page name returned = '" + gName + "'") ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
index c42a2afc94db..eac90e92e370 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLExporter.java
@@ -129,17 +129,14 @@ public class XMLExporter extends TestCase {
"com.sun.star.comp.Impress.XMLExporter", new Object[] {arg});
//get draw pages
- XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier)
- UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
XDrawPages drawPages = drawPagesSupplier.getDrawPages();
//insert new draw page
XDrawPage newDrawPage = drawPages.insertNewByIndex(0);
//set specific test name
- XNamed newPageNamed = (XNamed)
- UnoRuntime.queryInterface(XNamed.class, newDrawPage);
+ XNamed newPageNamed = UnoRuntime.queryInterface(XNamed.class, newDrawPage);
newPageNamed.setName(NAME);
- XExporter xEx = (XExporter)
- UnoRuntime.queryInterface(XExporter.class,oObj);
+ XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
} catch (com.sun.star.uno.Exception e) {
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
index 61e38481ff39..70835e11bf40 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java
@@ -153,8 +153,7 @@ public class XMLImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml);
//get draw pages
- XDrawPagesSupplier drawPagesSupplier = (XDrawPagesSupplier)
- UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
+ XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc);
XDrawPages drawPages = drawPagesSupplier.getDrawPages();
final XNameAccess xNamePages = (XNameAccess)
UnoRuntime.queryInterface(XNameAccess.class, drawPages);
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
index 9585db046ca9..569a91dfaee4 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java
@@ -125,14 +125,12 @@ public class XMLMetaExporter extends TestCase {
oObj = (XInterface) xMSF.createInstanceWithArguments(
"com.sun.star.comp.Impress.XMLMetaExporter",
new Object[]{arg});
- XExporter xEx = (XExporter)
- UnoRuntime.queryInterface(XExporter.class,oObj);
+ XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
//change title name
- XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
- UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xImpressDoc) ;
+ XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xImpressDoc) ;
XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
(XPropertySet.class, infoSup.getDocumentInfo()) ;
docInfo.setPropertyValue("Title", NAME);
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
index d09a5573f514..8330a9396847 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java
@@ -151,9 +151,8 @@ public class XMLMetaImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
- XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
- UnoRuntime.queryInterface
- (XDocumentInfoSupplier.class, xImpressDoc) ;
+ XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface
+ (XDocumentInfoSupplier.class, xImpressDoc) ;
final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
(XPropertySet.class, infoSup.getDocumentInfo()) ;
final PrintWriter logF = log ;
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
index b19c493ee69a..21d4493480f6 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java
@@ -122,13 +122,11 @@ public class XMLSettingsExporter extends TestCase {
oObj = (XInterface) xMSF.createInstanceWithArguments(
"com.sun.star.comp.Impress.XMLSettingsExporter",
new Object[] {arg});
- XExporter xEx = (XExporter)
- UnoRuntime.queryInterface(XExporter.class,oObj);
+ XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
//set some settings
- XModel xImpressModel = (XModel)
- UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+ XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc);
XController xController = xImpressModel.getCurrentController();
XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xController);
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
index 413b25472534..95707e671239 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java
@@ -163,8 +163,7 @@ public class XMLSettingsImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
// get property before import
- XModel xImpressModel = (XModel)
- UnoRuntime.queryInterface(XModel.class, xImpressDoc);
+ XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc);
XController xController = xImpressModel.getCurrentController();
final XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, xController);
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
index 4de8ce056410..8affc0d2ae4d 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java
@@ -133,14 +133,12 @@ public class XMLStylesExporter extends TestCase {
oObj = (XInterface) xMSF.createInstanceWithArguments(
"com.sun.star.comp.Impress.XMLStylesExporter",
new Object[] {arg});
- XExporter xEx = (XExporter)
- UnoRuntime.queryInterface(XExporter.class,oObj);
+ XExporter xEx = UnoRuntime.queryInterface(XExporter.class,oObj);
xEx.setSourceDocument(xImpressDoc);
// Obtaining and changing property values
- XStyleFamiliesSupplier styleSup = (XStyleFamiliesSupplier)
- UnoRuntime.queryInterface
- (XStyleFamiliesSupplier.class, xImpressDoc) ;
+ XStyleFamiliesSupplier styleSup = UnoRuntime.queryInterface
+ (XStyleFamiliesSupplier.class, xImpressDoc) ;
XNameAccess styleFamilies = styleSup.getStyleFamilies();
String[] styleFamiliesNames = styleFamilies.getElementNames();
XNameContainer StyleFamilyName = (XNameContainer)
diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
index 3345f7752303..c96ba75498d0 100644
--- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
+++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java
@@ -157,9 +157,8 @@ public class XMLStylesImporter extends TestCase {
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
XNameAccess styles = null ;
try {
- XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier)
- UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
- xImpressDoc);
+ XStyleFamiliesSupplier sup = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xImpressDoc);
XNameAccess oStyleFamilies = sup.getStyleFamilies();
Object family = oStyleFamilies.getByName("graphics") ;
styles = (XNameAccess) UnoRuntime.queryInterface