Commits

Anonymous committed dcfce91 Merge

swbookmarkfixes01: resync to DEV300m91

  • Participants
  • Parent commits d75b2e7, 8bd6c92

Comments (0)

Files changed (136)

File sfx2/source/dialog/mgetempl.cxx

 		pPool->First();     // fuer SW - interne Liste updaten
 	}
 
+    // Superficial at least for PageDescs in Writer
 	if ( !pStyle->GetName().Len() && pPool )
 	{
 		// NullString als Name -> Name generieren
 		}
 		pStyle->SetName( aNoName );
 		aName = aNoName;
-		aFollow = pStyle->GetFollow();
-		aParent = pStyle->GetParent();
+        // These are already set in the initializer list
+		//aFollow = pStyle->GetFollow();
+		//aParent = pStyle->GetParent();
 	}
 	aNameEd.SetText(pStyle->GetName());
 

File sw/inc/CheckPageDescHint.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 _CHECKPAGEDESCHINT_HXX
+#define _CHECKPAGEDESCHINT_HXX
+
+#include <svl/hint.hxx>
+
+namespace sw { namespace pagedesc {
+
+class CheckPageDescHint : public SfxHint {};
+
+}}
+#endif

File 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

File sw/inc/IDocumentFormatAccess.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 IDOCUMENTFORMATACCESS_HXX_INCLUDED
+#define IDOCUMENTFORMATACCESS_HXX_INCLUDED
+
+class SwFrmFmt;
+class SwCharFmt;
+
+namespace sw { namespace format
+{
+    class IDocumentFormatAccess
+    {
+        public:
+            virtual const SwFrmFmt* GetDfltFrmFmt() const =0;
+            virtual SwFrmFmt* GetDfltFrmFmt() =0;
+            virtual const SwFrmFmt* GetEmptyPageFmt() const =0;
+            virtual SwFrmFmt* GetEmptyPageFmt() =0;
+            virtual const SwFrmFmt* GetColumnContFmt() const =0;
+            virtual SwFrmFmt* GetColumnContFmt() =0;
+            virtual const SwCharFmt* GetDfltCharFmt() const =0;
+            virtual SwCharFmt* GetDfltCharFmt() =0;
+            virtual ~IDocumentFormatAccess() {};
+    };
+}}
+#endif

File 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

File sw/inc/IDocumentLayoutAccess.hxx

     virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor,
                                      bool bSetTxtFlyAtt, bool bMakeFrms ) = 0;
 
-protected:
-
     virtual ~IDocumentLayoutAccess() {};
  };
 

File sw/inc/IDocumentMarkAccess.hxx

             const ::rtl::OUString& rProposedName,
             MarkType eMark) =0;
 
-        virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM, 
-            const rtl::OUString& rName, 
+        virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM,
+            const rtl::OUString& rName,
             const rtl::OUString& rType) = 0;
-        virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM, 
-            const rtl::OUString& rName, 
+        virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM,
+            const rtl::OUString& rName,
             const rtl::OUString& rType) = 0;
 
         /** Returns a mark in the document for a paragraph.
             an iterator pointing to the mark, or pointing to getMarksEnd() if nothing was found. 
         */
         virtual const_iterator_t findMark(const ::rtl::OUString& rMark) const =0;
+        virtual bool hasMark(const ::rtl::OUString& rMark) const =0;
 
 
         // interface IBookmarks (BOOKMARK, CROSSREF_NUMITEM_BOOKMARK, CROSSREF_HEADING_BOOKMARK)

File sw/inc/IDocumentPageDescAccess.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 IDOCUMENTPAGEDESCACCESS_HXX_INCLUDED
+#define IDOCUMENTPAGEDESCACCESS_HXX_INCLUDED
+
+#include <sal/types.h>
+#include <boost/function.hpp>
+#include <boost/bind.hpp>
+
+class SwPageDesc;
+class SwFrmFmt;
+class String;
+class SfxListener;
+namespace rtl
+{
+    class OUString;
+}
+
+namespace sw { namespace pagedesc
+{
+    class IDocumentPageDescAccess
+    {
+        public:
+            typedef sal_Int32 difference_type;
+            typedef SwPageDesc* element_type;
+            typedef ::rtl::OUString index_type;
+            typedef ::boost::function<void (element_type)> foreach_functor_type;
+            typedef void (*foreach_funcptr_type)(element_type);
+            // Getters
+            virtual difference_type GetPageDescCnt() const =0;
+            virtual SwPageDesc* GetDefaultPageDesc() =0;
+            virtual const SwPageDesc* GetDefaultPageDesc() const =0;
+            virtual SwPageDesc* GetPageDescByName(const index_type& rName) =0;
+            virtual const SwPageDesc* GetPageDescByName(const index_type& rName) const =0;
+            virtual SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId) =0;
+            virtual const SwPageDesc* GetPageDescByPoolFmtId(sal_uInt16 nId) const =0;
+
+            // Creators
+            virtual SwPageDesc* MakePageDesc(const index_type &rName, const SwPageDesc* pCpy=NULL, bool bRegardLanguage=true, bool bBroadcast=false) =0;
+
+            // Deleters
+            virtual void DelPageDesc(const index_type& rName, bool bBroadcast=false) =0;
+            virtual void DelAllPageDescs(bool bBroadcast=false) =0;
+
+            // Checks and Fixes
+            // --> FME 2005-03-16 #i44963# The html import sometimes overwrites the
+            // page sizes set in the page descriptions. This function is used to
+            // correct this.
+            // FIXME: This belongs into the filter!!!
+            virtual void CheckDefaultPageFmt()=0;
+            // <--
+
+            // Interation
+            foreach_funcptr_type ForEach(foreach_funcptr_type f)
+            {
+                ForEach_Impl(static_cast<foreach_functor_type>(f));
+                return f;
+            }
+            template<typename T> T ForEach(T f)
+            {
+                ForEach_Impl(static_cast<foreach_functor_type>(::boost::bind(&T::operator(), &f, _1)));
+                return f;
+            }
+
+            virtual ~IDocumentPageDescAccess() {};
+        private:
+            virtual void ForEach_Impl(foreach_functor_type f) =0;
+    };
+}}
+#endif

