diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 17:45:45 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 17:45:45 +0000 |
commit | 118f0042f62a3f85cf2482fbdd8a5d6edfb98542 (patch) | |
tree | 4e95e4fab8f49785602471e3058eea7d6d52e839 /starmath/source | |
parent | 301c6a1557e9eb26e1cb195b52d40e3904da0ea8 (diff) |
INTEGRATION: CWS odbmacros2 (1.6.60); FILE MERGED
2007/12/22 13:39:56 fs 1.6.60.2: during #i49133#: extended the previous change (per AS' request) so the factory method does not take two booleans, but a 64 bit field instead
2007/12/12 11:22:57 fs 1.6.60.1: #i49133# allow creating documents which do not support scripting.
For this purpose, use a DocShell ctor which allows disabling scripting,
plus a service factory creator (::sfx2::createSfxModelFacrtory instead
of ::cppu::createSingleFactory) which extracts this setting from the
arguments given to createInstanceWithArguments
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/unodoc.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/starmath/source/unodoc.cxx b/starmath/source/unodoc.cxx index 5fc289b00707..b913a9eb0444 100644 --- a/starmath/source/unodoc.cxx +++ b/starmath/source/unodoc.cxx @@ -4,9 +4,9 @@ * * $RCSfile: unodoc.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: vg $ $Date: 2007-05-25 12:16:02 $ + * last change: $Author: kz $ $Date: 2008-03-06 18:45:45 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,6 +40,7 @@ #include <tools/string.hxx> #include <sfx2/docfac.hxx> +#include <sfx2/sfxmodelfactory.hxx> #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -70,13 +71,16 @@ uno::Sequence< rtl::OUString > SAL_CALL SmDocument_getSupportedServiceNames() th } uno::Reference< uno::XInterface > SAL_CALL SmDocument_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) throw( uno::Exception ) + const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/, const sal_uInt64 _nCreationFlags ) throw( uno::Exception ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); if ( !SM_MOD() ) SmDLL::Init(); - SfxObjectShell* pShell = new SmDocShell( SFX_CREATE_MODE_STANDARD ); + const SfxObjectCreateMode eCreateMode = ( _nCreationFlags & SFXMODEL_EMBEDDED_OBJECT ) ? SFX_CREATE_MODE_EMBEDDED : SFX_CREATE_MODE_STANDARD; + const bool bScriptSupport = ( _nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0; + + SfxObjectShell* pShell = new SmDocShell( eCreateMode, bScriptSupport ); if( pShell ) return uno::Reference< uno::XInterface >( pShell->GetModel() ); |