diff options
Diffstat (limited to 'odk/examples/java/DocumentHandling/DocumentSaver.java')
-rw-r--r-- | odk/examples/java/DocumentHandling/DocumentSaver.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/odk/examples/java/DocumentHandling/DocumentSaver.java b/odk/examples/java/DocumentHandling/DocumentSaver.java index f6f21ea48228..052b344a3d2e 100644 --- a/odk/examples/java/DocumentHandling/DocumentSaver.java +++ b/odk/examples/java/DocumentHandling/DocumentSaver.java @@ -71,9 +71,8 @@ public class DocumentSaver { "com.sun.star.frame.Desktop", xContext); com.sun.star.frame.XComponentLoader xCompLoader = - (com.sun.star.frame.XComponentLoader) - UnoRuntime.queryInterface( - com.sun.star.frame.XComponentLoader.class, oDesktop); + UnoRuntime.queryInterface( + com.sun.star.frame.XComponentLoader.class, oDesktop); java.io.File sourceFile = new java.io.File(args[0]); StringBuffer sLoadUrl = new StringBuffer("file:///"); @@ -92,8 +91,8 @@ public class DocumentSaver { Object oDocToStore = xCompLoader.loadComponentFromURL( sLoadUrl.toString(), "_blank", 0, propertyValue ); com.sun.star.frame.XStorable xStorable = - (com.sun.star.frame.XStorable)UnoRuntime.queryInterface( - com.sun.star.frame.XStorable.class, oDocToStore ); + UnoRuntime.queryInterface( + com.sun.star.frame.XStorable.class, oDocToStore ); propertyValue = new com.sun.star.beans.PropertyValue[ 2 ]; propertyValue[0] = new com.sun.star.beans.PropertyValue(); @@ -107,17 +106,15 @@ public class DocumentSaver { System.out.println("\nDocument \"" + sLoadUrl + "\" saved under \"" + sSaveUrl + "\"\n"); - com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable) - UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, - oDocToStore ); + com.sun.star.util.XCloseable xCloseable = UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, + oDocToStore ); if (xCloseable != null ) { xCloseable.close(false); } else { - com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent) - UnoRuntime.queryInterface( - com.sun.star.lang.XComponent.class, oDocToStore ); + com.sun.star.lang.XComponent xComp = UnoRuntime.queryInterface( + com.sun.star.lang.XComponent.class, oDocToStore ); xComp.dispose(); } System.out.println("document closed!"); |