File sw/inc/IDocumentUndoRedo.hxx

     /** Gets the position of the undo stack which reset the modified flag
     */
     virtual SwUndoNoModifiedPosition getUndoNoModifiedPosition() const = 0;
-    
-protected:
+
+    virtual void SetModified() = 0;
+
  	virtual ~IDocumentUndoRedo() {};
 };
  

File sw/inc/PageDescDisposingHint.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 _PAGEDESCDISPOSINGHINT_HXX
+#define _PAGEDESCDISPOSINGHINT_HXX
+
+#include <svl/hint.hxx>
+
+class SwPageDesc;
+
+namespace sw { namespace pagedesc {
+
+class PageDescDisposingHint : public SfxHint
+{
+    public:
+        PageDescDisposingHint(const SwPageDesc* const pPageDesc) : m_pPageDesc(pPageDesc) {};
+        const SwPageDesc* GetPageDesc() const { return m_pPageDesc; };
+    private:
+        const SwPageDesc* const m_pPageDesc;
+};
+
+}}
+#endif

File sw/inc/StyleOperationHint.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 _STYLEOPERATIONHINT_HXX
+#define _STYLEOPERATIONHINT_HXX
+
+#include <svl/hint.hxx>
+#include <tools/string.hxx>
+#include <rsc/rscsfx.hxx>
+#include <sal/types.h>
+
+namespace sw { namespace style {
+
+class StyleOperationHint : public SfxHint
+{
+    public:
+        StyleOperationHint(String rName, SfxStyleFamily eFamily, sal_Int32 nOp)
+            : m_rName(rName)
+            , m_eFamily(eFamily)
+            , m_nOp(nOp)
+        {};
+        const String& GetName() const { return m_rName; };
+        SfxStyleFamily GetStyleFamily() const { return m_eFamily; };
+        sal_Int32 GetOp() const { return m_nOp; };
+    private:
+        const String m_rName;
+        const SfxStyleFamily m_eFamily;
+        const sal_Int32 m_nOp;
+};
+
+}}
+#endif

File sw/inc/SwUndoPageDesc.hxx

 #include <undobj.hxx>
 #include <pagedesc.hxx>
 
+namespace sw { namespace pagedesc {
+    class IDocumentPageDescAccess;
+}}
+class IDocumentUndoRedo;
+class SwPageDesc;
 class SwDoc;
