Commits

Anonymous committed d1741b7

swbookmarkfixes01: intermediate commit

Comments (0)

Files changed (22)

sw/inc/IDocumentFootnoteAccess.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 IDOCUMENTFOOTNOTEACCESS_HXX_INCLUDED
+#define IDOCUMENTFOOTNOTEACCESS_HXX_INCLUDED
+
+class SwFtnInfo;
+class SwEndNoteInfo;
+class SwPaM; 
+class SwFtnIdxs;
+
+namespace sw { namespace pagedesc
+{
+    class IDocumentFootnoteAccess
+    {
+        public:
+            virtual const SwFtnInfo& GetFtnInfo() const =0;
+            virtual void SetFtnInfo(const SwFtnInfo& rInfo) =0;
+            virtual const SwEndNoteInfo& GetEndNoteInfo() const =0;
+            virtual void SetEndNoteInfo(const SwEndNoteInfo& rInfo) =0;
+            virtual SwFtnIdxs& GetFtnIdxs() =0;
+            virtual const SwFtnIdxs& GetFtnIdxs() const =0;
+            virtual ~IDocumentFootnoteAccess() {};
+    };
+}}
+#endif

sw/inc/IDocumentInterfaceProvider.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 _IDOCUMENTINTERFACEPROVIDER_HXX
+#define _IDOCUMENTINTERFACEPROVIDER_HXX
+
+class IDocumentMarkAccess;
+class IDocumentUndoRedo;
+class IDocumentLayoutAccess;
+
+namespace sw
+{
+    namespace format
+    {
+        class IDocumentFormatAccess;
+    }
+    namespace pagedesc
+    {
+        class IDocumentPageDescAccess;
+        class IDocumentFootnoteAccess;
+    }
+
+    class IDocumentInterfaceProvider
+    {
+        public:
+            virtual IDocumentMarkAccess* getIDocumentMarkAccess() =0;
+            virtual const IDocumentMarkAccess* getIDocumentMarkAccess() const =0;
+            virtual IDocumentUndoRedo* getIDocumentUndoRedo() =0;
+            virtual const IDocumentUndoRedo* getIDocumentUndoRedo() const =0;
+            virtual IDocumentLayoutAccess* getIDocumentLayoutAccess() =0;
+            virtual const IDocumentLayoutAccess* getIDocumentLayoutAccess() const =0;
+            virtual ::sw::format::IDocumentFormatAccess* getIDocumentFormatAccess() =0;
+            virtual const ::sw::format::IDocumentFormatAccess* getIDocumentFormatAccess() const =0;
+            virtual ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() =0;
+            virtual const ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() const =0;
+            virtual ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() =0;
+            virtual const ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() const =0;
+    };
+}
+
+#endif

sw/inc/SwUndoPageDesc.hxx

     virtual SwRewriter GetRewriter() const;
 };
 
-class SwUndoPageDescCreate : public SwUndo
+class SW_DLLPUBLIC SwUndoPageDescCreate : public SwUndo
 {
     const SwPageDesc * pDesc; // #116530#
     SwPageDescExt aNew;
     virtual SwRewriter GetRewriter() const;
 };
 
-class SwUndoPageDescDelete : public SwUndo
+class SW_DLLPUBLIC SwUndoPageDescDelete : public SwUndo
 {
     SwPageDescExt aOld;
     IDocumentUndoRedo* pDoc;
 	BOOL IsLastDepend() const
 		{ return pRoot && !pRoot->pLeft && !pRoot->pRight; }
 
+	void Broadcast(SfxPoolItem* pOldValue, SfxPoolItem* pNewValue);
+	void Broadcast(SfxPoolItem* pOldValue, SfxPoolItem* pNewValue, TypeId nType);
+
 private:
 	// forbidden and not implemented (see @ SwClient).
 	SwModify & operator= (const SwModify &);
 	SwDepend & operator= (const SwDepend &);
 };
 
