From bd215a796f9ff124bd291571e49526b6a54df247 Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 24 Aug 2010 13:14:28 +0200 Subject: [PATCH] mib19 #163409# set the macro exeution mode during workbooks.add --- vbahelper/source/vbahelper/vbadocumentsbase.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 2d4175b90939..f7af3a43d977 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -215,7 +215,13 @@ VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xP uno::Any SAL_CALL VbaDocumentsBase::Add() throw (uno::RuntimeException) { - uno::Reference< lang::XMultiComponentFactory > xSMgr( + uno::Sequence< beans::PropertyValue > aArgs( 1 ); + beans::PropertyValue aArg; + aArg.Name = ::rtl::OUString::createFromAscii("MacroExecutionMode"); + aArg.Value = uno::Any(com::sun::star::document::MacroExecMode::USE_CONFIG); + aArgs[ 0 ] = aArg; + + uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XComponentLoader > xLoader( @@ -231,8 +237,7 @@ VbaDocumentsBase::Add() throw (uno::RuntimeException) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); uno::Reference< lang::XComponent > xComponent = xLoader->loadComponentFromURL( sURL , - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, - uno::Sequence< beans::PropertyValue >(0) ); + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, aArgs ); return uno::makeAny( xComponent ); }