-class SwPageDesc;
 
 
 class SwUndoPageDesc : public SwUndo
 
 class SwUndoPageDescCreate : public SwUndo
 {
-    const SwPageDesc * pDesc; // #116530#
-    SwPageDescExt aNew;
-    SwDoc * pDoc;
+    SwPageDescExt m_aNew;
+    IDocumentUndoRedo* const m_pUndoRedo;
+    ::sw::pagedesc::IDocumentPageDescAccess* const m_pPageDescAccess;
 
 public:
-    SwUndoPageDescCreate(const SwPageDesc * pNew, SwDoc * pDoc); // #116530#
+    SwUndoPageDescCreate(const SwPageDesc* pNew, IDocumentUndoRedo* pUndoRedo, ::sw::pagedesc::IDocumentPageDescAccess* pPageDescAccess);
     virtual ~SwUndoPageDescCreate();
 
     virtual void Undo(SwUndoIter & rIt);
 
 class SwUndoPageDescDelete : public SwUndo
 {
-    SwPageDescExt aOld;
-    SwDoc * pDoc;
+    SwPageDescExt m_aOld;
+    IDocumentUndoRedo* m_pUndoRedo;
+    ::sw::pagedesc::IDocumentPageDescAccess* const m_pPageDescAccess;
 
 public:
-    SwUndoPageDescDelete(const SwPageDesc & aOld, SwDoc * pDoc);
+    SwUndoPageDescDelete(const SwPageDesc* pOld, IDocumentUndoRedo* pUndoRedo, ::sw::pagedesc::IDocumentPageDescAccess* pPageDescAccess);
     virtual ~SwUndoPageDescDelete();
 
     virtual void Undo(SwUndoIter & rIt);

File sw/inc/crsrsh.hxx

     BOOL GotoHeaderTxt();       // springe aus dem Content zum Header
     BOOL GotoFooterTxt();       // springe aus dem Content zum Footer
     // springe in den Header/Footer des angegebenen oder akt. PageDesc
-    BOOL SetCrsrInHdFt( USHORT nDescNo = USHRT_MAX,
-                            BOOL bInHeader = TRUE );
+    bool SetCrsrInHdFt(const SwPageDesc* pPageDesc, bool bInHeader = true);
     // is point of cursor in header/footer. pbInHeader return TRUE if it is
     // in a headerframe otherwise in a footerframe
     BOOL IsInHeaderFooter( BOOL* pbInHeader = 0 ) const;

File sw/inc/doc.hxx

 
 /** SwDoc interfaces */
 
-#include <IInterface.hxx>
-#include <IDocumentSettingAccess.hxx>
-#include <IDocumentDeviceAccess.hxx>
-#include <IDocumentMarkAccess.hxx>
-#include <IDocumentRedlineAccess.hxx>
-#include <IDocumentUndoRedo.hxx>
-#include <IDocumentLinksAdministration.hxx>
-#include <IDocumentFieldsAccess.hxx>
-#include <IDocumentContentOperations.hxx>
-#include <IDocumentStylePoolAccess.hxx>
-#include <IDocumentLineNumberAccess.hxx>
-#include <IDocumentStatistics.hxx>
-#include <IDocumentState.hxx>
-#include <IDocumentDrawModelAccess.hxx>
-#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>
+#include <chcmprse.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <com/sun/star/chart2/data/XDataProvider.hpp>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <editeng/numitem.hxx>
+#include <flyenum.hxx>
+#include <hash_map>
+#include <IDocumentInterfaceProvider.hxx>
+#include <IDocumentChartDataProviderAccess.hxx>
+#include <IDocumentContentOperations.hxx>
+#include <IDocumentDeviceAccess.hxx>
+#include <IDocumentDrawModelAccess.hxx>
+#include <IDocumentExternalData.hxx>
+#include <IDocumentFieldsAccess.hxx>
+#include <IDocumentFormatAccess.hxx>
+#include <IDocumentFootnoteAccess.hxx>
+#include <IDocumentLayoutAccess.hxx>
+#include <IDocumentLineNumberAccess.hxx>
+#include <IDocumentLinksAdministration.hxx>
+#include <IDocumentListItems.hxx>
+#include <IDocumentListsAccess.hxx>
+#include <IDocumentOutlineNodes.hxx>
+#include <IDocumentRedlineAccess.hxx>
+#include <IDocumentSettingAccess.hxx>
+#include <IDocumentState.hxx>
+#include <IDocumentStatistics.hxx>
+#include <IDocumentStylePoolAccess.hxx>
+#include <IDocumentTimerAccess.hxx>
+#include <IDocumentUndoRedo.hxx>
+#include <IInterface.hxx>
+#include <itabenum.hxx>
+#include <map>
+#include <memory>
+#include <ndarr.hxx>
+#include <set>
+#include <stringhash.hxx>
+#include <svl/style.hxx>
+#include <svl/svstdarr.hxx>
+#include <svtools/embedhlp.hxx>
+#include <svx/svdtypes.hxx>
+#include <swatrset.hxx>
+#include <swdbdata.hxx>
+#include <swdllapi.h>
+#include <swtypes.hxx>
+#include <toxe.hxx>
 #include <vcl/timer.hxx>
-#include "swdllapi.h"
-#include <swtypes.hxx>
-#include <ndarr.hxx>
-#include <swatrset.hxx>
-#include <toxe.hxx>   	  		// enums
-#include <flyenum.hxx>
-#include <itabenum.hxx>
-#include <swdbdata.hxx>
-#include <chcmprse.hxx>
-#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
-#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
+#include <vector>
 #include <vos/ref.hxx>
-#include <svx/svdtypes.hxx>
-#include <svl/style.hxx>
-#include <editeng/numitem.hxx>
-#include "comphelper/implementationreference.hxx"
-#include <com/sun/star/chart2/data/XDataProvider.hpp>
-#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
+
 #ifdef FUTURE_VBA
 #include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
 #endif
 
-#include <hash_map>
-#include <stringhash.hxx>
-
-#include <svtools/embedhlp.hxx>
-#include <vector>
-#include <set>
-#include <map>
-#include <memory>
-
-#include <boost/scoped_ptr.hpp>
-
-class SfxObjectShell;
-class SfxObjectShellRef;
-class SvxForbiddenCharactersTable;
-class SwExtTextInput;
+class Color;
 class DateTime;
 class EditFieldInfo;
+class GraphicObject;
+class IDocumentMarkAccess;
+class IGrammarContact;
+class IStyleAccess;
 class JobSetup;
-class Color;
 class KeyCode;
 class Outliner;
 class OutputDevice;
 class Point;
 class SbxArray;
+class SdrMarkList;
 class SdrModel;
 class SdrObject;
+class SdrPageView;
 class SdrUndoAction;
-class VirtualDevice;
+class SdrView;
+class _SetGetExpFld;
+class SfxBroadcaster;
+class SfxObjectShell;
+class SfxObjectShellRef;
 class SfxPrinter;
 class SvNumberFormatter;
 class SvStringsSort;
 class SvUShorts;
 class SvUShortsSort;
+class SvxBorderLine;
+class SvxForbiddenCharactersTable;
 class SvxMacro;
 class SvxMacroTableDtor;
-class SvxBorderLine;
+class SwAuthEntry;
 class SwAutoCompleteWord;
 class SwAutoCorrExceptWord;
 class SwCalc;
 class SwCellFrm;
 class SwCharFmt;
 class SwCharFmts;
+class SwChartDataProvider;
+class SwChartLockController_Helper;
 class SwConditionTxtFmtColl;
 class SwCrsrShell;
 class SwCursor;
 class SwDBNameInfField;
 class SwDocShell;
 class SwDocUpdtFld;
+class SwDrawContact;
 class SwDrawFrmFmt;
 class SwDrawView;
 class SwEditShell;
+class SwEndNoteInfo;
+class SwExtTextInput;
+class SwField;
 class SwFieldType;
-class SwField;
-class SwTxtFld;
 class SwFldTypes;
 class SwFlyFrmFmt;
 class SwFmt;
 class SwFrmFmts;
 class SwFtnIdxs;
 class SwFtnInfo;
-class SwEndNoteInfo;
-class GraphicObject;
 class SwGrfFmtColl;
 class SwGrfFmtColls;
+class SwLayoutCache;
+class SwLayouter;
 class SwLineNumberInfo;
+class SwList;
+class SwMsgPoolItem;
 class SwNewDBMgr;
-class SwNoTxtNode;
 class SwNodeIndex;
 class SwNodeRange;
+class SwNoTxtNode;
 class SwNumRule;
 class SwNumRuleTbl;
 class SwPageDesc;
+class SwPageFrm;
+class SwPagePreViewPrtData;
 class SwPosFlyFrms;
-class SwPagePreViewPrtData;
+class SwPrintData;
+class SwPrintData;
+class SwPrintUIOptions;
 class SwRedline;
 class SwRedlineTbl;
+class SwRenderData;
+class SwRewriter;
 class SwRootFrm;
 class SwRubyList;
 class SwRubyListEntry;
+class SwSection;
 class SwSectionFmt;
+class SwSectionData;
 class SwSectionFmts;
-class SwSectionData;
 class SwSelBoxes;
 class SwSpzFrmFmts;
-class SwTOXBase;
-class SwTOXBaseSection;
-class SwTOXMark;
-class SwTOXMarks;
-class SwTOXType;
-class SwTOXTypes;
 class SwTabCols;
 class SwTable;
 class SwTableAutoFmt;
 class SwTableLineFmt;
 class SwTableNode;
 class SwTextBlocks;
+class SwTOXBase;
+class SwTOXBaseSection;
+class SwTOXMark;
+class SwTOXMarks;
+class SwTOXType;
+class SwTOXTypes;
+class SwTxtFld;
 class SwTxtFmtColl;
 class SwTxtFmtColls;
-class SwURLStateChanged;
 class SwUndo;
 class SwUndoIds;
 class SwUndoIter;
 class SwUndos;
 class SwUnoCrsr;
 class SwUnoCrsrTbl;
+class SwURLStateChanged;
+class SwViewOption;
 class ViewShell;
-class _SetGetExpFld;
-class SwDrawContact;
-class SwLayouter;
-class SdrView;
-class SdrMarkList;
-class SwAuthEntry;
-class SwLayoutCache;
-class IStyleAccess;
+class VirtualDevice;
 struct SwCallMouseEvent;
+struct SwConversionArgs;
+struct SwDefTOXBase_Impl;
 struct SwDocStat;
 struct SwHash;
 struct SwSortOptions;
-struct SwDefTOXBase_Impl;
-class SwPrintData;
-class SwPrintUIOptions;
-class SdrPageView;
-struct SwConversionArgs;
-class SwRewriter;
-class SwMsgPoolItem;
-class SwChartDataProvider;
-class SwChartLockController_Helper;
-class IGrammarContact;
-class SwPrintData;
-class SwRenderData;
-class SwPageFrm;
-class SwViewOption;
 
-namespace sw { namespace mark {
-    class MarkManager;
-}}
 namespace sw {
+    namespace mark {
+        class IMark;
+        class MarkManager;
+    }
+    namespace pagedesc {
+        class IDocumentPageDescAccess;
+        class PageDescManager;
+    }
     class MetaFieldManager;
 }
 
     class LinkManager;
 }
 
-//PageDescriptor-Schnittstelle, Array hier wegen inlines.
-typedef SwPageDesc* SwPageDescPtr;
-SV_DECL_PTRARR_DEL( SwPageDescs, SwPageDescPtr, 4, 4 )
-
 // forward declartion
 void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem );
 
 void StartGrammarChecking( SwDoc &rDoc );
 
 class SW_DLLPUBLIC SwDoc :