-
+// Dont use SwClientIter in new code!
+// Use SwModify.Broadcast instead!
 class SwClientIter
 {
 	friend SwClient* SwModify::_Remove(SwClient *);	// fuer Ptr-Korrektur
 #include <editeng/numitem.hxx>
 #include <flyenum.hxx>
 #include <hash_map>
+#include <IDocumentInterfaceProvider.hxx>
 #include <IDocumentChartDataProviderAccess.hxx>
 #include <IDocumentContentOperations.hxx>
 #include <IDocumentDeviceAccess.hxx>
 #include <IDocumentExternalData.hxx>
 #include <IDocumentFieldsAccess.hxx>
 #include <IDocumentFormatAccess.hxx>
+#include <IDocumentFootnoteAccess.hxx>
 #include <IDocumentLayoutAccess.hxx>
 #include <IDocumentLineNumberAccess.hxx>
 #include <IDocumentLinksAdministration.hxx>
     public IDocumentLayoutAccess,
     public IDocumentTimerAccess,
     public IDocumentChartDataProviderAccess,
-    // --> OD 2007-10-26 #i83479#
     public IDocumentListItems,
     public IDocumentOutlineNodes,
-    // <--
-    // --> OD 2008-03-12 #refactorlists#
     public IDocumentListsAccess,
-    // <--
     public IDocumentExternalData,
-    public ::sw::format::IDocumentFormatAccess
+    public ::sw::format::IDocumentFormatAccess,
+    public ::sw::pagedesc::IDocumentFootnoteAccess,
+    public ::sw::IDocumentInterfaceProvider
 {
 
 	friend void _InitCore();
 
     /** IDocumentMarkAccess
     */
-    IDocumentMarkAccess* getIDocumentMarkAccess();
-    const IDocumentMarkAccess* getIDocumentMarkAccess() const;
+    virtual IDocumentMarkAccess* getIDocumentMarkAccess();
+    virtual const IDocumentMarkAccess* getIDocumentMarkAccess() const;
 
     /** IDocumentRedlineAccess
     */
 
     /** IDocumentUndoRedo
     */
-    IDocumentUndoRedo* getIDocumentUndoRedo() { return this; };
-    const IDocumentUndoRedo* getIDocumentUndoRedo() const { return this;};
+    virtual IDocumentUndoRedo* getIDocumentUndoRedo() { return this; };
+    virtual const IDocumentUndoRedo* getIDocumentUndoRedo() const { return this;};
     virtual void SetUndoNoResetModified();
 	virtual bool IsUndoNoResetModified() const;
 	virtual void DoUndo(bool bUn);
 
     /** IDocumentLayoutAccess
     */
-    IDocumentLayoutAccess* getIDocumentLayoutAccess() { return this; };
-    const IDocumentLayoutAccess* getIDocumentLayoutAccess() const { return this;};
+    virtual IDocumentLayoutAccess* getIDocumentLayoutAccess() { return this; };
+    virtual const IDocumentLayoutAccess* getIDocumentLayoutAccess() const { return this;};
     virtual const SwRootFrm* GetRootFrm() const ;
     virtual       SwRootFrm* GetRootFrm();
     virtual void SetRootFrm( SwRootFrm* pNew );
     /** Footnotes
     */
 	// Fussnoten Informationen
-	const SwFtnInfo& GetFtnInfo() const			{ return *pFtnInfo; }
-	void SetFtnInfo(const SwFtnInfo& rInfo);
-	const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
-	void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
-		  SwFtnIdxs& GetFtnIdxs() 		{ return *pFtnIdxs; }
-	const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
+    virtual ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() { return this; };
+    virtual const ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() const { return this; };
+    virtual const SwFtnInfo& GetFtnInfo() const         { return *pFtnInfo; }
+    virtual void SetFtnInfo(const SwFtnInfo& rInfo);
+    virtual const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
+    virtual void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
+    virtual SwFtnIdxs& GetFtnIdxs()       { return *pFtnIdxs; }
+    virtual const SwFtnIdxs& GetFtnIdxs() const { return *pFtnIdxs; }
     // change footnotes in area
     bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
-                    sal_uInt16 nNumber, bool bIsEndNote );
+            sal_uInt16 nNumber, bool bIsEndNote );
 
     /** Operations on the content of the document e.g.
         spell-checking/hyphenating/word-counting
 	const SwSpzFrmFmts* GetSpzFrmFmts() const	{ return pSpzFrmFmtTbl; }
 		  SwSpzFrmFmts* GetSpzFrmFmts() 		{ return pSpzFrmFmtTbl; }
     // IDocumentFormatAccess
-    IDocumentFormatAccess* getIDocumentFormatAccess() { return this; }
-    const IDocumentFormatAccess* getIDocumentFormatAccess() const { return this; }
+    	virtual IDocumentFormatAccess* getIDocumentFormatAccess() { return this; }
+	virtual const IDocumentFormatAccess* getIDocumentFormatAccess() const { return this; }
 	virtual const SwFrmFmt* GetDfltFrmFmt() const	{ return pDfltFrmFmt; }
 	virtual	SwFrmFmt* GetDfltFrmFmt() 		{ return pDfltFrmFmt; }
 	virtual const SwFrmFmt* GetEmptyPageFmt() const { return pEmptyPageFmt; }
     const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
 
     // IDocumentPageDescAccess
-    ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess();
-    const ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() const;
+    virtual ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess();
+    virtual const ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() const;
 
     //fuer Reader
     virtual void ChgPageDesc(SwPageDesc* pDesc, const SwPageDesc&);
 class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
 {
 	friend class SwTxtFld;
-	friend void _InitCore();
+	friend void _InitAttrTab(bool);
 
 	SwField *pField;
 	SwTxtFld* pTxtAttr;		// mein TextAttribut
 #ifndef _INIT_HXX
 #define _INIT_HXX
 
+#include <swdllapi.h>
+
 class ViewShell;
 
-void _InitCore();	// bastyp/init.cxx
+void _InitCore();
+SW_DLLPUBLIC void _InitAttrTab(bool);
 void _FinitCore();
 
 void _InitFilter();	// basflt/fltini.cxx

sw/inc/swapplication.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 SW_APPLICATION_HXX
+#define SW_APPLICATION_HXX
+
+#include <boost/shared_ptr.hpp>
+#include <vcl/svapp.hxx>
+#include <editeng/paperinf.hxx>
+#include <unotools/syslocale.hxx>
+
+namespace sw {
+
+class Application
+{
+    public:
+        virtual LanguageType GetLanguage()
+        {
+            return ::Application::GetSettings().GetLanguage();
+        }
+        virtual Size GetDefaultPaperSize( MapUnit eUnit = MAP_TWIP)
+        {
+            return SvxPaperInfo::GetDefaultPaperSize(eUnit);
+        }
+        virtual MeasurementSystem GetMeasurementSystem()
+        {
+           return SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+        }
+        static Application* GetInstance()
+        {
+            if (!our_pInstance)
+                our_pInstance.reset(new ::sw::Application());
+            return our_pInstance.get();
+        }
+        static SW_DLLPUBLIC void SetTestInstance(::boost::shared_ptr< ::sw::Application> io_pInstance);
+    private:
+        static ::boost::shared_ptr< ::sw::Application> our_pInstance;
+};
+
+}
+#endif
 class SwTblBoxFormula;
 class SwTblBoxValue;
 
-class SwAttrPool : public SfxItemPool
+class SW_DLLPUBLIC SwAttrPool : public SfxItemPool
 {
-	friend void _InitCore();			// fuers anlegen/zerstoeren der
-	friend void _FinitCore();           // Versionsmaps
+	friend void _InitCore();
+	friend void _InitAttrTab(bool);
+	friend void _FinitCore();
 	static USHORT* pVersionMap1;
 	static USHORT* pVersionMap2;
 	static USHORT* pVersionMap3;
     // map for binary filter is necessary (version map 5).
     static USHORT* pVersionMap5;
     static USHORT* pVersionMap6;
+    static bool isVersionMapInited;
+    static bool isAttrTabInited;
 
 	SwDoc* pDoc;
 
 public:
 	SwAttrPool( SwDoc* pDoc );
-protected:
+    static void InitVersionMaps();
 	virtual ~SwAttrPool();
-public:
 
 		  SwDoc* GetDoc() 			{ return pDoc; }
 	const SwDoc* GetDoc() const		{ return pDoc; }
     : public SfxPoolItem
     , public SwModify
 {
-	friend void _InitCore();
+	friend void _InitAttrTab(bool);
 	friend class SwTxtTOXMark;
 
 	String aAltText; 	// Der Text des Eintrages ist unterschiedlich
 #ifndef SW_UNDOBJ_HXX
 #define SW_UNDOBJ_HXX
 
-// --> OD 2006-11-01 #130889#
+#include <swdllapi.h>
 #include <vector>
-// <--
 #include <memory>
 
 #include <boost/shared_ptr.hpp>
 typedef SwRedlineSaveData* SwRedlineSaveDataPtr;
 SV_DECL_PTRARR_DEL( SwRedlineSaveDatas, SwRedlineSaveDataPtr, 8, 8 )
 
-class SwUndo
+class SW_DLLPUBLIC SwUndo
 {
     SwUndoId nId;
 	USHORT nOrigRedlineMode;
 sw      sw\util                             nmake   -       all     sw_util sw_core sw_flt sw_sdi sw_ui NULL
 sw sw\qa\unoapi nmake - all sw_qa_unoapi NULL
 sw sw\qa\core\bigpointerarray nmake - all sw_qa_core_bigpointerarray sw_bast sw_inc NULL
-sw sw\qa\core\PageDescManager nmake - all sw_qa_core_PageDescManager sw_inc NULL
+sw sw\qa\core\PageDescManager nmake - all sw_qa_core_PageDescManager sw_util NULL

sw/qa/core/PageDescManager/PageDescManagerTest.cxx

 *
 ************************************************************************/
 
+#undef SW_DLLIMPLEMENTATION
 #include "precompiled_sw.hxx"
 #include <sal/config.h>
 
 #include <set>
 #include <vector>
 
