diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_xmloff')
19 files changed, 25 insertions, 38 deletions
diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java index c7922f7f342f..be1f603ad3fb 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentExporter.java @@ -130,7 +130,7 @@ public class XMLContentExporter extends TestCase { xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; - XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; xTitleProp.setPropertyValue("String", exportStr) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java index f78b779bee62..6e6cc2646735 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLContentImporter.java @@ -132,7 +132,7 @@ public class XMLContentImporter extends TestCase { Object oTitle = xChartDoc.getTitle() ; - xTitleProp = (XPropertySet) UnoRuntime.queryInterface + xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java index 82b1a43a5f95..eece10c34068 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLExporter.java @@ -131,7 +131,7 @@ public class XMLExporter extends TestCase { xEx.setSourceDocument(xChartDoc); Object oTitle = xChartDoc.getTitle() ; - XPropertySet xTitleProp = (XPropertySet) UnoRuntime.queryInterface + XPropertySet xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; xTitleProp.setPropertyValue("String", exportStr) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java index ac381a634347..40c47b6e9a12 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Chart/XMLImporter.java @@ -130,7 +130,7 @@ public class XMLImporter extends TestCase { oInt = xMSF.createInstance("com.sun.star.comp.Chart.XMLImporter") ; Object oTitle = xChartDoc.getTitle() ; - xTitleProp = (XPropertySet) UnoRuntime.queryInterface + xTitleProp = UnoRuntime.queryInterface (XPropertySet.class, oTitle) ; } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java index 287695778987..3007c80c8bb1 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLContentExporter.java @@ -142,12 +142,10 @@ public class XMLContentExporter extends TestCase { // can not be exported to XML) set.insertNewByIndex(1); - XDrawPage page1 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); + XDrawPage page1 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); - XDrawPage page2 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); + XDrawPage page2 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); xEx.setSourceDocument(xDrawDoc); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java index 9bce636bb357..3730d72e000c 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLExporter.java @@ -141,12 +141,10 @@ public class XMLExporter extends TestCase { // This is an XML-export BUG (new slide named "NewSlide2" can not be exported to XML) set.insertNewByIndex(1); - XDrawPage page1 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); + XDrawPage page1 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(0)); XNamed NPage1 = UnoRuntime.queryInterface(XNamed.class,page1); NPage1.setName("NewSlide1"); - XDrawPage page2 = (XDrawPage) - UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); + XDrawPage page2 = UnoRuntime.queryInterface(XDrawPage.class, set.getByIndex(1)); XNamed NPage2 = UnoRuntime.queryInterface(XNamed.class,page2); NPage2.setName("NewSlide2"); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java index e572aeb7c13f..01b61cb665f7 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaExporter.java @@ -130,7 +130,7 @@ public class XMLMetaExporter extends TestCase { //set some meta data XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xDrawDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()) ; docInfo.setPropertyValue("Title", TITLE); diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java index 7c951ad28ab8..1fbfb34922c8 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLMetaImporter.java @@ -154,7 +154,7 @@ public class XMLMetaImporter extends TestCase { //set some meta data XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xDrawDoc); - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = UnoRuntime.queryInterface (XPropertySet.class, infoSup.getDocumentInfo()); final PrintWriter logF = log ; diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java index 5b6ff5b1df0b..3197070f159d 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsExporter.java @@ -131,8 +131,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); xPropSet.setPropertyValue("IsLayerMode", new Boolean("true")); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java index 1872604bba32..7debe8e434f6 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLSettingsImporter.java @@ -164,8 +164,7 @@ public class XMLSettingsImporter extends TestCase { final PrintWriter logF = log; XModel xDrawModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); XController xController = xDrawModel.getCurrentController(); - final XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + final XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java index c964b0c31a61..8f6bc82ffcd1 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesExporter.java @@ -138,11 +138,10 @@ public class XMLStylesExporter extends TestCase { String styleFamilyName = styleFamiliesNames[0]; //obtain style family with name[0] Object objectStyle = StyleFamilies.getByName(styleFamilyName); - XNameContainer xStyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, objectStyle); + XNameContainer xStyleFamilyName = UnoRuntime.queryInterface(XNameContainer.class, objectStyle); //creat new style Object SC = SOF.createInstance(xDrawDoc, "com.sun.star.style.Style"); - XStyle Style = (XStyle) UnoRuntime.queryInterface(XStyle.class,SC); + XStyle Style = UnoRuntime.queryInterface(XStyle.class,SC); //add new style to style familiy with name[0] xStyleFamilyName.insertByName(STYLE_NAME,Style); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java index aa067b04b939..d5981a0f9614 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Draw/XMLStylesImporter.java @@ -166,9 +166,8 @@ public class XMLStylesImporter extends TestCase { try { Object objectStyle = StyleFamilies.getByName(impFamilyName); - XNameContainer StyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface - (XNameContainer.class, objectStyle); + XNameContainer StyleFamilyName = UnoRuntime.queryInterface + (XNameContainer.class, objectStyle); boolean hasStyle = StyleFamilyName.hasByName(impStyleName); logF.println("Does style with name '" + impStyleName diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java index 70835e11bf40..115ed47238b0 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLImporter.java @@ -155,8 +155,7 @@ public class XMLImporter extends TestCase { //get draw pages XDrawPagesSupplier drawPagesSupplier = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages drawPages = drawPagesSupplier.getDrawPages(); - final XNameAccess xNamePages = (XNameAccess) - UnoRuntime.queryInterface(XNameAccess.class, drawPages); + final XNameAccess xNamePages = UnoRuntime.queryInterface(XNameAccess.class, drawPages); tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java index 569a91dfaee4..2829fdfee796 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaExporter.java @@ -131,7 +131,7 @@ public class XMLMetaExporter extends TestCase { //change title name XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xImpressDoc) ; - XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + XPropertySet docInfo = 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 8330a9396847..4c725fab6164 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLMetaImporter.java @@ -153,7 +153,7 @@ public class XMLMetaImporter extends TestCase { XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface (XDocumentInfoSupplier.class, xImpressDoc) ; - final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface + final XPropertySet docInfo = 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 21d4493480f6..424460e5398e 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsExporter.java @@ -128,8 +128,7 @@ public class XMLSettingsExporter extends TestCase { //set some settings XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); - XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); NewDataValue = ! ((Boolean) xPropSet.getPropertyValue ("IsLayerMode")).booleanValue(); xPropSet.setPropertyValue("IsLayerMode", diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java index 95707e671239..75b306624f92 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLSettingsImporter.java @@ -165,8 +165,7 @@ public class XMLSettingsImporter extends TestCase { // get property before import XModel xImpressModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); XController xController = xImpressModel.getCurrentController(); - final XPropertySet xPropSet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xController); + final XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, xController); try { log.println("Property \"IsLayerMode\" before import is " + xPropSet.getPropertyValue("IsLayerMode")); diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java index 8affc0d2ae4d..8a11242abace 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesExporter.java @@ -141,13 +141,11 @@ public class XMLStylesExporter extends TestCase { (XStyleFamiliesSupplier.class, xImpressDoc) ; XNameAccess styleFamilies = styleSup.getStyleFamilies(); String[] styleFamiliesNames = styleFamilies.getElementNames(); - XNameContainer StyleFamilyName = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, - styleFamilies.getByName(styleFamiliesNames[0])); + XNameContainer StyleFamilyName = UnoRuntime.queryInterface(XNameContainer.class, + styleFamilies.getByName(styleFamiliesNames[0])); Object SC = SOF.createInstance (xImpressDoc, "com.sun.star.style.Style"); - XStyle StylePage = (XStyle) - UnoRuntime.queryInterface(XStyle.class,SC); + XStyle StylePage = UnoRuntime.queryInterface(XStyle.class,SC); StyleFamilyName.insertByName(newName, StylePage); } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java index c96ba75498d0..5a4aa2ca795f 100644 --- a/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java +++ b/qadevOOo/tests/java/mod/_xmloff/Impress/XMLStylesImporter.java @@ -161,7 +161,7 @@ public class XMLStylesImporter extends TestCase { xImpressDoc); XNameAccess oStyleFamilies = sup.getStyleFamilies(); Object family = oStyleFamilies.getByName("graphics") ; - styles = (XNameAccess) UnoRuntime.queryInterface + styles = UnoRuntime.queryInterface (XNameAccess.class, family) ; log.println("Styles before:") ; String[] names = styles.getElementNames() ; |