+    public ::sw::IDocumentInterfaceProvider,
     public IInterface,
     public IDocumentSettingAccess,
     public IDocumentDeviceAccess,
     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 IDocumentExternalData,
+    public ::sw::format::IDocumentFormatAccess,
+    public ::sw::pagedesc::IDocumentFootnoteAccess
 {
 
 	friend void _InitCore();
 	friend void _FinitCore();
+    friend class ::sw::pagedesc::PageDescManager;
 
     //---------------- private Member --------------------------------
 
-	// -------------------------------------------------------------------
+    // broadcasters (created first, destructed last)
+    const ::boost::scoped_ptr< SfxBroadcaster > m_pStyleOperationBroadcaster;
+    const ::boost::scoped_ptr< SfxBroadcaster > m_pModelEventBroadcaster;
 	// die Objecte
 	SwNodes		aNodes;   	  	  	  	// Inhalt des Dokumentes
 	SwNodes 	aUndoNodes; 			// Inhalt fuer das Undo
 	SwAttrPool*	mpAttrPool;				// der Attribut Pool
-	SwPageDescs	aPageDescs;				// PageDescriptoren
 	Link 		aOle2Link;				// OLE 2.0-Benachrichtigung
     /* @@@MAINTAINABILITY-HORROR@@@
        Timer should not be members of the model
         xXForms;                        // container with XForms models
     mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator;
 
-    const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
+    const ::boost::scoped_ptr< ::sw::mark::MarkManager > m_pMarkManager;
     const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
+    const ::boost::scoped_ptr< ::sw::pagedesc::PageDescManager > m_pPageDescManager;
 
 	// -------------------------------------------------------------------
 	// die Pointer
 								const SfxItemSet* pGrfAttrSet,
 								SwFrmFmt* = 0 );
 
+public:
+    // This really should not be public, but is needed im
+    // SwFrmFmt::CopyHedaerFrom/CopyFooterFrom.
+    // so: please refactor me!
     void CopyFlyInFlyImpl(  const SwNodeRange& rRg,
                             const xub_StrLen nEndContentIndex,
                             const SwNodeIndex& rStartIdx,
                             const bool bCopyFlyAtFly = false ) const;
+private:
     sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms );
 
     // --> OD 2005-01-13 #i40550#
 						FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt );
 	void CopyFmtArr( const SvPtrarr& rSourceArr, SvPtrarr& rDestArr,
 						FNCopyFmt fnCopyFmt, SwFmt& rDfltFmt );
-    void CopyPageDescHeaderFooterImpl( bool bCpyHeader,
-								const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt );
 	SwFmt* FindFmtByName( const SvPtrarr& rFmtArr,
 									const String& rName ) const;
 
 
     /** IDocumentMarkAccess
     */
-    IDocumentMarkAccess* getIDocumentMarkAccess();
-    const IDocumentMarkAccess* getIDocumentMarkAccess() const;
+    virtual IDocumentMarkAccess* getIDocumentMarkAccess();
+    virtual const IDocumentMarkAccess* getIDocumentMarkAccess() const;
 
     /** IDocumentRedlineAccess
     */
 
     /** IDocumentUndoRedo
     */
+    virtual IDocumentUndoRedo* getIDocumentUndoRedo() { return this; };
+    virtual const IDocumentUndoRedo* getIDocumentUndoRedo() const { return this;};
     virtual void SetUndoNoResetModified();
 	virtual bool IsUndoNoResetModified() const;
 	virtual void DoUndo(bool bUn);
                            const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
 	virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
 	virtual bool AppendTxtNode(SwPosition& rPos);
-        virtual void SetModified(SwPaM &rPaM);
+    virtual void SetModified(SwPaM &rPaM);
     virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
                               const bool bRegExReplace);
     virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
 
     /** IDocumentLayoutAccess
     */
+    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; };
+    // Fussnoten Informationen
+    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 );
 	/* LayoutFormate (Rahmen, DrawObjecte), mal const mal nicht */
 	const SwSpzFrmFmts* GetSpzFrmFmts() const	{ return pSpzFrmFmtTbl; }
 		  SwSpzFrmFmts* GetSpzFrmFmts() 		{ return pSpzFrmFmtTbl; }