-#define _SWATRSET_HXX
-#include <svl/itemset.hxx>
-#include <svl/itempool.hxx>
-
-class IDocumentSettingAccess;
-class OutputDevice;
-class SfxBoolItem;
-class SvxAdjustItem;
-class SvxAutoKernItem;
-class SvxBlinkItem;
-class SvxBoxItem;
-class SvxBrushItem;
-class SvxCaseMapItem;
-class SvxCharHiddenItem;
-class SvxCharReliefItem;
-class SvxCharRotateItem;
-class SvxCharScaleWidthItem;
-class SvxCharSetColorItem;
-class SvxColorItem;
-class SvxContourItem;
-class SvxCrossedOutItem;
-class SvxEmphasisMarkItem;
-class SvxEscapementItem;
-class SvxFmtBreakItem;
-class SvxFmtKeepItem;
-class SvxFmtSplitItem;
-class SvxFontHeightItem;
-class SvxFontItem;
-class SvxForbiddenRuleItem;
-class SvxFrameDirectionItem;
-class SvxHangingPunctuationItem;
-class SvxHyphenZoneItem;
-class SvxKerningItem;
-class SvxLRSpaceItem;
-class SvxLanguageItem;
-class SvxLineSpacingItem;
-class SvxMacroItem;
-class SvxNoHyphenItem;
-class SvxOpaqueItem;
-class SvxOrphansItem;
-class SvxOverlineItem;
-class SvxPaperBinItem;
-class SvxParaGridItem;
-class SvxParaVertAlignItem;
-class SvxPostureItem;
-class SvxPrintItem;
-class SvxPropSizeItem;
-class SvxProtectItem;
-class SvxScriptSpaceItem;
-class SvxShadowItem;
-class SvxShadowedItem;
-class SvxTabStopItem;
-class SvxTwoLinesItem;
-class SvxULSpaceItem;
-class SvxUnderlineItem;
-class SvxWeightItem;
-class SvxWidowsItem;
-class SvxWordLineModeItem;
-class SwChannelBGrf;
-class SwChannelGGrf;
-class SwChannelRGrf;
-class SwContrastGrf;
-class SwCropGrf;
-class SwDoc;
-class SwDrawModeGrf;
-class SwFmtAnchor;
-class SwFmtChain;
-class SwFmtCntnt;
-class SwFmtCol;
-class SwFmtDrop;
-class SwFmtEditInReadonly;
-class SwFmtEndAtTxtEnd;
-class SwFmtFillOrder;
-class SwFmtFollowTextFlow;
-class SwFmtFooter;
-class SwFmtFrmSize;
-class SwFmtFtnAtTxtEnd;
-class SwFmtHeader;
-class SwFmtHoriOrient;
-class SwFmtLayoutSplit;
-class SwFmtLineNumber;
-class SwFmtNoBalancedColumns;
-class SwFmtPageDesc;
-class SwFmtRowSplit;
-class SwFmtSurround;
-class SwFmtURL;
-class SwFmtVertOrient;
-class SwFmtWrapInfluenceOnObjPos;
-class SwGammaGrf;
-class SwHeaderAndFooterEatSpacingItem;
-class SwInvertGrf;
-class SwLuminanceGrf;
-class SwMirrorGrf;
-class SwModify;
-class SwNumRuleItem;
-class SwParaConnectBorderItem;
-class SwRegisterItem;
-class SwRotationGrf;
-class SwTblBoxFormula;
-class SwTblBoxNumFormat;
-class SwTblBoxValue;
-class SwTextGridItem;
-class SwTransparencyGrf;
-class SwAttrPool {};
-class SwAttrSet : public SfxItemSet
-{
-    public:
-        SwDoc* GetDoc() const { return NULL; };
-        void GetPresentation( SfxItemPresentation, SfxMapUnit, SfxMapUnit, String) const {};
-        const SwFmtHeader& GetHeader(BOOL) const;
-        const SwFmtFooter& GetFooter(BOOL) const;
-        const SwFmtCntnt& GetCntnt(BOOL) const;
-};
-namespace sw { namespace test {
-    struct TestableSwAttrSet : public SwAttrSet
-    {
-    }
-}}
-
-#define SW_UNDOBJ_HXX
-struct SwUndo
-{
-    virtual ~SwUndo() {};
-};
-class SwUndoIter {};
-class SwRewriter {};
-
-#define _SW_UNDO_PAGE_DESC_HXX
-#include <IDocumentUndoRedo.hxx>
-class SwPageDesc;
-class SwUndoPageDescCreate : public SwUndo
-{
-    public:
-        SwUndoPageDescCreate(const SwPageDesc*, IDocumentUndoRedo*) {};
-};
-class SwUndoPageDescDelete : public SwUndo
-{
-    public:
-        SwUndoPageDescDelete(const SwPageDesc&, IDocumentUndoRedo*) {};
-};
-
-#include <editeng/frmdir.hxx>
-SvxFrameDirection GetDefaultFrameDirection(ULONG)
-    { return FRMDIR_HORI_LEFT_TOP; };
-
-unsigned short GetAppLanguage()
-    { return 0; };
-
-#define _PAGEDESC_HXX
-#include <frmfmt.hxx>
-class SwDoc;
-class SwPageDesc
-{
-    public:
-        SwPageDesc() {};
-        SwPageDesc(const String& rName, SwFrmFmt*, SwAttrPool*, SvxFrameDirection) : m_sName(rName) {};
-        SwPageDesc(const String& rName, SwFrmFmt*, SwAttrPool*) : m_sName(rName) {};
-        SwPageDesc(const SwPageDesc& rOther) : m_sName(rOther.m_sName), m_nFmtId(rOther.m_nFmtId) {};
-        String GetName() const { return m_sName; };
-        void SetName(const String& rName) { m_sName = rName; };
-        SwFrmFmt& GetLeft() { return *((SwFrmFmt*)NULL); };
-        SwFrmFmt& GetMaster() { return *((SwFrmFmt*)NULL); };
-        SwPageDesc* GetFollow() { return NULL; };
-        void SetFollow(SwPageDesc*) {};
-        const SwPageDesc* GetFollow() const { return NULL; };
-        void Dispose() {};
-        bool HasInvalidPageFormat() const { return true; };
-        void ResetToDefaultPageFormat() {};
-        USHORT GetPoolFmtId() const { return m_nFmtId; };
-        void SetPoolFmtId(USHORT nFmtId) { m_nFmtId = nFmtId; };
-        void SetPoolHelpId(USHORT nHid) { m_nHid = nHid; };
-        USHORT GetPoolHelpId() const { return m_nHid; };
-        void SetPoolHlpFileId(BYTE nHfid) { m_nHfid = nHfid; };
-        BYTE GetPoolHlpFileId() const { return m_nHfid; };
-    private:
-        String m_sName;
-        USHORT m_nFmtId;
-        USHORT m_nHid;
-        BYTE  m_nHfid;
-};
-class SwPageDescExt : public SwPageDesc {};
+#include <swatrset.hxx>
+#include <hintids.hxx>
+#include <init.hxx>
 
 #include <mock/FormatAccessMockBase.hxx>
 #include <mock/UndoRedoMockBase.hxx>
