diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-02-22 12:36:29 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-02-22 12:36:29 +0100 |
commit | 1816f3232b325c81b4d843925476a9cc1f089041 (patch) | |
tree | d195e44da471c1b299a27f8e7963f3cd9d06a28b /forms/qa | |
parent | 881fcb81a213938b856335f03894d5cfec008402 (diff) |
autorecovery: pass a MacroExecMode when creating a blank document - with the changed implementation, it is not (as before) by accident that a suitable MacroExecMode is set automatically
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 81b0c3a86f5a..3aae6bafc21a 100644 --- a/forms/qa/integration/forms/DocumentHelper.java +++ b/forms/qa/integration/forms/DocumentHelper.java @@ -29,11 +29,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; @@ -71,13 +73,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; } @@ -85,7 +93,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 ); @@ -115,7 +129,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 ); } /* ================================================================== */ |