-
-	const SwFrmFmt *GetDfltFrmFmt() const	{ return pDfltFrmFmt; }
-		  SwFrmFmt *GetDfltFrmFmt() 		{ return pDfltFrmFmt; }
-	const SwFrmFmt *GetEmptyPageFmt() const { return pEmptyPageFmt; }
-		  SwFrmFmt *GetEmptyPageFmt()		{ return pEmptyPageFmt; }
-	const SwFrmFmt *GetColumnContFmt() const{ return pColumnContFmt; }
-		  SwFrmFmt *GetColumnContFmt()		{ return pColumnContFmt; }
-	const SwCharFmt *GetDfltCharFmt() const { return pDfltCharFmt;}
-		  SwCharFmt *GetDfltCharFmt()		{ return pDfltCharFmt;}
+    // IDocumentFormatAccess
+    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; }
+	virtual SwFrmFmt* GetEmptyPageFmt()		{ return pEmptyPageFmt; }
+	virtual const SwFrmFmt* GetColumnContFmt() const{ return pColumnContFmt; }
+	virtual SwFrmFmt* GetColumnContFmt()		{ return pColumnContFmt; }
+	virtual const SwCharFmt* GetDfltCharFmt() const { return pDfltCharFmt;}
+	virtual  SwCharFmt* GetDfltCharFmt()		{ return pDfltCharFmt;}
 
     // Returns the interface of the management of (auto)styles
     IStyleAccess& GetIStyleAccess() { return *pStyleAccess; }
     sal_uInt16 GetPageCount() const;
     const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
 
-		//PageDescriptor-Schnittstelle
-	sal_uInt16 GetPageDescCnt() const { return aPageDescs.Count(); }
-	const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return *aPageDescs[i]; }
-	SwPageDesc* FindPageDescByName( const String& rName,
-									sal_uInt16* pPos = 0 ) const;
+    // IDocumentPageDescAccess
+    virtual ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess();
+    virtual const ::sw::pagedesc::IDocumentPageDescAccess* getIDocumentPageDescAccess() const;
 
-		// kopiere den gesamten PageDesc - ueber Dokumentgrenzen und "tief"!
-		// optional kann das kopieren der PoolFmtId, -HlpId verhindert werden
-	void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
-						sal_Bool bCopyPoolIds = sal_True );
+    //fuer Reader
+    virtual void ChgPageDesc(SwPageDesc* pDesc, const SwPageDesc&);
 
-		// kopiere die Kopzeile (mit dem Inhalt!) aus dem SrcFmt
-		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
-	void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
-        { CopyPageDescHeaderFooterImpl( true, rSrcFmt, rDestFmt ); }
-		// kopiere die Fusszeile (mit dem Inhalt!) aus dem SrcFmt
-		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
-	void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
-        { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); }
-
-		//fuer Reader
-
-    SwPageDesc * GetPageDesc( const String & rName );
-	SwPageDesc& _GetPageDesc( sal_uInt16 i ) const { return *aPageDescs[i]; }
-	void ChgPageDesc( const String & rName, const SwPageDesc& );
-	void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
-    BOOL FindPageDesc( const String & rName, sal_uInt16 * pFound );
-    // -> #116530#
-    void DelPageDesc( const String & rName, BOOL bBroadcast = FALSE);
-	void DelPageDesc( sal_uInt16 i, BOOL bBroadcast = FALSE );
-    // <- #116530#
-    void PreDelPageDesc(SwPageDesc * pDel); // #i7983#
-    // -> #116530#
-	sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0,
-                             BOOL bRegardLanguage = TRUE,
-                             BOOL bBroadcast = FALSE);
-    void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
-                                 USHORT nOp);
-    // <- #116530#
-
-
-    // --> FME 2005-03-16 #i44963# The html import sometimes overwrites the
-    // page sizes set in the page descriptions. This function is used to
-    // correct this.
-    void CheckDefaultPageFmt();
-    // <--
+    SfxBroadcaster* getStyleOperationBroadcaster()
+        { return m_pStyleOperationBroadcaster.get(); }
+    SfxBroadcaster* getModelEventBroadcaster()
+        { return m_pModelEventBroadcaster.get(); }
 
 		// Methoden fuer die Verzeichnisse:
 		// - Verzeichnismarke einfuegen loeschen travel

File sw/inc/fesh.hxx

 #include <svx/svdtypes.hxx>
 
 #include <svtools/embedhlp.hxx>
+#include <IDocumentPageDescAccess.hxx>
 
 #ifndef INCLUDED_VECTOR
 #include <vector>
 	void ShGetFcs( BOOL bUpdate = TRUE );
 
 	//PageDescriptor-Schnittstelle
-	void   ChgCurPageDesc( const SwPageDesc& );
-	USHORT GetCurPageDesc( const BOOL bCalcFrm = TRUE ) const;
-    USHORT GetMousePageDesc( const Point &rPt ) const;
-    USHORT GetPageDescCnt() const;
-	SwPageDesc* FindPageDescByName( const String& rName,
-									BOOL bGetFromPool = FALSE,
-									USHORT* pPos = 0 );
-
-	const SwPageDesc& GetPageDesc( USHORT i ) const;
-	void  ChgPageDesc( USHORT i, const SwPageDesc& );
+	::sw::pagedesc::IDocumentPageDescAccess::difference_type GetPageDescCnt() const;
+    SwPageDesc* GetDefaultPageDesc();
+	SwPageDesc* GetCurPageDesc( const BOOL bCalcFrm = TRUE ) const;
+	SwPageDesc* GetMousePageDesc( const Point &rPt ) const;
+	SwPageDesc* FindPageDescByName( const String& rName);
+	SwPageDesc* FindOrCreatePageDescByName( const String& rName);
+	void ChgCurPageDesc( const SwPageDesc& );
+	void ChgPageDesc( const String& rName, const SwPageDesc& );
 	// if inside all selection only one PageDesc, return this.
 	// Otherwise return 0 pointer
 	const SwPageDesc* GetSelectedPageDescs() const;
 
+    ::sw::pagedesc::IDocumentPageDescAccess::foreach_funcptr_type ForEachPageDesc(::sw::pagedesc::IDocumentPageDescAccess::foreach_funcptr_type f)
+    {
+        ForEachPageDesc_Impl(static_cast< ::sw::pagedesc::IDocumentPageDescAccess::foreach_functor_type>(f));
+        return f;
+    }
+    template<typename T> T ForEachPageDesc(T f)
+    {
+        ForEachPageDesc_Impl(static_cast< ::sw::pagedesc::IDocumentPageDescAccess::foreach_functor_type>(::boost::bind(&T::operator(), &f, _1)));
+        return f;
+    }
+private:
+	void ForEachPageDesc_Impl(::sw::pagedesc::IDocumentPageDescAccess::foreach_functor_type f);
+public:
+
+
 	const SwRect& GetAnyCurRect( CurRectType eType,
 								 const Point* pPt = 0,
                                  const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& =

File sw/inc/fmthdft.hxx

 class SwFrmFmt;
 class IntlWrapper;
 
+namespace sw { namespace pagedesc {
+    class HeaderFooter : public SfxPoolItem, public SwClient
+    {
+        public:
+            const SwFrmFmt *GetHeaderFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; }
+	        SwFrmFmt *GetHeaderFooterFmt() { return (SwFrmFmt*)pRegisteredIn; }
+            BOOL IsActive() const { return bActive; }
+            void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
+        protected:
+            HeaderFooter(bool isHeader, SwModify* pHeaderFooterFmt)
+                : SfxPoolItem(isHeader ? RES_HEADER : RES_FOOTER)
+                , SwClient(pHeaderFooterFmt)
+            { }
+            BOOL bActive;		//Nur zur Steuerung (Erzeugung des Inhaltes)
+    };
+}}
 
 //Kopfzeile, fuer Seitenformate
 //Client von FrmFmt das den Header beschreibt.
 
-class SW_DLLPUBLIC SwFmtHeader: public SfxPoolItem, public SwClient
+class SW_DLLPUBLIC SwFmtHeader: public ::sw::pagedesc::HeaderFooter
 {
-	BOOL bActive;		//Nur zur Steuerung (Erzeugung des Inhaltes)
-
 public:
 	SwFmtHeader( BOOL bOn = FALSE );
 	SwFmtHeader( SwFrmFmt *pHeaderFmt );
 
 	const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; }
 		  SwFrmFmt *GetHeaderFmt()		 { return (SwFrmFmt*)pRegisteredIn; }
-
-	BOOL IsActive() const { return bActive; }
-	void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
 };
 
 //Fusszeile, fuer Seitenformate
 //Client von FrmFmt das den Footer beschreibt.
 
-class SW_DLLPUBLIC SwFmtFooter: public SfxPoolItem, public SwClient
+class SW_DLLPUBLIC SwFmtFooter: public ::sw::pagedesc::HeaderFooter
 {
-	BOOL bActive;		//Nur zur Steuerung (Erzeugung des Inhaltes)
-
 public:
 	SwFmtFooter( BOOL bOn = FALSE );
 	SwFmtFooter( SwFrmFmt *pFooterFmt );
 	const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; }
 		  SwFrmFmt *GetFooterFmt()		 { return (SwFrmFmt*)pRegisteredIn; }
 
-	BOOL IsActive() const { return bActive; }
-	void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
 };
 
 inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const

File sw/inc/frmfmt.hxx

 #ifndef _FRMFMT_HXX
 #define _FRMFMT_HXX
 
-// --> OD 2004-08-06 #i28749#
 #include <com/sun/star/text/PositionLayoutDir.hpp>
-// <--
-
 #include <cppuhelper/weakref.hxx>
-
 #include <format.hxx>
+#include <tools/mempool.hxx>
 
 #include "swdllapi.h"
 
 class SwRect;
 class SwContact;
 class SdrObject;
+namespace sw { namespace pagedesc { class PageDescManager; }}
 
 class SW_DLLPUBLIC SwFrmFmt: public SwFmt
 {
 	friend class SwDoc;
+    friend class ::sw::pagedesc::PageDescManager;
 	friend class SwPageDesc;	//darf den protected CTor rufen.
 
     ::com::sun::star::uno::WeakReference<
             { m_wXObject = xObject; }
 
 	DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
+    // copy the header including content from the SrcFmt to this FrmFmt
+    void CopyHeaderFrom(const SwFrmFmt* pSrcFmt)
+        { CopyHeaderFooterFrom(pSrcFmt, true); };
+    // copy the footer including content from the SrcFmt to this FrmFmt
+    void CopyFooterFrom(const SwFrmFmt* pSrcFmt)
+        { CopyHeaderFooterFrom(pSrcFmt, false); };
+    bool HasFootnotePageListener() const;
+private:
+    void CopyHeaderFooterFrom(const SwFrmFmt* pSrcFmt, bool bCpyHeader);
 };
 
 //Das FlyFrame-Format ------------------------------

File sw/inc/pagedesc.hxx

 #include "swdllapi.h"
 #include <swtypes.hxx>	//fuer SwTwips
 #include <frmfmt.hxx>
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
 #include <editeng/numitem.hxx>
+#include <editeng/frmdir.hxx>
 
 class SfxPoolItem;
 class SwTxtFmtColl;
 class SwNode;
 
+namespace sw { namespace pagedesc {
+    class PageDescManager;
+    class IDocumentPageDescAccess;
+}}
+
 //Separator line adjustment
 enum SwFtnAdj
 {
 class SW_DLLPUBLIC SwPageDesc : public SwModify
 {
 	friend class SwDoc;
-    friend class SwUndoPageDescExt;
+    friend class ::sw::pagedesc::PageDescManager;
 
 	String		aDescName;
 	SvxNumberType	aNumType;
 
 	SW_DLLPRIVATE void ResetAllAttr( sal_Bool bLeft );
 
-	SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwDoc *pDc );
+	SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwAttrPool*, SvxFrameDirection);
+	SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwAttrPool*);
 
 public:
+    // copy the complete PageDesc -- even with different docs and "deep"
+    // optionally copying of PoolFmtId, -HlpId can be prevented
+    void CopyFrom(const SwPageDesc* pSrc, bool bCopyPoolIds=true);
+    bool HasInvalidPageFormat() const;
+    void ResetToDefaultPageFormat();
 	const String &GetName() const { return aDescName; }
 		  void 	  SetName( const String& rNewName ) { aDescName = rNewName; }
 
 	SwPageDesc& operator=( const SwPageDesc& );
 
 	SwPageDesc( const SwPageDesc& );
+    void Dispose();
 	~SwPageDesc();
 };
 
 
 class SwPageDescExt
 {
-    SwPageDesc aPageDesc;
-    SwDoc * pDoc;
-    String sFollow;
+    SwPageDesc m_aPageDesc;
+    ::sw::pagedesc::IDocumentPageDescAccess* const m_pPageDescAccess;
+    String m_sFollow;
 
     void SetPageDesc(const SwPageDesc & aPageDesc);
 
 public:
-    SwPageDescExt(const SwPageDesc & rPageDesc, SwDoc * pDoc);
+    SwPageDescExt(const SwPageDesc & rPageDesc, ::sw::pagedesc::IDocumentPageDescAccess* pPageDesc);
     SwPageDescExt(const SwPageDescExt & rSrc);
     ~SwPageDescExt();
 

File sw/inc/rolbck.hxx

     class MetadatableUndo;
 }
 
+namespace sw
+{
+    namespace mark
+    {
+        class IMark;
+    }
+}
+
 class SwDoc;
 class SwFmt;
 class SwFmtColl;

File 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

File sw/prj/build.lst

 # sw sw\qa\complex\indeterminateState nmake - all sw_qa_complex_indeterminateState sw_util NULL
 # 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

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

+/*************************************************************************
+*
+* 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.
+*
+************************************************************************/
+
+#include "precompiled_sw.hxx"
+#include <sal/config.h>
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+#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>
+
+#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>
+#include <IDocumentPageDescAccess.hxx>
+class SwPageDesc;
+class SwUndoPageDescCreate : public SwUndo
+{
+    public:
+        SwUndoPageDescCreate(const SwPageDesc*, IDocumentUndoRedo*, ::sw::pagedesc::IDocumentPageDescAccess*) {};
+};
+class SwUndoPageDescDelete : public SwUndo
+{
+    public:
+        SwUndoPageDescDelete(const SwPageDesc*, IDocumentUndoRedo*, ::sw::pagedesc::IDocumentPageDescAccess*) {};
+};
+
+#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), m_pFollow(this) {};
+        SwPageDesc(const String& rName, SwFrmFmt*, SwAttrPool*) : m_sName(rName), m_pFollow(this) {};
+        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 m_pFollow; };
+        void SetFollow(SwPageDesc* pFollow) { m_pFollow = pFollow; };
+        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;
+        SwPageDesc* m_pFollow;
+};
+class SwPageDescExt : public SwPageDesc {};
+
+#include <mock/FormatAccessMockBase.hxx>
+#include <mock/UndoRedoMockBase.hxx>
+#include <mock/BroadcastRecorderBase.hxx>
+
+namespace
+{
+    struct UndoRedoMock : public ::sw::mock::UndoRedoMockBase
+    {
+        UndoRedoMock() : m_isActive(false), m_isModified(false) {};
+        bool m_isActive;
+        bool m_isModified;
+        ::std::vector< ::boost::shared_ptr<SwUndo> > m_vUndos;
+        virtual void DoUndo(bool bOn) { m_isActive = bOn; };
+        virtual bool DoesUndo() const { return m_isActive; };
+        virtual void AppendUndo(SwUndo* pUndo)
+            { m_vUndos.push_back(::boost::shared_ptr<SwUndo>(pUndo)); }
+        virtual void SetModified() { m_isModified = true; }
+    };
+}
+
+#include <source/core/doc/PageDescManager.cxx>
+
+using namespace ::boost;
+using namespace ::std;
+using namespace ::sw::pagedesc;
+using namespace ::sw::style;
+using namespace ::sw::mock;
+namespace
+{
+    struct BroadcastRecorder : public BroadcastRecorderBase
+    {
+        virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
+        {
+            if( const StyleOperationHint* pStyleHint = dynamic_cast<const StyleOperationHint*>(&rHint) )
+                RecordHint(rBC, new StyleOperationHint(*pStyleHint));
+            else if( const CheckPageDescHint* pCeckPDHint = dynamic_cast<const CheckPageDescHint*>(&rHint) )
+                RecordHint(rBC, new CheckPageDescHint(*pCeckPDHint));
+            else if( const PageDescDisposingHint* pPDDisposeHint = dynamic_cast<const PageDescDisposingHint*>(&rHint) )
+                RecordHint(rBC, new PageDescDisposingHint(*pPDDisposeHint));
+            else
+                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:
+            void Create();
+            void MakePageDesc();
+            void MakePageDesc_Copy();
+            void MakePageDesc_Undo();
+            void GetPageDescCnt();
+            void GetPageDescByName();
+            void GetPageDescByPoolFmtId();
+            void GetDefaultPageDesc();
+            void DelPageDesc();
+            void DelPageDesc_Undo();
+            void DelAllPageDescs();
+            void ForEach();
+
+            CPPUNIT_TEST_SUITE(PageDescManagerTest);
+            CPPUNIT_TEST(Create);
+            CPPUNIT_TEST(MakePageDesc);
+            CPPUNIT_TEST(MakePageDesc_Copy);
+            CPPUNIT_TEST(MakePageDesc_Undo);
+            CPPUNIT_TEST(GetPageDescCnt);
+            CPPUNIT_TEST(GetPageDescByName);
+            CPPUNIT_TEST(GetPageDescByPoolFmtId);
+            CPPUNIT_TEST(GetDefaultPageDesc);
+            CPPUNIT_TEST(DelPageDesc);
+            CPPUNIT_TEST(DelPageDesc_Undo);
+            CPPUNIT_TEST(DelAllPageDescs);
+            CPPUNIT_TEST(ForEach);
+            CPPUNIT_TEST_SUITE_END();
+        private:
+            void Setup();
+            void AddPageDesc(const String& rName);
+            scoped_ptr<UndoRedoMock> m_pUndoRedo;
+            scoped_ptr<FormatAccessMockBase> m_pFormatAccess;
+            scoped_ptr<SwAttrPool> m_pPool;
+            scoped_ptr<SfxBroadcaster> m_pStyleOperationBroadcaster;
+            scoped_ptr<SfxBroadcaster> m_pModelEventBroadcaster;
+            scoped_ptr<BroadcastRecorder> m_pBroadcastRecorder;
+            scoped_ptr<IDocumentPageDescAccess> m_pPageDescAccess;
+            static const String our_sName;
+            static const String our_sOtherName;
+            static const String our_sThirdName;
+            static const String our_sFourthName;
+    };
+
+    const String PageDescManagerTest::our_sName = String::CreateFromAscii("SomeName");
+    const String PageDescManagerTest::our_sOtherName = String::CreateFromAscii("SomeOtherName");
+    const String PageDescManagerTest::our_sThirdName = String::CreateFromAscii("AnotherName");
+    const String PageDescManagerTest::our_sFourthName = String::CreateFromAscii("JustAName");
+    CPPUNIT_TEST_SUITE_REGISTRATION(PageDescManagerTest);
+
+}}
+
+using namespace ::sw::test;
+
+void PageDescManagerTest::Setup()
+{
+    m_pUndoRedo.reset(new UndoRedoMock());
+    m_pFormatAccess.reset(new FormatAccessMockBase());
+    m_pPool.reset(new SwAttrPool());
+    m_pStyleOperationBroadcaster.reset(new SfxBroadcaster());
+    m_pModelEventBroadcaster.reset(new SfxBroadcaster());
+    m_pPageDescAccess.reset(new TestablePageDescManager(
+        m_pUndoRedo.get(),
+        m_pFormatAccess.get(),
+        m_pPool.get(),
+        m_pStyleOperationBroadcaster.get(),
+        m_pModelEventBroadcaster.get()));
+    m_pBroadcastRecorder.reset(new BroadcastRecorder());
+    m_pBroadcastRecorder->StartListening(*m_pStyleOperationBroadcaster);
+    m_pBroadcastRecorder->StartListening(*m_pModelEventBroadcaster);
+    CPPUNIT_ASSERT(m_pPageDescAccess.get()!=NULL);
+}
+
+void PageDescManagerTest::Create()
+{
+    Setup();
+}
+
+void PageDescManagerTest::MakePageDesc()
+{
+    Setup();
+    IDocumentPageDescAccess::difference_type nPrecount = m_pPageDescAccess->GetPageDescCnt();
+    const SwPageDesc* const pPageDesc(m_pPageDescAccess->MakePageDesc(our_sName));
+    CPPUNIT_ASSERT(pPageDesc!=NULL);
+    CPPUNIT_ASSERT(m_pPageDescAccess->GetPageDescCnt() == nPrecount+1);
+    CPPUNIT_ASSERT(our_sName == pPageDesc->GetName());
+
+    CPPUNIT_ASSERT(m_pBroadcastRecorder->m_vHints.size() == 0);
+}
+
+void PageDescManagerTest::MakePageDesc_Copy()
+{
+    Setup();
+    SwPageDesc* const pPageDescTemplate(m_pPageDescAccess->MakePageDesc(our_sName));
+    pPageDescTemplate->SetPoolFmtId(0xdead);
+    pPageDescTemplate->SetPoolHelpId(0xdead);
+    pPageDescTemplate->SetPoolHlpFileId(0xde);
+    IDocumentPageDescAccess::difference_type nPrecount = m_pPageDescAccess->GetPageDescCnt();
+    const SwPageDesc* const pPageDesc(m_pPageDescAccess->MakePageDesc(our_sOtherName, pPageDescTemplate));
+    CPPUNIT_ASSERT(pPageDesc!=NULL);
+    CPPUNIT_ASSERT(m_pPageDescAccess->GetPageDescCnt() == nPrecount+1);
+    CPPUNIT_ASSERT(pPageDesc->GetName() == our_sOtherName);
+    CPPUNIT_ASSERT(pPageDesc->GetPoolFmtId() == USHRT_MAX);
+    CPPUNIT_ASSERT(pPageDesc->GetPoolHelpId() == USHRT_MAX);
+    CPPUNIT_ASSERT(pPageDesc->GetPoolHlpFileId() == UCHAR_MAX);
+    CPPUNIT_ASSERT(m_pPageDescAccess->GetPageDescByPoolFmtId(0xdead)==pPageDescTemplate);
+    CPPUNIT_ASSERT(m_pBroadcastRecorder->m_vHints.empty());
+}
+
+void PageDescManagerTest::MakePageDesc_Undo()
+{
+    Setup();
+    m_pUndoRedo->DoUndo(false);
+    m_pUndoRedo->m_isModified = false;
+    m_pPageDescAccess->MakePageDesc(our_sOtherName);
+    CPPUNIT_ASSERT(m_pUndoRedo->m_vUndos.empty());
+    CPPUNIT_ASSERT(m_pUndoRedo->m_isModified);
+    CPPUNIT_ASSERT(m_pBroadcastRecorder->m_vHints.empty());
+
+    m_pUndoRedo->m_isModified = false;
+    m_pUndoRedo->m_vUndos.clear();
+    m_pUndoRedo->DoUndo(true);
+    m_pPageDescAccess->MakePageDesc(our_sThirdName);
+    CPPUNIT_ASSERT(m_pUndoRedo->m_vUndos.size()==1);
+    CPPUNIT_ASSERT(dynamic_cast<SwUndoPageDescCreate*>(m_pUndoRedo->m_vUndos[0].get())!=NULL);
+    CPPUNIT_ASSERT(m_pUndoRedo->m_isModified);
+    CPPUNIT_ASSERT(m_pBroadcastRecorder->m_vHints.empty());
+}
+
+void PageDescManagerTest::GetPageDescCnt()
+{
+    Setup();
+    IDocumentPageDescAccess::difference_type nCount = m_pPageDescAccess->GetPageDescCnt();
+    m_pPageDescAccess->MakePageDesc(our_sName);
+    CPPUNIT_ASSERT(++nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->MakePageDesc(our_sOtherName);
+    CPPUNIT_ASSERT(++nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->MakePageDesc(our_sThirdName);
+    CPPUNIT_ASSERT(++nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->MakePageDesc(our_sFourthName);
+    CPPUNIT_ASSERT(++nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->DelPageDesc(our_sFourthName);
+    CPPUNIT_ASSERT(--nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->DelPageDesc(our_sThirdName);
+    CPPUNIT_ASSERT(--nCount == m_pPageDescAccess->GetPageDescCnt());
+    m_pPageDescAccess->DelPageDesc(our_sOtherName);
+    CPPUNIT_ASSERT(--nCount == m_pPageDescAccess->GetPageDescCnt());
+}
+
+void PageDescManagerTest::GetPageDescByName()
+{
+    Setup();
+    m_pPageDescAccess->MakePageDesc(our_sName);
+    CPPUNIT_ASSERT(m_pPageDescAccess->GetPageDescByName(our_sName)!=NULL);
+    CPPUNIT_ASSERT(m_pPageDescAccess->GetPageDescByName(our_sOtherName)==NULL);
+    CPPUNIT_ASSERT(m_pBroadcastRecorder->m_vHints.empty());