diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-06 21:34:53 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-06 21:34:53 +0100 |
commit | 1f680bfe9c50b03c7623bf34755d84ec0796ea32 (patch) | |
tree | 95d10b21ac9f39714bd7c58d0846d1a73ee58bcc /sd/source/ui | |
parent | 3b4faad942a61834824d9b3bc1919e1b10976f95 (diff) |
autorecovery: allow creating SFX-based documents which do not support the XDocumentRecovery interface
For this purpose, the SFX document factory methods got an additional parameter respectively flag
("DocumentRecoverySupport" resp. SFXMODEL_DISABLE_DOCUMENT_RECOVERY). This flag is used by database
documents to remove the interface from sub documents (aka forms/reports).
In this course, some of the functionality around those SFXMODELL_* flags, previously duplicated in
all applications, has been consolidated into a new SfxObjectShell constructor.
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/docshell/docshell.cxx | 27 | ||||
-rw-r--r-- | sd/source/ui/docshell/grdocsh.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/inc/DrawDocShell.hxx | 8 | ||||
-rw-r--r-- | sd/source/ui/inc/GraphicDocShell.hxx | 8 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unodoc.cxx | 10 |
5 files changed, 48 insertions, 17 deletions
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 8b7ce2e12045..b05e9158a873 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -166,7 +166,7 @@ void DrawDocShell::Construct( bool bClipboard ) DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode, BOOL bDataObject, - DocumentType eDocumentType,BOOL bScriptSupport) : + DocumentType eDocumentType) : SfxObjectShell( eMode == SFX_CREATE_MODE_INTERNAL ? SFX_CREATE_MODE_EMBEDDED : eMode), mpFormatClipboard(new SdFormatClipboard()), mpDoc(NULL), @@ -180,8 +180,6 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode, mbOwnPrinter(FALSE), mbNewDocument( sal_True ) { - if ( !bScriptSupport ) - SetHasNoBasic(); Construct( eMode == SFX_CREATE_MODE_INTERNAL ); } @@ -191,6 +189,29 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode, |* \************************************************************************/ +DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, BOOL bDataObject, DocumentType eDocumentType ) : + SfxObjectShell( nModelCreationFlags ), + mpFormatClipboard(new SdFormatClipboard()), + mpDoc(NULL), + mpUndoManager(NULL), + mpPrinter(NULL), + mpViewShell(NULL), + mpFontList(NULL), + meDocType(eDocumentType), + mpFilterSIDs(0), + mbSdDataObj(bDataObject), + mbOwnPrinter(FALSE), + mbNewDocument( sal_True ) +{ + Construct( FALSE ); +} + +/************************************************************************* +|* +|* Konstruktor 3 +|* +\************************************************************************/ + DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode, BOOL bDataObject, DocumentType eDocumentType) : diff --git a/sd/source/ui/docshell/grdocsh.cxx b/sd/source/ui/docshell/grdocsh.cxx index 990922111089..07c6f203e3a2 100644 --- a/sd/source/ui/docshell/grdocsh.cxx +++ b/sd/source/ui/docshell/grdocsh.cxx @@ -71,8 +71,16 @@ SFX_IMPL_OBJECTFACTORY( GraphicDocShell, SvGlobalName(SO3_SDRAW_CLASSID_60), SFX GraphicDocShell::GraphicDocShell(SfxObjectCreateMode eMode, BOOL bDataObject, - DocumentType eDocType,BOOL bScriptSupport) : - DrawDocShell(eMode, bDataObject, eDocType, bScriptSupport) + DocumentType eDocType) : + DrawDocShell(eMode, bDataObject, eDocType) +{ + SetStyleFamily( SD_STYLE_FAMILY_GRAPHICS ); +} + +GraphicDocShell::GraphicDocShell(const sal_uInt64 nModelCreationFlags, + BOOL bDataObject, + DocumentType eDocType) : + DrawDocShell(nModelCreationFlags, bDataObject, eDocType) { SetStyleFamily( SD_STYLE_FAMILY_GRAPHICS ); } diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index fb2d83ba4be9..01706cb6ab93 100644 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -74,8 +74,12 @@ public: DrawDocShell ( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED, BOOL bSdDataObj=FALSE, - DocumentType=DOCUMENT_TYPE_IMPRESS, - BOOL bScriptSupport=TRUE); + DocumentType=DOCUMENT_TYPE_IMPRESS); + + DrawDocShell ( + const sal_uInt64 nModelCreationFlags, + BOOL bSdDataObj=FALSE, + DocumentType=DOCUMENT_TYPE_IMPRESS); DrawDocShell ( SdDrawDocument* pDoc, diff --git a/sd/source/ui/inc/GraphicDocShell.hxx b/sd/source/ui/inc/GraphicDocShell.hxx index 9171dbefb801..08df27c9cb1c 100644 --- a/sd/source/ui/inc/GraphicDocShell.hxx +++ b/sd/source/ui/inc/GraphicDocShell.hxx @@ -60,8 +60,12 @@ public: GraphicDocShell ( SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED, BOOL bSdDataObj=FALSE, - DocumentType=DOCUMENT_TYPE_DRAW, - BOOL bScriptSupport=TRUE); + DocumentType=DOCUMENT_TYPE_DRAW); + + GraphicDocShell ( + const sal_uInt64 nModelCreationFlags, + BOOL bSdDataObj=FALSE, + DocumentType=DOCUMENT_TYPE_DRAW); virtual ~GraphicDocShell (void); }; diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx index 55b7a59fa56f..0efd5128cfc1 100644 --- a/sd/source/ui/unoidl/unodoc.cxx +++ b/sd/source/ui/unoidl/unodoc.cxx @@ -69,12 +69,9 @@ uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( 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( - eCreateMode, FALSE, DOCUMENT_TYPE_DRAW, bScriptSupport ); + _nCreationFlags, FALSE, DOCUMENT_TYPE_DRAW ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } @@ -101,12 +98,9 @@ uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance 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::DrawDocShell( - eCreateMode, FALSE, DOCUMENT_TYPE_IMPRESS, bScriptSupport ); + _nCreationFlags, FALSE, DOCUMENT_TYPE_IMPRESS ); return uno::Reference< uno::XInterface >( pShell->GetModel() ); } |