Commits

obo  committed 0c1219c Merge

CWS-TOOLING: integrate CWS swlayoutrefactoring

  • Participants
  • Parent commits 87e9b63, 1961c03

Comments (0)

Files changed (338)

File sw/inc/IDocumentLayoutAccess.hxx

 
 #include <swtypes.hxx>
 
+class ViewShell;
 class SwRootFrm;
 class SwFrmFmt;
 class SfxItemSet;
 
     /** Returns the layout set at the document.
     */
-    virtual const SwRootFrm* GetRootFrm() const = 0;
-    virtual       SwRootFrm* GetRootFrm() = 0;
+    virtual const ViewShell* GetCurrentViewShell() const = 0;
+    virtual       ViewShell* GetCurrentViewShell() = 0;	//swmod 071107//swmod 071225
+	virtual const SwRootFrm* GetCurrentLayout() const = 0;
+	virtual       SwRootFrm* GetCurrentLayout() = 0;	//swmod 080218
+    virtual bool HasLayout() const = 0;
 
     /** !!!The old layout must be deleted!!!
     */
-    virtual void SetRootFrm( SwRootFrm* pNew ) = 0;
+    virtual void SetCurrentViewShell( ViewShell* pNew ) = 0;	//swmod 071107//swmod 071225
 
     /**
     */

File sw/inc/authfld.hxx

 	// @@@ private copy assignment, but public copy ctor? @@@
 	const SwAuthorityFieldType& operator=( const SwAuthorityFieldType& );
 
+protected:
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
 public:
 	SwAuthorityFieldType(SwDoc* pDoc);
 	SwAuthorityFieldType( const SwAuthorityFieldType& );
 	~SwAuthorityFieldType();
 
 	virtual SwFieldType* Copy()    const;
-	virtual void 		Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
 
     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId );

File sw/inc/calbck.hxx

  *
  ************************************************************************/
 
-/*************************************************************
-#* Service-Klassen
- *************************************************************/
-
-/*
-#* Aendert sich ein Attribut in einem Format, so muss diese
-#* Aenderung an alle abhaengigen Formate und ueber sie an
-#* alle betroffenen Nodes propagiert werden. Dabei muss
-#* festgestellt werden, ob die Aenderung einen Effekt haben
-#* kann, oder ob das geaenderte Attribut von dem abhaengigen
-#* Format ueberdefiniert wird (so dass ohnehin der
-#* Attributwert des abhaengigen Formates den geaenderten
-#* Wert verdeckt). Weiterhin kann der betroffene Node
-#* feststellen, ob er von dem geaenderten Attribut Gebrauch
-#* macht (Beispiel: Linienabstand fuer Unterstreichung wurde
-#* geaendert, das Attribut Unterstreichung wurde aber nicht
-#* verwendet). So wird bei Aenderungen der minimale Aufwand
-#* zum Reformatieren erkannt.
- */
 #ifndef _CALBCK_HXX
 #define _CALBCK_HXX
 
 #include <tools/rtti.hxx>
 #include "swdllapi.h"
+#include <boost/noncopyable.hpp>
 
 class SwModify;
 class SwClientIter;
 class SfxPoolItem;
-class SvStream;
+class SfxHint;
+
+/*
+    SwModify and SwClient cooperate in propagating attribute changes.
+    If an attribute changes, the change is notified to all dependent
+    formats and other interested objects, e.g. Nodes. The clients will detect
+    if the change affects them. It could be that the changed attribute is 
+    overruled in the receiving object so that its change does not become 
+    effective or that the receiver is not interested in the particular attribute 
+    in general (though probably in other attributes of the SwModify object they
+    are registered in).
+    As SwModify objects are derived from SwClient, they can create a chain of SwClient
+    objects where changes can get propagated through.
+    Each SwClient can be registered at only one SwModify object, while each SwModify
+    object is connected to a list of SwClient objects. If an object derived from SwClient
+    wants to get notifications from more than one SwModify object, it must create additional 
+    SwClient objects. The SwDepend class allows to handle their notifications in the same
+    notification callback as it forwards the Modify() calls it receives to a "master" 
+    SwClient implementation.
+    The SwClientIter class allows to iterate over the SwClient objects registered at an 
+    SwModify. For historical reasons its ability to use TypeInfo to restrict this iteration 
+    to objects of a particular type created a lot of code that misuses SwClient-SwModify 
+    relationships that basically should be used only for Modify() callbacks. 
+    This is still subject to refactoring.
+    Until this gets resolved, new SwClientIter base code should be reduced to the absolute
+    minimum and it also should be wrapped by SwIterator templates that prevent that the
+    code gets polluted by pointer casts (see switerator.hxx).
+ */
 
 // ----------
 // SwClient
 // ----------
 
-class SW_DLLPUBLIC SwClient
+class SW_DLLPUBLIC SwClient : ::boost::noncopyable
 {
-	friend class SwModify;
+    // avoids making the details of the linked list and the callback method public
+	friend class SwModify;          
 	friend class SwClientIter;
 
-	SwClient *pLeft, *pRight;			// fuer die AVL-Sortierung
-	sal_Bool bModifyLocked : 1;				// wird in SwModify::Modify benutzt,
-										// eigentlich ein Member des SwModify
-										// aber aus Platzgruenden hier.
-	sal_Bool bInModify 	: 1;				// ist in einem Modify. (Debug!!!)
-	sal_Bool bInDocDTOR	: 1;				// Doc wird zerstoert, nicht "abmelden"
-	sal_Bool bInCache	: 1;				// Ist im BorderAttrCache des Layout,
-										// Traegt sich dann im Modify aus!
-	sal_Bool bInSwFntCache : 1; 			// Ist im SwFont-Cache der Formatierung
+	SwClient *pLeft, *pRight;       // double-linked list of other clients
+	SwModify *pRegisteredIn;        // event source
+
+    // in general clients should not be removed when their SwModify sends out Modify()
+    // notifications; in some rare cases this is necessary, but only the concrete SwClient
+    // sub class will know that; this flag allows to make that known
+    bool mbIsAllowedToBeRemovedInModifyCall;
+
+    // callbacks received from SwModify (friend class - so these methods can be private)
+    // should be called only from SwModify the client is registered in
+    // mba: IMHO these methods should be pure virtual
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+    virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
 
 protected:
-	SwModify *pRegisteredIn;
-
 	// single argument ctors shall be explicit.
 	explicit SwClient(SwModify *pToRegisterIn);
 
+    // write access to pRegisteredIn shall be granted only to the object itself (protected access)
+    SwModify* GetRegisteredInNonConst() const { return pRegisteredIn; }
+    void SetIsAllowedToBeRemovedInModifyCall( bool bSet ) { mbIsAllowedToBeRemovedInModifyCall = bSet; }
+
 public:
+
 	inline SwClient();
 	virtual ~SwClient();
 
-	virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+    // in case an SwModify object is destroyed that itself is registered in another SwModify, 
+    // its SwClient objects can decide to get registered to the latter instead by calling this method
+	void CheckRegistration( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue );
+
+    // controlled access to Modify method
+    // mba: this is still considered a hack and it should be fixed; the name makes grep-ing easier
+	void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { Modify ( pOldValue, pNewValue ); }
+   void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
+
 	const SwModify* GetRegisteredIn() const { return pRegisteredIn; }
+    bool IsLast() const { return !pLeft && !pRight; }
 
-	//rtti, abgeleitete moegens gleichtun oder nicht. Wenn sie es gleichtun
-	//kann ueber die Abhaengigkeitsliste eines Modify typsicher gecastet
-	//werden.
+    // needed for class SwClientIter
 	TYPEINFO();
 
-	void LockModify()					{ bModifyLocked = sal_True;  }
-	void UnlockModify()					{ bModifyLocked = sal_False; }
-	void SetInCache( sal_Bool bNew )		{ bInCache = bNew;		 }
-	void SetInSwFntCache( sal_Bool bNew ) 	{ bInSwFntCache = bNew;	 }
-	sal_Bool IsModifyLocked() const			{ return bModifyLocked;  }
-	sal_Bool IsInDocDTOR()	  const 		{ return bInDocDTOR;	 }
-	sal_Bool IsInCache()	  const 		{ return bInCache;		 }
-	sal_Bool IsInSwFntCache()  const 		{ return bInSwFntCache;	 }
-
-		// erfrage vom Client Informationen
+	// get information about attribute
 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
-
-private:
-	SwClient( const SwClient& );
-	SwClient &operator=( const SwClient& );
 };
 
 inline SwClient::SwClient() :