+#include <mock/InterfaceProviderMockBase.hxx>
+#include <source/core/doc/PageDescManager.hxx>
+#include <StyleOperationHint.hxx>
+#include <CheckPageDescHint.hxx>
+#include <PageDescDisposingHint.hxx>
+#include <pagedesc.hxx>
+#include <SwUndoPageDesc.hxx>
+
+#include <swapplication.hxx>
+#include <i18npool/lang.h>
+
+namespace sw { namespace mock
+{
+    struct ApplicationMock : public ::sw::Application
+    {
+        virtual LanguageType GetLanguage()
+            { return LANGUAGE_SYSTEM; }
+        virtual Size GetDefaultPaperSize(MapUnit)
+            { return Size(100, 100); }
+        virtual MeasurementSystem GetMeasurementSystem()
+            { return MEASURE_METRIC; }
+    };
+}}
+
 namespace
 {
+    
     struct UndoRedoMock : public ::sw::mock::UndoRedoMockBase
     {
         UndoRedoMock() : m_isActive(false), m_isModified(false) {};
     };
 }
 
-#include <source/core/doc/PageDescManager.cxx>
-
 using namespace ::boost;
 using namespace ::std;
 using namespace ::sw::pagedesc;
 using namespace ::sw::style;
 using namespace ::sw::mock;
+using namespace ::sw::format;
 namespace
 {
     struct BroadcastRecorder : public SfxListener
         }
     };
 }
