Kaydet (Commit) a7a6fffd authored tarafından Stephan Wunderlich's avatar Stephan Wunderlich

CHG: using AnyConverter instead of simple cast

üst 8405be31
......@@ -2,9 +2,9 @@
*
* $RCSfile: SvxDrawPage.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change:$Date: 2003-01-27 18:18:10 $
* last change:$Date: 2003-02-06 10:50:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -80,6 +80,9 @@ import util.InstCreator;
import util.SOfficeFactory;
import util.ShapeDsc;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
/**
* Test for object which is represented by service
* <code>com.sun.star.drawing.DrawPage</code>. <p>
......@@ -151,7 +154,7 @@ public class SvxDrawPage extends TestCase {
*/
protected void cleanup( TestParameters tParam, PrintWriter log ) {
log.println( " disposing xSheetDoc " );
//xDoc.dispose();
((XComponent) UnoRuntime.queryInterface(XComponent.class,xDoc)).dispose();
}
......@@ -173,9 +176,7 @@ public class SvxDrawPage extends TestCase {
* <code>com.sun.star.drawing.Line</code> service </li>
* </ul>
*/
public TestEnvironment createTestEnvironment( TestParameters tParam,
PrintWriter log )
throws StatusException {
protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
XInterface oObj = null;
XShape oShape = null ;
......@@ -193,7 +194,8 @@ public class SvxDrawPage extends TestCase {
oDP = (XDrawPages) oDPS.getDrawPages();
oDP.insertNewByIndex(1);
oDP.insertNewByIndex(2);
oObj = (XDrawPage) oDP.getByIndex(0);
oObj = (XDrawPage) AnyConverter.toObject(
new Type(XDrawPage.class),oDP.getByIndex(0));
SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
......@@ -210,6 +212,10 @@ public class SvxDrawPage extends TestCase {
log.println("Couldn't create insance");
e.printStackTrace(log);
throw new StatusException("Can't create enviroment", e) ;
} catch (com.sun.star.lang.IllegalArgumentException e) {
log.println("Couldn't create insance");
e.printStackTrace(log);
throw new StatusException("Can't create enviroment", e) ;
}
// create test environment here
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: SwAccessibleFooterView.java,v $
*
* $Revision: 1.1 $
* $Revision: 1.2 $
*
* last change: $Date: 2003-01-27 18:18:45 $
* last change: $Date: 2003-02-06 10:55:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -83,6 +83,9 @@ import util.AccessibilityTools;
import util.WriterTools;
import util.utils;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
/**
* Test of accessible object for a footer of a text document.<p>
* Object implements the following interfaces :
......@@ -122,14 +125,19 @@ public class SwAccessibleFooterView extends TestCase {
// obtains style 'Standard' from style family 'PageStyles'
try {
PageStyles = (XNameAccess) StyleFamNames.getByName("PageStyles");
StdStyle = (XStyle) PageStyles.getByName("Standard");
PageStyles = (XNameAccess) AnyConverter.toObject(
new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
StdStyle = (XStyle) AnyConverter.toObject(
new Type(XStyle.class),PageStyles.getByName("Standard"));
} catch ( com.sun.star.lang.WrappedTargetException e ) {
e.printStackTrace(log);
throw new StatusException("Error getting style by name!", e);
} catch ( com.sun.star.container.NoSuchElementException e ) {
e.printStackTrace(log);
throw new StatusException("Error, no such style name! ", e);
} catch ( com.sun.star.lang.IllegalArgumentException e ) {
e.printStackTrace(log);
throw new StatusException("Error getting style by name!", e);
}
final XPropertySet PropSet = (XPropertySet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment