diff options
author | sb <sb@openoffice.org> | 2010-04-07 14:09:12 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-04-07 14:09:12 +0200 |
commit | 4f1af49037ec75630216679cdbe2995a4b68d528 (patch) | |
tree | 522347a6cd91984f68e9ca382d596bf442507ab3 /forms/qa | |
parent | 124a56ba4e448e19bd924814b336142d47bd1bbb (diff) | |
parent | 55d474d85391d1eb9c9c6f04f88ed9a9f5161b13 (diff) |
sb120: merged in re/DEV300_next towards DEV300_m76 via cws/sb118
Diffstat (limited to 'forms/qa')
-rw-r--r-- | forms/qa/integration/forms/DocumentHelper.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/forms/qa/integration/forms/DocumentHelper.java b/forms/qa/integration/forms/DocumentHelper.java index f24e090537af..524f6b939afb 100644 --- a/forms/qa/integration/forms/DocumentHelper.java +++ b/forms/qa/integration/forms/DocumentHelper.java @@ -26,11 +26,13 @@ ************************************************************************/ package integration.forms; +import com.sun.star.beans.PropertyState; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XChild; import com.sun.star.container.XIndexContainer; import com.sun.star.container.XNameContainer; +import com.sun.star.document.MacroExecMode; import com.sun.star.drawing.XDrawPage; import com.sun.star.drawing.XDrawPageSupplier; import com.sun.star.drawing.XDrawPages; @@ -68,13 +70,19 @@ public class DocumentHelper /* ------------------------------------------------------------------ */ protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL ) throws com.sun.star.uno.Exception { + return implLoadAsComponent( orb, documentOrFactoryURL, new PropertyValue[0] ); + } + + /* ------------------------------------------------------------------ */ + protected static XComponent implLoadAsComponent( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception + { XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface( XComponentLoader.class, orb.createInstance( "com.sun.star.frame.Desktop" ) ); XComponent document = dbfTools.queryComponent( - aLoader.loadComponentFromURL( documentOrFactoryURL, "_blank", 0, new PropertyValue[ 0 ] ) + aLoader.loadComponentFromURL( documentOrFactoryURL, "_blank", 0, i_args ) ); return document; } @@ -82,7 +90,13 @@ public class DocumentHelper /* ------------------------------------------------------------------ */ private static DocumentHelper implLoadDocument( XMultiServiceFactory orb, String documentOrFactoryURL ) throws com.sun.star.uno.Exception { - XComponent document = implLoadAsComponent( orb, documentOrFactoryURL ); + return implLoadDocument( orb, documentOrFactoryURL, new PropertyValue[0] ); + } + + /* ------------------------------------------------------------------ */ + private static DocumentHelper implLoadDocument( XMultiServiceFactory orb, String documentOrFactoryURL, final PropertyValue[] i_args ) throws com.sun.star.uno.Exception + { + XComponent document = implLoadAsComponent( orb, documentOrFactoryURL, i_args ); XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, document ); @@ -112,7 +126,10 @@ public class DocumentHelper /* ------------------------------------------------------------------ */ public static DocumentHelper blankDocument( XMultiServiceFactory orb, DocumentType eType ) throws com.sun.star.uno.Exception { - return implLoadDocument( orb, getDocumentFactoryURL( eType ) ); + final PropertyValue[] args = new PropertyValue[] { + new PropertyValue( "MacroExecutionMode", -1, MacroExecMode.ALWAYS_EXECUTE, PropertyState.DIRECT_VALUE ) + }; + return implLoadDocument( orb, getDocumentFactoryURL( eType ), args ); } /* ================================================================== */ |