Commits

Anonymous committed e49903e

cws swcoreseparation: #i117814#: remove most dependencies on docsh.hxx by introducing an interface covering all functionality from SwDocShell needed in core and filter

Comments (0)

Files changed (114)

sfx2/inc/sfx2/objsh.hxx

 	// Misc
 	sal_Bool					IsPreview() const;
 	SfxObjectCreateMode			GetCreateMode() const { return eCreateMode; }
+    bool                        IsEmbedded() const { return SFX_CREATE_MODE_EMBEDDED == eCreateMode; }
+    bool                        IsInternal() const 
+                                { return ( SFX_CREATE_MODE_INTERNAL == eCreateMode || SFX_CREATE_MODE_ORGANIZER == eCreateMode || SFX_CREATE_MODE_PREVIEW == eCreateMode ); }
+
 	virtual void				MemoryError();
 	SfxProgress*				GetProgress() const;
     void                        SetWaitCursor( sal_Bool bSet ) const;
     }
     comphelper::EmbeddedObjectContainer&    GetEmbeddedObjectContainer() const;
     void    ClearEmbeddedObjects();
+    bool HasEmbeddedObjects() const;
 
     // ==== The functions from SvEmbeddedObject
 	virtual	Printer *		GetDocumentPrinter();

sfx2/source/doc/objembed.cxx

     DELETEZ( pImp->mpObjectContainer );
 }
 
+bool SfxObjectShell::HasEmbeddedObjects() const
+{
+	return pImp->mpObjectContainer && pImp->mpObjectContainer->HasEmbeddedObjects();
+}
+
 	sw/source/core/undo/unspnd \
 	sw/source/core/undo/untbl \
 	sw/source/core/undo/untblk \
+	sw/source/core/unocore/docstyle \
 	sw/source/core/unocore/SwXTextDefaults \
 	sw/source/core/unocore/TextCursorHelper  \
 	sw/source/core/unocore/XMLRangeHelper \
 	sw/source/core/view/vdraw \
 	sw/source/core/view/viewimp \
 	sw/source/core/view/viewoptionadjust \
+	sw/source/core/view/viewopt \
 	sw/source/core/view/viewpg \
 	sw/source/core/view/viewsh \
 	sw/source/core/view/vnew \
 	sw/source/ui/app/docshdrw \
 	sw/source/ui/app/docshini \
 	sw/source/ui/app/docst \
-	sw/source/ui/app/docstyle \
+	sw/source/ui/app/docshinterface \
 	sw/source/ui/app/swdll \
 	sw/source/ui/app/swmodul1 \
 	sw/source/ui/app/swmodule \
 	sw/source/ui/config/fontcfg \
 	sw/source/ui/config/swacorr \
 	sw/source/ui/config/uinums \
-	sw/source/ui/config/viewopt \
 	sw/source/ui/dbui/mergemgr \
 	sw/source/ui/dbui/dbtree \
 	sw/source/ui/dbui/dbui \

sw/inc/crsrsh.hxx

      */
     String GetCrsrDescr() const;
 
+	void SetReadonlyUI( bool );
     SwRect GetRectOfCurrentChar();
     virtual Window* GetSearchDialog() const;
 };
 #include <IDocumentLayoutAccess.hxx>
 #include <IDocumentTimerAccess.hxx>
 #include <IDocumentChartDataProviderAccess.hxx>
-// --> OD 2007-10-26 #i83479#
 #include <IDocumentOutlineNodes.hxx>
 #include <IDocumentListItems.hxx>
 #include <set>
-// <--
-// --> OD 2008-03-12 #refactorlists#
 #include <IDocumentListsAccess.hxx>
-class SwList;
-// <--
 #include <IDocumentExternalData.hxx>
 #define _SVSTDARR_STRINGSDTOR
 #include <svl/svstdarr.hxx>
 
 #include <boost/scoped_ptr.hpp>
 
+class SwList;
 class SvxForbiddenCharactersTable;
 class SwExtTextInput;
 class DateTime;
 class SwCrsrShell;
 class SwCursor;
 class SwDBNameInfField;
-class SwDocShell;
+class IDocShell;
 class SwDocUpdtFld;
 class SwDrawFrmFmt;
 class SwDrawView;
 	SwDocStat		*pDocStat;			// Statistic Informationen
 	SvxMacroTableDtor *pMacroTable; 	// Tabelle der dokumentglobalen Macros
 
-	SwDocShell		*pDocShell;			// Ptr auf die SfxDocShell vom Doc
+	IDocShell		*pDocShell;			// Ptr auf die SfxDocShell vom Doc
     SfxObjectShellLock xTmpDocShell;    // A temporary shell that is used to copy OLE-Nodes
 
 	sfx2::LinkManager	*pLinkMgr;			// Liste von Verknuepften (Grafiken/DDE/OLE)
 	// #i78591#
 	sal_uInt32  n32DummyCompatabilityOptions1;
 	sal_uInt32  n32DummyCompatabilityOptions2;
+    sal_uInt16  mnUpdateDocMode;
     //
     // COMPATIBILITY FLAGS END
     //
        Unnecessary compile/link time dependency.
     */
 	// Pointer auf die SfxDocShell vom Doc, kann 0 sein !!!
-		  SwDocShell* GetDocShell() 		{ return pDocShell; }
-	const SwDocShell* GetDocShell() const	{ return pDocShell; }
-	void SetDocShell( SwDocShell* pDSh );
+		  IDocShell* GetDocShell() 		{ return pDocShell; }
+	const IDocShell* GetDocShell() const	{ return pDocShell; }
+	void SetDocShell( IDocShell* pDSh );
 
 	// in case during copying of embedded object a new shell is created,
     // it should be set here and cleaned later
     // fuer die TextBausteine - diese habe nur ein SvPersist zur
     // Verfuegung
     SfxObjectShell* GetPersist() const;
+    SfxObjectShell* GetDocPersist() const;
 
 	// Pointer auf den Storage des SfxDocShells, kann 0 sein !!!
     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetDocStorage();
 	{
 		return n32DummyCompatabilityOptions2;
 	}
+
+    void SetUpdateDocMode( sal_uInt16 nMode ) { mnUpdateDocMode = nMode; }
+    sal_uInt16 GetUpdateDocMode() const { return mnUpdateDocMode; }
+
 #ifdef FUTURE_VBA
     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor > GetVbaEventProcessor();
 #endif
 
 	sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt,
 								sal_Bool bUnoCall );
-	void InvalidateModel();
-	void ReactivateModel();
+	void ClearModel();
 
 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >	GetEventNames();
 
 //implemented in source/ui/docvw/romenu.cxx
 String ExportGraphic( const Graphic &rGraphic, const String &rGrfName );
 
+SW_DLLPUBLIC sal_uInt16 GetHtmlMode( const SwDocShell* pShell );
+
 #endif

sw/inc/idocshell.hxx

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _IDOCSHELL_HXX
+#define _IDOCSHELL_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <tools/errcode.hxx>
+#include <rtl/ustring.hxx>
+
+class FmFormModel;
+class SfxItemPool;
+class String;
+class SfxInPlaceClient;
+class SfxStyleSheetBasePool;
+class SfxPoolItem;
+class Reader;
+class SwReader;
+class SfxMedium;
+class SwCrsrShell;
+class SwPaM;
+class SwgReaderOption;
+class SwDoc;
+class SfxObjectShell;
+class SfxObjectShellLock;
+
+namespace svt { class EmbeddedObjectRef; }
+
+class IDocShell
+{
+public:
+/*
+	// methods that can be implemented from SfxObjectShell retrieved via GetDocPersist()
+	// this code must become a part of a future Persist class (spin-off of SfxObjectShell)
+    sal_Bool IsHelpDocument() const; // avoidable?
+    sal_Bool IsReadOnly() const;
+    sal_Bool IsReadOnlyUI() const;
+    void SetReadOnlyUI( sal_Bool );
+    com::sun::star::uno::Reference < com::sun::star::frame::XModel > GetModel() const;
+    void Broadcast( const SfxHint &rHint );
+	ErrCode CallBasic( const String& rMacro, const String& rBasicName, SbxArray* pArgs = 0, SbxValue* pRet = 0 );
+    ErrCode CallXScript( const String& rScriptURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams,
+        ::com::sun::star::uno::Any& aRet,
+        ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex,
+        ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam,
+        bool bRaiseError = true );
+    SfxItemPool& GetPool() const;
+	const SfxPoolItem* GetItem( sal_uInt16 nId ) const; // methods for each item?
+	void PutItem( const SfxPoolItem& rItem );
+    bool IsEmbedded() const;
+    sal_Bool IsInPlaceActive() const;       // really necessary?
+	void ClearEmbeddedObjects();
+    sal_Bool SaveAsChildren( SfxMedium &rMedium );
+    sal_Bool SaveCompletedChildren( sal_Bool bSuccess );
+	BasicManager* GetBasicManager() const;
+	sal_Bool IsLoading() const;
+	sal_Bool IsEnableSetModified() const;
+	void EnableSetModified( sal_Bool bEnable = sal_True );
+	void SetTitle( const String& rTitle );
+    SvKeyValueIterator* GetHeaderAttributes();
+	void UpdateDocInfoForSave(  );
+    Rectangle GetVisArea( sal_uInt16 nAspect ) const;
+    MapUnit GetMapUnit() const;
+	void SetVisArea( const Rectangle & rVisArea );
+	void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
+    com::sun::star::uno::Reference < com::sun::star::embed::XStorage > GetStorage() const;
+    bool IsInternal() const;
+    sal_Bool IsPreview() const;
+    SfxMedium* GetMedium() const; // for which purpose?
+    sal_Bool DoClose();
+
+	// used for:
+	SfxWait
+	SfxViewFrame::GetFirst
+	SfxProgress::GetActiveProgress
+	SfxObjectShellRef/Lock
+	SwDrawModel::SetPersist
+	new FmMormModel
+
+	// from Medium and DocFact:
+    const SfxFilter* GetFilter4FilterName( const String& );   // UNO API usable?
+    ErrCode GuessFilter( SfxMedium&, const SfxFilter** );
+    const INetURLObject& GetURLObject() const;  // method from model?
+    sal_Bool HasName() const; // method from model?
+    const String& GetMediumName() const; // method from model?
+    ::rtl::OUString GetBaseURL( bool bForSaving=false );
+*/
+	virtual ~IDocShell();
+
+    virtual SfxObjectShell* GetDocPersist() = 0;
+
+	// interface to SwDocShell: this code needs to be moved to SwDoc
+    virtual SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef ) = 0; // creates Client on demand
+	virtual SfxStyleSheetBasePool* GetStyleSheetPool() = 0;
+	virtual Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, SwCrsrShell* pCrsrSh = 0, SwPaM* pPaM = 0) = 0;
+	virtual sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, sal_Bool bUnoCall ) = 0;
+    virtual int FindDocShell( SwDoc** ppDoc,
+                        SfxObjectShellLock& rLock,
+						const String& rFileName,
+						const String& rPasswd,
+						String& rFilter,
+						sal_Int16 nVersion ) = 0;
+    virtual bool CanSwitchReadOnlyCursor() const = 0;
+    virtual void CreateLinguisticEventListener() = 0;   // could become static function
+    virtual bool IsWeb() const = 0; // hopefully gone soon
+	virtual void ClearModel() = 0;  // via API?
+    virtual void LoadingFinished() = 0;		// can be eliminated when HTML filter is changed
+    virtual void UpdateFontList() = 0;  // we could move the font list from SwDocShell to SwDoc
+    virtual void BroadcastEventHint( sal_uInt16 nId, sal_uInt16 nResId ) = 0;
+};
+
+#endif // _IDOCSHELLd_HXX

sw/inc/unosett.hxx

 
 class SwDoc;
 class SwFmtCol;
-class SwDocShell;
 class SwNumRule;
-/******************************************************************************
- *
- ******************************************************************************/
-/* -----------------04.05.98 12:28-------------------
- *
- * --------------------------------------------------*/
+
 class SwXFootnoteProperties : public cppu::WeakAggImplHelper2
 <
 	::com::sun::star::beans::XPropertySet,
 	void			Invalidate() {pDoc = 0;}
 };
 
-/* -----------------04.05.98 12:28-------------------
- *
- * --------------------------------------------------*/
 class SwXEndnoteProperties : public cppu::WeakAggImplHelper2
 <
 	::com::sun::star::beans::XPropertySet,
 	void			Invalidate() {pDoc = 0;}
 };
 
-/* -----------------04.05.98 12:28-------------------
- *
- * --------------------------------------------------*/
 class SwXLineNumberingProperties : public cppu::WeakAggImplHelper2
 <
 	::com::sun::star::beans::XPropertySet,
 	void			Invalidate() {pDoc = 0;}
 };
 
-/* -----------------25.05.98 08:21-------------------
- *
- * --------------------------------------------------*/
 class SwXNumberingRules : public cppu::WeakAggImplHelper5
 <
 	::com::sun::star::container::XIndexReplace,
 	String 						sNewCharStyleNames[MAXLEVEL];
 	String 						sNewBulletFontNames[MAXLEVEL];
 	String 						sCreatedNumRuleName; //connects to a numbering in SwDoc
-	SwDoc*						pDoc; // wird nur fuers anmelden gebraucht
-	SwDocShell*					pDocShell; //nur, wenn als ChapterNumbering verwendet
+	SwDoc*						pDoc;
+	bool						m_bChapterNumbering;
 	SwNumRule*					pNumRule;
     const SfxItemPropertySet*   m_pPropertySet;
 	sal_Bool					bOwnNumRuleCreated;
    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
 
 public:
-	SwXNumberingRules(SwDocShell& rDocSh);	// chapter numbering
 	SwXNumberingRules(const SwNumRule& rRule); // NumRule for paragraphs, numbering styles
-	SwXNumberingRules(SwDoc& rDoc); //create a new instance
+	SwXNumberingRules(SwDoc& rDoc, bool bChapternumbering);
 	
 
 	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
 	const SwNumRule*		GetNumRule() {return pNumRule;}
 
 	static const String&	GetInvalidStyle();
-	void	Invalidate() 	{pDocShell = 0;}
+	void	Invalidate() 	{pDoc = 0;}
 	const String& 			GetCreatedNumRuleName() const{return sCreatedNumRuleName; }
 };
-/*-----------------12.02.98 08:27-------------------
 
---------------------------------------------------*/
 class SwXChapterNumbering : public SwXNumberingRules
 {
 protected:
 	virtual ~SwXChapterNumbering();
 public:
-	SwXChapterNumbering(SwDocShell& rDocSh);
+	SwXChapterNumbering(SwDoc&);
 	
 
 	void	Invalidate() {SwXNumberingRules::Invalidate();}
 
 };
 
-/* -----------------27.05.98 15:44-------------------
- *
- * --------------------------------------------------*/
+
 class SwXTextColumns : public cppu::WeakAggImplHelper4
 <
 

sw/inc/unostyle.hxx

 
 #include <istyleaccess.hxx>
 
-class SwDocShell;
 class SfxItemPropertySet;
 class SwXStyle;
 class SwStyleProperties_Impl;
 class SfxItemSet;
 typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
 
-/******************************************************************************
- *
- ******************************************************************************/
-/*-----------------12.02.98 08:27-------------------
-
---------------------------------------------------*/
 class SwXStyleFamilies :  public cppu::WeakImplHelper4
 <
 	::com::sun::star::container::XIndexAccess,
 >,
 	public SwUnoCollection
 {
-	SwDocShell* 		pDocShell;
+	SwDoc* 		pDoc;
 
 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *	pxCharStyles;
 	::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *	pxParaStyles;
 protected:
 	virtual ~SwXStyleFamilies();
 public:
-	SwXStyleFamilies(SwDocShell& rDocShell);
+	SwXStyleFamilies(SwDoc&);
 
 
 	//XNameAccess
 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
 };
 
-/* -----------------26.05.98 10:56-------------------
- *
- * --------------------------------------------------*/
 class SwXStyleFamily : public cppu::WeakImplHelper4
 <
 	::com::sun::star::container::XNameContainer,
 	SfxStyleFamily 				eFamily;		// Familie
 	SfxStyleSheetBasePool*		pBasePool;
 //	const SfxItemPropertyMap*	_pPropMap;
-	SwDocShell* 				pDocShell;
+	SwDoc* 				pDoc;
 
 	SwXStyle* 				_FindStyle(const String& rStyleName) const;
 public:
-	SwXStyleFamily(SwDocShell* pDocShell, sal_uInt16 nFamily);
+	SwXStyleFamily(SwDoc*, sal_uInt16 nFamily);
 	~SwXStyleFamily();
 
 	//XIndexAccess
 	virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
 	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
 };
-/* -----------------20.05.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
 class SwXStyle : public cppu::WeakImplHelper7
 <
 	::com::sun::star::style::XStyle,
 							}
     SwDoc*                GetDoc() const { return m_pDoc; }
 };
-/* -----------------------------15.12.00 14:25--------------------------------
 
- ---------------------------------------------------------------------------*/
 class SwXFrameStyle : public SwXStyle,
 						public com::sun::star::document::XEventsSupplier
 {
 
 	friend class SwFrameStyleEventDescriptor;
 };
-/* -----------------24.08.98 16:04-------------------
- *
- * --------------------------------------------------*/
+
 class SwXPageStyle : public SwXStyle
 {
-	SwDocShell* 	pDocShell;
+	SwDoc* 	pDoc;
 
 protected:
     void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
 
 public:
-	SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, SfxStyleFamily eFam,
+	SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDoc*, SfxStyleFamily eFam,
 								const String& rStyleName);//,
 									//const SfxItemPropertyMap* _pMap);
-	SwXPageStyle(SwDocShell* pDocSh);
+	SwXPageStyle(SwDoc*);
 	~SwXPageStyle();
 
 	virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     public cppu::WeakImplHelper1< ::com::sun::star::style::XAutoStyles >,
     public SwUnoCollection
 {
-    SwDocShell *pDocShell;
+    SwDoc *pDoc;
 	::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoCharStyles;
     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoRubyStyles;
     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoParaStyles;
     virtual ~SwXAutoStyles();
 
 public:
-    SwXAutoStyles(SwDocShell& rDocShell);
+    SwXAutoStyles(SwDoc&);
 
 	//XIndexAccess
 	virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
 	virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
 
 };
-/*-- 19.05.2006 11:20:12---------------------------------------------------
+/*-------------------------------------------------------------------------
     access to a family of automatic styles (character or paragraph or ...)
   -----------------------------------------------------------------------*/
 class SwXAutoStyleFamily : public cppu::WeakImplHelper1< com::sun::star::style::XAutoStyleFamily >,
     public SwClient
 {
-    SwDocShell *pDocShell;
+    SwDoc *pDoc;
     IStyleAccess::SwAutoStyleFamily eFamily;
 
 protected:
    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
 
 public:
-    SwXAutoStyleFamily(SwDocShell* pDocShell, IStyleAccess::SwAutoStyleFamily eFamily);
+    SwXAutoStyleFamily(SwDoc*, IStyleAccess::SwAutoStyleFamily eFamily);
 	virtual ~SwXAutoStyleFamily();
 
     //XAutoStyleFamily
     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
 };
 
-/*-- 19.05.2006 11:20:02---------------------------------------------------
+/*-------------------------------------------------------------------------
     an automatic style
   -----------------------------------------------------------------------*/
-
 class SwXAutoStyle : public cppu::WeakImplHelper3
 <
     ::com::sun::star::beans::XPropertySet,

sw/inc/viewopt.hxx

 class Window;
 class OutputDevice;
 class ViewShell;
-class SwDocShell;
+class IDocShell;
+
 namespace svtools{ class ColorConfig;}
 
 //#define VIEWOPT_1_IDLE             0x00000001L  no longer used, see new member 'bIdle'
 
 
 // Hilfsfunktion zur Ermittlung der HTML-Faehigkeiten
-SW_DLLPUBLIC sal_uInt16		GetHtmlMode(const SwDocShell*);
-
+SW_DLLPUBLIC sal_uInt16 GetHtmlMode( const IDocShell* pShell );
+SW_DLLPUBLIC sal_uInt16 GetHtmlMode( bool bIsWeb );
 
 #endif

sw/source/core/crsr/crsrsh.cxx

 #include <callnk.hxx>
 #include <viscrs.hxx>
 #include <section.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
 #include <scriptinfo.hxx>
 #include <pamtyp.hxx>
 #include <fmteiro.hxx>
 			pVisCrsr->Hide();       // sichtbaren Cursor immer verstecken
 			eMvState = MV_NONE;		// Status fuers Crsr-Travelling
 			bAllProtect = sal_True;
-			if( GetDoc()->GetDocShell() )
-			{
-				GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
-				CallChgLnk();			// UI bescheid sagen!
-			}
+			SetReadonlyUI( true );
 		}
 	}
 
 		if( pSectNd && ( pSectNd->GetSection().IsHiddenFlag() ||
 			( !IsReadOnlyAvailable() &&
               pSectNd->GetSection().IsProtectFlag() &&
-			 ( !pDoc->GetDocShell() ||
-			   !pDoc->GetDocShell()->IsReadOnly() || bAllProtect )) ) )
+			 ( !pDoc->GetDocPersist() ||
+			   !pDoc->GetDocPersist()->IsReadOnly() || bAllProtect )) ) )
 		{
 			if( !FindValidCntntNode( !HasDrawView() ||
 					0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
 				{
 					eMvState = MV_NONE;		// Status fuers Crsr-Travelling
 					bAllProtect = sal_True;
-					if( GetDoc()->GetDocShell() )
-					{
-						GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
-						CallChgLnk();		// UI bescheid sagen!
-					}
+					SetReadonlyUI( true );
 					return;
 				}
 			}
 		{
 			sal_Bool bWasAllProtect = bAllProtect;
 			bAllProtect = sal_False;
-			if( bWasAllProtect && GetDoc()->GetDocShell() &&
-				GetDoc()->GetDocShell()->IsReadOnlyUI() )
-			{
-				GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False );
-				CallChgLnk();		// UI bescheid sagen!
-			}
+			if( bWasAllProtect )
+				SetReadonlyUI( false );
 		}
 	}
 
 			if( !IsReadOnlyAvailable() && pFrm->IsProtected() &&
 				( !Imp()->GetDrawView() ||
 				  !Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ) &&
-				(!pDoc->GetDocShell() ||
-				 !pDoc->GetDocShell()->IsReadOnly() || bAllProtect ) )
+				(!pDoc->GetDocPersist() ||
+				 !pDoc->GetDocPersist()->IsReadOnly() || bAllProtect ) )
 			{
 				// dann suche eine gueltige Position
 				sal_Bool bChgState = sal_True;
 					{
 						eMvState = MV_NONE;     // Status fuers Crsr-Travelling
 						bAllProtect = sal_True;
-						if( GetDoc()->GetDocShell() )
-						{
-							GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
-							CallChgLnk();		// UI bescheid sagen!
-						}
+						SetReadonlyUI( true );
 						return;
 					}
 				}
 				{
 					sal_Bool bWasAllProtect = bAllProtect;
 					bAllProtect = sal_False;
-					if( bWasAllProtect && GetDoc()->GetDocShell() &&
-						GetDoc()->GetDocShell()->IsReadOnlyUI() )
-					{
-						GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False );
-						CallChgLnk();		// UI bescheid sagen!
-					}
+					if( bWasAllProtect )
+						SetReadonlyUI( false );
 					bAllProtect = sal_False;
 					bAgainst = sal_True;        // nochmal den richigen Frm suchen
 				}
 	}
 
 	//JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
-	if( !bAllProtect && GetDoc()->GetDocShell() &&
-		GetDoc()->GetDocShell()->IsReadOnlyUI() )
+	if( !bAllProtect && GetDoc()->GetDocPersist() &&
+		GetDoc()->GetDocPersist()->IsReadOnlyUI() )
 		return sal_True;
 
 	// dann raus da!
     return 0;
 }
 
+void SwCrsrShell::SetReadonlyUI( bool bSet )
+{
+	if( GetDoc()->GetDocShell() )
+	{
+		// mba why this difference ?!
+		if ( bSet || GetDoc()->GetDocPersist()->IsReadOnlyUI() )
+		{		
+			GetDoc()->GetDocPersist()->SetReadOnlyUI( bSet );
+			CallChgLnk();			// UI bescheid sagen!
+		}
+	}
+}
+

sw/source/core/crsr/swcrsr.cxx

 #include <txtfrm.hxx>
 #include <scriptinfo.hxx>
 #include <crstate.hxx>
-#include <docsh.hxx>
 #include <viewsh.hxx>
 #include <frmatr.hxx>
 #include <breakit.hxx>
 
 struct _PercentHdl
 {
-	SwDocShell* pDSh;
+	SwDoc* pDoc;
 	sal_uLong nActPos;
 	sal_Bool bBack, bNodeIdx;
 
-	_PercentHdl( sal_uLong nStt, sal_uLong nEnd, SwDocShell* pSh )
-		: pDSh( pSh )
+	_PercentHdl( sal_uLong nStt, sal_uLong nEnd, SwDoc* pSwDoc )
+		: pDoc( pSwDoc )
 	{
 		nActPos = nStt;
 		if( 0 != ( bBack = (nStt > nEnd )) )
 	}
 
 	_PercentHdl( const SwPaM& rPam )
-		: pDSh( (SwDocShell*)rPam.GetDoc()->GetDocShell() )
+		: pDoc( rPam.GetDoc() )
 	{
 		sal_uLong nStt, nEnd;
 		if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode )
 		{
 			sal_uLong n = nStt; nStt = nEnd; nEnd = n;
 		}
-		::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, pDSh->GetDoc() );
+		::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, pDoc );
 	}
 
-	~_PercentHdl()  					{ ::EndProgress( pDSh->GetDoc() ); }
+	~_PercentHdl()  					{ ::EndProgress( pDoc ); }
 
 	void NextPos( sal_uLong nPos ) const
-		{ ::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh->GetDoc() ); }
+		{ ::SetProgressState( bBack ? nActPos - nPos : nPos, pDoc ); }
 
 	void NextPos( SwPosition& rPos ) const
 		{
 				nPos = rPos.nNode.GetIndex();
 			else
 				nPos = rPos.nContent.GetIndex();
-			::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh->GetDoc() );
+			::SetProgressState( bBack ? nActPos - nPos : nPos, pDoc );
 		}
 };
 
 // Anfang
 	if( pSavePos->nNode != GetPoint()->nNode.GetIndex() &&
 		//JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
-		( !pDoc->GetDocShell() || !pDoc->GetDocShell()->IsReadOnlyUI() ))
+		( !pDoc->GetDocPersist() || !pDoc->GetDocPersist()->IsReadOnlyUI() ))
 	{
 		// teste doch mal die neuen Sections:
 		SwNodeIndex& rPtIdx = GetPoint()->nNode;
     }
 
 		//JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt
-	if( !pDoc->GetDocShell() || !pDoc->GetDocShell()->IsReadOnlyUI() )
+	if( !pDoc->GetPersist() || !pDoc->GetDocPersist()->IsReadOnlyUI() )
 		return sal_True;
 
 	sal_Bool bCrsrInReadOnly = IsReadOnlyAvailable();
 		while( pCurCrsr != ( pTmpCrsr = (SwPaM*)pTmpCrsr->GetNext() ))
 			++nCrsrCnt;
 		if( nCrsrCnt && !bIsUnoCrsr )
-			pPHdl = new _PercentHdl( 0, nCrsrCnt, pDoc->GetDocShell() );
+			pPHdl = new _PercentHdl( 0, nCrsrCnt, pDoc );
 	}
     else
         pSaveCrsr = (SwPaM*)pSaveCrsr->GetPrev();

sw/source/core/doc/acmplwrd.cxx

 
 #include <editeng/acorrcfg.hxx>
 #include <sfx2/docfile.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
 
 #include <vector>
 /* -----------------------------05.08.2002 12:43------------------------------
 
 sal_Bool SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
 {
-    SwDocShell* pDocShell = rDoc.GetDocShell();
-    SfxMedium* pMedium = pDocShell ? pDocShell->GetMedium() : 0;
-    // strings from help module should not be added
-    if( pMedium )
-    {
-        const INetURLObject& rURL = pMedium->GetURLObject();
-        if ( rURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP )
-            return sal_False;
-    }
+    if ( rDoc.GetDocPersist()->IsHelpDocument() )
+		return sal_False;
 
     String aNewWord(rWord);
     aNewWord.EraseAllChars( CH_TXTATR_INWORD );

sw/source/core/doc/doc.cxx

 #include <SwUndoTOXChange.hxx>
 #include <SwUndoFmt.hxx>
 #include <unocrsr.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
+#include <sfx2/objsh.hxx>
 #include <viewopt.hxx>
 #include <docfld.hxx>           // _SetGetExpFld
 #include <docufld.hxx>          // SwPostItField
         // SwPrintData should be initialized from the configuration,
         // the respective config item is implememted by SwPrintOptions which
         // is also derived from SwPrintData
-        const SwDocShell *pDocSh = GetDocShell();
+        const IDocShell *pDocSh = GetDocShell();
         DBG_ASSERT( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
         SwPrintOptions aPrintOptions( pDocSh->IsWeb() );
         *pThis->pPrtData = aPrintOptions;
 		aStat[n++].Value <<= (sal_Int32)rStat.nChar;
 
 		// For e.g. autotext documents there is no pSwgInfo (#i79945)
-        SfxObjectShell * const pObjShell( GetDocShell() );
+        SfxObjectShell* pObjShell( GetDocPersist() );
         if (pObjShell)
         {
             const uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
 {
     return m_externalData[eType];
 }
+
+IDocShell::~IDocShell()
+{
+}   

sw/source/core/doc/docbasic.cxx

 #include <frmatr.hxx>
 #include <docary.hxx>
 #include <doc.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
 #include <swevent.hxx>
 
 using namespace ::com::sun::star::uno;
 			SbxBaseRef aRef;
 			SbxValue* pRetValue = new SbxValue;
 			aRef = pRetValue;
-			eErr = pDocShell->CallBasic( rMacro.GetMacName(),
+			eErr = GetDocPersist()->CallBasic( rMacro.GetMacName(),
 										 rMacro.GetLibName(),
 										 pArgs, pRet ? pRetValue : 0 );
 
 			OSL_TRACE( "SwDoc::ExecMacro URL is %s", ByteString( rMacro.GetMacName(),
 				RTL_TEXTENCODING_UTF8).GetBuffer() );
 
-			eErr = pDocShell->CallXScript(
+			eErr = GetDocPersist()->CallXScript(
 				rMacro.GetMacName(), *pUnoArgs, aRet, aOutArgsIndex, aOutArgs);
 
 			//*pRet = pRetValue->GetString();
 			const SvxMacro& rMacro = *pTbl->Get( nEvent );
 			if( STARBASIC == rMacro.GetScriptType() )
 			{
-				nRet += 0 == pDocShell->CallBasic( rMacro.GetMacName(),
+				nRet += 0 == GetDocPersist()->CallBasic( rMacro.GetMacName(),
 									rMacro.GetLibName(), pArgs ) ? 1 : 0;
 			}
 			else if( EXTENDED_STYPE == rMacro.GetScriptType() )
 				OSL_TRACE( "SwDoc::CallEvent URL is %s", ByteString(
 					rMacro.GetMacName(), RTL_TEXTENCODING_UTF8).GetBuffer() );
 
-				nRet += 0 == pDocShell->CallXScript(
+				nRet += 0 == GetDocPersist()->CallXScript(
 					rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0;
 
-				//*pRet = pRetValue->GetString();
-				// use the AnyConverter to return a String if appropriate?
-
-				// need to call something like lcl_translateUno2Basic
-				// pArgs = lcl_translateUno2Basic( pUnoArgs );
-
 				delete pUnoArgs;
 			}
 			// JavaScript calls are ignored

sw/source/core/doc/doccomp.cxx

 #include <UndoRedline.hxx>
 #include <section.hxx>
 #include <tox.hxx>
-#include <docsh.hxx>
 
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
 #include <com/sun/star/document/XDocumentProperties.hpp>
 	//				document info
 	sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
 	DateTime aTimeStamp;
-    SwDocShell *pDocShell(rDoc.GetDocShell());
-    DBG_ASSERT(pDocShell, "no SwDocShell");
-    if (pDocShell) {
+    SfxObjectShell *pPersist(rDoc.GetDocPersist());
+    DBG_ASSERT(pPersist, "no SwDocShell");
+    if (pPersist) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
-            pDocShell->GetModel(), uno::UNO_QUERY_THROW);
+            pPersist->GetModel(), uno::UNO_QUERY_THROW);
         uno::Reference<document::XDocumentProperties> xDocProps(
             xDPS->getDocumentProperties());
         DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");

sw/source/core/doc/docdesc.cxx

 #include <frmtool.hxx>
 #include <pagedesc.hxx>
 #include <poolfmt.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
 #include <ndindex.hxx>
 #include <ftnidx.hxx>
 #include <fmtftn.hxx>
             pSh->GetViewOptions()->IsPrtFormat() )
 		{
 			if ( GetDocShell() )
-				pWait = new SfxWait( *GetDocShell(), true );
+				pWait = new SfxWait( *GetDocPersist(), true );
 
 			pTmpRoot->StartAllAction();
 			bEndAction = sal_True;

sw/source/core/doc/docdraw.cxx

 #include <swhints.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
-#include <docsh.hxx>
 #include <rootfrm.hxx>	//Damit der RootDtor gerufen wird.
 #include <poolfmt.hxx>
 #include <viewsh.hxx>           // fuer MakeDrawView
 		} while ( pTmp != pCurrentView );
 
 		//Broadcast, damit die FormShell mit der DrawView verbunden werden kann
-		if( GetDocShell() )
+		if( GetDocPersist() )
 		{
 			SfxSimpleHint aHnt( SW_BROADCAST_DRAWVIEWS_CREATED );
-			GetDocShell()->Broadcast( aHnt );
+			GetDocPersist()->Broadcast( aHnt );
 		}
 	}	//swmod 071029//swmod 071225
 	return pDrawModel;

sw/source/core/doc/docedt.cxx

 #include <crsrsh.hxx>
 #include <doc.hxx>
 #include <UndoManager.hxx>
-#include <docsh.hxx>
 #include <docary.hxx>
 #include <doctxm.hxx>		// beim Move: Verzeichnisse korrigieren
 #include <ftnidx.hxx>
                             if (xGCIterator.is())
                             {
                                 String aText( ((SwTxtNode*)pNd)->GetTxt().Copy( nBeginGrammarCheck, nEndGrammarCheck - nBeginGrammarCheck ) );
-                                uno::Reference< lang::XComponent > xDoc( ((SwDocShell*)GetDocShell())->GetBaseModel(), uno::UNO_QUERY );
+                                uno::Reference< lang::XComponent > xDoc( GetDocPersist()->GetModel(), uno::UNO_QUERY );
                                 // Expand the string:
                                 rtl::OUString aExpandText;
                                 const ModelToViewHelper::ConversionMap* pConversionMap =

sw/source/core/doc/docfly.cxx

 #include <undoflystrattr.hxx>
 #include <switerator.hxx>
 
-extern sal_uInt16 GetHtmlMode( const SwDocShell* );
-
-
 using namespace ::com::sun::star;
 
 sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const

sw/source/core/doc/docglos.cxx

 #include <ndtxt.hxx>
 #include <acorrect.hxx>
 #include <crsrsh.hxx>
-#include <docsh.hxx>
-
 
 using namespace ::com::sun::star;
 
             // entry document.
             // To be able to do this, we copy the document properties of the
             // target document to the glossary document
-//            DBG_ASSERT(GetDocShell(), "no SwDocShell"); // may be clipboard!
             DBG_ASSERT(pGDoc->GetDocShell(), "no SwDocShell at glossary");
             if (GetDocShell() && pGDoc->GetDocShell()) {
                 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
-                    GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
+                    GetDocPersist()->GetModel(), uno::UNO_QUERY_THROW);
                 uno::Reference<document::XDocumentProperties> xDocProps(
                     xDPS->getDocumentProperties() );
                 uno::Reference<document::XDocumentPropertiesSupplier> xGlosDPS(
-                    pGDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
+                    pGDoc->GetDocPersist()->GetModel(), uno::UNO_QUERY_THROW);
                 uno::Reference<document::XDocumentProperties> xGlosDocProps(
                     xGlosDPS->getDocumentProperties() );
                 lcl_copyDocumentProperties(xDocProps, xGlosDocProps);

sw/source/core/doc/doclay.cxx

 #include <cntfrm.hxx>
 #include <flyfrm.hxx>
 #include <fesh.hxx>
-#include <docsh.hxx>
 #include <dflyobj.hxx>
 #include <dcontact.hxx>
 #include <swundo.hxx>
 #endif
 
 	SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
-	if( pTmpRoot &&
-        !SfxProgress::GetActiveProgress( pDocShell ) )
+    SfxProgress* pProgress = SfxProgress::GetActiveProgress( GetDocPersist() );
+	if( pTmpRoot && !pProgress )
 	{
 		ViewShell *pSh, *pStartSh;
 		pSh = pStartSh = GetCurrentViewShell();

sw/source/core/doc/docnew.cxx

 #include <rolbck.hxx>           // Undo-Attr, SwHistory
 #include <poolfmt.hxx>          // fuer die Pool-Vorlage
 #include <dbmgr.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
 #include <acorrect.hxx>			// fuer die autom. Aufnahme von Ausnahmen
 #include <visiturl.hxx>			// fuer die URL-Change Benachrichtigung
 #include <docary.hxx>
 #include <MarkManager.hxx>
 #include <UndoManager.hxx>
 #include <unochart.hxx>
-
 #include <cmdid.h>              // fuer den dflt - Printer in SetJob
-
-
-// --> OD 2006-04-19 #b6375613#
 #include <com/sun/star/document/XDocumentInfoSupplier.hpp>
 #include <com/sun/star/beans/XPropertyContainer.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-
-// <--
-
-// --> OD 2007-03-16 #i73788#
 #include <pausethreadstarting.hxx>
-// <--
 #include <numrule.hxx>
-// --> OD 2008-03-13 #refactorlists#
 #include <list.hxx>
 #include <listfunc.hxx>
-// <--
-
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-
 #include <sfx2/Metadatable.hxx>
 #include <fmtmeta.hxx> // MetaFieldManager
-
+#include <sfx2/objsh.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::document;
 {
     // check for a visible view
     bool bVisible = false;
-    const SwDocShell *pDocShell = rDoc.GetDocShell();
-    SfxViewFrame    *pFrame = SfxViewFrame::GetFirst( pDocShell, sal_False );
+    const SfxObjectShell* pObjShell = rDoc.GetDocPersist();
+    SfxViewFrame    *pFrame = SfxViewFrame::GetFirst( pObjShell, sal_False );
     while (pFrame && !bVisible)
     {
         if (pFrame->IsVisible())
             bVisible = true;
-        pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False );
+        pFrame = SfxViewFrame::GetNext( *pFrame, pObjShell, sal_False );
     }
     
     //!! only documents with visible views need to be checked
         uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( rDoc.GetGCIterator() );
         if ( xGCIterator.is() )
         {
-            uno::Reference< lang::XComponent >  xDoc( rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
+            uno::Reference< lang::XComponent >  xDoc( pObjShell->GetModel(), uno::UNO_QUERY );
             uno::Reference< text::XFlatParagraphIteratorProvider >  xFPIP( xDoc, uno::UNO_QUERY );
 
             // start automatic background checking if not active already
     mbLastBrowseMode( false ),
     n32DummyCompatabilityOptions1(0),
     n32DummyCompatabilityOptions2(0),
+    mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
     mbStartIdleTimer(sal_False)
 {
 	RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722",  "SwDoc::SwDoc" );
 
     if (pDocShell)
     {
-        pDocShell->SetUndoManager(0);
+        pDocShell->GetDocPersist()->SetUndoManager(0);
     }
 
     // --> OD 2007-03-16 #i73788#
 }
 //---------------------------------------------------
 
-void SwDoc::SetDocShell( SwDocShell* pDSh )
+void SwDoc::SetDocShell( IDocShell* pDSh )
 {
 	if( pDocShell != pDSh )
 	{
         if (pDocShell)
         {
-            pDocShell->SetUndoManager(0);
+            pDocShell->GetDocPersist()->SetUndoManager(0);
         }
 		pDocShell = pDSh;
-        if (pDocShell)
+        SfxObjectShell* pObjShell = GetDocPersist();
+        if (pObjShell)
         {
-            pDocShell->SetUndoManager(& GetUndoManager());
+            pObjShell->SetUndoManager(& GetUndoManager());
         }
 
-		pLinkMgr->SetPersist( pDocShell );
+		pLinkMgr->SetPersist( pObjShell );
 		//JP 27.08.98: Bug 55570 - DocShell Pointer auch am DrawModel setzen
 		if( pDrawModel )
 		{
-			((SwDrawDocument*)pDrawModel)->SetObjectShell( pDocShell );
-			pDrawModel->SetPersist( pDocShell );
+			((SwDrawDocument*)pDrawModel)->SetObjectShell( pObjShell );
+			pDrawModel->SetPersist( pObjShell );
 			ASSERT( pDrawModel->GetPersist() == GetPersist(),
 					"draw model's persist is out of sync" );
 		}
 }
 
 
-// Convenience-Methode, um uebermaessige Includes von docsh.hxx
-// zu vermeiden
-
-
-
 uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
 {
-	if( pDocShell )
-		return pDocShell->GetStorage();
+	if( GetDocPersist() )
+		return GetDocPersist()->GetStorage();
 	if( pLinkMgr->GetPersist() )
 		return pLinkMgr->GetPersist()->GetStorage();
 	return NULL;
 }
 
-
+SfxObjectShell* SwDoc::GetDocPersist() const
+{
+    return pDocShell ? pDocShell->GetDocPersist() : 0;
+}
 
 SfxObjectShell* SwDoc::GetPersist() const
 {
-	return pDocShell ? pDocShell : pLinkMgr->GetPersist();
+    SfxObjectShell* pObjShell = GetDocPersist();
+    if ( !pObjShell )
+    {
+        // mba: nobody knows when this might happen, so let's find it out!
+        DBG_ASSERT( !pLinkMgr->GetPersist(), "No DocShell, but LinkMgr with Persist?" );
+    	pObjShell = pLinkMgr->GetPersist();
+    }
+
+    return pObjShell;
 }
 
 
 // SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
 void SwDoc::UpdateLinks( sal_Bool bUI )
 {
-    SfxObjectCreateMode eMode;
     sal_uInt16 nLinkMode = getLinkUpdateMode( true );
-    sal_uInt16 nUpdateDocMode = GetDocShell()->GetUpdateDocMode();
-    if( GetDocShell() &&
-            (nLinkMode != NEVER ||  document::UpdateDocMode::FULL_UPDATE == nUpdateDocMode) &&
-        GetLinkManager().GetLinks().Count() &&
-        SFX_CREATE_MODE_INTERNAL !=
-                    ( eMode = GetDocShell()->GetCreateMode()) &&
-        SFX_CREATE_MODE_ORGANIZER != eMode &&
-        SFX_CREATE_MODE_PREVIEW != eMode &&
-        !GetDocShell()->IsPreview() )
+    if( GetDocPersist() &&
+            (nLinkMode != NEVER || document::UpdateDocMode::FULL_UPDATE == mnUpdateDocMode) &&
+            GetLinkManager().GetLinks().Count() &&
+            !GetDocPersist()->IsInternal() && !GetDocPersist()->IsPreview() )
     {
         ViewShell* pVSh = 0;
         sal_Bool bAskUpdate = nLinkMode == MANUAL;
         sal_Bool bUpdate = sal_True;
-        switch(nUpdateDocMode)
+        switch(mnUpdateDocMode)
         {
             case document::UpdateDocMode::NO_UPDATE:   bUpdate = sal_False;break;
             case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = sal_False; break;
         }
         if( bUpdate && (bUI || !bAskUpdate) )
         {
-            SfxMedium* pMedium = GetDocShell()->GetMedium();
-            SfxFrame* pFrm = pMedium ? pMedium->GetLoadTargetFrame() : 0;
-            Window* pDlgParent = pFrm ? &pFrm->GetWindow() : 0;
+			// mba: window needs to be provided from outside
+            Window* pDlgParent = 0;
             if( GetCurrentViewShell() && !GetEditShell( &pVSh ) && !pVSh )	//swmod 071108//swmod 071225
             {
                 ViewShell aVSh( *this, 0, 0 );
         mbApplyWorkaroundForB6375613 = p_bApplyWorkaroundForB6375613;
 
         uno::Reference< document::XDocumentInfoSupplier > xDoc(
-                                                GetDocShell()->GetBaseModel(),
+                                                GetDocPersist()->GetModel(),
                                                 uno::UNO_QUERY);
         if ( xDoc.is() )
         {

sw/source/core/doc/doctxm.cxx

 
 #include <limits.h>
 #include <hintids.hxx>
-
+#include <tools/globname.hxx>
 #define _SVSTDARR_STRINGSSORT
 #include <svl/svstdarr.hxx>
 #include <editeng/langitem.hxx>
 #include <editeng/tstpitem.hxx>
 #include <editeng/lrspitem.hxx>
 #include <sot/clsids.hxx>
-#include <docsh.hxx>
 #include <ndole.hxx>
 #include <txttxmrk.hxx>
 #include <fmtinfmt.hxx>
 	if(pSect && pSect->GetFmt() &&
 			0 != (pSectNode = pSect->GetFmt()->GetSectionNode()))
 	{
-		const SwDocShell* pDocSh;
-		bRet = (0 != (pDocSh = pSectNode->GetDoc()->GetDocShell()) &&
+		const SfxObjectShell* pDocSh;
+		bRet = (0 != (pDocSh = pSectNode->GetDoc()->GetDocPersist()) &&
 													pDocSh->IsReadOnly()) ||
             (0 != (pSectNode = pSectNode->StartOfSectionNode()->FindSectionNode())&&
 					pSectNode->GetSection().IsProtectFlag());

sw/source/core/doc/docxforms.cxx

 
 
 #include <doc.hxx>
-#include <docsh.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 
         // change our module identifier, to be able to have a dedicated UI
         Reference< XModule > xModule;
-        SwDocShell* pShell( GetDocShell() );
+        SfxObjectShell* pShell( GetDocPersist() );
         if ( pShell )
             xModule = xModule.query( pShell->GetModel() );
         DBG_ASSERT( xModule.is(), "SwDoc::initXForms: no XModule at the document!" );

sw/source/core/doc/visiturl.cxx

 #include <hints.hxx>
 #include <ndtxt.hxx>
 #include <editsh.hxx>
-#include <docsh.hxx>
-
 
 SwURLStateChanged::SwURLStateChanged( const SwDoc* pD )
 	: pDoc( pD )
 
 		SwEditShell* pESh = pDoc->GetEditShell();
 
-		if( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() &&
+		if( pDoc->GetDocPersist() && pDoc->GetDocPersist()->GetMedium() &&
 			// falls das unser Doc ist, kann es auch lokale Spruenge geben!
-			sURL == pDoc->GetDocShell()->GetMedium()->GetName() )
+			sURL == pDoc->GetDocPersist()->GetMedium()->GetName() )
 			(sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 );
 
 		sal_Bool bAction = sal_False, bUnLockView = sal_False;
 	if( rURL.Len() )
 	{
 		INetURLHistory *pHist = INetURLHistory::GetOrCreate();
-		if( '#' == rURL.GetChar( 0 ) && pDocShell && pDocShell->GetMedium() )
+		if( '#' == rURL.GetChar( 0 ) && GetDocPersist() && GetDocPersist()->GetMedium() )
 		{
-			INetURLObject aIObj( pDocShell->GetMedium()->GetURLObject() );
+			INetURLObject aIObj( GetDocPersist()->GetMedium()->GetURLObject() );
 			aIObj.SetMark( rURL.Copy( 1 ) );
 			bRet = pHist->QueryUrl( aIObj );
 		}

sw/source/core/docnode/ndtbl.cxx

 #include <frmtool.hxx>
 #include <node2lay.hxx>
 #include <comcore.hrc>
-#include "docsh.hxx"
 #include <tabcol.hxx>
 #include <unochart.hxx>
 #include <node.hxx>

sw/source/core/docnode/nodes.cxx

 #include <txtatr.hxx>
 #include <tox.hxx> // InvalidateTOXMark
 
-#include <docsh.hxx>
 #include <svl/smplhint.hxx>
 
 extern sal_Bool CheckNodesRange( const SwNodeIndex& rStt,
 									const SwFieldType* pTyp = pTxtFld->GetFld().GetFld()->GetTyp();
 									if ( RES_POSTITFLD == pTyp->Which() )
 									{
-										rNds.GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( &pTxtFld->GetFld(), pTxtFld->GetFld().IsFldInDoc() ? SWFMTFLD_INSERTED : SWFMTFLD_REMOVED ) );
+										rNds.GetDoc()->GetDocPersist()->Broadcast( SwFmtFldHint( &pTxtFld->GetFld(), pTxtFld->GetFld().IsFldInDoc() ? SWFMTFLD_INSERTED : SWFMTFLD_REMOVED ) );
 									}
 									else
 									if( RES_DDEFLD == pTyp->Which() )
 			// wird aufgehoben !
 			pEnd->nContent = pStt->nContent;
 			rPam.DeleteMark();
-            GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( 0,
+            GetDoc()->GetDocPersist()->Broadcast( SwFmtFldHint( 0,
                 rNodes.IsDocNodes() ? SWFMTFLD_INSERTED : SWFMTFLD_REMOVED ) );
 			return;
 		}
 	// wird aufgehoben !
 	*pEnd = *pStt;
 	rPam.DeleteMark();
-    GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( 0,
+    GetDoc()->GetDocPersist()->Broadcast( SwFmtFldHint( 0,
                 rNodes.IsDocNodes() ? SWFMTFLD_INSERTED : SWFMTFLD_REMOVED ) );
 }
 

sw/source/core/docnode/section.cxx

 #include <frmtool.hxx>
 #include <editsh.hxx>
 #include <hints.hxx>
-#include <docsh.hxx>
+#include <idocshell.hxx>
 #include <ndtxt.hxx>
 #include <section.hxx>
 #include <swserv.hxx>
 #include <unosection.hxx>
 #include <switerator.hxx>
 #include <svl/smplhint.hxx>
+#include <sfx2/objsh.hxx>
 
 using namespace ::com::sun::star;
 
 void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
 {
 	SwDoc* pDoc = rSectNd.GetDoc();
-	SwDocShell* pDShell = pDoc->GetDocShell();
+	SfxObjectShell* pDShell = pDoc->GetDocPersist();
 	if( !pDShell || !pDShell->GetMedium() )
 		return ;
 
 	}
 }
 
-
-// sucht sich die richtige DocShell raus oder erzeugt eine neue:
-// Der Return-Wert gibt an, was mit der Shell zu geschehen hat:
-//	0 - Fehler, konnte DocShell nicht finden
-//	1 - DocShell ist ein existieren Document
-//	2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden ( will be assigned to xLockRef additionaly )
-
-int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
-                        SfxObjectShellLock& xLockRef,
-						const String& rFileName,
-						const String& rPasswd,
-						String& rFilter,
-						sal_Int16 nVersion,
-						SwDocShell* pDestSh )
-{
-	if( !rFileName.Len() )
-		return 0;
-
-	// 1. existiert die Datei schon in der Liste aller Dokumente?
-	INetURLObject aTmpObj( rFileName );
-	aTmpObj.SetMark( aEmptyStr );
-
-	// erstmal nur ueber die DocumentShells laufen und die mit dem
-	// Namen heraussuchen:
-	TypeId aType( TYPE(SwDocShell) );
-
-	SfxObjectShell* pShell = pDestSh;
-	sal_Bool bFirst = 0 != pShell;
-
-	if( !bFirst )
-		// keine DocShell uebergeben, also beginne mit der ersten aus der
-		// DocShell Liste
-		pShell = SfxObjectShell::GetFirst( &aType );
-
-	while( pShell )
-	{
-		// die wollen wir haben
-		SfxMedium* pMed = pShell->GetMedium();
-		if( pMed && pMed->GetURLObject() == aTmpObj )
-		{
-			const SfxPoolItem* pItem;
-			if( ( SFX_ITEM_SET == pMed->GetItemSet()->GetItemState(
-											SID_VERSION, sal_False, &pItem ) )
-					? (nVersion == ((SfxInt16Item*)pItem)->GetValue())
-					: !nVersion )
-			{
-				// gefunden also returnen
-				xDocSh = pShell;
-				return 1;
-			}
-		}
-
-		if( bFirst )
-		{
-			bFirst = sal_False;
-			pShell = SfxObjectShell::GetFirst( &aType );
-		}
-		else
-			pShell = SfxObjectShell::GetNext( *pShell, &aType );
-	}
-
-	// 2. selbst die Date oeffnen
-	SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL(
-							 INetURLObject::NO_DECODE ), STREAM_READ, sal_True );
-	if( INET_PROT_FILE == aTmpObj.GetProtocol() )
-		pMed->DownLoad(); 	  // nur mal das Medium anfassen (DownLoaden)
-
-	const SfxFilter* pSfxFlt = 0;
-	if( !pMed->GetError() )
-	{
-        String sFactory(String::CreateFromAscii(SwDocShell::Factory().GetShortName()));
-        SfxFilterMatcher aMatcher( sFactory );
-
-        // kein Filter, dann suche ihn. Ansonsten teste, ob der angegebene
-		// ein gueltiger ist
-		if( rFilter.Len() )
-		{
-            pSfxFlt = aMatcher.GetFilter4FilterName( rFilter );
-		}
-
-		if( nVersion )
-			pMed->GetItemSet()->Put( SfxInt16Item( SID_VERSION, nVersion ));
-
-		if( rPasswd.Len() )
-			pMed->GetItemSet()->Put( SfxStringItem( SID_PASSWORD, rPasswd ));
-
-		if( !pSfxFlt )
-            aMatcher.DetectFilter( *pMed, &pSfxFlt, sal_False, sal_False );
-
-		if( pSfxFlt )
-		{
-			// ohne Filter geht gar nichts
-			pMed->SetFilter( pSfxFlt );
-
-            // if the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure
-			xLockRef = new SwDocShell( SFX_CREATE_MODE_INTERNAL );
-            xDocSh = (SfxObjectShell*)xLockRef;
-			if( xDocSh->DoLoad( pMed ) )
-				return 2;
-		}
-	}
-
-	if( !xDocSh.Is() )		// Medium muss noch geloescht werden
-		delete pMed;
-
-	return 0;	// das war wohl nichts
-}
-
-
 void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
                                 const uno::Any & rValue )
 {
 			pDoc->GetLinkManager().GetDisplayNames( this, 0, &sFileName,
 													&sRange, &sFilter );
 
+            SwDoc *pSrcDoc=0;
             RedlineMode_t eOldRedlineMode = nsRedlineMode_t::REDLINE_NONE;
 			SfxObjectShellRef xDocSh;
             SfxObjectShellLock xLockRef;
-			int nRet;
+			int nRet=0;
 			if( !sFileName.Len() )
 			{
-				xDocSh = pDoc->GetDocShell();
+                xDocSh = pDoc->GetDocPersist();
 				nRet = 1;
 			}
-			else
+			else if ( pDoc->GetDocShell() )
 			{
-				nRet = lcl_FindDocShell( xDocSh, xLockRef, sFileName,
-                                    rSection.GetLinkFilePassword(),
-									sFilter, 0, pDoc->GetDocShell() );
+				nRet = pDoc->GetDocShell()->FindDocShell( &pSrcDoc, xLockRef, sFileName,
+                          rSection.GetLinkFilePassword(), sFilter, 0 );
 				if( nRet )
 				{
-					SwDoc* pSrcDoc = ((SwDocShell*)&xDocSh)->GetDoc();
+                    xDocSh = pSrcDoc->GetDocPersist();
 					eOldRedlineMode = pSrcDoc->GetRedlineMode();
 					pSrcDoc->SetRedlineMode( nsRedlineMode_t::REDLINE_SHOW_INSERT );
 				}
 			}
+            else
+                DBG_ERROR("Need DocShell to react on DataChanged Event!");
 
 			if( nRet )
 			{
 								((SfxStringItem*)pItem)->GetValue() );
 				}
 
-				SwDoc* pSrcDoc = ((SwDocShell*)&xDocSh)->GetDoc();
-
 				if( sRange.Len() )
 				{
 					// Rekursionen abfangen
 
                 // update alle Links in diesem Bereich
 				lcl_UpdateLinksInSect( *this, *pSectNd );
-			}
-			if( xDocSh.Is() )
-			{
-				if( 2 == nRet )
-					xDocSh->DoClose();
-                else if( ((SwDocShell*)&xDocSh)->GetDoc() )
-					((SwDocShell*)&xDocSh)->GetDoc()->SetRedlineMode(
-								eOldRedlineMode );
+
+			    if( xDocSh.Is() )
+			    {
+				    if( 2 == nRet )
+                        // document was created in FindDocShell
+					    xDocSh->DoClose();
+                    else if( pSrcDoc )
+                        // RelineMode was changed before treatment (after FindDocShell)
+					    pSrcDoc->SetRedlineMode( eOldRedlineMode );
+			    }
 			}
 		}
 		break;
 #endif
 
         // TODO/MBA: it's impossible to set a BaseURL here!
-        SwReader aTmpReader( aStrm, aEmptyStr, pDoc->GetDocShell()->GetMedium()->GetBaseURL(), *pPam );
+        SwReader aTmpReader( aStrm, aEmptyStr, pDoc->GetDocPersist()->GetMedium()->GetBaseURL(), *pPam );
 
 		if( !IsError( aTmpReader.Read( *pRead ) ))
         {

sw/source/core/docnode/swbaslnk.cxx

 #include <sfx2/docfile.hxx>
 #include <sfx2/lnkbase.hxx>
 #include <sfx2/linkmgr.hxx>
-#include <sfx2/objsh.hxx>
 #include <editeng/boxitem.hxx>
-#ifndef _SVX_SVXIDS_HRC
 #include <svx/svxids.hrc>		// fuer die EventIds
-#endif
 #include <sfx2/linkmgr.hxx>
 #include <svtools/soerr.hxx>
 #include <fmtfsize.hxx>

sw/source/core/draw/dpage.cxx

 #include <fmturl.hxx>
 #include <frmfmt.hxx>
 #include <doc.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
 #include <shellres.hxx>
 #include <viewimp.hxx>
 #include <pagefrm.hxx>
 #include <dpage.hxx>
 #include <dcontact.hxx>
 #include <dflyobj.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
 #include <usrfld.hxx>
 #include <flyfrm.hxx>
 #include <ndnotxt.hxx>
 			if ( sTxt.Len() )
 			{
                 // --> OD 2007-07-26 #i80029#
-                sal_Bool bExecHyperlinks = rDoc.GetDocShell()->IsReadOnly();
+                sal_Bool bExecHyperlinks = rDoc.GetDocPersist()->IsReadOnly();
                 if ( !bExecHyperlinks )
                 {
                     SvtSecurityOptions aSecOpts;
 Reference< XInterface > SwDPage::createUnoPage()
 {
 	Reference < XInterface > xRet;
-	SwDocShell* pDocShell = rDoc.GetDocShell();
+	SfxObjectShell* pDocShell = rDoc.GetDocPersist();
 	if ( pDocShell )
 	{
-		Reference<XModel> xModel = pDocShell->GetBaseModel();
+		Reference<XModel> xModel = rDoc.GetDocPersist()->GetModel();
 		Reference<XDrawPageSupplier> xPageSupp(xModel, UNO_QUERY);
 		xRet = xPageSupp->getDrawPage();
 	}

sw/source/core/draw/drawdoc.cxx

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-#ifndef _SVX_SVXIDS_HRC
 #include <svx/svxids.hrc>
-#endif
 #include <tools/stream.hxx>
 #include <unotools/pathoptions.hxx>
 #include <sot/storage.hxx>
 #include <svl/intitem.hxx>
 #include <editeng/forbiddencharacterstable.hxx>
-
 #include <unotools/ucbstreamhelper.hxx>
 #include <svx/xtable.hxx>
 #include <svx/drawitem.hxx>
 #include <rootfrm.hxx>
 #include <drawdoc.hxx>
 #include <dpage.hxx>
-#ifndef _DOCSH_HXX
-#include <docsh.hxx>
-#endif
 #include <shellio.hxx>
 #include <hintids.hxx>
 #include <com/sun/star/embed/ElementModes.hpp>
 
 SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
 	FmFormModel( ::GetPalettePath(), &pD->GetAttrPool(),
-				 pD->GetDocShell(), sal_True ),
+				 pD->GetDocPersist(), sal_True ),
 	pDoc( pD )
 {
 	SetScaleUnit( MAP_TWIP );
 	SetSwapGraphics( sal_True );
 
-	SwDocShell* pDocSh = pDoc->GetDocShell();
+	SfxObjectShell* pDocSh = pDoc->GetDocPersist();
 	if ( pDocSh )
 	{
 		SetObjectShell( pDocSh );
 
     try
     {
-        if ( GetDoc().GetDocShell() )
+        if ( GetDoc().GetDocPersist() )
         {
-            xModel = GetDoc().GetDocShell()->GetModel();
+            xModel = GetDoc().GetDocPersist()->GetModel();
         }
     }
     catch( uno::RuntimeException& )
     {
         ASSERT( false,
-                "<SwDrawDocument::createUnoModel()> - could *not* retrieve model at <SwDocShell>" );
+                "<SwDrawDocument::createUnoModel()> - could *not* retrieve model" );
     }
 
     return xModel;

sw/source/core/edit/autofmt.cxx

 
 #include <ctype.h>
 #include <hintids.hxx>
-#include <docsh.hxx>
 #include <svl/svstdarr.hxx>
-
 #include <unotools/charclass.hxx>
-
 #include <vcl/msgbox.hxx>
-
 #include <editeng/boxitem.hxx>
 #include <editeng/lrspitem.hxx>
 #include <editeng/brkitem.hxx>
 	{
 		aAFFlags = *pAFlags;
 		if( !aAFFlags.bAFmtByInput )
-			pWait = new SfxWait( *GetDoc()->GetDocShell(), true );
+			pWait = new SfxWait( *GetDoc()->GetDocPersist(), true );
 	}
 
 	SwPaM* pCrsr = GetCrsr();

sw/source/core/edit/edlingu.cxx

 #include <splargs.hxx>
 #include <redline.hxx>      // SwRedline
 #include <docary.hxx>       // SwRedlineTbl
-#include <docsh.hxx>
 #include <txatbase.hxx>
 #include <txtfrm.hxx>
 
             if (xGCIterator.is())
             {
 //                LanguageType eActLang = (LanguageType)pNode->GetLang( nBegin, nLen );
-                uno::Reference< lang::XComponent > xDoc( pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY );
+                uno::Reference< lang::XComponent > xDoc( pDoc->GetDocPersist()->GetModel(), uno::UNO_QUERY );
                 
                 // Expand the string:
                 rtl::OUString aExpandText;

sw/source/core/edit/edtab.cxx

 
 #define _SVSTDARR_ULONGS
 #include <svl/svstdarr.hxx>
-#include <docsh.hxx>
 #include <sfx2/sfxwait.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
                                sal_Int16 eAdj,
                                const SwTableAutoFmt* pTAFmt )
 {
-	SfxWait aWait( *GetDoc()->GetDocShell(), true );
+	SfxWait aWait( *GetDoc()->GetDocPersist(), true );
 	sal_Bool bRet = sal_False;
 	StartAllAction();
 	FOREACHPAM_START(this)
 
 sal_Bool SwEditShell::TableToText( sal_Unicode cCh )
 {
-	SfxWait aWait( *GetDoc()->GetDocShell(), true );
+	SfxWait aWait( *GetDoc()->GetDocPersist(), true );
 	sal_Bool bRet = sal_False;
 	SwPaM* pCrsr = GetCrsr();
 	const SwTableNode* pTblNd =

sw/source/core/edit/edundo.cxx

 #include <flyfrm.hxx>
 #include <frmfmt.hxx>
 #include <viewimp.hxx>
-#include <docsh.hxx>
 
 
 /** helper function to select all objects in an SdrMarkList;
 bool SwEditShell::CursorsLocked() const
 {
 
-    return GetDoc()->GetDocShell()->GetModel()->hasControllersLocked();
+    return GetDoc()->GetDocPersist()->GetModel()->hasControllersLocked();
 }
 
 void

sw/source/core/fields/docufld.cxx

 #include <ndtxt.hxx>
 #include <expfld.hxx>
 #include <poolfmt.hxx>
-#include <docsh.hxx>
 #include <unofldmid.h>
 #include <swunohelper.hxx>
 #include <comcore.hrc>
 String SwFileNameFieldType::Expand(sal_uLong nFmt) const
 {
 	String aRet;
-	const SwDocShell* pDShell = pDoc->GetDocShell();
+	const SfxObjectShell* pDShell = pDoc->GetDocPersist();
 	if( pDShell && pDShell->HasName() )
 	{
 		const INetURLObject& rURLObj = pDShell->GetMedium()->GetURLObject();
 	ASSERT( nFmt < FF_END, "Expand: kein guelt. Fmt!" );
 
 	String aRet;
-    SwDocShell *pDocShell(pDoc->GetDocShell());
+    SfxObjectShell *pDocShell(pDoc->GetDocPersist());
     DBG_ASSERT(pDocShell, "no SwDocShell");
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
 {
 	String aStr;
 	const LocaleDataWrapper *pAppLocalData = 0, *pLocalData = 0;
-    SwDocShell *pDocShell(GetDoc()->GetDocShell());
+    SfxObjectShell *pDocShell(GetDoc()->GetDocPersist());
     DBG_ASSERT(pDocShell, "no SwDocShell");
     if (!pDocShell) { return aStr; }
 
         // so we treat *every* unknown property as a custom property, even the "built-in" section in Word's document summary information stream
         // as these properties have not been inserted when the document summary information was imported, we do it here
         // this approach is still a lot better than the old one to import such fields as "user fields" and simple text
-        SwDocShell* pDocShell = GetDoc()->GetDocShell();
+        SfxObjectShell* pDocShell = GetDoc()->GetDocPersist();
         if( !pDocShell )
             return aContent;
         try
                     util::Duration aDuration;
                     if( aAny >>= aDate) 
                     {
-                        SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();