-	pLeft(0), pRight(0), pRegisteredIn(0)
-{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = sal_False; }
-
+	pLeft(0), pRight(0), pRegisteredIn(0), mbIsAllowedToBeRemovedInModifyCall(false)
+{}
 
 // ----------
 // SwModify
 // ----------
 
-// Klasse hat eine doppelt Verkette Liste fuer die Abhaengigen.
-
 class SW_DLLPUBLIC SwModify: public SwClient
 {
-	friend SvStream& operator<<( SvStream& aS, SwModify & );
+//	friend class SwClientIter;
 
-	friend class SwClientIter;
-	SwClient* pRoot;
+	SwClient* pRoot;                // the start of the linked list of clients
+	sal_Bool bModifyLocked : 1;         // don't broadcast changes now
+	sal_Bool bLockClientList : 1;       // may be set when this instance notifies its clients
+	sal_Bool bInDocDTOR	: 1;            // workaround for problems when a lot of objects are destroyed
+	sal_Bool bInCache	: 1;
+	sal_Bool bInSwFntCache : 1;
 
-	SwClient *_Remove(SwClient *pDepend);
+    // mba: IMHO this method should be pure virtual
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
 
 public:
-	SwModify() : pRoot(0) {}
+	SwModify();
+
+    // broadcasting: send notifications to all clients
+	void NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue );
+
+    // the same, but without setting bModifyLocked or checking for any of the flags
+    // mba: it would be interesting to know why this is necessary
+    // also allows to limit callback to certain type (HACK)
+	void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) );
+
+    // a more universal broadcasting mechanism
+	void CallSwClientNotify( const SfxHint& rHint ) const;
 
 	// single argument ctors shall be explicit.
-	explicit SwModify(SwModify *pToRegisterIn );
+	explicit SwModify( SwModify *pToRegisterIn );
 	virtual ~SwModify();
 
-	virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
 	void Add(SwClient *pDepend);
-	SwClient *Remove(SwClient *pDepend)
-		{	return bInDocDTOR ?  0 : _Remove( pDepend ); }
-
+	SwClient* Remove(SwClient *pDepend);
 	const SwClient* GetDepends() const	{ return pRoot; }
 
-		// erfrage vom Client Informationen
+	// get information about attribute
 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 
-	void SetInDocDTOR() { bInDocDTOR = sal_True; }
+	void LockModify()                   { bModifyLocked = sal_True;  }
+	void UnlockModify()  				{ bModifyLocked = sal_False; }
+	void SetInCache( sal_Bool bNew )		{ bInCache = bNew;		 }
+	void SetInSwFntCache( sal_Bool bNew ) 	{ bInSwFntCache = bNew;	 }
+	void SetInDocDTOR()                 { bInDocDTOR = sal_True; }
+	sal_Bool IsModifyLocked() const		{ return bModifyLocked;  }
+	sal_Bool IsInDocDTOR()	  const 	{ return bInDocDTOR;	 }
+	sal_Bool IsInCache()	  const 	{ return bInCache;		 }
+	sal_Bool IsInSwFntCache() const     { return bInSwFntCache;	 }
 
 	void CheckCaching( const sal_uInt16 nWhich );