+
 namespace sw { namespace test
 {
-    struct TestablePageDescManager : public PageDescManager
-    {
-        TestablePageDescManager(IDocumentUndoRedo* pUndoRedo, IDocumentFormatAccess* pFormatAccess, SwAttrPool* pPool, SfxBroadcaster* pStyleOperationBroadcaster, SfxBroadcaster* pModelEventBroadcaster)
-            : PageDescManager(pUndoRedo, pFormatAccess, pPool, pStyleOperationBroadcaster, pModelEventBroadcaster) {};
-
-        SvxFrameDirection GetDfltFrameDirForCurrentLang()
-            { return FRMDIR_HORI_LEFT_TOP; }
-    };
-
     class PageDescManagerTest: public CppUnit::TestFixture
     {
         public:
         private:
             void Setup();
             void AddPageDesc(const String& rName);
+            scoped_ptr<InterfaceProviderMockBase> m_pInterfaceProvider;
             scoped_ptr<UndoRedoMock> m_pUndoRedo;
             scoped_ptr<FormatAccessMockBase> m_pFormatAccess;
             scoped_ptr<SwAttrPool> m_pPool;
             static const String our_sOtherName;
             static const String our_sThirdName;
             static const String our_sFourthName;
+            static bool isSwCoreInitialized;
     };
 
     const String PageDescManagerTest::our_sName = String::CreateFromAscii("SomeName");
 
 using namespace ::sw::test;
 
+bool PageDescManagerTest::isSwCoreInitialized = false;
+
 void PageDescManagerTest::Setup()
 {
+    if(!PageDescManagerTest::isSwCoreInitialized)
+    {
+        ::sw::Application::SetTestInstance(::boost::shared_ptr< ::sw::Application>(new ::sw::mock::ApplicationMock()));
+        ::_InitAttrTab(false);
+        SwAttrPool::InitVersionMaps();
+        PageDescManagerTest::isSwCoreInitialized = true;
+    }
+    m_pInterfaceProvider.reset(new InterfaceProviderMockBase());
     m_pUndoRedo.reset(new UndoRedoMock());
+    m_pInterfaceProvider->m_pUndoRedo = m_pUndoRedo.get();
     m_pFormatAccess.reset(new FormatAccessMockBase());
-    m_pPool.reset(new SwAttrPool());
+    m_pInterfaceProvider->m_pFormatAccess = m_pFormatAccess.get();
+    m_pPool.reset(new SwAttrPool(reinterpret_cast<SwDoc*>(m_pInterfaceProvider.get())));
     m_pStyleOperationBroadcaster.reset(new SfxBroadcaster());
     m_pModelEventBroadcaster.reset(new SfxBroadcaster());
-    m_pPageDescAccess.reset(new TestablePageDescManager(
+    m_pPageDescAccess.reset(new PageDescManager(
         m_pUndoRedo.get(),
         m_pFormatAccess.get(),
         m_pPool.get(),
         m_pStyleOperationBroadcaster.get(),
         m_pModelEventBroadcaster.get()));
+    m_pInterfaceProvider->m_pPageDescAccess = m_pPageDescAccess.get();
+
     m_pBroadcastRecorder.reset(new BroadcastRecorder());
     m_pBroadcastRecorder->StartListening(*m_pStyleOperationBroadcaster);
     m_pBroadcastRecorder->StartListening(*m_pModelEventBroadcaster);

sw/qa/core/PageDescManager/makefile.mk

     $(SVTOOLLIB) \
     $(SVXCORELIB) \
     $(SVXLIB) \
+    $(ISWLIB) \
     $(TKLIB) \
     $(TOOLSLIB) \
     $(UCBHELPERLIB) \

sw/qa/core/inc/mock/FootnoteAccessMockBase.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 FOOTNOTEACCESSMOCKBASE_HXX_INCLUDED
+#define FOOTNOTEACCESSMOCKBASE_HXX_INCLUDED
+
+#include <IDocumentFootnoteAccess.hxx>
+
+namespace sw { namespace mock
+{
+    class FootnoteAccessMockBase : public ::sw::pagedesc::IDocumentFootnoteAccess
+    {
+        public:
+            virtual const SwFtnInfo& GetFtnInfo() const { return *((SwFtnInfo*)NULL); }
+            virtual void SetFtnInfo(const SwFtnInfo&) {}
+            virtual const SwEndNoteInfo& GetEndNoteInfo() const { return *((SwEndNoteInfo*)NULL); }
+            virtual void SetEndNoteInfo(const SwEndNoteInfo&) {};
+            virtual SwFtnIdxs& GetFtnIdxs() { return *((SwFtnIdxs*)NULL); }
+            virtual const SwFtnIdxs& GetFtnIdxs() const { return *((SwFtnIdxs*)NULL); }
+            virtual ~IDocumentFootnoteAccess() {};
+    };
+}}
+#endif

sw/qa/core/inc/mock/InterfaceProviderMockBase.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 _INTERFACEPROVIDERMOCKBASE_HXX
+#define _INTERFACEPROVIDERMOCKBASE_HXX
+
+#include <IDocumentInterfaceProvider.hxx>
+//#include <IDocumentMarkAccess.hxx>
+//#include <IDocumentUndoRedo.hxx>
+//#include <IDocumentFormatAccess.hxx>
+//#include <IDocumentPageDescAccess.hxx>
+//#include <IDocumentFootnoteAccess.hxx>
+
+namespace sw { namespace mock
+{
+    struct InterfaceProviderMockBase : public ::sw::IDocumentInterfaceProvider
+    {
+        virtual IDocumentMarkAccess* getIDocumentMarkAccess() { return m_pMarkAccess; }
+        virtual const IDocumentMarkAccess* getIDocumentMarkAccess() const { return m_pMarkAccess; }
+        virtual IDocumentUndoRedo* getIDocumentUndoRedo() { return m_pUndoRedo; }
+        virtual const IDocumentUndoRedo* getIDocumentUndoRedo() const { return m_pUndoRedo; }
+        virtual IDocumentLayoutAccess* getIDocumentLayoutAccess() { return m_pLayoutAcess; }
+        virtual const IDocumentLayoutAccess* getIDocumentLayoutAccess() const { return m_pLayoutAcess; }
+        virtual ::sw::format::IDocumentFormatAccess* getIDocumentFormatAccess() { return m_pFormatAccess; }
+        virtual const ::sw::format::IDocumentFormatAccess* getIDocumentFormatAccess() const { return m_pFormatAccess; }
+        virtual ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() { return m_pPageDescAccess; }
+        virtual const ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() const { return m_pPageDescAccess; }
+        virtual ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() { return m_pFootnoteAccess; }
+        virtual const ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() const { return m_pFootnoteAccess; }
+        IDocumentMarkAccess* m_pMarkAccess;
+        IDocumentUndoRedo* m_pUndoRedo;
+        IDocumentLayoutAccess* m_pLayoutAcess;
+        ::sw::format::IDocumentFormatAccess* m_pFormatAccess;
+        ::sw::pagedesc::IDocumentPageDescAccess* m_pPageDescAccess;
+        ::sw::pagedesc::IDocumentFootnoteAccess* m_pFootnoteAccess;
+    };
+}}
+
+#endif

sw/source/core/attr/calbck.cxx

 	return bRet;		// und weiter
 }
 
+void SwModify::Broadcast(SfxPoolItem* pOldValue, SfxPoolItem* pNewValue)
+{
+    SwClientIter aIter(*this);
+    for(SwClient* pLast = aIter.First(TYPE(SwClient)); pLast; pLast = aIter.Next())
+        pLast->Modify(pOldValue, pNewValue);
+}
+
+void SwModify::Broadcast(SfxPoolItem* pOldValue, SfxPoolItem* pNewValue, TypeId nType)
+{
+    SwClientIter aIter(*this);
+    for(SwClient* pLast = aIter.First(nType); pLast; pLast = aIter.Next())
+        pLast->Modify(pOldValue, pNewValue);
+}
+
 /*************************************************************************
 |*	  SwModify::Add( SwClient *pDepend )
 |*

sw/source/core/bastyp/init.cxx

 #include <com/sun/star/i18n/CollatorOptions.hpp>
 #include <unotools/transliterationwrapper.hxx>
 #include <editeng/acorrcfg.hxx>
-#include <vcl/svapp.hxx>
 #include <fmtanchr.hxx>
 #include <fmtornt.hxx>
 #include <fmtsrnd.hxx>
 #include <checkit.hxx>
 #include <swcalwrp.hxx>
 #include <SwStyleNameMapper.hxx>
-
-// OD 09.10.2003 #i18732#
 #include <fmtfollowtextflow.hxx>
-// OD 2004-05-05 #i28701#
 #include <fmtwrapinfluenceonobjpos.hxx>
-
 #include <fmtmeta.hxx>
+#include <swapplication.hxx>
 
 
 using namespace ::com::sun::star;
 extern void _FrmFinit();
 extern void ClearFEShellTabCols();
 
+::boost::shared_ptr< ::sw::Application> sw::Application::our_pInstance = ::boost::shared_ptr< ::sw::Application>();
+
+void ::sw::Application::SetTestInstance(::boost::shared_ptr< ::sw::Application> io_pInstance)
+{
+    our_pInstance = io_pInstance;
+}
+
 /*************************************************************************
 |*	einige Bereiche fuer die Set in Collections / Nodes
 |*************************************************************************/
 };
 
 
-USHORT* SwAttrPool::pVersionMap1 = 0;
-USHORT* SwAttrPool::pVersionMap2 = 0;
-USHORT* SwAttrPool::pVersionMap3 = 0;
-USHORT* SwAttrPool::pVersionMap4 = 0;
-// OD 2004-01-21 #i18732#
-USHORT* SwAttrPool::pVersionMap5 = 0;
-USHORT* SwAttrPool::pVersionMap6 = 0;
 SwIndexReg* SwIndexReg::pEmptyIndexArray = 0;
 
 const sal_Char* __FAR_DATA pMarkToTable		= "table";
 }
 void _InitCore()
 {
-	SfxPoolItem* pItem;
+    _InitAttrTab(true);
 
+    SwAttrPool::InitVersionMaps();
+    uno::Reference<
+            lang::XMultiServiceFactory > xMSF =
+									::comphelper::getProcessServiceFactory();
+
+	SwBreakIt::_Create( xMSF );
+    pCheckIt = NULL;
+	/*pAppCharClass = new CharClass(
+		xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));*/
+	//pCalendarWrapper = new SwCalendarWrapper( xMSF );
+
+	_FrmInit();
+	_TextInit();
+
+	SwSelPaintRects::pMapMode = new MapMode;
+	SwFntObj::pPixMap = new MapMode;
+
+	SwIndexReg::pEmptyIndexArray = new SwIndexReg;
+
+	pGlobalOLEExcludeList = new SvPtrarr;
+
+	const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+	SwDoc::pACmpltWords = new SwAutoCompleteWord( rAFlags.nAutoCmpltListLen,
+											rAFlags.nAutoCmpltWordLen );
+}
+
+bool SwAttrPool::isAttrTabInited = false;
+bool SwAttrPool::isVersionMapInited = false;
+
+void _InitAttrTab(bool bUseOutputDevice)
+{
+    if(SwAttrPool::isAttrTabInited)
+        return;
+ 
 	// erstmal alle Attribut-Pointer auf 0 setzen
 	memset( aAttrTab, 0, (POOLATTR_END - POOLATTR_BEGIN) *
 							sizeof( SfxPoolItem* ) );
     aAttrTab[ RES_PARATR_ORPHANS- POOLATTR_BEGIN ] = new SvxOrphansItem( 0, RES_PARATR_ORPHANS );
     aAttrTab[ RES_PARATR_TABSTOP- POOLATTR_BEGIN ] = new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
 
-    pItem = new SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE );
-	((SvxHyphenZoneItem*)pItem)->GetMaxHyphens() = 0; // Default z.Z. auf 0
-    aAttrTab[ RES_PARATR_HYPHENZONE- POOLATTR_BEGIN ] = pItem;
+    {
+        SfxPoolItem* pItem = new SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE );
+        ((SvxHyphenZoneItem*)pItem)->GetMaxHyphens() = 0; // Default z.Z. auf 0
+        aAttrTab[ RES_PARATR_HYPHENZONE- POOLATTR_BEGIN ] = pItem;
+    }
 
 	aAttrTab[ RES_PARATR_DROP- POOLATTR_BEGIN ] = new SwFmtDrop;
 	aAttrTab[ RES_PARATR_REGISTER - POOLATTR_BEGIN ] = new SwRegisterItem( FALSE );
 	aAttrTab[ RES_UNKNOWNATR_CONTAINER- POOLATTR_BEGIN ] =
 				new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER );
 
-	// get the correct fonts:
-	::GetDefaultFonts( *(SvxFontItem*)aAttrTab[ RES_CHRATR_FONT- POOLATTR_BEGIN ],
-					   *(SvxFontItem*)aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ],
-					   *(SvxFontItem*)aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] );
+	// use real fonts when an output device is available for query
+    if(bUseOutputDevice)
+    {
+        ::GetDefaultFonts( *(SvxFontItem*)aAttrTab[ RES_CHRATR_FONT - POOLATTR_BEGIN ],
+                           *(SvxFontItem*)aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ],
+                           *(SvxFontItem*)aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] );
+    }
+    else
+    {
+        aAttrTab[ RES_CHRATR_FONT - POOLATTR_BEGIN ] = new SvxFontItem(RES_CHRATR_FONT);
+        aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ] = new SvxFontItem(RES_CHRATR_CJK_FONT);
+        aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] = new SvxFontItem(RES_CHRATR_CTL_FONT);
+    }
+    SwAttrPool::isAttrTabInited = true;
+}
 
