18package org.openoffice.test.tools;
33import java.util.logging.Level;
34import java.util.logging.Logger;
60 XComponentLoader aLoader = UnoRuntime.queryInterface( XComponentLoader.class,
61 orb.createInstance(
"com.sun.star.frame.Desktop" ) );
63 XComponent document = UnoRuntime.queryInterface( XComponent.class,
64 aLoader.loadComponentFromURL( documentOrFactoryURL,
"_blank", 0, i_args )
74 XServiceInfo xSI = UnoRuntime.queryInterface( XServiceInfo.class, document );
75 if ( xSI.supportsService(
"com.sun.star.sheet.SpreadsheetDocument" ) )
89 final PropertyValue[]
args =
new PropertyValue[] {
90 new PropertyValue(
"MacroExecutionMode", -1, MacroExecMode.ALWAYS_EXECUTE, PropertyState.DIRECT_VALUE )
101 closeDoc.close(
true );
104 catch ( CloseVetoException e )
106 Logger.getLogger(
OfficeDocument.class.getName() ).log( Level.SEVERE,
"closing the document was vetoed", e );
129 XController
xController = xDocModel.getCurrentController();
143 return "private:factory/swriter";
145 return "private:factory/scalc";
147 return "private:factory/sdraw";
149 return "private:factory/swriter?slot=21053";
151 return "private:factory/simpress";
153 return "private:factory/smath";
154 return "private:factory/swriter";
164 if ( xSI.supportsService(
"com.sun.star.text.TextDocument" ) )
166 else if ( xSI.supportsService(
"com.sun.star.sheet.SpreadsheetDocument" ) )
168 else if ( xSI.supportsService(
"com.sun.star.drawing.DrawingDocument" ) )
170 else if ( xSI.supportsService(
"com.sun.star.presentation.PresentationDocument" ) )
172 else if ( xSI.supportsService(
"com.sun.star.formula.FormulaProperties" ) )
183 XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
m_documentComponent );
184 return (XInterface)xORB.createInstance( serviceSpecifier );
192 return UnoRuntime.queryInterface( i_interfaceClass,
createInstance( i_serviceSpecifier ) );
195 private final XMultiServiceFactory
m_orb;
Reference< XController > xController