-
-	sal_Bool IsLastDepend() const
-		{ return pRoot && !pRoot->pLeft && !pRoot->pRight; }
-
-private:
-	// forbidden and not implemented (see @ SwClient).
-	SwModify & operator= (const SwModify &);
-
-protected:
-	// forbidden and not implemented (see @ SwClient),
-	//   but GCC >= 3.4 needs an accessible "T (const T&)"
-	//   to pass a "T" as a "const T&" argument
-	SwModify (const SwModify &);
+    bool IsLastDepend() { return pRoot && pRoot->IsLast(); }
+    int GetClientCount() const;
 };
 
 // ----------
 // ----------
 
 /*
- * Sehr sinnvolle Klasse, wenn ein Objekt von mehreren Objekten
- * abhaengig ist. Diese sollte fuer jede Abhaengigkeit ein Objekt
- * der Klasse SwDepend als Member haben.
+ * Helper class for objects that need to depend on more than one SwClient
  */
 class SW_DLLPUBLIC SwDepend: public SwClient
 {
 	SwDepend(SwClient *pTellHim, SwModify *pDepend);
 
 	SwClient* GetToTell() { return pToTell; }
-	virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
 
-		// erfrage vom Client Informationen
 	virtual sal_Bool GetInfo( SfxPoolItem & ) const;
 
-private:
-	// forbidden and not implemented (see @ SwClient).
-	SwDepend (const SwDepend &);
-	SwDepend & operator= (const SwDepend &);
+protected:
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue );
+    virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
 };
 
 
 class SwClientIter
 {
-	friend SwClient* SwModify::_Remove(SwClient *);	// fuer Ptr-Korrektur
-	friend void SwModify::Add(SwClient *);			// nur fuer ASSERT !
+	friend SwClient* SwModify::Remove(SwClient *); // for pointer adjustments
+	friend void SwModify::Add(SwClient *pDepend);   // for pointer adjustments
 
-    SwModify const& rRoot;
-	SwClient *pAkt, *pDelNext;
-	// fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von
-	// Clients, wenn der Iterator gerade draufsteht.
+    const SwModify& rRoot;
+
+    // the current object in an iteration
+	SwClient* pAct;
+
+    // in case the current object is already removed, the next object in the list
+    // is marked down to become the current object in the next step
+    // this is necessary because iteration requires access to members of the current object
+    SwClient* pDelNext;
+
+    // SwClientIter objects are tracked in linked list so that they can react
+    // when the current (pAct) or marked down (pDelNext) SwClient is removed 
+    // from its SwModify
 	SwClientIter *pNxtIter;
 
-    SwClient* mpWatchClient;    // if set, SwModify::_Remove checks if this client is removed
-
-	TypeId aSrchId;				// fuer First/Next - suche diesen Type
+    // iterator can be limited to return only SwClient objects of a certain type
+	TypeId aSrchId;
 
 public:
-    SW_DLLPUBLIC SwClientIter( SwModify const& );
+    SW_DLLPUBLIC SwClientIter( const SwModify& );
 	SW_DLLPUBLIC ~SwClientIter();
 
-	const SwModify& GetModify() const		{ return rRoot; }
+	const SwModify& GetModify() const { return rRoot; }
 
-#ifndef CFRONT
-	SwClient* operator++(int);	// zum Naechsten
-	SwClient* operator--(int);	// zum Vorherigen
-#endif
-	SwClient* operator++();		// zum Naechsten
-	SwClient* operator--();		// zum Vorherigen
+	SwClient* operator++(int);
+	SwClient* GoStart();
+	SwClient* GoEnd();
 
-	SwClient* GoStart(); 		// zum Anfang
-	SwClient* GoEnd();			// zum Ende
+    // returns the current SwClient object; 
+    // in case this was already removed, the object marked down to become 
+    // the next current one is returned
+	SwClient* operator()() const
+		{ return pDelNext == pAct ? pAct : pDelNext; }
 
-	inline SwClient* GoRoot(); 		// wieder ab Root (==Start) anfangen
-
-	SwClient* operator()() const
-		{ return pDelNext == pAkt ? pAkt : pDelNext; }
-
-	int IsChanged() const { return pDelNext != pAkt; }
+    // return "true" if an object was removed from a client chain in iteration
+    // adding objects to a client chain in iteration is forbidden
+    // SwModify::Add() asserts this
+	bool IsChanged() const { return pDelNext != pAct; }
 
 	SW_DLLPUBLIC SwClient* First( TypeId nType );
 	SW_DLLPUBLIC SwClient* Next();
-
-    const SwClient* GetWatchClient() const { return mpWatchClient; }
-    void SetWatchClient( SwClient* pWatch ) { mpWatchClient = pWatch; }
+	SW_DLLPUBLIC SwClient* Last( TypeId nType );
+	SW_DLLPUBLIC SwClient* Previous();
 };
 
-inline SwClient* SwClientIter::GoRoot()		// wieder ab Root anfangen
-{
-	pAkt = rRoot.pRoot;
-	return (pDelNext = pAkt);
-}
-
-
-
 #endif

File sw/inc/crsrsh.hxx

     */
     SW_DLLPRIVATE void UpdateMarkedListLevel();
 
+protected:
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
 public:
     TYPEINFO();
     SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
     SwCrsrShell( SwCrsrShell& rShell, Window *pWin );
     virtual ~SwCrsrShell();
 
-    virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
     // IShellCursorSupplier
     virtual SwPaM & CreateNewShellCursor();
     virtual SwPaM & GetCurrentShellCursor();

File sw/inc/dcontact.hxx

 #define	_DCONTACT_HXX
 
 #include <svx/svdobj.hxx>
-// OD 14.05.2003 #108784#
 #include <svx/svdovirt.hxx>
-// OD 2004-01-16 #110582#
 #include <swtypes.hxx>
 #include <fmtanchr.hxx>
 #include <frmfmt.hxx>
-
-// OD 17.06.2003 #108784#
 #include <list>
 
 #include "calbck.hxx"
+#include <anchoreddrawobject.hxx>
 
 class SfxPoolItem;
 class SwFrmFmt;
 class SwFmtAnchor;
 class SwFlyDrawObj;
 class SwRect;
-// OD 17.06.2003 #108784# - forward declaration for class <SwDrawVirtObj>
 class SwDrawContact;
-// OD 2004-01-16 #110582#
 struct SwPosition;
 class SwIndex;
-// OD 2004-03-25 #i26791#
-#include <anchoreddrawobject.hxx>
+class SdrTextObj;
 
 //Der Umgekehrte Weg: Sucht das Format zum angegebenen Objekt.
 //Wenn das Object ein SwVirtFlyDrawObj ist so wird das Format von
 
         @author
     */
-    virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
+    virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
 
     /** get minimum order number of anchored objects handled by with contact
 
     // OD 2004-04-01 #i26791#
     SwFlyDrawObj* mpMasterObj;
 
-    /** method to determine new order number for new instance of <SwVirtFlyDrawObj>
-
-        OD 2004-08-16 #i27030#
-        Used in method <CreateNewRef(..)>.
-
-        @author OD
-    */
-    sal_uInt32 _GetOrdNumForNewRef( const SwFlyFrm* pFlyFrm );
+protected:
+	 // virtuelle Methoden von SwClient
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
 
 public:
 	TYPEINFO();
     virtual SdrObject* GetMaster();
     virtual void SetMaster( SdrObject* _pNewMaster );
 
-    SwVirtFlyDrawObj* CreateNewRef( SwFlyFrm* pFly );
-
-	// virtuelle Methoden von SwClient
-	virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
     // OD 2004-01-16 #110582# - override methods to control Writer fly frames,
     // which are linked, and to assure that all objects anchored at/inside the
     // Writer fly frame are also made visible/invisible.
 
         @author
     */
-    virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const;
+    virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
 };
 
 // OD 16.05.2003 #108784# - new class for re-direct methods calls at a 'virtual'
         SwDrawContact( const SwDrawContact& );
         SwDrawContact& operator=( const SwDrawContact& );
         // <--
+
+    protected:        
+        // virtuelle Methoden von SwClient
+        virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
     public:
         TYPEINFO();
 
         // by frame.
         SdrObject* GetDrawObjectByAnchorFrm( const SwFrm& _rAnchorFrm );
 
-        // virtuelle Methoden von SwClient
-        virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
         // virtuelle Methoden von SdrObjUserCall
         virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect);
 
 
             @author
         */