+USHORT* SwAttrPool::pVersionMap1 = 0;
+USHORT* SwAttrPool::pVersionMap2 = 0;
+USHORT* SwAttrPool::pVersionMap3 = 0;
+USHORT* SwAttrPool::pVersionMap4 = 0;
+USHORT* SwAttrPool::pVersionMap5 = 0;
+USHORT* SwAttrPool::pVersionMap6 = 0;
+void SwAttrPool::InitVersionMaps()
+{
+    if(isVersionMapInited)
+        return;
 	// 1. Version - neue Attribute:
 	//		- RES_CHRATR_BLINK
 	//		- RES_CHRATR_NOHYPHEN
 	//		- RES_CHRATR_NOLINEBREAK
 	// 		- RES_PARATR_REGISTER
 	// 		+ 2 Dummies fuer die einzelnen "Bereiche"
-	SwAttrPool::pVersionMap1 = new USHORT[ 60 ];
+	pVersionMap1 = new USHORT[ 60 ];
 	USHORT i;
 	for( i = 1; i <= 17; i++ )
-		SwAttrPool::pVersionMap1[ i-1 ] = i;
+		pVersionMap1[ i-1 ] = i;
 	for ( i = 18; i <= 27; ++i )
-		SwAttrPool::pVersionMap1[ i-1 ] = i + 5;
+		pVersionMap1[ i-1 ] = i + 5;
 	for ( i = 28; i <= 35; ++i )
-		SwAttrPool::pVersionMap1[ i-1 ] = i + 7;
+		pVersionMap1[ i-1 ] = i + 7;
 	for ( i = 36; i <= 58; ++i )
-		SwAttrPool::pVersionMap1[ i-1 ] = i + 10;
+		pVersionMap1[ i-1 ] = i + 10;
 	for ( i = 59; i <= 60; ++i )
-		SwAttrPool::pVersionMap1[ i-1 ] = i + 12;
+		pVersionMap1[ i-1 ] = i + 12;
 
 	// 2. Version - neue Attribute:
 	// 		10 Dummies fuer den Frame "Bereich"
-	SwAttrPool::pVersionMap2 = new USHORT[ 75 ];
+	pVersionMap2 = new USHORT[ 75 ];
 	for( i = 1; i <= 70; i++ )
-		SwAttrPool::pVersionMap2[ i-1 ] = i;
+		pVersionMap2[ i-1 ] = i;
 	for ( i = 71; i <= 75; ++i )
-		SwAttrPool::pVersionMap2[ i-1 ] = i + 10;
+		pVersionMap2[ i-1 ] = i + 10;
 
 	// 3. Version - neue Attribute:
 	// 		neue Attribute und Dummies fuer die CJK-Version
 	// 		und neue Grafik-Attribute
-	SwAttrPool::pVersionMap3 = new USHORT[ 86 ];
+	pVersionMap3 = new USHORT[ 86 ];
 	for( i = 1; i <= 21; i++ )
-		SwAttrPool::pVersionMap3[ i-1 ] = i;
+		pVersionMap3[ i-1 ] = i;
 	for ( i = 22; i <= 27; ++i )
-		SwAttrPool::pVersionMap3[ i-1 ] = i + 15;
+		pVersionMap3[ i-1 ] = i + 15;
 	for ( i = 28; i <= 82; ++i )
-		SwAttrPool::pVersionMap3[ i-1 ] = i + 20;
+		pVersionMap3[ i-1 ] = i + 20;
 	for ( i = 83; i <= 86; ++i )
-		SwAttrPool::pVersionMap3[ i-1 ] = i + 35;
+		pVersionMap3[ i-1 ] = i + 35;
 
 	// 4. Version - neue Paragraph Attribute fuer die CJK-Version
-	SwAttrPool::pVersionMap4 = new USHORT[ 121 ];
+	pVersionMap4 = new USHORT[ 121 ];
 	for( i = 1; i <= 65; i++ )
-		SwAttrPool::pVersionMap4[ i-1 ] = i;
+		pVersionMap4[ i-1 ] = i;
 	for ( i = 66; i <= 121; ++i )
-		SwAttrPool::pVersionMap4[ i-1 ] = i + 9;
+		pVersionMap4[ i-1 ] = i + 9;
 
     // OD 2004-01-21 #i18732# - setup new version map due to extension of
     // the frame attributes (RES_FRMATR_*) for binary filters.
-    SwAttrPool::pVersionMap5 = new USHORT[ 130 ];
+    pVersionMap5 = new USHORT[ 130 ];
     for( i = 1; i <= 109; i++ )
-        SwAttrPool::pVersionMap5[ i-1 ] = i;
+        pVersionMap5[ i-1 ] = i;
     for ( i = 110; i <= 130; ++i )
-        SwAttrPool::pVersionMap5[ i-1 ] = i + 6;
+        pVersionMap5[ i-1 ] = i + 6;
 
     // 6. Version - new character attribute for overlining plus 2 dummies
-    SwAttrPool::pVersionMap6 = new USHORT[ 136 ];
+    pVersionMap6 = new USHORT[ 136 ];
     for( i = 1; i <= 37; i++ )
-        SwAttrPool::pVersionMap6[ i-1 ] = i;
+        pVersionMap6[ i-1 ] = i;
     for ( i = 38; i <= 136; ++i )
-        SwAttrPool::pVersionMap6[ i-1 ] = i + 3;
-
-    uno::Reference<
-            lang::XMultiServiceFactory > xMSF =
-									::comphelper::getProcessServiceFactory();
-
-	SwBreakIt::_Create( xMSF );
-    pCheckIt = NULL;
-	/*pAppCharClass = new CharClass(
-		xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));*/
-	//pCalendarWrapper = new SwCalendarWrapper( xMSF );
-
-	_FrmInit();
-	_TextInit();
-
-	SwSelPaintRects::pMapMode = new MapMode;
-	SwFntObj::pPixMap = new MapMode;
-
-	SwIndexReg::pEmptyIndexArray = new SwIndexReg;
-
-	pGlobalOLEExcludeList = new SvPtrarr;
-
-	const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
-	SwDoc::pACmpltWords = new SwAutoCompleteWord( rAFlags.nAutoCmpltListLen,
-											rAFlags.nAutoCmpltWordLen );
+        pVersionMap6[ i-1 ] = i + 3;
+    isVersionMapInited = true;
 }
 
 /******************************************************************************
 
 LanguageType GetAppLanguage()
 {
-	return Application::GetSettings().GetLanguage();
+	return ::sw::Application::GetInstance()->GetLanguage();
 }
 
 CollatorWrapper& GetAppCollator()

sw/source/core/bastyp/makefile.mk

 
 # --- Files --------------------------------------------------------
 
-CXXFILES = \
-		bparr.cxx \
-		breakit.cxx \
-		calc.cxx \
-		checkit.cxx \
-		index.cxx \
-		init.cxx \
-		ring.cxx \
-		swcache.cxx \
-		swrect.cxx \
-		swregion.cxx \
-		swtypes.cxx \
-		tabcol.cxx \
-		SwSmartTagMgr.cxx
-
 SLOFILES =	\
 		$(SLO)$/bparr.obj \
 		$(SLO)$/breakit.obj \
 		$(SLO)$/SwSmartTagMgr.obj
 
 EXCEPTIONSFILES = \
+		$(SLO)$/init.obj \
 		$(SLO)$/tabcol.obj
 
 # --- Tagets -------------------------------------------------------

sw/source/core/doc/PageDescManager.hxx

 #ifndef _SW_PAGEDESC_PAGEDESCMANAGER_HXX
 #define _SW_PAGEDESC_PAGEDESCMANAGER_HXX
 
+#include <swdllapi.h>
 #include <IDocumentPageDescAccess.hxx>
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
 namespace sw { namespace pagedesc
 {
-    class PageDescManager
-    : private ::boost::noncopyable
-    , public ::sw::pagedesc::IDocumentPageDescAccess
+    class SW_DLLPUBLIC PageDescManager
+        : private ::boost::noncopyable
+        , public ::sw::pagedesc::IDocumentPageDescAccess
     {
-    public:
-        typedef ::sw::pagedesc::IDocumentPageDescAccess::index_type index_type;
-        PageDescManager(IDocumentUndoRedo* io_pUndoRedo, ::sw::format::IDocumentFormatAccess* io_pFormatAccess, SwAttrPool* io_pPool, SfxBroadcaster* io_pStyleOperationBroadcaster, SfxBroadcaster* io_pModelEventBroadcaster);
-        static PageDescManager* Create(IDocumentUndoRedo* io_pUndoRedo, ::sw::format::IDocumentFormatAccess* io_pFormatAccess, SwAttrPool* io_pPool, SfxBroadcaster* io_pStyleOperationBroadcaster, SfxBroadcaster* io_pModelEventBroadcaster)
-            { return new PageDescManager(io_pUndoRedo, io_pFormatAccess, io_pPool, io_pStyleOperationBroadcaster, io_pModelEventBroadcaster); };
-        virtual difference_type GetPageDescCnt() const
-        { return m_vPageDescs.size(); };
-        virtual SwPageDesc* GetDefaultPageDesc()
-        {
-            OSL_ENSURE(m_pDefaultPageDesc.get(), "<PageDescManager:GetDefaultPageDesc(..)>"
-                " - no default page description available.");
-            return m_pDefaultPageDesc.get();
-        }
-        virtual const SwPageDesc* GetDefaultPageDesc() const
-            { return const_cast<PageDescManager*>(this)->GetDefaultPageDesc(); }
-        virtual SwPageDesc* GetPageDescByName(const index_type& rName);
-        virtual const SwPageDesc* GetPageDescByName(const index_type& rName) const
-            { return const_cast<PageDescManager*>(this)->GetPageDescByName(rName); }
-        virtual SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId);
-        virtual const SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId) const
-            { return const_cast<PageDescManager*>(this)->GetPageDescByPoolFmtId(nId); }
-        virtual SwPageDesc* MakePageDesc(const index_type &rName, const SwPageDesc* pCpy=NULL, bool bRegardLanguage=true, bool bBroadcast=false);
-        virtual void DelPageDesc(const index_type& rName, bool bBroadcast=false);
-        virtual void DelAllPageDescs(bool bBroadcast);
-        virtual void CheckDefaultPageFmt();
-        // dispose removes all pagedescs including the default pagedesc
-        // it is only to be called by the document upon destruction
-        void Dispose();
+        public:
+            typedef ::sw::pagedesc::IDocumentPageDescAccess::index_type index_type;
+            PageDescManager(IDocumentUndoRedo* io_pUndoRedo, ::sw::format::IDocumentFormatAccess* io_pFormatAccess, SwAttrPool* io_pPool, SfxBroadcaster* io_pStyleOperationBroadcaster, SfxBroadcaster* io_pModelEventBroadcaster);
+            static PageDescManager* Create(IDocumentUndoRedo* io_pUndoRedo, ::sw::format::IDocumentFormatAccess* io_pFormatAccess, SwAttrPool* io_pPool, SfxBroadcaster* io_pStyleOperationBroadcaster, SfxBroadcaster* io_pModelEventBroadcaster)
+                { return new PageDescManager(io_pUndoRedo, io_pFormatAccess, io_pPool, io_pStyleOperationBroadcaster, io_pModelEventBroadcaster); };
+            virtual difference_type GetPageDescCnt() const
+            { return m_vPageDescs.size(); };
+            virtual SwPageDesc* GetDefaultPageDesc()
+            {
+                OSL_ENSURE(m_pDefaultPageDesc.get(), "<PageDescManager:GetDefaultPageDesc(..)>"
+                    " - no default page description available.");
+                return m_pDefaultPageDesc.get();
+            }
+            virtual const SwPageDesc* GetDefaultPageDesc() const
+                { return const_cast<PageDescManager*>(this)->GetDefaultPageDesc(); }
+            virtual SwPageDesc* GetPageDescByName(const index_type& rName);
+            virtual const SwPageDesc* GetPageDescByName(const index_type& rName) const
+                { return const_cast<PageDescManager*>(this)->GetPageDescByName(rName); }
+            virtual SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId);
+            virtual const SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId) const
+                { return const_cast<PageDescManager*>(this)->GetPageDescByPoolFmtId(nId); }
+            virtual SwPageDesc* MakePageDesc(const index_type &rName, const SwPageDesc* pCpy=NULL, bool bRegardLanguage=true, bool bBroadcast=false);
+            virtual void DelPageDesc(const index_type& rName, bool bBroadcast=false);
+            virtual void DelAllPageDescs(bool bBroadcast);
+            virtual void CheckDefaultPageFmt();
+            // dispose removes all pagedescs including the default pagedesc
+            // it is only to be called by the document upon destruction
+            void Dispose();
 
-    private:
-        typedef ::std::vector< ::boost::shared_ptr< SwPageDesc > > container_t;
-        IDocumentUndoRedo* const m_pUndoRedo;
-        ::sw::format::IDocumentFormatAccess* const m_pFormatAccess;
-        SwAttrPool* m_pAttrPool;
-        SfxBroadcaster* const m_pStyleOperationBroadcaster;
-        SfxBroadcaster* const m_pModelEventBroadcaster;
-        container_t m_vPageDescs;
-        ::boost::shared_ptr< SwPageDesc > m_pDefaultPageDesc;
+        private:
+            typedef ::std::vector< ::boost::shared_ptr< SwPageDesc > > container_t;
+            IDocumentUndoRedo* const m_pUndoRedo;
+            ::sw::format::IDocumentFormatAccess* const m_pFormatAccess;
+            SwAttrPool* m_pAttrPool;
+            SfxBroadcaster* const m_pStyleOperationBroadcaster;
+            SfxBroadcaster* const m_pModelEventBroadcaster;
+            container_t m_vPageDescs;
+            ::boost::shared_ptr< SwPageDesc > m_pDefaultPageDesc;
 
 
-        void CopyPageDescHeaderFooter(bool bCpyHeader, const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt);
-        void DelPageDesc(container_t::iterator ppPageDesc, bool bBroadcast=false);
-        container_t::iterator FindByName(const index_type& rName);
-        container_t::iterator FindByPoolFmtId(sal_uInt16 nId);
-        virtual void ForEach_Impl(IDocumentPageDescAccess::foreach_functor_type f);
-        SvxFrameDirection GetDfltFrameDirForCurrentLang();
+            void CopyPageDescHeaderFooter(bool bCpyHeader, const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt);
+            void DelPageDesc(container_t::iterator ppPageDesc, bool bBroadcast=false);
+            container_t::iterator FindByName(const index_type& rName);
+            container_t::iterator FindByPoolFmtId(sal_uInt16 nId);
+            virtual void ForEach_Impl(IDocumentPageDescAccess::foreach_functor_type f);
+            virtual SvxFrameDirection GetDfltFrameDirForCurrentLang();
     };
 }}
 #endif

sw/source/core/layout/makefile.mk

     $(SLO)$/paintfrm.obj \
     $(SLO)$/softpagebreak.obj \
     $(SLO)$/sortedobjsimpl.obj \
-    $(SLO)$/pagechg.obj
+    $(SLO)$/pagechg.obj \
+    $(SLO)$/pagedesc.obj \
 
 
 SLOFILES =  \

sw/source/core/layout/pagedesc.cxx

 #include <rootfrm.hxx>
 #include <swtable.hxx>
 #include <IDocumentPageDescAccess.hxx>
+#include <swapplication.hxx>
 
 SwPageDesc::SwPageDesc( const String& rName, SwFrmFmt* pFmt, SwAttrPool* pPool) :
 	SwModify( 0 ),
     {
         SetFtnInfo(pSrc->GetFtnInfo());
         SwMsgPoolItem aInfo(RES_PAGEDESC_FTNINFO);
-        {
-            SwClientIter aIter(GetMaster());
-            for(SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
-                    pLast = aIter.Next())
-                pLast->Modify(&aInfo, 0);
-        }
-        {
-            SwClientIter aIter(GetLeft());
-            for(SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
-                    pLast = aIter.Next())
-                pLast->Modify(&aInfo, 0);
-        }
+        GetMaster().Broadcast(&aInfo, NULL, TYPE(SwFrm));
+        GetLeft().Broadcast(&aInfo,	NULL, TYPE(SwFrm));
     }
 }
 
 void SwPageDesc::Dispose()
 {
-    SwDoc* const pDoc = GetMaster().GetDoc();
-    ::sw::pagedesc::IDocumentPageDescAccess* const pPageDescAccess(pDoc->getIDocumentPageDescAccess());
+    ::sw::IDocumentInterfaceProvider* const pIProvider = GetMaster().GetDoc();
+    ::sw::pagedesc::IDocumentPageDescAccess* const pPageDescAccess(pIProvider->getIDocumentPageDescAccess());
+    ::sw::pagedesc::IDocumentFootnoteAccess* const pFootnoteAccess(pIProvider->getIDocumentFootnoteAccess());
+    IDocumentLayoutAccess* const pLayoutAccess(pIProvider->getIDocumentLayoutAccess());
     SwFmtPageDesc aDfltDesc(pPageDescAccess->GetDefaultPageDesc());
     SwClient* pLast;
     // move all clients to other page descriptions
     while(NULL != (pLast = const_cast<SwClient*>(GetDepends())))
     {
-        SwFmtPageDesc* pPageDesc = dynamic_cast<SwFmtPageDesc*>(pLast);
-        if(pPageDesc)
+        SwFmtPageDesc* pFmtPageDesc = dynamic_cast<SwFmtPageDesc*>(pLast);
+        if(pFmtPageDesc)
         {
-            SwModify* pMod = const_cast<SwModify*>(pPageDesc->GetDefinedIn());
+            SwModify* pMod = const_cast<SwModify*>(pFmtPageDesc->GetDefinedIn());
             if(pMod)
             {
                 SwCntntNode* pCntntNode;
         // there may still be undo copies around
         if(pLast->GetRegisteredIn() == this)
             pPageDescAccess->GetDefaultPageDesc()->Add(pLast);
-        SwRootFrm* pRootFrm = pDoc->GetRootFrm();
+        SwRootFrm* pRootFrm = pLayoutAccess->GetRootFrm();
         if(pRootFrm)
         {
-            if(pLast == pDoc->GetFtnInfo().GetPageDescDep())
-                pDoc->GetRootFrm()->CheckFtnPageDescs(false);
-            else if(pLast == pDoc->GetEndNoteInfo().GetPageDescDep())
-                pDoc->GetRootFrm()->CheckFtnPageDescs(true);
+            if(pLast == pFootnoteAccess->GetFtnInfo().GetPageDescDep())
+                pRootFrm->CheckFtnPageDescs(false);
+            else if(pLast == pFootnoteAccess->GetEndNoteInfo().GetPageDescDep())
+                pRootFrm->CheckFtnPageDescs(true);
         }
     }
 }
 void SwPageDesc::ResetToDefaultPageFormat()
 {
     SwFmtFrmSize aFrmSize( ATT_FIX_SIZE );
-    const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
+    const Size aPhysSize = ::sw::Application::GetInstance()->GetDefaultPaperSize();
     aFrmSize.SetSize( aPhysSize );
 
     //Auf Default-Raender vorbereiten.
         nMinRight = nMinTop = nMinBottom = GetMetricVal( CM_1 );
         nMinLeft = nMinRight * 2;
     }
-    else if( MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() )
+    else if( MEASURE_METRIC == ::sw::Application::GetInstance()->GetMeasurementSystem() )
     {
         nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; //2 Zentimeter
     }
 
     nRegHeight = 0;
 	{
+        // Shouldnt this be:
+        // GetMaster().Broadcast(PagePreRegisterChg, NULL, TYPE(SwPageFrm));
 		SwClientIter aIter( GetMaster() );
 		for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
 				pLast = aIter.Next() )
 		}
 	}
 	{
+        // Shouldnt this be:
+        // GetLeft().Broadcast(PagePreRegisterChg, NULL, TYPE(SwPageFrm));
 		SwClientIter aIter( GetLeft() );
 		for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
 				pLast = aIter.Next() )
 	return bRet;
 }
 
-/*************************************************************************
-|*
-|*	SwPageFtnInfo::SwPageFtnInfo()
-|*
-|*	Ersterstellung		MA 24. Feb. 93
-|*	Letzte Aenderung	MA 24. Feb. 93
-|*
-|*************************************************************************/
-
 
 
 SwPageFtnInfo::SwPageFtnInfo() :
 	nMaxHeight( 0 ),
-//	aPen( PEN_SOLID ),
 	nLineWidth(10),
 	aWidth( 25, 100 ),
     nTopDist( 57 ),         //1mm
     eAdj = FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ?
            FTNADJ_RIGHT :
            FTNADJ_LEFT;
-//	aPen.SetWidth( 10 );
 }