diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sw/ParagraphStyle.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sw/ParagraphStyle.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java index c0d95a6163be..68dddf1fc7ac 100644 --- a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java +++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java @@ -85,11 +85,11 @@ public class ParagraphStyle extends TestCase { XStyleFamiliesSupplier oSFS = UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDoc); XNameAccess oSF = oSFS.getStyleFamilies(); - oSFNA = (XNameAccess) UnoRuntime.queryInterface( + oSFNA = UnoRuntime.queryInterface( XNameAccess.class,oSF.getByName("ParagraphStyles")); XIndexAccess oSFIA = UnoRuntime.queryInterface(XIndexAccess.class, oSFNA); String[] els = oSFNA.getElementNames(); - oStyle = (XStyle) UnoRuntime.queryInterface( + oStyle = UnoRuntime.queryInterface( XStyle.class,oSFIA.getByIndex(1)); } catch ( com.sun.star.lang.WrappedTargetException e ) { log.println("Error: exception occurred."); @@ -110,7 +110,7 @@ public class ParagraphStyle extends TestCase { XMultiServiceFactory oMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc); XInterface oInt = (XInterface) oMSF.createInstance("com.sun.star.style.ParagraphStyle"); - oMyStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, oInt); + oMyStyle = UnoRuntime.queryInterface(XStyle.class, oInt); } catch ( com.sun.star.uno.Exception e ) { log.println("Error: exception occurred."); e.printStackTrace(log); @@ -122,8 +122,7 @@ public class ParagraphStyle extends TestCase { log.println("FAILED"); else log.println("OK"); - XNameContainer oSFNC = (XNameContainer) - UnoRuntime.queryInterface(XNameContainer.class, oSFNA); + XNameContainer oSFNC = UnoRuntime.queryInterface(XNameContainer.class, oSFNA); try { if ( oSFNC.hasByName("My Style") ) @@ -145,8 +144,7 @@ public class ParagraphStyle extends TestCase { XText oText = xTextDoc.getText(); XTextCursor oCursor = oText.createTextCursor(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oCursor); + XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class, oCursor); try { xProp.setPropertyValue("ParaStyleName", oMyStyle.getName()); @@ -168,8 +166,7 @@ public class ParagraphStyle extends TestCase { tEnv = new TestEnvironment(oMyStyle); tEnv.addObjRelation("PoolStyle", oStyle); - XPropertySet xStyleProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); + XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle); short exclude = PropertyAttribute.MAYBEVOID + PropertyAttribute.READONLY; String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude); tEnv.addObjRelation("PropertyNames", names); |