diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 17:59:39 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 17:59:39 +0000 |
commit | 0690af9d75f4b8eaa36e2a1854b0efee886f401e (patch) | |
tree | a2767758a6ff50728374a058aa91cc84a8d9aa91 /sd | |
parent | 2c0be4402ab0cad638cb46491bef78633ffbfdd2 (diff) |
INTEGRATION: CWS odbmacros2 (1.10.240); FILE MERGED
2007/12/22 13:38:14 fs 1.10.240.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:15:45 fs 1.10.240.1: #i49133# allow creating text 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 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unodoc.cxx | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx index 305fba478f8e..5ac2408ad1aa 100644 --- a/sd/source/ui/unoidl/unodoc.cxx +++ b/sd/source/ui/unoidl/unodoc.cxx @@ -4,9 +4,9 @@ * * $RCSfile: unodoc.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: kz $ $Date: 2006-12-12 18:58:26 $ + * last change: $Author: kz $ $Date: 2008-03-06 18:59:39 $ * * 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> @@ -79,13 +80,18 @@ uno::Sequence< rtl::OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNam } uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & ) + const uno::Reference< lang::XMultiServiceFactory > &, const sal_uInt64 _nCreationFlags ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); SdDLL::Init(); + + 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 ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD); + new ::sd::GraphicDocShell( + eCreateMode, FALSE, DOCUMENT_TYPE_DRAW, bScriptSupport ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } @@ -106,12 +112,18 @@ uno::Sequence< rtl::OUString > SAL_CALL SdPresentationDocument_getSupportedServi } uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( - const uno::Reference< lang::XMultiServiceFactory > & ) + const uno::Reference< lang::XMultiServiceFactory > &, const sal_uInt64 _nCreationFlags ) { ::vos::OGuard aGuard( Application::GetSolarMutex() ); SdDLL::Init(); - SfxObjectShell* pShell = new ::sd::DrawDocShell(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 ::sd::DrawDocShell( + eCreateMode, FALSE, DOCUMENT_TYPE_IMPRESS, bScriptSupport ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } |