Commits

Michael Stahl  committed e5e7c90 Merge

swbookmarkfixes01: merge heads

  • Participants
  • Parent commits 5266778, aafeabd

Comments (0)

Files changed (21)

File sw/inc/CheckPageDescHint.hxx

 
 namespace sw { namespace pagedesc {
 
-class CheckPageDescHint : public SfxHint {};
+class SW_DLLPUBLIC CheckPageDescHint : public SfxHint
+{
+};
 
 }}
 #endif

File sw/inc/PageDescDisposingHint.hxx

 
 namespace sw { namespace pagedesc {
 
-class PageDescDisposingHint : public SfxHint
+class SW_DLLPUBLIC PageDescDisposingHint : public SfxHint
 {
     public:
         PageDescDisposingHint(const SwPageDesc* const pPageDesc) : m_pPageDesc(pPageDesc) {};
+        virtual ~PageDescDisposingHint() {};
         const SwPageDesc* GetPageDesc() const { return m_pPageDesc; };
     private:
         const SwPageDesc* const m_pPageDesc;

File sw/inc/StyleOperationHint.hxx

 
 namespace sw { namespace style {
 
-class StyleOperationHint : public SfxHint
+class SW_DLLPUBLIC StyleOperationHint : public SfxHint
 {
     public:
         StyleOperationHint(String rName, SfxStyleFamily eFamily, sal_Int32 nOp)
             , m_eFamily(eFamily)
             , m_nOp(nOp)
         {};
+        virtual ~StyleOperationHint() {};
         const String& GetName() const { return m_rName; };
         SfxStyleFamily GetStyleFamily() const { return m_eFamily; };
         sal_Int32 GetOp() const { return m_nOp; };

File sw/inc/SwUndoPageDesc.hxx

     virtual SwRewriter GetRewriter() const;
 };
 
-class SwUndoPageDescCreate : public SwUndo
+class SW_DLLPUBLIC SwUndoPageDescCreate : public SwUndo
 {
     SwPageDescExt m_aNew;
     IDocumentUndoRedo* const m_pUndoRedo;
     virtual SwRewriter GetRewriter() const;
 };
 
-class SwUndoPageDescDelete : public SwUndo
+class SW_DLLPUBLIC SwUndoPageDescDelete : public SwUndo
 {
     SwPageDescExt m_aOld;
     IDocumentUndoRedo* m_pUndoRedo;

File sw/inc/calbck.hxx

 	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

File sw/inc/doc.hxx

     */
     virtual ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() { return this; };
     virtual const ::sw::pagedesc::IDocumentFootnoteAccess* getIDocumentFootnoteAccess() const { return this; };
-    // Fussnoten Informationen
     virtual const SwFtnInfo& GetFtnInfo() const         { return *pFtnInfo; }
     virtual void SetFtnInfo(const SwFtnInfo& rInfo);
     virtual const SwEndNoteInfo& GetEndNoteInfo() const { return *pEndNoteInfo; }
     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

File sw/inc/fmtfld.hxx

 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

File sw/inc/init.hxx

 #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

File sw/inc/swatrset.hxx

 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; }

File sw/inc/tox.hxx

     : public SfxPoolItem
     , public SwModify
 {
-	friend void _InitCore();
+	friend void _InitAttrTab(bool);
 	friend class SwTxtTOXMark;
 
 	String aAltText; 	// Der Text des Eintrages ist unterschiedlich

File sw/inc/undobj.hxx

 
 #include <svx/svdundo.hxx> // #111827#
 
+#include <swdllapi.h>
 #include <numrule.hxx>
 #include <itabenum.hxx>
 #include <format.hxx>
 typedef SwRedlineSaveData* SwRedlineSaveDataPtr;
 SV_DECL_PTRARR_DEL( SwRedlineSaveDatas, SwRedlineSaveDataPtr, 8, 8 )
 
-class SwUndo
+class SW_DLLPUBLIC SwUndo
 {
     SwUndoId nId;
 	USHORT nOrigRedlineMode;

File sw/prj/build.lst

 # sw sw\qa\complex\writer             nmake - all sw_qa_complex_writer sw_util NULL
 sw sw\qa\unoapi                     nmake - all sw_qa_unoapi sw_util 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

File sw/qa/core/PageDescManager/PageDescManagerTest.cxx

 *
 ************************************************************************/
 
+#undef SW_DLLIMPLEMENTATION
 #include "precompiled_sw.hxx"
 #include <sal/config.h>
 
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
 
+#include <set>
+#include <vector>
+
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include <tools/rtti.hxx>
-#include <rsc/rscsfx.hxx>
-#include <svl/style.hxx>
-#include <editeng/frmdir.hxx>
-#include <set>
-#include <vector>
+#include <swatrset.hxx>
+#include <init.hxx>
+#include <svl/brdcst.hxx>
 
-#define _SWATRSET_HXX
-#include <svl/itemset.hxx>
-#include <svl/itempool.hxx>
+#include <StyleOperationHint.hxx>
+#include <CheckPageDescHint.hxx>
+#include <PageDescDisposingHint.hxx>
 
 class IDocumentSettingAccess;
 class OutputDevice;
     };
 }}
 
-#define SW_UNDOBJ_HXX
-struct SwUndo
-{
-    virtual ~SwUndo() {};
-};
-class SwUndoIter {};
-class SwRewriter {};
+#include <source/core/doc/PageDescManager.hxx>
+#include <pagedesc.hxx>
+#include <SwUndoPageDesc.hxx>
 
 #define _SW_UNDO_PAGE_DESC_HXX
 #include <IDocumentUndoRedo.hxx>
 using namespace ::sw::pagedesc;
 using namespace ::sw::style;
 using namespace ::sw::mock;
+using namespace ::sw::format;
+
+#include <svl/lstner.hxx>
 namespace
 {
     struct BroadcastRecorder : public BroadcastRecorderBase
     {
         virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
         {
+            //OSL_TRACE("Received hint of type %s", typeid(rHint).name());
             if( const StyleOperationHint* pStyleHint = dynamic_cast<const StyleOperationHint*>(&rHint) )
                 RecordHint(rBC, new StyleOperationHint(*pStyleHint));
-            else if( const CheckPageDescHint* pCeckPDHint = dynamic_cast<const CheckPageDescHint*>(&rHint) )
+            else if( const ::sw::pagedesc::CheckPageDescHint* pCeckPDHint = dynamic_cast<const ::sw::pagedesc::CheckPageDescHint*>(&rHint) )
                 RecordHint(rBC, new CheckPageDescHint(*pCeckPDHint));
             else if( const PageDescDisposingHint* pPDDisposeHint = dynamic_cast<const PageDescDisposingHint*>(&rHint) )
                 RecordHint(rBC, new PageDescDisposingHint(*pPDDisposeHint));
             else
+            {
+                //OSL_TRACE("Unknown hint");
                 RecordHint(rBC, new SfxHint(rHint));
+            }
         }
     };
 }
+
 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:
+            ~PageDescManagerTest()
+            {
+                // Those undo objects better die before the SwAttrPool does ....
+                m_pUndoRedo.reset();
+            }
             void Create();
             void MakePageDesc();
             void MakePageDesc_Copy();
         private:
             void Setup();
             void AddPageDesc(const String& rName);
-            scoped_ptr<UndoRedoMock> m_pUndoRedo;
+            scoped_ptr<InterfaceProviderMockBase> m_pInterfaceProvider;
+            scoped_ptr<UndoRedoMockBase> m_pUndoRedo;
             scoped_ptr<FormatAccessMockBase> m_pFormatAccess;
             scoped_ptr<SwAttrPool> m_pPool;
             scoped_ptr<SfxBroadcaster> m_pStyleOperationBroadcaster;
             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()
 {
-    m_pUndoRedo.reset(new UndoRedoMock());
+    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 UndoRedoMockBase());
+    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);

File sw/qa/core/PageDescManager/makefile.mk

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

File sw/qa/core/inc/mock/FootnoteAccessMockBase.hxx

File contents unchanged.

File 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 )
 |*

File 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()

File 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 -------------------------------------------------------

File 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

File 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 =  \

File 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 );
 }