-        virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const;
+
+        static void GetTextObjectsFromFmt( std::list<SdrTextObj*>&, SwDoc* );
+        virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const;
 };
 
 #endif

File sw/inc/ddefld.hxx

File contents unchanged.

File sw/inc/doc.hxx

 	SwTOXTypes		*pTOXTypes;			// Verzeichnisse
 	SwDefTOXBase_Impl * pDefTOXBases;	// defaults of SwTOXBase's
 
-	SwRootFrm		*pLayout;			// Rootframe des spezifischen Layouts.
+	ViewShell		*pCurrentView;	// SwDoc should get a new member pCurrentView//swmod 071225
 	SdrModel		*pDrawModel;		// StarView Drawing
 
 	SwDocUpdtFld 	*pUpdtFlds;			// Struktur zum Field-Update
     bool mbNewFldLst             : 1;    // TRUE: Felder-Liste neu aufbauen
     bool mbCopyIsMove            : 1;    // TRUE: Copy ist ein verstecktes Move
     bool mbVisibleLinks          : 1;    // TRUE: Links werden sichtbar eingefuegt
-    bool mbBrowseMode            : 1;    // TRUE: Dokument im BrowseModus anzeigen
     bool mbInReading             : 1;    // TRUE: Dokument wird gerade gelesen
     bool mbInXMLImport           : 1;    // TRUE: During xml import, attribute portion building is not necessary
     bool mbUpdateTOX             : 1;    // TRUE: nach Dokument laden die TOX Updaten
     bool mbProtectForm                              : 1;
     bool mbTabAtLeftIndentForParagraphsInList;             // OD 2008-06-05 #i89181# - see above
 
+    bool mbLastBrowseMode                           : 1;
+
 	// #i78591#
 	sal_uInt32  n32DummyCompatabilityOptions1;
 	sal_uInt32  n32DummyCompatabilityOptions2;
 
     /** IDocumentLayoutAccess
     */
-    virtual const SwRootFrm* GetRootFrm() const ;
-    virtual       SwRootFrm* GetRootFrm();
-    virtual void SetRootFrm( SwRootFrm* pNew );
+	virtual void SetCurrentViewShell( ViewShell* pNew );//swmod 071225
     virtual SwLayouter* GetLayouter();
     virtual const SwLayouter* GetLayouter() const;
     virtual void SetLayouter( SwLayouter* pNew );
     virtual SwFrmFmt* MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet );
     virtual void DelLayoutFmt( SwFrmFmt *pFmt );
     virtual SwFrmFmt* CopyLayoutFmt( const SwFrmFmt& rSrc, const SwFmtAnchor& rNewAnchor, bool bSetTxtFlyAtt, bool bMakeFrms );
+	virtual const ViewShell *GetCurrentViewShell() const;	//swmod 080219
+	virtual ViewShell *GetCurrentViewShell();//swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later.
+	virtual const SwRootFrm *GetCurrentLayout() const;
+	virtual SwRootFrm *GetCurrentLayout();//swmod 080219
+    virtual bool HasLayout() const;
 
     /** IDocumentTimerAccess
     */
     String GetUniqueOLEName() const;
 	String GetUniqueFrameName() const;
 
+	std::set<SwRootFrm*> GetAllLayouts();//swmod 080225
+
 	void SetFlyName( SwFlyFrmFmt& rFmt, const String& rName );
 	const SwFlyFrmFmt* FindFlyByName( const String& rName, sal_Int8 nNdTyp = 0 ) const;
 
 
     // get the set of printable pages for the XRenderable API by
     // evaluating the respective settings (see implementation)
-    void CalculatePagesForPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, 
+    void CalculatePagesForPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, 
             sal_Int32 nDocPageCount );
     void UpdatePagesForPrintingWithPostItData( SwRenderData &rData, const SwPrintUIOptions &rOptions, bool bIsPDFExport, 
             sal_Int32 nDocPageCount );
-    void CalculatePagePairsForProspectPrinting( SwRenderData &rData, const SwPrintUIOptions &rOptions, 
+    void CalculatePagePairsForProspectPrinting( const SwRootFrm& rLayout, SwRenderData &rData, const SwPrintUIOptions &rOptions, 
             sal_Int32 nDocPageCount );
 
-    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]; }
 	// update all modified OLE-Objects. The modification is called over the
 	// StarOne - Interface				--> Bug 67026
 	void SetOLEObjModified()
-	{	if( GetRootFrm() ) aOLEModifiedTimer.Start(); }
+	{	if( GetCurrentViewShell() ) aOLEModifiedTimer.Start(); }	//swmod 071107//swmod 071225
 
 	// -------------------- Uno - Schnittstellen ---------------------------
 	const SwUnoCrsrTbl& GetUnoCrsrTbl() const 		{ return *pUnoCrsrTbl; }

File sw/inc/docsh.hxx

 	void EnterWait( sal_Bool bLockDispatcher );
 	void LeaveWait( sal_Bool bLockDispatcher );
 
-	void ToggleBrowserMode(sal_Bool bOn, SwView* pView = 0);
+	void ToggleBrowserMode(sal_Bool bOn, SwView* pView);
 
 	sal_uLong LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt,
 								sal_Bool bUnoCall );

File sw/inc/docufld.hxx

 	SwRefPageSetFieldType();
 
 	virtual SwFieldType*	Copy() const;
+
+protected:
 	// ueberlagert, weil es nichts zum Updaten gibt!
-	virtual void			Modify( SfxPoolItem *, SfxPoolItem * );
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
 };
 
 /*--------------------------------------------------------------------
 	sal_Int16		nNumberingType;
 
 	void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
-
+protected:
+	// ueberlagert, um alle RefPageGet-Felder zu updaten
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
 public:
 	SwRefPageGetFieldType( SwDoc* pDoc );
 	virtual SwFieldType*    Copy() const;
-
-	// ueberlagert, um alle RefPageGet-Felder zu updaten
-	virtual void Modify( SfxPoolItem *, SfxPoolItem * );
 	sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst );
-
     SwDoc*  GetDoc() const                  { return pDoc; }
 };
 

File sw/inc/expfld.hxx

 		// ueberlagert, weil das Get-Field nicht veraendert werden kann
 		// und dann auch nicht aktualisiert werden muss. Aktualisierung
 		// erfolgt beim Aendern von Set-Werten !
-
-		virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+protected:
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
 };
 
 /*--------------------------------------------------------------------
 {
 	String 		sName;
 	const SwNode* pOutlChgNd;
-//	sal_Unicode cDelim;
 	String		sDelim;
 	sal_uInt16 		nType;
 	sal_uInt8		nLevel;
 	sal_Bool		bDeleted;
 
+protected:
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
 public:
 	SwSetExpFieldType( SwDoc* pDoc, const String& rName,
 						sal_uInt16 nType = nsSwGetSetExpType::GSE_EXPR );
 
 	// ueberlagert, weil das Set-Field selbst dafuer sorgt, das
 	// es aktualisiert wird.
-	virtual void 			Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
 	inline const String& 	GetSetRefName() const;
 
 	sal_uInt16 SetSeqRefNo( SwSetExpField& rFld );

File sw/inc/fchrfmt.hxx

 
 	// @@@ public copy ctor, but no copy assignment?
 	SwFmtCharFmt( const SwFmtCharFmt& rAttr );
+protected:
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
 private:
 	// @@@ public copy ctor, but no copy assignment?
 	SwFmtCharFmt & operator= (const SwFmtCharFmt &);
 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
 
-	// an das SwTxtCharFmt weiterleiten (vom SwClient)
-	virtual void    Modify( SfxPoolItem*, SfxPoolItem* );
 	virtual sal_Bool 	GetInfo( SfxPoolItem& rInfo ) const;
 
 	void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); }

File sw/inc/fldbas.hxx

 
 inline void SwFieldType::UpdateFlds() const
 {
-	((SwFieldType*)this)->Modify( 0, 0 );
+	((SwFieldType*)this)->ModifyNotification( 0, 0 );
 }
 
 /*--------------------------------------------------------------------

File sw/inc/fmtcol.hxx

           //nOutlineLevel( NO_NUMBERING )	//<-#outline level,removed by zhaojianwei
 		  mbAssignedToOutlineStyle(false)	//<-#outline level,added by zhaojianwei
     { pNextTxtFmtColl = this; }
-public:
 
 	// zum "abfischen" von UL-/LR-/FontHeight Aenderungen
-	virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
+public:
 
 	TYPEINFO();		//Bereits in Basisklasse Client drin.
 
 
 	void SetCondition( sal_uLong nCond, sal_uLong nSubCond );
 	SwTxtFmtColl* GetTxtFmtColl() const 	{ return (SwTxtFmtColl*)GetRegisteredIn(); }
+    void RegisterToFormat( SwFmt& );
 };
 
 
 
 	virtual ~SwConditionTxtFmtColl();
 
-	// zum "abfischen" von Aenderungen
-//	virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
 	const SwCollCondition* HasCondition( const SwCollCondition& rCond ) const;
 	const SwFmtCollConditions& GetCondColls() const		{ return aCondColls; }
 	void InsertCondition( const SwCollCondition& rCond );

File sw/inc/fmtfld.hxx

 #ifndef _FMTFLD_HXX
 #define _FMTFLD_HXX
 
+#include <list>
 #include <svl/poolitem.hxx>
 #include <svl/brdcst.hxx>
 #include <svl/smplhint.hxx>
 class SwField;
 class SwTxtFld;
 class SwView;
+class SwFieldType;
 
 // ATT_FLD ***********************************
 class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
 	// @@@ copy construction allowed, but copy assignment is not? @@@
 	SwFmtFld& operator=(const SwFmtFld& rFld);
 
+protected:
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+    virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint );
+
 public:
 	TYPEINFO();
 
 	virtual int             operator==( const SfxPoolItem& ) const;
 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
 
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
 	virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
 
 	const SwField *GetFld() const	{ return pField; }
 	const SwTxtFld *GetTxtFld() const	{ return pTxtAttr; }
 	SwTxtFld *GetTxtFld()				{ return pTxtAttr; }
 
+    void RegisterToFieldType( SwFieldType& );
 	sal_Bool IsFldInDoc() const;
 	sal_Bool IsProtect() const;
 };

File sw/inc/fmthdft.hxx

 
 class SwFrmFmt;
 class IntlWrapper;
-
+class SwFmt;
 
 //Kopfzeile, fuer Seitenformate
 //Client von FrmFmt das den Header beschreibt.
 									String &rText,
                                     const IntlWrapper*    pIntl = 0 ) const;
 
-	const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)pRegisteredIn; }
-		  SwFrmFmt *GetHeaderFmt()		 { return (SwFrmFmt*)pRegisteredIn; }
+	const SwFrmFmt *GetHeaderFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
+		  SwFrmFmt *GetHeaderFmt()		 { return (SwFrmFmt*)GetRegisteredIn(); }
 
+    void RegisterToFormat( SwFmt& rFmt );
 	sal_Bool IsActive() const { return bActive; }
 	void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
 };
 
+
 //Fusszeile, fuer Seitenformate
 //Client von FrmFmt das den Footer beschreibt.
 
 									String &rText,
                                     const IntlWrapper*    pIntl = 0 ) const;
 
-	const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)pRegisteredIn; }
-		  SwFrmFmt *GetFooterFmt()		 { return (SwFrmFmt*)pRegisteredIn; }
+	const SwFrmFmt *GetFooterFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
+		  SwFrmFmt *GetFooterFmt()		 { return (SwFrmFmt*)GetRegisteredIn(); }
 
+    void RegisterToFormat( SwFmt& rFmt );
 	sal_Bool IsActive() const { return bActive; }
 	void SetActive( sal_Bool bNew = sal_True ) { bActive = bNew; }
 };

File sw/inc/fmtmeta.hxx

                     ::com::sun::star::rdf::XMetadatable> const& xMeta)
             { m_wXMeta = xMeta; }
 
+    // SwClient
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
 public:
     explicit Meta(SwFmtMeta * const i_pFmt = 0);
     virtual ~Meta();
 
-    // SwClient
-    virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
     // sfx2::Metadatable
     virtual ::sfx2::IXmlIdRegistry& GetRegistry();
     virtual bool IsInClipboard() const;

File sw/inc/fmtpdsc.hxx

 class SwHistory;
 class SwPaM;
 class IntlWrapper;
+class SwEndNoteInfo;
 
 //Pagedescriptor
 //Client vom SwPageDesc der durch das Attribut "beschrieben" wird.
 	sal_uInt16 nDescNameIdx;		// SW3-Reader: Stringpool-Index des Vorlagennamens
 	SwModify* pDefinedIn;		// Verweis auf das Objekt, in dem das
 								// Attribut gesetzt wurde (CntntNode/Format)
+protected:
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+    virtual void SwClientNotify( const SwModify&, const SfxHint& rHint );
 
 public:
 	SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
 
-	virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
 		  SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
 	const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
 
 	// erfrage/setze, wo drin das Attribut verankert ist
 	inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
 	void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; }
+    void RegisterToEndNotInfo( SwEndNoteInfo& );
+    void RegisterToPageDesc( SwPageDesc& );
+    bool KnowsPageDesc() const;
 };
 
 

File sw/inc/format.hxx

 
 class SW_DLLPUBLIC SwFmt : public SwModify
 {
-//  friend class SwSwgReader;
-//  friend class SwSwgWriter;
-
 	String aFmtName;
 	SwAttrSet aSet;
 
 	SwFmt( SwAttrPool& rPool, const String &rFmtNm, const sal_uInt16* pWhichRanges,
 			SwFmt *pDrvdFrm, sal_uInt16 nFmtWhich );
 	SwFmt( const SwFmt& rFmt );
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
 
 public:
 	TYPEINFO();		//Bereits in Basisklasse Client drin.
 	// fuer die Abfrage der Writer-Funktionen
 	sal_uInt16 Which() const { return nWhichId; }
 
-	virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
 		// erfrage vom Format Informationen
 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 
     virtual sal_uInt16 ResetAllFmtAttr();
     // <--
 
-	inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; }
+	inline SwFmt* DerivedFrom() const { return (SwFmt*)GetRegisteredIn(); }
 	inline sal_Bool IsDefault() const { return DerivedFrom() == 0; }
 
 	inline const String& GetName() const 		{ return aFmtName; }

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 <tools/gen.hxx>
-
 #include <format.hxx>
-
 #include "swdllapi.h"
 
 class SwFlyFrm;
 				pDrvdFrm, nFmtWhich )
 	{}
 
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
 public:
 	TYPEINFO();		//Bereits in Basisklasse Client drin.
 
 
 	virtual Graphic MakeGraphic( ImageMap* pMap = NULL );
 
-	virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
-
 	// returnt das IMapObject, das an dem Format (Fly), in der ImageMap
 	// an der Point Position definiert ist.
 	// 	rPoint - teste auf der DocPosition
             { m_wXObject = xObject; }
 
 	DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
+    void RegisterToFormat( SwFmt& rFmt );
 };
 
 //Das FlyFrame-Format ------------------------------

File sw/inc/ftninfo.hxx

 
 #include <tools/string.hxx>
 #include "swdllapi.h"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
 #include <calbck.hxx>
 #include <editeng/numitem.hxx>
 
 	String 		sSuffix;
 protected:
     bool        m_bEndNote;
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
 public:
 	SvxNumberType aFmt;
 	sal_uInt16 	  nFtnOffset;
 
 	void 		ChgPageDesc( SwPageDesc *pDesc );
-	SwPageDesc *GetPageDesc( SwDoc &rDoc ) const;
-	SwClient   *GetPageDescDep() const { return (SwClient*)&aPageDescDep; }
+	SwPageDesc* GetPageDesc( SwDoc &rDoc ) const;
+    bool        KnowsPageDesc() const;
+    bool        DependsOn( const SwPageDesc* ) const;
 
 	void SetFtnTxtColl(SwTxtFmtColl& rColl);
 	SwTxtFmtColl* GetFtnTxtColl() const { return  (SwTxtFmtColl*) GetRegisteredIn(); } // kann 0 sein
 	void SetAnchorCharFmt( SwCharFmt* );
 	SwClient   *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; }
 
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
 	SwEndNoteInfo & operator=(const SwEndNoteInfo&);
 	sal_Bool operator==( const SwEndNoteInfo &rInf ) const;
 
 
 	void SetPrefix(const String& rSet)		{ sPrefix = rSet; }
 	void SetSuffix(const String& rSet)		{ sSuffix = rSet; }
+    void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
 };
 
 enum SwFtnPos

File sw/inc/lineinfo.hxx

 #define SW_LINEINFO_HXX
 
 #include "calbck.hxx"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
 #include <editeng/numitem.hxx>
 #include "swdllapi.h"
 
 	sal_Bool				bCountInFlys;		//Count also within FlyFrames?
 	sal_Bool				bRestartEachPage;	//Restart counting at the first paragraph of each page
 											//(even on follows when paragraphs are splitted)
+protected:
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
 
 public:
 	SwLineNumberInfo();
 	sal_Bool   IsRestartEachPage() const	{ return bRestartEachPage;	}
 	void   SetRestartEachPage( sal_Bool b )	{ bRestartEachPage = b;		}
 
-	virtual	void Modify( SfxPoolItem*, SfxPoolItem* );
+    bool   HasCharFormat() const { return GetRegisteredIn() != 0; }
 };
 
 

File sw/inc/ndnotxt.hxx

 public:
 	~SwNoTxtNode();
 
-	virtual SwCntntFrm *MakeFrm();
+	virtual SwCntntFrm *MakeFrm( SwFrm* );
 
     inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
 

File sw/inc/ndtxt.hxx

 #include <vector>
 #include <set>
 
-
+class SfxHint;
 class SwNumRule;
 class SwNodeNum;
-// --> OD 2008-05-06 #refactorlists#
 class SwList;
-// <--
-// --> OD 2008-12-02 #i96772#
 class SvxLRSpaceItem;
-// <--
 
 namespace utl {
 	class TransliterationWrapper;
     //
     // End: Data collected during idle time
     //
+protected:
+	// fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
+    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+    virtual void SwClientNotify( const SwModify&, const SfxHint& );
 
 public:
     using SwCntntNode::GetAttr;
 					const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
 
 	// virtuelle Methoden aus dem CntntNode
-	virtual SwCntntFrm *MakeFrm();
+	virtual SwCntntFrm *MakeFrm( SwFrm* );
     virtual SwCntntNode *SplitCntntNode( const SwPosition & );
 	virtual SwCntntNode *JoinNext();
 	virtual SwCntntNode *JoinPrev();
 
 	TYPEINFO();	// fuer rtti
 
-	// fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
-	virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
     // override SwIndexReg
     virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
                  const bool bNegative = false, const bool bDelete = false );

File sw/inc/node.hxx

 class SwSectionNode;
 class SwStartNode;
 class SwTabFrm;
+class SwRootFrm;
 class SwTable;
 class SwTableNode;
 class SwTableBox;
 class IDocumentLinksAdministration;
 class IDocumentFieldsAccess;
 class IDocumentContentOperations;
-// --> OD 2007-10-31 #i83479#
 class IDocumentListItems;
-// <--
+class SwOLENodes;
 
 // --------------------
 // class SwNode
     // SwAttrSet (handle):
     sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
 
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
 public:
 	TYPEINFO();		//Bereits in Basisklasse Client drin.
 
-	virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+    // MakeFrm will be called for a certain layout
+    // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent)
+	virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0;
 
-	virtual SwCntntFrm *MakeFrm() = 0;
     virtual SwCntntNode *SplitCntntNode(const SwPosition & ) = 0;
+
 	virtual SwCntntNode *JoinNext();
 	virtual SwCntntNode *JoinPrev();
 	// koennen 2 Nodes zusammengefasst werden ?
 	sal_Bool GoNext(SwIndex *, sal_uInt16 nMode ) const;
 	sal_Bool GoPrevious(SwIndex *, sal_uInt16 nMode ) const;
 
-	SwCntntFrm *GetFrm( const Point* pDocPos = 0,
+    // Replacement for good old GetFrm(..):
+	SwCntntFrm *getLayoutFrm( const SwRootFrm*,
+                        const Point* pDocPos = 0,
 						const SwPosition *pPos = 0,
 						const sal_Bool bCalcFrm = sal_True ) const;
 	// Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres
     inline void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
     inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr; }
 
+    static SwOLENodes* CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize );
+
 private:
 	// privater Constructor, weil nie kopiert werden darf !!
 	SwCntntNode( const SwCntntNode & rNode );
 	SwCntntNode & operator= ( const SwCntntNode & rNode );
-
 };
 
 
 
 	const SwTable& GetTable() const { return *pTable; }
 	SwTable& GetTable() { return *pTable; }
-	SwTabFrm *MakeFrm();
+	SwTabFrm *MakeFrm( SwFrm* );
 
 	//Legt die Frms fuer den TableNode (also die TabFrms) an.
 	void MakeFrms( SwNodeIndex* pIdxBehind );
     const SwSection& GetSection() const { return *m_pSection; }
           SwSection& GetSection()       { return *m_pSection; }
 
-	SwFrm *MakeFrm();
+	SwFrm *MakeFrm( SwFrm* );
 
 	//Legt die Frms fuer den SectionNode (also die SectionFrms) an.
 	//Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt,

File sw/inc/numrule.hxx

 #include "swdllapi.h"
 #include <swtypes.hxx>
 #include <calbck.hxx>
-#include <errhdl.hxx> 		// Fuer die inline-ASSERTs
-#include <error.h>			// Fuer die inline-ASSERTs
+#include <errhdl.hxx>
+#include <error.h>	
 #include <hints.hxx>
 #include <hash_map>
 #include <stringhash.hxx>
-// --> OD 2008-02-21 #refactorlists#
+#include <SwNumberTreeTypes.hxx>
+#include <vector>
+
+class SwTxtFmtColl;
+class IDocumentListsAccess;
 class SwNodeNum;
-#include <SwNumberTreeTypes.hxx>
-// <--
-// --> OD 2008-02-19 #refactorlists#
-#include <vector>
-class SwTxtFmtColl;
-// <--
-// --> OD 2008-07-08 #i91400#
-class IDocumentListsAccess;
-// <--
-
 class Font;
 class SvxBrushItem;
 class SvxNumRule;
     using SvxNumberFormat::operator ==;
     using SvxNumberFormat::operator !=;
 
+protected:
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
 public:
 	SwNumFmt();
 	SwNumFmt( const SwNumFmt& );
 	sal_Bool operator==( const SwNumFmt& ) const;
 	sal_Bool operator!=( const SwNumFmt& r ) const { return !(*this == r); }
 
-	SwCharFmt* GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; }
+	SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
 	void SetCharFmt( SwCharFmt* );
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+    void ForgetCharFmt();
 
 	virtual void			SetCharFmtName(const String& rSet);
 	virtual const String&	GetCharFmtName()const;
     String msDefaultListId;
     // <--
 
-	// forbidden and not implemented.
-	SwNumRule();
-
 public:
     // --> OD 2008-02-08 #newlistlevelattrs#
     // add parameter <eDefaultNumberFormatPositionAndSpaceMode>

File sw/inc/pagedesc.hxx

 
 	SW_DLLPRIVATE SwPageDesc(const String&, SwFrmFmt*, SwDoc *pDc );
 
+protected:
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue );
+
 public:
 	const String &GetName() const { return aDescName; }
 		  void 	  SetName( const String& rNewName ) { aDescName = rNewName; }
 
 	void SetRegisterFmtColl( const SwTxtFmtColl* rFmt );
 	const SwTxtFmtColl* GetRegisterFmtColl() const;
-	virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
 	void RegisterChange();
 
 	// erfragen und setzen der PoolFormat-Id

File sw/inc/paratr.hxx

 private:
 	// @@@ public copy ctor, but no copy assignment?
 	SwFmtDrop & operator= (const SwFmtDrop &);
+
+protected:
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
 public:
 
 	// "pure virtual Methoden" vom SfxPoolItem
 	inline sal_uInt16 GetDistance() const { return nDistance; }
 	inline sal_uInt16 &GetDistance() { return nDistance; }
 
-    inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)pRegisteredIn; }
-	inline SwCharFmt *GetCharFmt()       { return (SwCharFmt*)pRegisteredIn; }
+   inline const SwCharFmt *GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
+	inline SwCharFmt *GetCharFmt()       { return (SwCharFmt*)GetRegisteredIn(); }
 	void SetCharFmt( SwCharFmt *pNew );
-	virtual void Modify( SfxPoolItem*, SfxPoolItem* );
 		// erfrage vom Client Informationen
 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 

File sw/inc/printdata.hxx

 class SwViewOption;
 class OutputDevice;
 class SwViewOptionAdjust_Impl;
-class SwWrtShell;
+class SwPrtOptions;
+class ViewShell;
 class SfxViewShell;
 
 // forward declarations
     void DeletePostItData();
 
     bool IsViewOptionAdjust() const  { return m_pViewOptionAdjust != 0; }
-    bool NeedNewViewOptionAdjust( const SwWrtShell& ) const;
-    void ViewOptionAdjustStart( SwWrtShell &rSh, const SwViewOption &rViewOptions );
-    void ViewOptionAdjust( SwPrintData const*const pPrtOptions );
+    bool NeedNewViewOptionAdjust( const ViewShell& ) const;
+    void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions );
+    void ViewOptionAdjust( SwPrintData const* const pPrtOptions );
     void ViewOptionAdjustStop();
 
     bool HasSwPrtOptions() const    { return m_pPrtOptions != 0; }

File sw/inc/reffld.hxx

 class SwGetRefFieldType : public SwFieldType
 {
 	SwDoc* pDoc;
+protected:
+	// ueberlagert, um alle Ref-Felder zu updaten
+   virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
 public:
 	SwGetRefFieldType(SwDoc* pDoc );
 	virtual SwFieldType*    Copy() const;
 
 	SwDoc* 					GetDoc() const { return pDoc; }
-	// ueberlagert, um alle Ref-Felder zu updaten
-	virtual void Modify( SfxPoolItem *, SfxPoolItem * );
 
 	void MergeWithOtherDoc( SwDoc& rDestDoc );
 

File sw/inc/section.hxx

 
 class SW_DLLPUBLIC SwSection
     : public SwClient
-    , private ::boost::noncopyable
 {
 	// damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird!
 	friend class SwSectionNode;
     SW_DLLPRIVATE void ImplSetHiddenFlag(
             bool const bHidden, bool const bCondition);
 
+protected:
+    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
 public:
 	TYPEINFO();		// rtti
 
     SectionType GetType() const             { return m_Data.GetType(); }
     void SetType(SectionType const eType)   { return m_Data.SetType(eType); }
 
-	SwSectionFmt* GetFmt() 			{ return (SwSectionFmt*)pRegisteredIn; }
-	SwSectionFmt* GetFmt() const	{ return (SwSectionFmt*)pRegisteredIn; }
-
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+	SwSectionFmt* GetFmt() 			{ return (SwSectionFmt*)GetRegisteredIn(); }
+	SwSectionFmt* GetFmt() const	{ return (SwSectionFmt*)GetRegisteredIn(); }
 
 	// setze die Hidden/Protected -> gesamten Baum updaten !
 	// (Attribute/Flags werden gesetzt/erfragt)
 
 protected:
 	SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc );
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
 
 public:
 	TYPEINFO();		//Bereits in Basisklasse Client drin.
 	//Erzeugt die Ansichten
 	virtual void MakeFrms();
 
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
 		// erfrage vom Format Informationen
 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
 

File sw/inc/swcrsr.hxx

 
 	// @@@ semantic: no copy ctor.
 	SwCursor( SwCursor& rCpy);
-private:
-	// forbidden and not implemented.
-    //SwCursor( const SwCursor& );
-	// @@@ used e.g. in core/frmedt/fetab.cxx @@@
-	// SwCursor & operator= ( const SwCursor& );
+
 public:
 
 	virtual SwCursor* Create( SwPaM* pRing = 0 ) const;
     sal_Bool GoEndWord();
     sal_Bool GoNextWord();
     sal_Bool GoPrevWord();
-    sal_Bool SelectWord( const Point* pPt = 0 );
+    sal_Bool SelectWord( ViewShell* pViewShell, const Point* pPt = 0 );
 
     // API versions of above functions (will be used with a different
     // WordType for the break iterator)
     sal_Bool GoEndWordWT( sal_Int16 nWordType );
     sal_Bool GoNextWordWT( sal_Int16 nWordType );
     sal_Bool GoPrevWordWT( sal_Int16 nWordType );
-    sal_Bool SelectWordWT( sal_Int16 nWordType, const Point* pPt = 0 );
+    sal_Bool SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt = 0 );
 
 	enum SentenceMoveType
 	{

File sw/inc/swddetbl.hxx

 				sal_Bool bUpdate = sal_True );
 	~SwDDETable();
 
-	void Modify( SfxPoolItem*, SfxPoolItem* );
 	void ChangeContent();
 	sal_Bool  NoDDETable();
 
 	SwDDEFieldType* GetDDEFldType();
 	inline const SwDDEFieldType* GetDDEFldType() const;
+protected:
+    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+    virtual void SwClientNotify( const SwModify&, const SfxHint& );    
 };
 
 

File sw/inc/switerator.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 _SWITERATOR_HXX
+#define _SWITERATOR_HXX
+
+#include <calbck.hxx>
+#include <tools/debug.hxx>
+
+template< class TElementType, class TSource > class SwIterator 
+{
+    SwClientIter aClientIter;
+public:
+
+    SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
+    TElementType* First()     { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+    TElementType* Last()      { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+    TElementType* Next()      { SwClient* p = aClientIter.Next();     return PTR_CAST(TElementType,p); }
+    TElementType* Previous()  { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p);  }
+    static TElementType* FirstElement( const TSource& rMod ) { SwClient* p = SwClientIter(rMod).First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+    bool IsChanged()          { return aClientIter.IsChanged(); }
+};
+
+#endif

File sw/inc/swtable.hxx

 #ifndef _SWTABLE_HXX
 #define _SWTABLE_HXX
 #include <tools/mempool.hxx>
-#ifndef _TOOLS_REF_HXX
 #include <tools/ref.hxx>
-#endif
 #include <svl/svarray.hxx>
 #include <tblenum.hxx>
 #include <swtypes.hxx>
 #include <boost/noncopyable.hpp>
 #endif
 
+class SwFmt;
 class Color;
 class SwFrmFmt;
 class SwTableFmt;
 
 class SW_DLLPUBLIC SwTable: public SwClient			 //Client vom FrmFmt
 {
-    using SwClient::IsModifyLocked;
+
 
 protected:
 	SwTableLines aLines;
 
 	sal_Bool IsModifyLocked(){ return bModifyLocked;}
 
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
 public:
     enum SearchType
     {
 		  SwTableLines &GetTabLines() { return aLines; }
 	const SwTableLines &GetTabLines() const { return aLines; }
 
-	SwFrmFmt* GetFrmFmt() 		{ return (SwFrmFmt*)pRegisteredIn; }
-	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)pRegisteredIn; }
-
-	virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+	SwFrmFmt* GetFrmFmt() 		{ return (SwFrmFmt*)GetRegisteredIn(); }
+	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
+	SwTableFmt* GetTableFmt() const	{ return (SwTableFmt*)GetRegisteredIn(); }
 
 	void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
 					 sal_Bool bHidden = sal_False, sal_Bool bCurRowOnly = sal_False ) const;
 						SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
 	sal_Bool SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
 						SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
+    void RegisterToFormat( SwFmt& rFmt );
 #ifdef DBG_UTIL
     void CheckConsistency() const;
 #endif
 	void SetUpper( SwTableBox *pNew ) { pUpper = pNew; }
 
 
-	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)pRegisteredIn; }
-	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)pRegisteredIn; }
+	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)GetRegisteredIn(); }
+	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
 
 	//Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen.
 	SwFrmFmt* ClaimFrmFmt();
     SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
 
     bool hasSoftPageBreak() const;
+    void RegisterToFormat( SwFmt& rFmt );
 };
 
 class SW_DLLPUBLIC SwTableBox: public SwClient		//Client vom FrmFmt
 	const SwTableLine *GetUpper() const { return pUpper; }
 	void SetUpper( SwTableLine *pNew ) { pUpper = pNew; }
 
-	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)pRegisteredIn; }
-	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)pRegisteredIn; }
+	SwFrmFmt* GetFrmFmt()		{ return (SwFrmFmt*)GetRegisteredIn(); }
+	SwFrmFmt* GetFrmFmt() const	{ return (SwFrmFmt*)GetRegisteredIn(); }
 
 	//Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen.
 	SwFrmFmt* ClaimFrmFmt();
     const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
         sal_uInt16 nMaxStep = USHRT_MAX ) const
         { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
+    void RegisterToFormat( SwFmt& rFmt ) ;
+    void ForgetFrmFmt();
 };
 
 class SwCellFrm;

File sw/inc/swtblfmt.hxx

 		: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
 	{}
 
+	// zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
+   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
 public: