summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-12-17 09:02:23 +0100
committerMathias Bauer <mba@openoffice.org>2010-12-17 09:02:23 +0100
commitde60fd06b84bc1aa080ef209b0eeb36914bd8b32 (patch)
tree91852e2ba1f7df04e02c5f75ca2fe4a1b58bfb5f /sw
parent5e9bd0b1ce50ae0e03c0563ed2f0cd589d94a287 (diff)
CWS swlayoutrefactoring: #i115510#: first step to clean up the SwClient mess
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/authfld.hxx4
-rw-r--r--sw/inc/calbck.hxx247
-rw-r--r--sw/inc/crsrsh.hxx5
-rw-r--r--sw/inc/dcontact.hxx42
-rw-r--r--sw/inc/docufld.hxx12
-rw-r--r--sw/inc/expfld.hxx7
-rw-r--r--sw/inc/fchrfmt.hxx4
-rw-r--r--sw/inc/fldbas.hxx2
-rw-r--r--sw/inc/fmtcol.hxx9
-rw-r--r--sw/inc/fmtfld.hxx7
-rw-r--r--sw/inc/fmthdft.hxx14
-rwxr-xr-xsw/inc/fmtmeta.hxx6
-rw-r--r--sw/inc/fmtpdsc.hxx9
-rw-r--r--sw/inc/format.hxx7
-rw-r--r--sw/inc/frmfmt.hxx10
-rw-r--r--sw/inc/ftninfo.hxx8
-rw-r--r--sw/inc/lineinfo.hxx7
-rw-r--r--sw/inc/ndtxt.hxx7
-rw-r--r--sw/inc/node.hxx10
-rw-r--r--sw/inc/numrule.hxx21
-rw-r--r--sw/inc/pagedesc.hxx4
-rw-r--r--sw/inc/paratr.hxx9
-rw-r--r--sw/inc/reffld.hxx5
-rw-r--r--sw/inc/rolbck.hxx5
-rw-r--r--sw/inc/section.hxx11
-rw-r--r--sw/inc/swddetbl.hxx3
-rwxr-xr-xsw/inc/switerator.hxx47
-rw-r--r--sw/inc/swtable.hxx26
-rw-r--r--sw/inc/swtblfmt.hxx6
-rw-r--r--sw/inc/tox.hxx12
-rw-r--r--sw/inc/txtatr.hxx12
-rw-r--r--sw/inc/txtinet.hxx6
-rw-r--r--sw/inc/undobj.hxx9
-rw-r--r--sw/inc/unobaseclass.hxx2
-rw-r--r--sw/inc/unobookmark.hxx3
-rw-r--r--sw/inc/unochart.hxx17
-rw-r--r--sw/inc/unodraw.hxx6
-rw-r--r--sw/inc/unofield.hxx31
-rw-r--r--sw/inc/unoflatpara.hxx3
-rw-r--r--sw/inc/unoframe.hxx15
-rw-r--r--sw/inc/unoport.hxx17
-rw-r--r--sw/inc/unoredline.hxx6
-rw-r--r--sw/inc/unoredlines.hxx4
-rw-r--r--sw/inc/unosett.hxx7
-rw-r--r--sw/inc/unostyle.hxx15
-rw-r--r--sw/inc/unotbl.hxx22
-rw-r--r--sw/inc/unotextmarkup.hxx6
-rw-r--r--sw/inc/usrfld.hxx4
-rw-r--r--sw/source/core/access/accframebase.cxx22
-rw-r--r--sw/source/core/access/accframebase.hxx3
-rw-r--r--sw/source/core/access/accmap.cxx16
-rw-r--r--sw/source/core/access/accnotextframe.cxx8
-rw-r--r--sw/source/core/access/accnotextframe.hxx4
-rw-r--r--sw/source/core/access/accpara.cxx4
-rw-r--r--sw/source/core/access/accpara.hxx6
-rw-r--r--sw/source/core/access/acctable.cxx13
-rw-r--r--sw/source/core/access/acctable.hxx7
-rw-r--r--sw/source/core/access/acctextframe.cxx6
-rw-r--r--sw/source/core/access/acctextframe.hxx5
-rw-r--r--sw/source/core/attr/calbck.cxx508
-rw-r--r--sw/source/core/attr/cellatr.cxx11
-rw-r--r--sw/source/core/attr/format.cxx54
-rw-r--r--sw/source/core/crsr/bookmrk.cxx4
-rw-r--r--sw/source/core/crsr/crsrsh.cxx4
-rw-r--r--sw/source/core/crsr/crstrvl.cxx41
-rw-r--r--sw/source/core/crsr/pam.cxx2
-rw-r--r--sw/source/core/doc/acmplwrd.cxx9
-rw-r--r--sw/source/core/doc/doc.cxx51
-rw-r--r--sw/source/core/doc/docbm.cxx2
-rw-r--r--sw/source/core/doc/doccorr.cxx2
-rw-r--r--sw/source/core/doc/docdesc.cxx73
-rw-r--r--sw/source/core/doc/docdraw.cxx25
-rw-r--r--sw/source/core/doc/docedt.cxx8
-rw-r--r--sw/source/core/doc/docfld.cxx69
-rw-r--r--sw/source/core/doc/docfly.cxx52
-rw-r--r--sw/source/core/doc/docfmt.cxx31
-rw-r--r--sw/source/core/doc/docftn.cxx14
-rw-r--r--sw/source/core/doc/docglbl.cxx7
-rw-r--r--sw/source/core/doc/doclay.cxx2
-rw-r--r--sw/source/core/doc/docnew.cxx12
-rw-r--r--sw/source/core/doc/docnum.cxx31
-rw-r--r--sw/source/core/doc/docredln.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx56
-rw-r--r--sw/source/core/doc/fmtcol.cxx29
-rw-r--r--sw/source/core/doc/htmltbl.cxx15
-rw-r--r--sw/source/core/doc/lineinfo.cxx6
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/doc/number.cxx30
-rw-r--r--sw/source/core/doc/tblrwcl.cxx29
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx22
-rw-r--r--sw/source/core/docnode/ndtbl.cxx65
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx12
-rw-r--r--sw/source/core/docnode/node.cxx112
-rw-r--r--sw/source/core/docnode/node2lay.cxx95
-rw-r--r--sw/source/core/docnode/nodes.cxx77
-rw-r--r--sw/source/core/docnode/section.cxx152
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx8
-rw-r--r--sw/source/core/draw/dcontact.cxx168
-rw-r--r--sw/source/core/draw/dview.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx10
-rw-r--r--sw/source/core/edit/edfldexp.cxx12
-rw-r--r--sw/source/core/edit/editsh.cxx20
-rw-r--r--sw/source/core/edit/edlingu.cxx10
-rw-r--r--sw/source/core/edit/edtox.cxx10
-rw-r--r--sw/source/core/fields/authfld.cxx89
-rw-r--r--sw/source/core/fields/cellfml.cxx14
-rw-r--r--sw/source/core/fields/dbfld.cxx70
-rw-r--r--sw/source/core/fields/ddefld.cxx14
-rw-r--r--sw/source/core/fields/ddetbl.cxx10
-rw-r--r--sw/source/core/fields/docufld.cxx104
-rw-r--r--sw/source/core/fields/expfld.cxx45
-rw-r--r--sw/source/core/fields/fldlst.cxx13
-rw-r--r--sw/source/core/fields/postithelper.cxx7
-rw-r--r--sw/source/core/fields/reffld.cxx66
-rw-r--r--sw/source/core/fields/tblcalc.cxx18
-rw-r--r--sw/source/core/fields/usrfld.cxx4
-rw-r--r--sw/source/core/frmedt/feshview.cxx150
-rw-r--r--sw/source/core/frmedt/tblsel.cxx92
-rw-r--r--sw/source/core/graphic/ndgrf.cxx12
-rw-r--r--sw/source/core/inc/bookmrk.hxx6
-rw-r--r--sw/source/core/inc/cellfrm.hxx2
-rw-r--r--sw/source/core/inc/cntfrm.hxx7
-rw-r--r--sw/source/core/inc/flyfrm.hxx18
-rw-r--r--sw/source/core/inc/flyfrms.hxx10
-rw-r--r--sw/source/core/inc/frame.hxx17
-rw-r--r--sw/source/core/inc/frmtool.hxx2
-rw-r--r--sw/source/core/inc/notxtfrm.hxx2
-rw-r--r--sw/source/core/inc/pagefrm.hxx4
-rw-r--r--sw/source/core/inc/rowfrm.hxx2
-rw-r--r--sw/source/core/inc/sectfrm.hxx6
-rw-r--r--sw/source/core/inc/tabfrm.hxx4
-rw-r--r--sw/source/core/inc/txtfrm.hxx5
-rw-r--r--sw/source/core/layout/atrfrm.cxx148
-rw-r--r--sw/source/core/layout/colfrm.cxx7
-rw-r--r--sw/source/core/layout/findfrm.cxx9
-rw-r--r--sw/source/core/layout/flowfrm.cxx39
-rw-r--r--sw/source/core/layout/fly.cxx125
-rw-r--r--sw/source/core/layout/flycnt.cxx2
-rw-r--r--sw/source/core/layout/flyincnt.cxx2
-rw-r--r--sw/source/core/layout/flylay.cxx2
-rw-r--r--sw/source/core/layout/flypos.cxx22
-rw-r--r--sw/source/core/layout/frmtool.cxx324
-rw-r--r--sw/source/core/layout/ftnfrm.cxx145
-rw-r--r--sw/source/core/layout/hffrm.cxx4
-rw-r--r--sw/source/core/layout/movedfwdfrmsbyobjpos.cxx9
-rw-r--r--sw/source/core/layout/newfrm.cxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx21
-rw-r--r--sw/source/core/layout/pagedesc.cxx27
-rw-r--r--sw/source/core/layout/paintfrm.cxx30
-rw-r--r--sw/source/core/layout/sectfrm.cxx11
-rw-r--r--sw/source/core/layout/softpagebreak.cxx15
-rw-r--r--sw/source/core/layout/ssfrm.cxx88
-rw-r--r--sw/source/core/layout/tabfrm.cxx38
-rw-r--r--sw/source/core/layout/wsfrm.cxx27
-rw-r--r--sw/source/core/para/paratr.cxx19
-rw-r--r--sw/source/core/table/swnewtable.cxx7
-rw-r--r--sw/source/core/table/swtable.cxx248
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx48
-rw-r--r--sw/source/core/text/itratr.cxx23
-rw-r--r--sw/source/core/text/porlay.cxx16
-rw-r--r--sw/source/core/text/txtdrop.cxx20
-rw-r--r--sw/source/core/text/txtfrm.cxx24
-rw-r--r--sw/source/core/tox/tox.cxx51
-rw-r--r--sw/source/core/txtnode/SwGrammarContact.cxx44
-rw-r--r--sw/source/core/txtnode/atrfld.cxx22
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx19
-rw-r--r--sw/source/core/txtnode/atrftn.cxx19
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx12
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx77
-rw-r--r--sw/source/core/txtnode/thints.cxx36
-rw-r--r--sw/source/core/txtnode/txtatr2.cxx18
-rw-r--r--sw/source/core/txtnode/txtedt.cxx8
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx32
-rw-r--r--sw/source/core/undo/rolbck.cxx8
-rw-r--r--sw/source/core/undo/unattr.cxx71
-rw-r--r--sw/source/core/undo/undobj1.cxx9
-rw-r--r--sw/source/core/undo/undraw.cxx131
-rw-r--r--sw/source/core/undo/untbl.cxx50
-rw-r--r--sw/source/core/unocore/unobkm.cxx4
-rw-r--r--sw/source/core/unocore/unochart.cxx4
-rw-r--r--sw/source/core/unocore/unocoll.cxx171
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx2
-rw-r--r--sw/source/core/unocore/unodraw.cxx182
-rw-r--r--sw/source/core/unocore/unofield.cxx255
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx2
-rw-r--r--sw/source/core/unocore/unoframe.cxx313
-rw-r--r--sw/source/core/unocore/unoftn.cxx20
-rw-r--r--sw/source/core/unocore/unoidx.cxx30
-rw-r--r--sw/source/core/unocore/unoobj.cxx4
-rw-r--r--sw/source/core/unocore/unoobj2.cxx117
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx4
-rw-r--r--sw/source/core/unocore/unoport.cxx12
-rw-r--r--sw/source/core/unocore/unoportenum.cxx4
-rw-r--r--sw/source/core/unocore/unoredline.cxx72
-rw-r--r--sw/source/core/unocore/unoredlines.cxx49
-rw-r--r--sw/source/core/unocore/unorefmk.cxx28
-rw-r--r--sw/source/core/unocore/unosect.cxx2
-rw-r--r--sw/source/core/unocore/unosett.cxx4
-rw-r--r--sw/source/core/unocore/unostyle.cxx10
-rw-r--r--sw/source/core/unocore/unotbl.cxx571
-rw-r--r--sw/source/core/unocore/unotext.cxx2
-rw-r--r--sw/source/core/unocore/unotextmarkup.cxx10
-rw-r--r--sw/source/core/view/viewsh.cxx2
-rw-r--r--sw/source/core/view/vnew.cxx21
-rw-r--r--sw/source/filter/html/htmlvsh.hxx5
-rw-r--r--sw/source/filter/html/swhtml.cxx6
-rw-r--r--sw/source/filter/html/swhtml.hxx2
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx2
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx2
-rw-r--r--sw/source/filter/ww1/fltshell.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx24
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx4
-rw-r--r--sw/source/filter/xml/xmltexti.cxx6
-rw-r--r--sw/source/ui/app/docsh.cxx60
-rw-r--r--sw/source/ui/app/docstyle.cxx4
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx50
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx23
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx10
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx2
-rw-r--r--sw/source/ui/fldui/fldpage.cxx10
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx49
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.hxx1
-rw-r--r--sw/source/ui/shells/textfld.cxx10
-rw-r--r--sw/source/ui/uno/unotxvw.cxx6
-rw-r--r--sw/source/ui/utlui/uitool.cxx4
233 files changed, 2548 insertions, 5356 deletions
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 7d3ff5514b72..b1811d5bb965 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -89,13 +89,15 @@ class SW_DLLPUBLIC SwAuthorityFieldType : public SwFieldType
// @@@ 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 BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhichId ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhichId );
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 6ce5e181947a..e8a33399ac8e 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -25,25 +25,6 @@
*
************************************************************************/
-/*************************************************************
-#* 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
@@ -53,7 +34,33 @@
class SwModify;
class SwClientIter;
class SfxPoolItem;
-class SvStream;
+
+/*
+ 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
@@ -61,106 +68,128 @@ class SvStream;
class SW_DLLPUBLIC SwClient
{
+ // 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
- BOOL bModifyLocked : 1; // wird in SwModify::Modify benutzt,
- // eigentlich ein Member des SwModify
- // aber aus Platzgruenden hier.
- BOOL bInModify : 1; // ist in einem Modify. (Debug!!!)
- BOOL bInDocDTOR : 1; // Doc wird zerstoert, nicht "abmelden"
- BOOL bInCache : 1; // Ist im BorderAttrCache des Layout,
- // Traegt sich dann im Modify aus!
- BOOL bInSwFntCache : 1; // Ist im SwFont-Cache der Formatierung
+ SwClient *pLeft, *pRight; // double-linked list of other clients
+ SwModify *pRegisteredIn; // event source
-protected:
- SwModify *pRegisteredIn;
+ // 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( SwModify* pModify, USHORT nWhich );
+
+protected:
// 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 );
+
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 = TRUE; }
- void UnlockModify() { bModifyLocked = FALSE; }
- void SetInCache( BOOL bNew ) { bInCache = bNew; }
- void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; }
- BOOL IsModifyLocked() const { return bModifyLocked; }
- BOOL IsInDocDTOR() const { return bInDocDTOR; }
- BOOL IsInCache() const { return bInCache; }
- BOOL IsInSwFntCache() const { return bInSwFntCache; }
-
- // erfrage vom Client Informationen
+ // get information about attribute
virtual BOOL GetInfo( SfxPoolItem& ) const;
private:
+ // forbidden and not implemented
SwClient( const SwClient& );
SwClient &operator=( const SwClient& );
};
inline SwClient::SwClient() :
- pLeft(0), pRight(0), pRegisteredIn(0)
-{ bModifyLocked = bInModify = bInDocDTOR = bInCache = bInSwFntCache = 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
+ BOOL bModifyLocked : 1; // don't broadcast changes now
+ BOOL bLockClientList : 1; // may be set when this instance notifies its clients
+ BOOL bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed
+ BOOL bInCache : 1;
+ 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) );
+
+ // placeholder for a more elaborated broadcasting mechanism; currently the nWhich is enough
+ void CallSwClientNotify( USHORT nWhich );
// 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 BOOL GetInfo( SfxPoolItem& ) const;
- void SetInDocDTOR() { bInDocDTOR = TRUE; }
+ void LockModify() { bModifyLocked = TRUE; }
+ void UnlockModify() { bModifyLocked = FALSE; }
+ void SetInCache( BOOL bNew ) { bInCache = bNew; }
+ void SetInSwFntCache( BOOL bNew ) { bInSwFntCache = bNew; }
+ void SetInDocDTOR() { bInDocDTOR = TRUE; }
+ BOOL IsModifyLocked() const { return bModifyLocked; }
+ BOOL IsInDocDTOR() const { return bInDocDTOR; }
+ BOOL IsInCache() const { return bInCache; }
+ BOOL IsInSwFntCache() const { return bInSwFntCache; }
void CheckCaching( const USHORT nWhich );
- BOOL IsLastDepend() const
- { return pRoot && !pRoot->pLeft && !pRoot->pRight; }
+ bool IsLastDepend() { return pRoot && pRoot->IsLast(); }
+
+#ifdef DBG_UTIL
+ int GetClientCount() const;
+#endif
private:
- // forbidden and not implemented (see @ SwClient).
+ // forbidden and not implemented
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 &);
};
@@ -169,9 +198,7 @@ protected:
// ----------
/*
- * 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
{
@@ -182,13 +209,14 @@ public:
SwDepend(SwClient *pTellHim, SwModify *pDepend);
SwClient* GetToTell() { return pToTell; }
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
- // erfrage vom Client Informationen
virtual BOOL GetInfo( SfxPoolItem & ) const;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue );
+
private:
- // forbidden and not implemented (see @ SwClient).
+ // forbidden and not implemented
SwDepend (const SwDepend &);
SwDepend & operator= (const SwDepend &);
};
@@ -196,55 +224,52 @@ private:
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.
- SwClientIter *pNxtIter;
+ const SwModify& rRoot;
- SwClient* mpWatchClient; // if set, SwModify::_Remove checks if this client is removed
+ // the current object in an iteration
+ SwClient* pAct;
- TypeId aSrchId; // fuer First/Next - suche diesen Type
+ // 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;
-public:
- SW_DLLPUBLIC SwClientIter( SwModify const& );
- SW_DLLPUBLIC ~SwClientIter();
+ // 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;
- const SwModify& GetModify() const { return rRoot; }
+ // iterator can be limited to return only SwClient objects of a certain type
+ TypeId aSrchId;
-#ifndef CFRONT
- SwClient* operator++(int); // zum Naechsten
- SwClient* operator--(int); // zum Vorherigen
-#endif
- SwClient* operator++(); // zum Naechsten
- SwClient* operator--(); // zum Vorherigen
+public:
+ SW_DLLPUBLIC SwClientIter( const SwModify& );
+ SW_DLLPUBLIC ~SwClientIter();
- SwClient* GoStart(); // zum Anfang
- SwClient* GoEnd(); // zum Ende
+ const SwModify& GetModify() const { return rRoot; }
- inline SwClient* GoRoot(); // wieder ab Root (==Start) anfangen
+ SwClient* operator++(int);
+ SwClient* GoStart();
+ SwClient* GoEnd();
+ // 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 == pAkt ? pAkt : pDelNext; }
+ { return pDelNext == pAct ? pAct : 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
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 22cb3613502e..cd0c2168a97e 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -322,6 +322,9 @@ protected:
*/
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 );
@@ -329,8 +332,6 @@ public:
SwCrsrShell( SwCrsrShell& rShell, Window *pWin );
virtual ~SwCrsrShell();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
// neuen Cusror erzeugen und den alten anhaengen
SwPaM * CreateCrsr();
// loesche den aktuellen Cursor und der folgende wird zum Aktuellen
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 5406fb042e95..f4b66b59b53a 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -28,17 +28,14 @@
#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;
@@ -50,13 +47,10 @@ class SwVirtFlyDrawObj;
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
@@ -212,7 +206,7 @@ public:
@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
@@ -240,14 +234,9 @@ private:
// 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();
@@ -265,11 +254,6 @@ public:
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.
@@ -282,7 +266,7 @@ public:
@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'
@@ -468,6 +452,11 @@ class SwDrawContact : public SwContact
SwDrawContact( const SwDrawContact& );
SwDrawContact& operator=( const SwDrawContact& );
// <--
+
+ protected:
+ // virtuelle Methoden von SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
public:
TYPEINFO();
@@ -530,9 +519,6 @@ class SwDrawContact : public SwContact
// 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);
@@ -555,7 +541,9 @@ class SwDrawContact : public SwContact
@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
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 8483cf7b2d39..091280e5b294 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -636,8 +636,10 @@ public:
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 * );
};
/*--------------------------------------------------------------------
@@ -677,15 +679,13 @@ class SwRefPageGetFieldType : public SwFieldType
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 * );
USHORT MakeSetList( _SetGetExpFlds& rTmpLst );
-
SwDoc* GetDoc() const { return pDoc; }
};
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 00598528e891..613a66c9cc4f 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -82,8 +82,8 @@ public:
// 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 );
};
/*--------------------------------------------------------------------
@@ -165,6 +165,8 @@ class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
USHORT nType;
BYTE nLevel;
BOOL bDeleted;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
SwSetExpFieldType( SwDoc* pDoc, const String& rName,
@@ -183,7 +185,6 @@ public:
// ueberlagert, weil das Set-Field selbst dafuer sorgt, das
// es aktualisiert wird.
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
inline const String& GetSetRefName() const;
USHORT SetSeqRefNo( SwSetExpField& rFld );
diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx
index ee557e8eeaba..a84c6e4cd04c 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -53,6 +53,9 @@ public:
// @@@ 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 &);
@@ -73,7 +76,6 @@ public:
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
// an das SwTxtCharFmt weiterleiten (vom SwClient)
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); }
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a2e08366ba24..8a36e1de6ec8 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -293,7 +293,7 @@ public:
inline void SwFieldType::UpdateFlds() const
{
- ((SwFieldType*)this)->Modify( 0, 0 );
+ ((SwFieldType*)this)->ModifyNotification( 0, 0 );
}
/*--------------------------------------------------------------------
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index aba9b8533c0a..79536445f5b8 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -96,10 +96,11 @@ protected:
//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.
@@ -255,6 +256,7 @@ public:
void SetCondition( ULONG nCond, ULONG nSubCond );
SwTxtFmtColl* GetTxtFmtColl() const { return (SwTxtFmtColl*)GetRegisteredIn(); }
+ void RegisterToFormat( SwFmt& );
};
@@ -281,9 +283,6 @@ public:
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 );
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 0e1932f9605b..1f8be0e88f12 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -27,6 +27,7 @@
#ifndef _FMTFLD_HXX
#define _FMTFLD_HXX
+#include <list>
#include <svl/poolitem.hxx>
#include <svl/brdcst.hxx>
#include <svl/smplhint.hxx>
@@ -37,6 +38,7 @@
class SwField;
class SwTxtFld;
class SwView;
+class SwFieldType;
// ATT_FLD ***********************************
class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
@@ -53,6 +55,9 @@ class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBro
// @@@ copy construction allowed, but copy assignment is not? @@@
SwFmtFld& operator=(const SwFmtFld& rFld);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
TYPEINFO();
@@ -68,7 +73,6 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
const SwField *GetFld() const { return pField; }
@@ -89,6 +93,7 @@ public:
BOOL IsFldInDoc() const;
BOOL IsProtect() const;
+ void RegisterToFieldType( SwFieldType& );
};
class SW_DLLPUBLIC SwFmtFldHint : public SfxHint
diff --git a/sw/inc/fmthdft.hxx b/sw/inc/fmthdft.hxx
index 14c71d6a0264..935fe8c80de8 100644
--- a/sw/inc/fmthdft.hxx
+++ b/sw/inc/fmthdft.hxx
@@ -34,7 +34,7 @@
class SwFrmFmt;
class IntlWrapper;
-
+class SwFmt;
//Kopfzeile, fuer Seitenformate
//Client von FrmFmt das den Header beschreibt.
@@ -61,13 +61,15 @@ public:
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(); }
BOOL IsActive() const { return bActive; }
void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
+ void RegisterToFormat( SwFmt& rFmt );
};
+
//Fusszeile, fuer Seitenformate
//Client von FrmFmt das den Footer beschreibt.
@@ -93,13 +95,15 @@ public:
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(); }
BOOL IsActive() const { return bActive; }
void SetActive( BOOL bNew = TRUE ) { bActive = bNew; }
+ void RegisterToFormat( SwFmt& rFmt );
};
+
inline const SwFmtHeader &SwAttrSet::GetHeader(BOOL bInP) const
{ return (const SwFmtHeader&)Get( RES_HEADER,bInP); }
inline const SwFmtFooter &SwAttrSet::GetFooter(BOOL bInP) const
diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index d09df11bb1aa..5b443c479124 100755
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -162,13 +162,13 @@ protected:
::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;
diff --git a/sw/inc/fmtpdsc.hxx b/sw/inc/fmtpdsc.hxx
index 47ad826bc875..7f23e7cd7e2f 100644
--- a/sw/inc/fmtpdsc.hxx
+++ b/sw/inc/fmtpdsc.hxx
@@ -38,6 +38,7 @@ class SwPageDesc;
class SwHistory;
class SwPaM;
class IntlWrapper;
+class SwEndNoteInfo;
//Pagedescriptor
//Client vom SwPageDesc der durch das Attribut "beschrieben" wird.
@@ -55,6 +56,8 @@ class SW_DLLPUBLIC SwFmtPageDesc : public SfxPoolItem, public SwClient
USHORT 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 );
public:
SwFmtPageDesc( const SwPageDesc *pDesc = 0 );
@@ -75,8 +78,6 @@ public:
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
SwPageDesc *GetPageDesc() { return (SwPageDesc*)GetRegisteredIn(); }
const SwPageDesc *GetPageDesc() const { return (SwPageDesc*)GetRegisteredIn(); }
@@ -86,6 +87,10 @@ public:
// 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;
+ bool IsRegisteredAt( SwEndNoteInfo* pInfo ) const;
};
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index d1a33db7b246..f12ac15f5d69 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -44,9 +44,6 @@ class SwDoc;
class SW_DLLPUBLIC SwFmt : public SwModify
{
-// friend class SwSwgReader;
-// friend class SwSwgWriter;
-
String aFmtName;
SwAttrSet aSet;
@@ -70,6 +67,7 @@ protected:
SwFmt( SwAttrPool& rPool, const String &rFmtNm, const USHORT* pWhichRanges,
SwFmt *pDrvdFrm, USHORT nFmtWhich );
SwFmt( const SwFmt& rFmt );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -80,7 +78,6 @@ public:
// fuer die Abfrage der Writer-Funktionen
USHORT Which() const { return nWhichId; }
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
// erfrage vom Format Informationen
virtual BOOL GetInfo( SfxPoolItem& ) const;
@@ -114,7 +111,7 @@ public:
virtual USHORT ResetAllFmtAttr();
// <--
- inline SwFmt* DerivedFrom() const { return (SwFmt*)pRegisteredIn; }
+ inline SwFmt* DerivedFrom() const { return (SwFmt*)GetRegisteredIn(); }
inline BOOL IsDefault() const { return DerivedFrom() == 0; }
inline const String& GetName() const { return aFmtName; }
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 388607d4f0e0..26da8b872073 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -27,14 +27,9 @@
#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 "swdllapi.h"
class SwFlyFrm;
@@ -70,6 +65,8 @@ protected:
pDrvdFrm, nFmtWhich )
{}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -81,8 +78,6 @@ public:
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
@@ -145,6 +140,7 @@ public:
{ m_wXObject = xObject; }
DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
+ void RegisterToFormat( SwFmt& rFmt ) { Add( &rFmt ); }
};
//Das FlyFrame-Format ------------------------------
diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index c3b9f7c7dc13..6bf1f073aa3d 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -29,9 +29,6 @@
#include <tools/string.hxx>
#include "swdllapi.h"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
#include <calbck.hxx>
#include <editeng/numitem.hxx>
@@ -48,6 +45,8 @@ class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
String sSuffix;
protected:
bool m_bEndNote;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
SvxNumberType aFmt;
USHORT nFtnOffset;
@@ -67,8 +66,6 @@ public:
void SetAnchorCharFmt( SwCharFmt* );
SwClient *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; }
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
SwEndNoteInfo & operator=(const SwEndNoteInfo&);
BOOL operator==( const SwEndNoteInfo &rInf ) const;
@@ -80,6 +77,7 @@ public:
void SetPrefix(const String& rSet) { sPrefix = rSet; }
void SetSuffix(const String& rSet) { sSuffix = rSet; }
+ void ReleaseCollection() { if ( GetRegisteredInNonConst() ) GetRegisteredInNonConst()->Remove( this ); }
};
enum SwFtnPos
diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx
index 079fbeee4cf5..3af3d39e29ec 100644
--- a/sw/inc/lineinfo.hxx
+++ b/sw/inc/lineinfo.hxx
@@ -28,9 +28,6 @@
#define SW_LINEINFO_HXX
#include "calbck.hxx"
-//#ifndef _NUMRULE_HXX
-//#include <numrule.hxx>
-//#endif
#include <editeng/numitem.hxx>
#include "swdllapi.h"
@@ -60,6 +57,8 @@ class SW_DLLPUBLIC SwLineNumberInfo : public SwClient //purpose of derivation fr
BOOL bCountInFlys; //Count also within FlyFrames?
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();
@@ -100,7 +99,7 @@ public:
BOOL IsRestartEachPage() const { return bRestartEachPage; }
void SetRestartEachPage( BOOL b ) { bRestartEachPage = b; }
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ bool HasCharFormat() const { return GetRegisteredIn() != 0; }
};
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 415ff86ee01a..3fa98364e177 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -228,6 +228,10 @@ public:
//
// End: Data collected during idle time
//
+protected:
+ // fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+ virtual void SwClientNotify( SwModify* pModify, USHORT nWhich );
public:
using SwCntntNode::GetAttr;
@@ -794,9 +798,6 @@ public:
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 );
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 8bdf86af3a38..0ae7e1ca3be1 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -82,9 +82,8 @@ class IDocumentLineNumberAccess;
class IDocumentLinksAdministration;
class IDocumentFieldsAccess;
class IDocumentContentOperations;
-// --> OD 2007-10-31 #i83479#
class IDocumentListItems;
-// <--
+class SwOLENodes;
// --------------------
// class SwNode
@@ -398,11 +397,11 @@ protected:
// SwAttrSet (handle):
USHORT ClearItemsFromAttrSet( const std::vector<USHORT>& 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;
@@ -508,11 +507,12 @@ public:
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 );
-
};
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index 11920c2d6f61..99460b60b6be 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -35,23 +35,17 @@
#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#
-class SwNodeNum;
#include <SwNumberTreeTypes.hxx>
-// <--
-// --> OD 2008-02-19 #refactorlists#
#include <vector>
+
class SwTxtFmtColl;
-// <--
-// --> OD 2008-07-08 #i91400#
class IDocumentListsAccess;
-// <--
-
+class SwNodeNum;
class Font;
class SvxBrushItem;
class SvxNumRule;
@@ -72,6 +66,9 @@ class SW_DLLPUBLIC SwNumFmt : public SvxNumberFormat, public SwClient
using SvxNumberFormat::operator ==;
using SvxNumberFormat::operator !=;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
SwNumFmt();
SwNumFmt( const SwNumFmt& );
@@ -84,9 +81,9 @@ public:
BOOL operator==( const SwNumFmt& ) const;
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;
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 6df70d20199d..070ace752129 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -160,6 +160,9 @@ class SW_DLLPUBLIC SwPageDesc : public SwModify
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; }
@@ -213,7 +216,6 @@ public:
void SetRegisterFmtColl( const SwTxtFmtColl* rFmt );
const SwTxtFmtColl* GetRegisterFmtColl() const;
- virtual void Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue );
void RegisterChange();
// erfragen und setzen der PoolFormat-Id
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 68b9ba203ba3..30d593d7b4ec 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -69,6 +69,10 @@ public:
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
@@ -94,10 +98,9 @@ public:
inline USHORT GetDistance() const { return nDistance; }
inline USHORT &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 BOOL GetInfo( SfxPoolItem& ) const;
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index b2b61dff6434..318319cf9884 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -77,14 +77,15 @@ public:
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 );
static SwTxtNode* FindAnchor( SwDoc* pDoc, const String& rRefMark,
USHORT nSubType, USHORT nSeqNo,
USHORT* pStt, USHORT* pEnd = 0 );
+protected:
+ // ueberlagert, um alle Ref-Felder zu updaten
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
};
/*--------------------------------------------------------------------
diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx
index e2aa129f65e1..1ad68c714330 100644
--- a/sw/inc/rolbck.hxx
+++ b/sw/inc/rolbck.hxx
@@ -425,6 +425,9 @@ private:
void _MakeSetWhichIds();
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
// --> OD 2008-02-27 #refactorlists# - removed <rDoc>
SwRegHistory( SwHistory* pHst );
@@ -432,8 +435,6 @@ public:
SwRegHistory( const SwNode& rNd, SwHistory* pHst );
SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
/// @return true iff at least 1 item was inserted
bool InsertItems( const SfxItemSet& rSet,
xub_StrLen const nStart, xub_StrLen const nEnd,
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index db99cfdf4d52..f6b083dec54a 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -177,6 +177,9 @@ private:
SW_DLLPRIVATE void ImplSetHiddenFlag(
bool const bHidden, bool const bCondition);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
TYPEINFO(); // rtti
@@ -193,10 +196,8 @@ public:
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)
@@ -300,6 +301,7 @@ class SW_DLLPUBLIC SwSectionFmt
protected:
SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -311,7 +313,6 @@ public:
//Erzeugt die Ansichten
virtual void MakeFrms();
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
// erfrage vom Format Informationen
virtual BOOL GetInfo( SfxPoolItem& ) const;
diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx
index 042654389174..93d7fe578a1e 100644
--- a/sw/inc/swddetbl.hxx
+++ b/sw/inc/swddetbl.hxx
@@ -42,12 +42,13 @@ public:
BOOL bUpdate = TRUE );
~SwDDETable();
- void Modify( SfxPoolItem*, SfxPoolItem* );
void ChangeContent();
BOOL NoDDETable();
SwDDEFieldType* GetDDEFldType();
inline const SwDDEFieldType* GetDDEFldType() const;
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
};
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
new file mode 100755
index 000000000000..be729771b54b
--- /dev/null
+++ b/sw/inc/switerator.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 1b1316ce37d1..f8b59353097c 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -27,9 +27,7 @@
#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>
@@ -43,6 +41,7 @@ class SwStartNode;
#include <boost/noncopyable.hpp>
#endif
+class SwFmt;
class Color;
class SwFrmFmt;
class SwTableFmt;
@@ -86,7 +85,7 @@ typedef SwTableLine* SwTableLinePtr;
class SW_DLLPUBLIC SwTable: public SwClient //Client vom FrmFmt
{
- using SwClient::IsModifyLocked;
+
protected:
SwTableLines aLines;
@@ -116,6 +115,8 @@ protected:
BOOL IsModifyLocked(){ return bModifyLocked;}
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
enum SearchType
{
@@ -175,10 +176,9 @@ public:
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,
BOOL bHidden = FALSE, BOOL bCurRowOnly = FALSE ) const;
@@ -322,6 +322,7 @@ public:
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
BOOL SetRowHeight( SwTableBox& rAktBox, USHORT eType,
SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
+ void RegisterToFormat( SwFmt& rFmt );
#ifdef DBG_UTIL
void CheckConsistency() const;
#endif
@@ -348,8 +349,8 @@ public:
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();
@@ -364,6 +365,7 @@ public:
SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
bool hasSoftPageBreak() const;
+ void RegisterToFormat( SwFmt& rFmt );
};
class SW_DLLPUBLIC SwTableBox: public SwClient //Client vom FrmFmt
@@ -402,8 +404,8 @@ public:
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();
@@ -468,6 +470,8 @@ public:
const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
USHORT nMaxStep = USHRT_MAX ) const
{ return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
+ void RegisterToFormat( SwFmt& rFmt ) ;
+ void ForgetFrmFmt();
};
class SwCellFrm;
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 96479197cde6..86ace11c4e6b 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -86,12 +86,12 @@ protected:
: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
{}
+ // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
+
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
- // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
- virtual void Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue );
-
DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
};
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index fea15cfafb82..e8ebce2782c6 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -91,6 +91,10 @@ class SW_DLLPUBLIC SwTOXMark
SwTOXMark(); // to create the dflt. atr. in _InitCore
+protected:
+ // SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
+
public:
TYPEINFO(); // rtti
@@ -105,9 +109,6 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
- // SwClient
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
void InvalidateTOXMark();
String GetText() const;
@@ -151,7 +152,9 @@ public:
SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
::com::sun::star::text::XDocumentIndexMark> const& xMark)
{ m_wXDocumentIndexMark = xMark; }
-
+ void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
+ void RegisterToTOXType( SwTOXType& rMark );
+ static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
};
/*--------------------------------------------------------------------
@@ -592,6 +595,7 @@ public:
// #i21237#
void AdjustTabStops(SwDoc & rDoc, BOOL bDefaultRightTabStop);
SwTOXBase& operator=(const SwTOXBase& rSource);
+ void RegisterToTOXType( SwTOXType& rMark );
};
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index 65ecd951868c..da925ea1b886 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -45,9 +45,9 @@ public:
SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtCharFmt( );
- // werden vom SwFmtCharFmt hierher weitergeleitet
- virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient
- virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
+ // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!)
+ void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
+ bool GetInfo( SfxPoolItem& rInfo ) const;
// get and set TxtNode pointer
void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
@@ -88,15 +88,17 @@ public:
class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
{
SwTxtNode* m_pTxtNode;
-
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtRuby();
TYPEINFO();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
+ SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
+
/// get and set TxtNode pointer
const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx
index 8e0d66df654e..bec9f403c41c 100644
--- a/sw/inc/txtinet.hxx
+++ b/sw/inc/txtinet.hxx
@@ -45,14 +45,18 @@ class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient
// forbidden and not implemented.
SwTxtINetFmt();
+protected:
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtINetFmt();
TYPEINFO();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
+ SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode);
+
// get and set TxtNode pointer
const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 7f16e4e4d44c..7479623fb072 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -680,12 +680,12 @@ class SwUndoFmtAttrHelper : public SwClient
{
::std::auto_ptr<SwUndoFmtAttr> m_pUndo;
const bool m_bSaveDrawPt;
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); }
// release the undo object (so it is not deleted here), and return it
SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); }
@@ -1243,9 +1243,11 @@ class SwUndoSetFlyFmt : public SwUndo, public SwClient
BOOL bAnchorChgd;
void PutAttr( USHORT nWhich, const SfxPoolItem* pItem );
- void Modify( SfxPoolItem*, SfxPoolItem* );
void GetAnchor( SwFmtAnchor& rAnhor, ULONG nNode, xub_StrLen nCntnt );
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
public:
SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt );
virtual ~SwUndoSetFlyFmt();
@@ -1254,6 +1256,7 @@ public:
virtual void Redo( SwUndoIter& );
virtual SwRewriter GetRewriter() const;
+ void DeRegisterFromFormat( SwFmt& );
};
//--------------------------------------------------------------------
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 6c12a01b0d47..9e3425e04c90 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -98,7 +98,7 @@ class UnoActionRemoveContext
::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId();
/// helper function for implementing SwClient::Modify
-void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew);
+void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew);
#include <boost/utility.hpp>
diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx
index fdd5df4c8a6c..a212efd933f3 100644
--- a/sw/inc/unobookmark.hxx
+++ b/sw/inc/unobookmark.hxx
@@ -220,8 +220,9 @@ class SwXFieldmarkParameters
// XElementAccess
virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+ protected:
//SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
private:
::sw::mark::IFieldmark::parameter_map_t* getCoreParameters() throw (::com::sun::star::uno::RuntimeException);
};
diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx
index eeced6e62c50..17cbe800cb2f 100644
--- a/sw/inc/unochart.hxx
+++ b/sw/inc/unochart.hxx
@@ -171,6 +171,10 @@ class SwChartDataProvider :
rtl::OUString GetBrokenCellRangeForExport( const rtl::OUString &rCellRangeRepresentation );
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwChartDataProvider( const SwDoc* pDoc );
virtual ~SwChartDataProvider();
@@ -197,10 +201,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
void AddDataSequence( const SwTable &rTable, ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > &rxDataSequence );
@@ -292,6 +292,10 @@ class SwChartDataSequence :
SwChartDataSequence( const SwChartDataSequence &rObj );
SwChartDataSequence & operator = ( const SwChartDataSequence & );
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwChartDataSequence( SwChartDataProvider &rProvider,
SwFrmFmt &rTblFmt,
@@ -348,11 +352,6 @@ public:
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
-
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
sal_Bool DeleteBox( const SwTableBox &rBox );
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index d4ac0f4f3d61..33ed59bd50b0 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -257,6 +257,9 @@ class SwXShape : public SwXShapeBaseClass,
protected:
virtual ~SwXShape();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xShape);
@@ -310,9 +313,6 @@ public:
virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
// <--
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;}
::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > GetAggregationInterface() {return xShapeAgg;}
diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx
index 521a85e9168e..18dcdfc86b68 100644
--- a/sw/inc/unofield.hxx
+++ b/sw/inc/unofield.hxx
@@ -77,6 +77,9 @@ class SwXFieldMaster : public cppu::WeakImplHelper4
protected:
virtual ~SwXFieldMaster();
+ //SwClient
+virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId);
@@ -109,9 +112,6 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
static rtl::OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc);
static rtl::OUString LocalizeFormula(const SwSetExpField& rFld, const rtl::OUString& rFormula, sal_Bool bQuery);
@@ -122,9 +122,6 @@ public:
sal_uInt16 GetResId() const {return nResTypeId;}
};
-/* -----------------04.12.98 12:49-------------------
- *
- * --------------------------------------------------*/
struct SwFieldProperties_Impl;
class SwXTextField : public cppu::WeakImplHelper5
<
@@ -153,6 +150,9 @@ class SwXTextField : public cppu::WeakImplHelper5
SwDoc* GetDoc() {return m_pDoc;}
protected:
virtual ~SwXTextField();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc=0);
SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
@@ -198,24 +198,18 @@ public:
//XUpdatable
virtual void SAL_CALL update( ) throw (::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
const SwField* GetField() const;
const SwFmtFld* GetFldFmt(){return GetField() ? pFmtFld : 0; };
void Invalidate();
-};
-/// @return a SwXTextField, either an already existing one or a new one
-SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
+ /// @return an SwXTextField, either an already existing one or a new one
+ static SwXTextField* CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
+};
-/* -----------------21.12.98 10:26-------------------
- *
- * --------------------------------------------------*/
typedef
cppu::WeakImplHelper2
<
@@ -292,9 +286,6 @@ public:
virtual void Invalidate();
};
-/* -----------------21.12.98 14:49-------------------
- *
- * --------------------------------------------------*/
class SwXFieldEnumeration : public cppu::WeakImplHelper2
<
::com::sun::star::container::XEnumeration,
@@ -309,6 +300,8 @@ class SwXFieldEnumeration : public cppu::WeakImplHelper2
protected:
virtual ~SwXFieldEnumeration();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwXFieldEnumeration(SwDoc* pDoc);
@@ -321,8 +314,6 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoflatpara.hxx b/sw/inc/unoflatpara.hxx
index acc004d473ab..36d8025ab20f 100644
--- a/sw/inc/unoflatpara.hxx
+++ b/sw/inc/unoflatpara.hxx
@@ -122,8 +122,9 @@ public:
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > & xPara) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
+protected:
// SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
private:
SwXFlatParagraphIterator( const SwXFlatParagraphIterator & ); // not defined
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 65de34a4db7f..11baa88741b7 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -55,10 +55,6 @@ class SwDoc;
class SwFmt;
class SwFlyFrmFmt;
-
-/*-----------------12.02.98 11:21-------------------
-
---------------------------------------------------*/
class BaseFrameProperties_Impl;
class SwXFrame : public cppu::WeakImplHelper6
<
@@ -87,6 +83,7 @@ class SwXFrame : public cppu::WeakImplHelper6
protected:
com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData;
com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > mxStyleFamily;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
virtual ~SwXFrame();
public:
@@ -145,9 +142,6 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
@@ -163,9 +157,7 @@ public:
void SetSelection(SwPaM& rCopySource);
static SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
};
-/*-----------------20.02.98 11:28-------------------
---------------------------------------------------*/
typedef cppu::WeakImplHelper3
<
::com::sun::star::text::XTextFrame,
@@ -244,9 +236,7 @@ public:
void * SAL_CALL operator new( size_t ) throw();
void SAL_CALL operator delete( void * ) throw();
};
-/*-----------------20.02.98 11:28-------------------
---------------------------------------------------*/
typedef cppu::WeakImplHelper2
<
::com::sun::star::text::XTextContent,
@@ -370,7 +360,8 @@ public:
// ::com::sun::star::util::XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
- void Modify( SfxPoolItem*, SfxPoolItem* );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/inc/unoport.hxx b/sw/inc/unoport.hxx
index 9071a388a5b8..bb48c64b208b 100644
--- a/sw/inc/unoport.hxx
+++ b/sw/inc/unoport.hxx
@@ -133,9 +133,9 @@ private:
SwFmtFld * GetFldFmt(bool bInit = false);
-protected:
+ void init(const SwUnoCrsr* pPortionCursor);
- //SfxItemPropertySet& GetPropSet() { return aPropSet; }
+protected:
void SAL_CALL SetPropertyValues_Impl(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames,
@@ -145,9 +145,6 @@ protected:
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-// ::com::sun::star::uno::Any GetPropertyValue( const SfxItemPropertyMap *pEntry,
-// SwUnoCrsr *pUnoCrsr,
-// SfxItemSet *pSet );
void GetPropertyValues( const ::rtl::OUString *pPropertyNames,
::com::sun::star::uno::Any *pValues,
sal_Int32 nLength );
@@ -161,6 +158,9 @@ protected:
virtual ~SwXTextPortion();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType );
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwFrmFmt& rFmt );
@@ -229,9 +229,6 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames() throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
void SetRefMark( ::com::sun::star::uno::Reference<
::com::sun::star::text::XTextContent > xMark)
{ m_xRefMark = xMark; }
@@ -317,9 +314,9 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames()
throw( ::com::sun::star::uno::RuntimeException );
-
+protected:
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx
index 92db9257c4a6..5e491dc9ac34 100644
--- a/sw/inc/unoredline.hxx
+++ b/sw/inc/unoredline.hxx
@@ -148,9 +148,9 @@ public:
virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const SwRedline* GetRedline() const {return pRedline;}
+protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx
index 948e972e1998..fc6648ce6ca5 100644
--- a/sw/inc/unoredlines.hxx
+++ b/sw/inc/unoredlines.hxx
@@ -95,9 +95,9 @@ public:
virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
-
+protected:
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index 8423ac29ad4c..b904ad8374c9 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -176,6 +176,10 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5
static String sInvalidStyle;
protected:
virtual ~SwXNumberingRules();
+
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
SwXNumberingRules(const SwNumRule& rRule); // NumRule for paragraphs, numbering styles
@@ -223,9 +227,6 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rProperties, sal_Int32 nIndex)
throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const String* GetNewCharStyleNames() const {return sNewCharStyleNames;}
const String* GetBulletFontNames() const {return sNewBulletFontNames;}
const SwNumRule* GetNumRule() {return pNumRule;}
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 4a9fd533da66..cd1da6df9aea 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -211,6 +211,7 @@ protected:
void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, BOOL bConditional = FALSE);
SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
@@ -286,7 +287,6 @@ public:
StartListening(*pBasePool);
}
SwDoc* GetDoc() const { return m_pDoc; }
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
};
/* -----------------------------15.12.00 14:25--------------------------------
@@ -377,10 +377,12 @@ class SwXAutoStyleFamily : public cppu::WeakImplHelper1< com::sun::star::style::
SwDocShell *pDocShell;
IStyleAccess::SwAutoStyleFamily eFamily;
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXAutoStyleFamily(SwDocShell* pDocShell, IStyleAccess::SwAutoStyleFamily eFamily);
virtual ~SwXAutoStyleFamily();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XAutoStyleFamily
virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyle > SAL_CALL insertStyle( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Values ) throw (::com::sun::star::uno::RuntimeException);
@@ -400,13 +402,14 @@ class SwXAutoStylesEnumerator : public cppu::WeakImplHelper1< ::com::sun::star::
public:
SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam );
virtual ~SwXAutoStylesEnumerator();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XEnumeration
virtual sal_Bool SAL_CALL hasMoreElements( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL nextElement( ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
+
/*-- 19.05.2006 11:20:02---------------------------------------------------
an automatic style
-----------------------------------------------------------------------*/
@@ -428,7 +431,6 @@ public:
SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam );
virtual ~SwXAutoStyle();
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
//XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
@@ -461,6 +463,9 @@ public:
// Special
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getProperties() throw (::com::sun::star::uno::RuntimeException);
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
};
#endif
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 372b55ca9193..99006ac57d02 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -115,6 +115,9 @@ protected:
virtual ~SwXCell();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX );
SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface
@@ -162,9 +165,6 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//XEnumerationAccess - frueher XParagraphEnumerationAccess
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
@@ -194,6 +194,9 @@ class SwXTextTableRow : public cppu::WeakImplHelper2
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
protected:
virtual ~SwXTextTableRow();
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLine);
@@ -214,9 +217,6 @@ public:
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
const SwTableLine* GetTblRow() const {return pLine;}
static SwTableLine* FindLine(SwTable* pTable, SwTableLine* pLine);
};
@@ -274,7 +274,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
// ITextCursorHelper
virtual const SwPaM* GetPaM() const;
@@ -418,7 +418,7 @@ public:
SwRangeDescriptor& rDesc);
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
@@ -505,7 +505,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
sal_uInt16 getRowCount(void);
@@ -567,7 +567,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
/* -----------------03.02.99 07:31-------------------
@@ -615,7 +615,7 @@ public:
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
//SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
#endif
diff --git a/sw/inc/unotextmarkup.hxx b/sw/inc/unotextmarkup.hxx
index 98bb3416d385..7d48595e8e3b 100644
--- a/sw/inc/unotextmarkup.hxx
+++ b/sw/inc/unotextmarkup.hxx
@@ -65,14 +65,14 @@ public:
// ::com::sun::star::text::XMultiTextMarkup:
virtual void SAL_CALL commitMultiTextMarkup( const ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextMarkupDescriptor >& aMarkups ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- //SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
private:
SwXTextMarkup( const SwXTextMarkup & ); // not defined
SwXTextMarkup & operator =( const SwXTextMarkup & ); // not defined
protected:
+ //SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
SwTxtNode* mpTxtNode;
const ModelToViewHelper::ConversionMap* mpConversionMap;
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index b755cbc1631b..433af9eae145 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -61,8 +61,6 @@ public:
inline BOOL IsValid() const;
inline void ChgValid( BOOL bNew );
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
-
double GetValue(SwCalc& rCalc); // Member nValue neu berrechnen
inline double GetValue() const;
inline void SetValue(const double nVal);
@@ -75,6 +73,8 @@ public:
virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nMId ) const;
virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nMId );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
};
inline BOOL SwUserFieldType::IsValid() const
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index 221c7e1650a2..91cbe0b9324f 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -216,7 +216,7 @@ SwAccessibleFrameBase::~SwAccessibleFrameBase()
{
}
-void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
const SwFlyFrm *pFlyFrm = static_cast< const SwFlyFrm * >( GetFrm() );
@@ -230,13 +230,13 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
OUString sOldName( GetName() );
ASSERT( !pOld ||
- static_cast < SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ),
+ static_cast < const SwStringMsgPoolItem * >( pOld )->GetString() == String( sOldName ),
"invalid old name" );
const String& rNewName = pFrmFmt->GetName();
SetName( rNewName );
ASSERT( !pNew ||
- static_cast < SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
+ static_cast < const SwStringMsgPoolItem * >( pNew )->GetString() == rNewName,
"invalid new name" );
if( sOldName != GetName() )
@@ -250,18 +250,20 @@ void SwAccessibleFrameBase::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
break;
case RES_OBJECTDYING:
+ // mba: it seems that this class intentionally does not call code in base class SwClient
if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) )
- pRegisteredIn->Remove( this );
+ static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ GetRegisteredInNonConst()->Remove( this );
break;
case RES_FMT_CHG:
- if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
- static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
- pRegisteredIn->Remove( this );
+ if( static_cast< const SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
+ static_cast< const SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
+ GetRegisteredInNonConst()->Remove( this );
break;
+
default:
- SwClient::Modify( pOld, pNew );
+ // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING
break;
}
}
@@ -271,7 +273,7 @@ void SwAccessibleFrameBase::Dispose( sal_Bool bRecursive )
vos::OGuard aGuard(Application::GetSolarMutex());
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
diff --git a/sw/source/core/access/accframebase.hxx b/sw/source/core/access/accframebase.hxx
index faa4bb492697..551f8b452621 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -51,6 +51,7 @@ protected:
virtual void _InvalidateFocus();
virtual ~SwAccessibleFrameBase();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
@@ -60,8 +61,6 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
static sal_uInt8 GetNodeType( const SwFlyFrm *pFlyFrm );
// The object is not visible an longer and should be destroyed
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 0d7ab98d3b03..32d1fc424cb8 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -68,14 +68,12 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <cppuhelper/implbase1.hxx>
-// OD 15.01.2003 #103492#
#include <pagepreviewlayout.hxx>
-// --> OD 2005-12-13 #i27301#
#include <pam.hxx>
#include <ndtxt.hxx>
-// <--
#include <dflyobj.hxx>
#include <prevwpage.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -2722,15 +2720,8 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
if ( pTxtNode )
{
// loop on all text frames registered at the text node.
- SwClientIter aIter( *pTxtNode );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
- {
- ASSERT( dynamic_cast<SwTxtFrm*>(pFrm),
- "<SwAccessibleMap::_BuildSelectedParas()> - unexpected frame type" );
- SwTxtFrm* pTxtFrm( dynamic_cast<SwTxtFrm*>(pFrm) );
- if ( pTxtFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *pTxtNode );
+ for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() )
{
uno::WeakReference < XAccessible > xWeakAcc;
SwAccessibleContextMap_Impl::iterator aMapIter =
@@ -2758,7 +2749,6 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas()
}
}
}
- }
// prepare next turn: get next cursor in ring
pCrsr = static_cast<SwPaM*>( pCrsr->GetNext() );
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index fea47cb212e5..8764feff8d74 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -92,7 +92,7 @@ SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame()
{
}
-void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
// --> OD 2009-07-14 #i73249#
@@ -112,9 +112,9 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pOld)->GetString() );
const String& sNewTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pNew)->GetString() );
if ( sOldTitle == sNewTitle )
{
break;
@@ -168,7 +168,7 @@ void SwAccessibleNoTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_FMT_CHG:
if( static_cast< SwFmtChg * >(pNew)->pChangedFmt == GetRegisteredIn() &&
static_cast< SwFmtChg * >(pOld)->pChangedFmt->IsFmtInDTOR() )
- pRegisteredIn->Remove( this );
+ GetRegisteredIn()->Remove( this );
break;
*/
}
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index 6e070c6dd864..e07d9ff0ffc0 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -47,14 +47,14 @@ protected:
const SwNoTxtNode *GetNoTxtNode() const;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleNoTextFrame( SwAccessibleMap* pInitMap,
sal_Int16 nInitRole,
const SwFlyFrm *pFlyFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XAccessibleContext ==============================================
// --> OD 2009-07-14 #i73249#
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 368e076470ab..84d0cc67e7ab 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -2669,10 +2669,10 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getNumberOfLineWithCaret()
}
// --> OD 2010-02-19 #i108125#
-void SwAccessibleParagraph::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwAccessibleParagraph::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
mpParaChangeTrackInfo->reset();
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
// <--
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index 7e07fa132d05..8a45a4bdd64d 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -234,6 +234,8 @@ protected:
::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew);
+
public:
SwAccessibleParagraph( SwAccessibleMap& rInitMap,
@@ -243,10 +245,6 @@ public:
virtual sal_Bool HasCursor(); // required by map to remember that object
- // --> OD 2010-02-19 #i108125#
- virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew);
- // <--
-
//===== XAccessibleContext ==============================================
/// Return this object's description.
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 43befb2a3f86..869f9b4c7d43 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -740,7 +740,7 @@ SwAccessibleTable::~SwAccessibleTable()
delete mpTableData;
}
-void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
const SwTabFrm *pTabFrm = static_cast< const SwTabFrm * >( GetFrm() );
@@ -787,13 +787,14 @@ void SwAccessibleTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
break;
case RES_OBJECTDYING:
+ // mba: it seems that this class intentionally does not call code in base class SwClient
if( GetRegisteredIn() ==
- static_cast< SwModify *>( static_cast< SwPtrMsgPoolItem * >( pOld )->pObject ) )
- pRegisteredIn->Remove( this );
+ static_cast< SwModify *>( static_cast< const SwPtrMsgPoolItem * >( pOld )->pObject ) )
+ GetRegisteredInNonConst()->Remove( this );
break;
default:
- SwClient::Modify( pOld, pNew );
+ // mba: former call to base class method removed as it is meant to handle only RES_OBJECTDYING
break;
}
}
@@ -1360,7 +1361,7 @@ void SwAccessibleTable::Dispose( sal_Bool bRecursive )
vos::OGuard aGuard(Application::GetSolarMutex());
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
SwAccessibleContext::Dispose( bRecursive );
}
@@ -1717,7 +1718,7 @@ SwAccessibleTableData_Impl* SwAccessibleTableColHeaders::CreateNewTableData()
}
-void SwAccessibleTableColHeaders::Modify( SfxPoolItem * /*pOld*/, SfxPoolItem * /*pNew*/ )
+void SwAccessibleTableColHeaders::Modify( const SfxPoolItem * /*pOld*/, const SfxPoolItem * /*pNew*/ )
{
}
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index 8bdf2e8b49b2..82141c09bead 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -89,12 +89,12 @@ protected:
// Is table data evailable?
sal_Bool HasTableData() const { return (mpTableData != 0); }
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleTable( SwAccessibleMap* pInitMap, const SwTabFrm* pTableFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XInterface ======================================================
// (XInterface methods need to be implemented to disambigouate
@@ -277,13 +277,12 @@ protected:
{}
virtual SwAccessibleTableData_Impl* CreateNewTableData();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
SwAccessibleTableColHeaders( SwAccessibleMap *pMap, const SwTabFrm *pTabFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
//===== XInterface ======================================================
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 75fc1fdebc0e..c0188c7eb193 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -84,7 +84,7 @@ SwAccessibleTextFrame::~SwAccessibleTextFrame()
{
}
-void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
// --> OD 2009-07-14 #i73249#
@@ -103,9 +103,9 @@ void SwAccessibleTextFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
case RES_TITLE_CHANGED:
{
const String& sOldTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pOld)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pOld)->GetString() );
const String& sNewTitle(
- dynamic_cast<SwStringMsgPoolItem*>(pNew)->GetString() );
+ dynamic_cast<const SwStringMsgPoolItem*>(pNew)->GetString() );
if ( sOldTitle == sNewTitle )
{
break;
diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx
index d6c9a7a74331..a2b891de18e4 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -46,13 +46,12 @@ protected:
virtual ~SwAccessibleTextFrame();
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
+
public:
SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm );
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-
-
//===== XAccessibleContext ==============================================
// --> OD 2009-07-14 #i73249#
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 65b11401b1da..18449844cde4 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -28,127 +28,107 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <hintids.hxx> // fuer RES_..
+#include <hintids.hxx> // contains RES_.. IDs
#include <frame.hxx>
#include <hints.hxx>
-#include <swcache.hxx>
-#include <swfntcch.hxx>
-
-#ifdef DBG_UTIL
-#include <unotextmarkup.hxx>
-#endif
+#include <swcache.hxx> // mba: get rid of that dependency
+#include <swfntcch.hxx> // mba: get rid of that dependency
static SwClientIter* pClientIters = 0;
-TYPEINIT0(SwClient); //rtti
-
-/*************************************************************************
-|* SwClient::SwClient(SwModify *)
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 20. Mar. 95
-*************************************************************************/
-
+TYPEINIT0(SwClient);
+/*************************************************************************/
SwClient::SwClient(SwModify *pToRegisterIn)
- : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 )
+ : pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ), mbIsAllowedToBeRemovedInModifyCall(false)
{
- bModifyLocked =
- bInModify =
- bInDocDTOR =
- bInCache = FALSE;
- bInSwFntCache = FALSE;
-
if(pToRegisterIn)
+ // connect to SwModify
pToRegisterIn->Add(this);
}
-/*************************************************************************
-|* SwClient::Modify()
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
-
-void SwClient::Modify( SfxPoolItem *pOld, SfxPoolItem * )
+/*************************************************************************/
+void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem * )
{
+ // this method only handles notification about dying SwModify objects
if( (!pOld || pOld->Which() != RES_OBJECTDYING) )
return;
- SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld;
- if(pDead->pObject == pRegisteredIn)
+ const SwPtrMsgPoolItem *pDead = static_cast<const SwPtrMsgPoolItem*>(pOld);
+ if(pDead && pDead->pObject == pRegisteredIn)
{
- SwModify *pAbove = (SwModify*)pRegisteredIn->GetRegisteredIn();
+ // I've got a notification from the object I know
+ SwModify *pAbove = const_cast<SwModify*>(pRegisteredIn->GetRegisteredIn());
if(pAbove)
{
+ // if the dying object itself was listening at an SwModify, I take over
+ // adding myself to pAbove will automatically remove me from my current pRegisteredIn
pAbove->Add(this);
return;
}
+
+ // destroy connection
pRegisteredIn->Remove(this);
}
}
-/*************************************************************************
-|* SwClient::~SwClient()
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung MA 25. Jan. 94
-*************************************************************************/
+void SwClient::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
+{
+ CheckRegistration( pOldValue, pNewValue );
+}
+void SwClient::ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
+{
+ Modify( pOldValue, pNewValue );
+}
+
+void SwClient::SwClientNotify( SwModify*, USHORT )
+{
+}
+//*************************************************************************
SwClient::~SwClient()
{
+ DBG_ASSERT( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
if( pRegisteredIn && pRegisteredIn->GetDepends() )
+ // still connected
pRegisteredIn->Remove( this );
-
- ASSERT( !IsModifyLocked(), "Modify destroyed but locked." );
}
- // erfrage vom Client Informationen
+/*************************************************************************/
BOOL SwClient::GetInfo( SfxPoolItem& ) const
{
- return TRUE; // und weiter
+ return TRUE; // no information here, return TRUE to enable continuation
}
-/*************************************************************************
-|* SwModify::SwModify( SwModify * )
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
-SwModify::SwModify( SwModify *pToRegisterIn )
- : SwClient(pToRegisterIn), pRoot( 0 )
+/*************************************************************************/
+SwModify::SwModify()
+ : SwClient(0), pRoot(0)
{
+ bModifyLocked = FALSE;
+ bLockClientList = FALSE;
+ bInDocDTOR = FALSE;
+ bInCache = FALSE;
+ bInSwFntCache = FALSE;
}
-// @@@ forbidden and not implemented, but needs to be accessible (protected).
-SwModify::SwModify( const SwModify & )
- : SwClient( 0 )
+SwModify::SwModify( SwModify *pToRegisterIn )
+ : SwClient(pToRegisterIn), pRoot( 0 )
{
- OSL_PRECOND(0, "SwModify(const SwModify&): not implemented.");
+ bModifyLocked = FALSE;
+ bLockClientList = FALSE;
+ bInDocDTOR = FALSE;
+ bInCache = FALSE;
+ bInSwFntCache = FALSE;
}
-/*************************************************************************
-|* SwModify::~SwModify()
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 15.04.94
-*************************************************************************/
-
-
-
+/*************************************************************************/
SwModify::~SwModify()
{
+ ASSERT( !IsModifyLocked(), "Modify destroyed but locked." );
+
if ( IsInCache() )
SwFrm::GetCache().Delete( this );
@@ -157,44 +137,40 @@ SwModify::~SwModify()
if( pRoot )
{
+ // there are depending objects
if( IsInDocDTOR() )
{
- // alle Clients "logisch" austragen
+ // if document gets destroyed anyway, just tell clients to forget me
+ // so that they don't try to get removed from my list later when they also get destroyed
SwClientIter aIter( *this );
- SwClient* p;
- while( 0 != ( p = aIter++ ) )
- p->pRegisteredIn = 0;
-
- p = aIter.GoRoot(); // wieder ab Root (==Start) anfangen
- do {
+ SwClient* p = aIter.GoStart();
+ while ( p )
+ {
p->pRegisteredIn = 0;
- } while( 0 != ( p = aIter-- ) );
+ p = aIter++;
+ }
}
else
{
- // verschicke die Nachricht an die abgeleiteten Objekte.
+ // notify all clients that they shall remove themselves
SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this );
- Modify( &aDyObject, &aDyObject );
+ NotifyClients( &aDyObject, &aDyObject );
- // Zwangsummeldung aller derjenigen, die sich nicht ausgetragen
- // haben, durch Aufruf von SwClient::Modify()
+ // remove all clients that have not done themselves
+ // mba: possibly a hotfix for forgotten base class calls?!
while( pRoot )
- pRoot->SwClient::Modify(&aDyObject, &aDyObject);
+ pRoot->CheckRegistration(&aDyObject, &aDyObject);
}
}
}
-/*************************************************************************
-|* SwModify::Modify( SwHint * pOldValue, SwHint * pNewValue )
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung MA 20. Mar. 95
-*************************************************************************/
-
-
+/*************************************************************************/
+void SwModify::Modify( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
+{
+ NotifyClients( pOldValue, pNewValue );
+}
-void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwModify::NotifyClients( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue )
{
if (IsInCache() || IsInSwFntCache())
{
@@ -208,50 +184,38 @@ void SwModify::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
LockModify();
-#ifndef DBG_UTIL
- bInModify = TRUE;
-#else
+ // mba: WTF?!
if( !pOldValue )
- bInModify = TRUE;
+ bLockClientList = TRUE;
else
- // following Modifies don't calls an ASSRT
+ {
+ // following Modifies shouldn't call an ASSERT
switch( pOldValue->Which() )
{
case RES_OBJECTDYING:
case RES_REMOVE_UNO_OBJECT:
- bInModify = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this;
+ bLockClientList = ((SwPtrMsgPoolItem *)pOldValue)->pObject != this;
break;
case RES_FOOTNOTE_DELETED:
case RES_REFMARK_DELETED:
case RES_TOXMARK_DELETED:
case RES_FIELD_DELETED:
- bInModify = FALSE;
+ bLockClientList = FALSE;
break;
default:
- bInModify = TRUE;
+ bLockClientList = TRUE;
}
-#endif
-
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do
- {
- pLast->Modify( pOldValue, pNewValue );
- if( !pRoot ) // Baum schon Weg ??
- break;
- } while( 0 != ( pLast = aIter++ ));
+ }
- bInModify = FALSE;
+ ModifyBroadcast( pOldValue, pNewValue );
+ bLockClientList = FALSE;
UnlockModify();
}
-// erfrage vom Modify Informationen
-
BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const
{
- BOOL bRet = TRUE; // bedeutet weiter zum naechsten
+ BOOL bRet = TRUE; // means: continue with next one
if( pRoot )
{
@@ -264,48 +228,38 @@ BOOL SwModify::GetInfo( SfxPoolItem& rInfo ) const
;
}
- return bRet; // und weiter
+ return bRet;
}
-/*************************************************************************
-|* SwModify::Add( SwClient *pDepend )
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
-*************************************************************************/
-
-
-
+/*************************************************************************/
void SwModify::Add(SwClient *pDepend)
{
- ASSERT( !bInModify, "Client innerhalb des eigenen Modifies einfuegen?" );
+ ASSERT( !bLockClientList, "Client inserted while in Modify" );
- // nur wenn das hier noch nicht eingetragen ist einfuegen
if(pDepend->pRegisteredIn != this )
{
#ifdef DBG_UTIL
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- ASSERT( &pTmp->rRoot != pRoot,
- "Client beim angemeldeten ClientIter einfuegen?" );
+ ASSERT( &pTmp->GetModify() != pRoot, "Client added to active ClientIter" );
pTmp = pTmp->pNxtIter;
}
#endif
- // wenn schon wanders angemeldet, dann dort abmelden
+ // deregister new client in case it is already registered elsewhere
if( pDepend->pRegisteredIn != 0 )
pDepend->pRegisteredIn->Remove( pDepend );
if( !pRoot )
{
+ // first client added
pRoot = pDepend;
pRoot->pLeft = 0;
pRoot->pRight = 0;
}
else
{
- // immer hinter die Root haengen
+ // append client
pDepend->pRight = pRoot->pRight;
pRoot->pRight = pDepend;
pDepend->pLeft = pRoot;
@@ -313,29 +267,24 @@ void SwModify::Add(SwClient *pDepend)
pDepend->pRight->pLeft = pDepend;
}
+ // connect client to me
pDepend->pRegisteredIn = this;
}
}
-/*************************************************************************
-|* SwModify::_Remove( SwClient *pDepend )
-|*
-|* Beschreibung Dokument 1.7
-|* Ersterstellung JP 20.11.90
-|* Letzte Aenderung JP 14.09.94
-*************************************************************************/
-
-
+/*************************************************************************/
-SwClient *SwModify::_Remove(SwClient * pDepend)
+SwClient* SwModify::Remove(SwClient * pDepend)
{
- // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
- ASSERT( !bInModify || 0 != dynamic_cast<SwXTextMarkup*>(pDepend), "Client innerhalb des eigenen Modifies loeschen?" );
+ if ( bInDocDTOR )
+ return 0;
+
+ ASSERT( !bLockClientList || pDepend->mbIsAllowedToBeRemovedInModifyCall, "SwClient shall be removed in Modify call!" );
- // loesche das Object aus der Liste und setze den
- // Registrierungs-Pointer zurueck
if( pDepend->pRegisteredIn == this )
{
+ // SwClient is my listener
+ // remove it from my list
SwClient* pR = pDepend->pRight;
SwClient* pL = pDepend->pLeft;
if( pRoot == pDepend )
@@ -346,40 +295,45 @@ SwClient *SwModify::_Remove(SwClient * pDepend)
if( pR )
pR->pLeft = pL;
- // alle Client-Iters updaten
+ // update ClientIters
SwClientIter* pTmp = pClientIters;
while( pTmp )
{
- if( pTmp->pAkt == pDepend || pTmp->pDelNext == pDepend )
+ if( pTmp->pAct == pDepend || pTmp->pDelNext == pDepend )
+ // if object being removed is the current or next object in an iterator, advance this iterator
pTmp->pDelNext = pR;
-
- // --> FME 2006-02-03 #127369# Notify SwClientIter if mpWatchClient is removed
- if ( pTmp->mpWatchClient == pDepend )
- pTmp->mpWatchClient = 0;
- // <--
-
pTmp = pTmp->pNxtIter;
}
pDepend->pLeft = 0;
pDepend->pRight = 0;
}
- else {
- ASSERT( FALSE, "SwModify::Remove(): pDepend nicht gefunden");
+ else
+ {
+ ASSERT( false, "SwModify::Remove(): pDepend nicht gefunden" );
}
+
+ // disconnect client from me
pDepend->pRegisteredIn = 0;
return pDepend;
}
+#ifdef DBG_UTIL
+int SwModify::GetClientCount() const
+{
+ int nRet=0;
+ SwClientIter aIter( *this );
+ SwClient *pLast = aIter.GoStart();
+ if( pLast )
+ do
+ {
+ ++nRet;
+ } while( 0 != ( pLast = aIter++ ));
+ return nRet;
+}
+#endif
-/*************************************************************************
-|* SwModify::CheckCaching( const USHORT nWhich )
-|*
-|* Ersterstellung JP 25.06.95
-|* Letzte Aenderung JP 25.06.95
-*************************************************************************/
-
-
+/*************************************************************************/
void SwModify::CheckCaching( const USHORT nWhich )
{
@@ -411,19 +365,33 @@ void SwModify::CheckCaching( const USHORT nWhich )
}
}
+void SwModify::CallSwClientNotify( USHORT nWhich )
+{
+ SwClientIter aIter(*this);
+ SwClient * pClient = aIter.GoStart();
+ while (pClient)
+ {
+ pClient->SwClientNotify( this, nWhich );
+ pClient = aIter++;
+ }
+}
+
+void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType )
+{
+ SwClientIter aIter(*this);
+ SwClient * pClient = aIter.First( nType );
+ while (pClient)
+ {
+ pClient->Modify( pOldValue, pNewValue );
+ pClient = aIter.Next();
+ }
+}
// ----------
// SwDepend
// ----------
-/*************************************************************************
-|* SwDepend::SwDepend(SwClient *pTellHim,SwModify *pDepend)
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-*************************************************************************/
-
+/*************************************************************************/
SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
: SwClient(pDepend)
@@ -431,27 +399,17 @@ SwDepend::SwDepend(SwClient *pTellHim, SwModify *pDepend)
pToTell = pTellHim;
}
-/*************************************************************************
-|*
-|* SwDepend::Modify(SwHint *, SwHint *)
-|*
-|* Beschreibung callback.doc V1.14
-|* Ersterstellung VB 20.03.91
-|* Letzte Aenderung VB 20.03.91
-|*
-*************************************************************************/
-
+/*************************************************************************/
-void SwDepend::Modify( SfxPoolItem *pOldValue, SfxPoolItem *pNewValue )
+void SwDepend::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem *pNewValue )
{
if(pNewValue && pNewValue->Which() == RES_OBJECTDYING)
- SwClient::Modify(pOldValue,pNewValue);
+ CheckRegistration(pOldValue,pNewValue);
else if(pToTell)
- pToTell->Modify(pOldValue, pNewValue);
+ pToTell->ModifyNotification(pOldValue, pNewValue);
}
- // erfrage vom Modify Informationen
BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const
{
return pToTell ? pToTell->GetInfo( rInfo ) : TRUE;
@@ -459,14 +417,13 @@ BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const
/********************************************************************/
-
-SwClientIter::SwClientIter( SwModify const& rModify )
+SwClientIter::SwClientIter( const SwModify& rModify )
: rRoot( rModify )
{
- // hinten einketten!
pNxtIter = 0;
if( pClientIters )
{
+ // append to list of ClientIters
SwClientIter* pTmp = pClientIters;
while( pTmp->pNxtIter )
pTmp = pTmp->pNxtIter;
@@ -475,9 +432,8 @@ SwClientIter::SwClientIter( SwModify const& rModify )
else
pClientIters = this;
- pAkt = rRoot.pRoot;
- pDelNext = pAkt;
- mpWatchClient = 0;
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ pDelNext = pAct;
}
@@ -486,6 +442,7 @@ SwClientIter::~SwClientIter()
{
if( pClientIters )
{
+ // reorganize list of ClientIters
if( pClientIters == this )
pClientIters = pNxtIter;
else
@@ -503,132 +460,109 @@ SwClientIter::~SwClientIter()
}
-#ifndef CFRONT
- // Postfix Operator
SwClient* SwClientIter::operator++(int)
{
-// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer
-// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der
-// Code entsprechen umgestellt werden !!!
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
- return pAkt;
+ pAct = pDelNext;
+ return pAct;
}
-#endif
-
- // Prefix Operator
-SwClient* SwClientIter::operator++()
+SwClient* SwClientIter::GoStart()
{
- if( pDelNext == pAkt )
- {
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
- }
- else
- pAkt = pDelNext;
- return pAkt;
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ if( pAct )
+ while( pAct->pLeft )
+ pAct = pAct->pLeft;
+ pDelNext = pAct;
+ return pAct;
}
-
-#ifndef CFRONT
- // Postfix Operator
-SwClient* SwClientIter::operator--(int)
+SwClient* SwClientIter::GoEnd()
{
-// solange der CFRONT Prefix und PostFix nicht unterscheiden kann, immer
-// als Prefix-Operator arbeiten. Wenn der CFRONT es kann, muss auch der
-// Code entsprechen umgestellt werden !!!
- if( pDelNext == pAkt )
- pAkt = pAkt->pLeft;
- else
- pAkt = pDelNext->pLeft;
- pDelNext = pAkt;
- return pAkt;
+ pAct = pDelNext;
+ if( !pAct )
+ pAct = const_cast<SwClient*>(rRoot.GetDepends());
+ if( pAct )
+ while( pAct->pRight )
+ pAct = pAct->pRight;
+ pDelNext = pAct;
+ return pAct;
}
-#endif
-
-
- // Prefix Operator
-SwClient* SwClientIter::operator--()
-{
- if( pDelNext == pAkt )
- pAkt = pAkt->pLeft;
- else
- pAkt = pDelNext->pLeft;
- pDelNext = pAkt;
- return pAkt;
-}
-
-
-SwClient* SwClientIter::GoStart() // zum Anfang des Baums
-{
- pAkt = rRoot.pRoot;
- if( pAkt )
- while( pAkt->pLeft )
- pAkt = pAkt->pLeft;
- pDelNext = pAkt;
- return pAkt;
-}
-
-
-SwClient* SwClientIter::GoEnd() // zum End des Baums
-{
- pAkt = pDelNext;
- if( !pAkt )
- pAkt = rRoot.pRoot;
- if( pAkt )
- while( pAkt->pRight )
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
- return pAkt;
-}
-
-
SwClient* SwClientIter::First( TypeId nType )
{
aSrchId = nType;
GoStart();
- if( pAkt )
+ if( pAct )
do {
- if( pAkt->IsA( aSrchId ) )
+ if( pAct->IsA( aSrchId ) )
break;
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
+ pAct = pDelNext;
- } while( pAkt );
- return pAkt;
+ } while( pAct );
+ return pAct;
}
-
SwClient* SwClientIter::Next()
{
do {
- // erstmal zum naechsten
- if( pDelNext == pAkt )
+ if( pDelNext == pAct )
{
- pAkt = pAkt->pRight;
- pDelNext = pAkt;
+ pAct = pAct->pRight;
+ pDelNext = pAct;
}
else
- pAkt = pDelNext;
+ pAct = pDelNext;
- if( pAkt && pAkt->IsA( aSrchId ) )
+ if( pAct && pAct->IsA( aSrchId ) )
break;
- } while( pAkt );
- return pAkt;
+ } while( pAct );
+ return pAct;
+}
+
+SwClient* SwClientIter::Last( TypeId nType )
+{
+ aSrchId = nType;
+ GoEnd();
+ if( pAct )
+ do {
+ if( pAct->IsA( aSrchId ) )
+ break;
+
+ if( pDelNext == pAct )
+ pAct = pAct->pLeft;
+ else
+ pAct = pDelNext->pLeft;
+ pDelNext = pAct;
+
+ } while( pAct );
+ return pAct;
}
+SwClient* SwClientIter::Previous()
+{
+ do {
+ if( pDelNext == pAct )
+ pAct = pAct->pLeft;
+ else
+ pAct = pDelNext->pLeft;
+ pDelNext = pAct;
+ if( pAct && pAct->IsA( aSrchId ) )
+ break;
+ } while( pAct );
+ return pAct;
+}
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index f492696ef8ac..17a7461fbc1e 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -29,9 +29,7 @@
#include "precompiled_sw.hxx"
#include <float.h>
-
#include <rtl/math.hxx>
-
#include <hintids.hxx> // fuer RES_..
#include <cellatr.hxx>
#include <calc.hxx>
@@ -41,7 +39,7 @@
#include <node.hxx>
#include <hints.hxx>
#include <rolbck.hxx>
-
+#include <switerator.hxx>
//TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -112,9 +110,9 @@ const SwNode* SwTblBoxFormula::GetNodeOfFormula() const
const SwNode* pRet = 0;
if( pDefinedIn )
{
- SwClient* pBox = SwClientIter( *pDefinedIn ).First( TYPE( SwTableBox ));
+ SwTableBox* pBox = SwIterator<SwTableBox,SwModify>::FirstElement( *pDefinedIn );
if( pBox )
- pRet = ((SwTableBox*)pBox)->GetSttNd();
+ pRet = pBox->GetSttNd();
}
return pRet;
}
@@ -124,8 +122,7 @@ SwTableBox* SwTblBoxFormula::GetTableBox()
{
SwTableBox* pBox = 0;
if( pDefinedIn )
- pBox = (SwTableBox*)SwClientIter( *pDefinedIn ).
- First( TYPE( SwTableBox ));
+ pBox = SwIterator<SwTableBox,SwModify>::FirstElement( *pDefinedIn );
return pBox;
}
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 6a296782ce6c..51d8e842365e 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -36,9 +36,7 @@
#include <doc.hxx>
#include <paratr.hxx> // fuer SwParaFmt - SwHyphenBug
#include <swcache.hxx>
-// --> OD 2006-11-22 #i71574#
#include <fmtcolfunc.hxx>
-// <--
TYPEINIT1( SwFmt, SwClient ); //rtti fuer SwFmt
@@ -142,16 +140,16 @@ SwFmt &SwFmt::operator=(const SwFmt& rFmt)
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
- if( pRegisteredIn != rFmt.pRegisteredIn )
+ if( GetRegisteredIn() != rFmt.GetRegisteredIn() )
{
- if( pRegisteredIn )
- pRegisteredIn->Remove(this);
- if(rFmt.pRegisteredIn)
+ if( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove(this);
+ if(rFmt.GetRegisteredIn())
{
- rFmt.pRegisteredIn->Add(this);
+ const_cast<SwFmt&>(rFmt).GetRegisteredInNonConst()->Add(this);
aSet.SetParent( &rFmt.aSet );
}
else
@@ -170,7 +168,7 @@ void SwFmt::SetName( const String& rNewName, sal_Bool bBroadcast )
SwStringMsgPoolItem aOld( RES_NAME_CHANGED, aFmtName );
SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
aFmtName = rNewName;
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -229,7 +227,7 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, BOOL bReplace )
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
@@ -269,7 +267,7 @@ SwFmt::~SwFmt()
SwFmtChg aNewFmt(pParentFmt);
SwClient * pDepend = (SwClient*)GetDepends();
pParentFmt->Add(pDepend);
- pDepend->Modify(&aOldFmt, &aNewFmt);
+ pDepend->ModifyNotification(&aOldFmt, &aNewFmt);
}
}
}
@@ -277,7 +275,7 @@ SwFmt::~SwFmt()
/*************************************************************************
-|* void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+|* void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
|*
|* Beschreibung Dokument 1.14
|* Ersterstellung JP 22.11.90
@@ -285,7 +283,7 @@ SwFmt::~SwFmt()
*************************************************************************/
-void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
BOOL bWeiter = TRUE; // TRUE = Propagierung an die Abhaengigen
@@ -302,9 +300,9 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject;
// nicht umhaengen wenn dieses das oberste Format ist !!
- if( pRegisteredIn && pRegisteredIn == pFmt )
+ if( GetRegisteredIn() && GetRegisteredIn() == pFmt )
{
- if( pFmt->pRegisteredIn )
+ if( pFmt->GetRegisteredIn() )
{
// wenn Parent, dann im neuen Parent wieder anmelden
pFmt->DerivedFrom()->Add( this );
@@ -332,7 +330,7 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
if( aNew.Count() )
// keine mehr gesetzt, dann Ende !!
- SwModify::Modify( &aOld, &aNew );
+ NotifyClients( &aOld, &aNew );
bWeiter = FALSE;
}
break;
@@ -353,12 +351,12 @@ void SwFmt::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
{
// IsWritten-Flag zuruecksetzen. Hint nur an abhanegige
// Formate (und keine Frames) propagieren.
+ // mba: the code does the opposite from what is written in the comment!
ResetWritten();
- SwClientIter aIter( *this );
- for( SwClient *pClient = aIter.First( TYPE(SwFmt) ); pClient;
- pClient = aIter.Next() )
- pClient->Modify( pOldValue, pNewValue );
-
+ // mba: here we don't use the additional stuff from NotifyClients().
+ // should we?!
+ // mba: move the code that ignores this event to the clients
+ ModifyBroadcast( pOldValue, pNewValue, TYPE(SwFmt) );
bWeiter = FALSE;
}
break;
@@ -383,7 +381,7 @@ ASSERT( RES_PARATR_DROP == nWhich, "Modify ohne Absender verschickt" );
if( bWeiter )
{
// laufe durch alle abhaengigen Formate
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
}
@@ -431,7 +429,7 @@ BOOL SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
SwFmtChg aOldFmt(this);
SwFmtChg aNewFmt(this);
- Modify( &aOldFmt, &aNewFmt );
+ ModifyNotification( &aOldFmt, &aNewFmt );
return TRUE;
}
@@ -476,7 +474,7 @@ BOOL SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -524,7 +522,7 @@ BOOL SwFmt::SetFmtAttr( const SfxItemSet& rSet )
aSet.SetModifyAtAttr( this );
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -561,7 +559,7 @@ BOOL SwFmt::ResetFmtAttr( USHORT nWhich1, USHORT nWhich2 )
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
return bRet;
}
@@ -595,7 +593,7 @@ USHORT SwFmt::ResetAllFmtAttr()
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
return aNew.Count();
}
@@ -644,7 +642,7 @@ void SwFmt::DelDiffs( const SfxItemSet& rSet )
{
SwAttrSetChg aChgOld( aSet, aOld );
SwAttrSetChg aChgNew( aSet, aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 11060352b6c3..4a773c6980c4 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -164,9 +164,9 @@ namespace sw { namespace mark
}
- void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+ void MarkBase::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
{
- SwModify::Modify(pOld, pNew);
+ NotifyClients(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
SetXBookmark(uno::Reference<text::XTextContent>(0));
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 33c9a9fb71c4..4a92f73a9ed8 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2147,7 +2147,7 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const
// Link weitergeleitet.
-void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwCrsrShell::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
const USHORT nWhich = pOld ?
pOld->Which() :
@@ -2673,7 +2673,7 @@ SwCrsrShell::~SwCrsrShell()
// der CursorShell haengt keine Chance geben, sich an den
// TextNode zu haengen.
if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
SwShellCrsr* SwCrsrShell::getShellCrsr( bool bBlock )
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index b713d1e2b626..d281da0c67e1 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -71,7 +71,7 @@
#include <fmturl.hxx>
#include "txtfrm.hxx"
#include <wrong.hxx>
-
+#include <switerator.hxx>
#include <vcl/window.hxx>
#include <docufld.hxx> // OD 2008-06-19 #i90516#
@@ -411,14 +411,13 @@ BOOL SwCrsrShell::GotoTOXMarkBase()
// dann nehme den 1. und hole den Verzeichnis-Typ.
// Suche in seiner Abhaengigkeitsliste nach dem eigentlichem
// Verzeichnis
- SwModify* pType = (SwModify*)aMarks[0]->GetRegisteredIn();
- SwClientIter aIter( *pType );
+ const SwTOXType* pType = aMarks[0]->GetTOXType();
+ SwIterator<SwTOXBase,SwTOXType> aIter( *pType );
const SwSectionNode* pSectNd;
const SwSectionFmt* pSectFmt;
- for( SwTOXBase* pTOX =
- (SwTOXBase*)aIter.First( TYPE( SwTOXBase ));
- pTOX; pTOX = (SwTOXBase*)aIter.Next() )
+ for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
+ {
if( pTOX->ISA( SwTOXBaseSection ) &&
0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) &&
0 != ( pSectNd = pSectFmt->GetSectionNode() ))
@@ -445,6 +444,7 @@ BOOL SwCrsrShell::GotoTOXMarkBase()
}
}
}
+ }
return bRet;
}
@@ -630,13 +630,13 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
// es muss immer der 1. Frame gesucht werden
Point aPt;
SwTxtFld* pTxtFld;
- SwClientIter aIter( (SwFieldType&)rFldType );
+ SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
BOOL bSubType = nSubType != USHRT_MAX;
- for( SwClient* pLast = aIter.First( TYPE( SwFmtFld )); pLast; pLast = aIter.Next() )
- if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) &&
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) &&
( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld())
->GetInputFlag() ) &&
- (!bSubType || (((SwFmtFld*)pLast)->GetFld()->GetSubType()
+ (!bSubType || (pFmtFld->GetFld()->GetSubType()
& 0xff ) == nSubType ))
{
SwCntntFrm* pCFrm;
@@ -1612,20 +1612,16 @@ bool SwContentAtPos::IsInRTLText()const
}
if(pNd)
{
- SwClientIter aClientIter( * const_cast<SwTxtNode*>(pNd) );
- SwClient* pLast = aClientIter.GoStart();
- while( pLast )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter(*pNd);
+ SwTxtFrm* pTmpFrm = aIter.First();
+ while( pTmpFrm )
{
- if ( pLast->ISA( SwTxtFrm ) )
- {
- SwTxtFrm* pTmpFrm = static_cast<SwTxtFrm*>( pLast );
if ( !pTmpFrm->IsFollow())
{
bRet = pTmpFrm->IsRightToLeft();
break;
}
- }
- pLast = ++aClientIter;
+ pTmpFrm = aIter.Next();
}
}
return bRet;
@@ -2110,14 +2106,13 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
for( USHORT n = pFmts->Count(); 1 < n; )
{
- SwClientIter aIter( *(*pFmts)[ --n ] );
+ SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
- for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt ));
- pFnd; pFnd = aIter.Next() )
- if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) &&
+ for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
+ if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) &&
pTxtNd->GetNodes().IsDocNodes() )
{
- SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd;
+ SwTxtINetFmt& rAttr = *pFnd;
SwPosition aTmpPos( *pTxtNd );
_SetGetExpFld aPos( aTmpPos.nNode, rAttr );
SwCntntFrm* pFrm;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index a79203c13ece..238982aac785 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1236,7 +1236,7 @@ void SwPaM::InvalidatePaM()
SwInsTxt aHint( Start()->nContent.GetIndex(),
End()->nContent.GetIndex() - Start()->nContent.GetIndex() + 1 );
SwModify *_pModify=(SwModify*)_pTxtNd;
- _pModify->Modify( 0, &aHint);
+ _pModify->ModifyNotification( 0, &aHint);
}
}
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 5431de73cd6a..53bbd9cfbd84 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -66,11 +66,12 @@ public:
SwAutoCompleteClient& operator=(const SwAutoCompleteClient& rClient);
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
const SwDoc& GetDoc(){return *pDoc;}
#ifdef DBG_UTIL
static ULONG GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
/* -----------------------------05.08.2002 12:48------------------------------
@@ -156,15 +157,15 @@ SwAutoCompleteClient& SwAutoCompleteClient::operator=(const SwAutoCompleteClient
pAutoCompleteWord = rClient.pAutoCompleteWord;
pDoc = rClient.pDoc;
if(rClient.GetRegisteredIn())
- rClient.pRegisteredIn->Add(this);
+ ((SwModify*)rClient.GetRegisteredIn())->Add(this);
else if(GetRegisteredIn())
- pRegisteredIn->Remove(this);
+ GetRegisteredInNonConst()->Remove(this);
return *this;
}
/* -----------------------------05.08.2002 12:49------------------------------
---------------------------------------------------------------------------*/
-void SwAutoCompleteClient::Modify(SfxPoolItem *pOld, SfxPoolItem *)
+void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *)
{
switch( pOld ? pOld->Which() : 0 )
{
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index d866a41a3016..c7aabee9c99f 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -124,6 +124,8 @@
#include <vbahelper/vbaaccesshelper.hxx>
#endif
+#include "switerator.hxx"
+
/* @@@MAINTAINABILITY-HORROR@@@
Probably unwanted dependency on SwDocShell
*/
@@ -1087,9 +1089,8 @@ USHORT _PostItFld::GetPageNo(
//Bereichs ermittelt werden.
rVirtPgNo = 0;
USHORT nPos = GetCntnt();
- SwClientIter aIter( (SwModify &)GetFld()->GetTxtNode() );
- for( SwTxtFrm* pFrm = (SwTxtFrm*)aIter.First( TYPE( SwFrm ));
- pFrm; pFrm = (SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( GetFld()->GetTxtNode() );
+ for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
if( pFrm->GetOfst() > nPos ||
(pFrm->HasFollow() && pFrm->GetFollow()->GetOfst() <= nPos) )
@@ -1119,13 +1120,11 @@ bool lcl_GetPostIts(
if( pFldType->GetDepends() )
{
// Modify-Object gefunden, trage alle Felder ins Array ein
- SwClientIter aIter( *pFldType );
- SwClient* pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
const SwTxtFld* pTxtFld;
-
- for( pLast = aIter.First( TYPE(SwFmtFld)); pLast; pLast = aIter.Next() )
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
- if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) &&
+ if( 0 != ( pTxtFld = pFld->GetTxtFld() ) &&
pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
{
bHasPostIts = true;
@@ -1736,10 +1735,8 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
// #i93174#: notes contain paragraphs that are not nodes
{
SwFieldType * const pPostits( GetSysFldType(RES_POSTITFLD) );
- SwClientIter aIter(*pPostits);
- SwFmtFld const * pFmtFld =
- static_cast<SwFmtFld const*>(aIter.First( TYPE(SwFmtFld) ));
- while (pFmtFld)
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pPostits );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if (pFmtFld->IsFldInDoc())
{
@@ -1747,7 +1744,6 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
static_cast<SwPostItField const*>(pFmtFld->GetFld()));
rStat.nAllPara += pField->GetNumberOfParagraphs();
}
- pFmtFld = static_cast<SwFmtFld const*>(aIter.Next());
}
}
@@ -2192,9 +2188,8 @@ BOOL SwDoc::RemoveInvisibleContent()
{
SwTxtNode* pTxtNd;
- SwClientIter aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetSysFldType( RES_HIDDENPARAFLD ) );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if( pFmtFld->GetTxtFld() &&
0 != ( pTxtNd = (SwTxtNode*)pFmtFld->GetTxtFld()->GetpTxtNode() ) &&
@@ -2374,14 +2369,11 @@ BOOL SwDoc::ConvertFieldsToText()
if ( RES_POSTITFLD == pCurType->Which() )
continue;
- SwClientIter aIter( *(SwFieldType*)pCurType );
- const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pCurType );
::std::vector<const SwFmtFld*> aFieldFmts;
- while (pCurFldFmt)
- {
+ for( SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next() )
aFieldFmts.push_back(pCurFldFmt);
- pCurFldFmt = (SwFmtFld*)aIter.Next();
- }
+
::std::vector<const SwFmtFld*>::iterator aBegin = aFieldFmts.begin();
::std::vector<const SwFmtFld*>::iterator aEnd = aFieldFmts.end();
while(aBegin != aEnd)
@@ -2671,21 +2663,8 @@ void SwDoc::ChkCondColls()
for (USHORT n = 0; n < pTxtFmtCollTbl->Count(); n++)
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
-
if (RES_CONDTXTFMTCOLL == pColl->Which())
- {
- SwClientIter aIter(*pColl);
-
- SwClient * pClient = aIter.First(TYPE(SwTxtNode));
- while (pClient)
- {
- SwTxtNode * pTxtNode = static_cast<SwTxtNode *>(pClient);
-
- pTxtNode->ChkCondColl();
-
- pClient = aIter.Next();
- }
- }
+ pColl->CallSwClientNotify( RES_CONDTXTFMTCOLL );
}
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index ca3ab77a2d5c..fa29cd583efc 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1490,7 +1490,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
{
SwFrmFmt *pFrmFmt = (*pSpz)[ aSave.GetCount() ];
SfxPoolItem *pAnchor = (SfxPoolItem*)&pFrmFmt->GetAnchor();
- pFrmFmt->SwModify::Modify( pAnchor, pAnchor );
+ pFrmFmt->NotifyClients( pAnchor, pAnchor );
}
break;
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 2cef07f9b487..0477eff2b0ed 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -257,7 +257,7 @@ void PaMCorrAbs( const SwNodeIndex &rStartNode,
{
// the UNO cursor has left its section. We need to notify it!
SwMsgPoolItem aHint( RES_UNOCURSOR_LEAVES_SECTION );
- pUnoCursor->Modify( &aHint, NULL );
+ pUnoCursor->ModifyNotification( &aHint, NULL );
}
}
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 1f05a93f1abd..ab7cebda7304 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -55,9 +55,7 @@
#include <frmtool.hxx>
#include <pagedesc.hxx>
#include <poolfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <ndindex.hxx>
#include <ftnidx.hxx>
#include <fmtftn.hxx>
@@ -69,10 +67,8 @@
#include <swwait.hxx>
#include <GetMetricVal.hxx>
#include <unotools/syslocale.hxx>
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
-
+#include <switerator.hxx>
#include <SwUndoPageDesc.hxx>
#include <tgrditem.hxx>
@@ -416,16 +412,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
pDesc->SetFtnInfo( rChged.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
- SwClientIter aIter( pDesc->GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ pDesc->GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
- SwClientIter aIter( pDesc->GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
}
SetModified();
@@ -459,9 +449,9 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
return;
SwFmtPageDesc aDfltDesc( aPageDescs[0] );
- SwClientIter aIter( *pDel );
+ SwClientIter aIter( *pDel ); // TODO
SwClient* pLast;
- while( 0 != ( pLast = aIter.GoRoot() ))
+ while( 0 != ( pLast = aIter.GoStart() ))
{
if( pLast->ISA( SwFmtPageDesc ) )
{
@@ -475,18 +465,22 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
else
{
ASSERT( !this, "was ist das fuer ein Mofify-Obj?" );
- aPageDescs[0]->Add( pLast );
+ ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] );
}
}
else //Es kann noch eine Undo-Kopie existieren
- aPageDescs[0]->Add( pLast );
+ ((SwFmtPageDesc*)pLast)->RegisterToPageDesc( *aPageDescs[0] );
}
+ // mba: this code prevents us from using an SwIterator as GetPageDescDep() returns an SwClient that is an SwDepend
BOOL bFtnInf = FALSE;
if ( TRUE == (bFtnInf = pLast == pFtnInfo->GetPageDescDep()) ||
pLast == pEndNoteInfo->GetPageDescDep() )
{
- aPageDescs[0]->Add( pLast );
+ if ( bFtnInf )
+ pFtnInfo->ChgPageDesc( aPageDescs[0] );
+ else
+ pEndNoteInfo->ChgPageDesc( aPageDescs[0] );
if ( pTmpRoot )
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
@@ -746,23 +740,7 @@ void SwDoc::PrtOLENotify( BOOL bAll )
mbOLEPrtNotifyPending = mbAllOLENotify = FALSE;
-
- SwOLENodes *pNodes = 0;
- SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd;
- pNd = (SwCntntNode*)aIter.Next() )
- {
- SwOLENode *pONd;
- if ( 0 != (pONd = pNd->GetOLENode()) &&
- (bAll || pONd->IsOLESizeInvalid()) )
- {
- if ( !pNodes )
- pNodes = new SwOLENodes;
- pNodes->Insert( pONd, pNodes->Count() );
- }
- }
-
+ SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), !bAll );
if ( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
@@ -836,31 +814,19 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
{
mbOLEPrtNotifyPending = mbAllOLENotify = FALSE;
- SwOLENodes aOLENodes;
- SwClientIter aIter( *(SwModify*)GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd;
- pNd = (SwCntntNode*)aIter.Next() )
- {
- SwOLENode *pONd = pNd->GetOLENode();
- if( pONd && pONd->IsOLESizeInvalid() )
- {
- aOLENodes.Insert( pONd, aOLENodes.Count() );
- }
- }
-
- if( aOLENodes.Count() )
+ SwOLENodes *pNodes = SwCntntNode::CreateOLENodesArray( *GetDfltGrfFmtColl(), true );
+ if( pNodes )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
- 0, aOLENodes.Count(), GetDocShell());
+ 0, pNodes->Count(), GetDocShell());
GetCurrentLayout()->StartAllAction(); //swmod 080218
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
- for( USHORT i = 0; i < aOLENodes.Count(); ++i )
+ for( USHORT i = 0; i < pNodes->Count(); ++i )
{
::SetProgressState( i, GetDocShell() );
- SwOLENode* pOLENd = aOLENodes[i];
+ SwOLENode* pOLENd = (*pNodes)[i];
pOLENd->SetOLESizeInvalid( FALSE );
//Kennen wir nicht, also muss das Objekt geladen werden.
@@ -881,11 +847,12 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
pOLENd->SetOLESizeInvalid( TRUE );
}*/
// repaint it
- pOLENd->Modify( &aMsgHint, &aMsgHint );
+ pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
+ delete pNodes;
}
}
return 0;
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 312115566374..6c09d1c4fcf5 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -63,21 +63,15 @@
#include <dflyobj.hxx>
#include <svx/svdetc.hxx>
#include <editeng/fhgtitem.hxx>
-
-// OD 26.06.2003 #108784#
#include <svx/svdpagv.hxx>
-// OD 2004-04-01 #i26791#
#include <dcontact.hxx>
#include <txtfrm.hxx>
#include <frmfmt.hxx>
#include <editeng/frmdiritem.hxx>
#include <fmtornt.hxx>
-// --> OD 2006-03-14 #i62875#
#include <svx/svditer.hxx>
-// <--
-// --> OD 2006-11-01 #130889#
#include <vector>
-// <--
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -544,28 +538,29 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
// #i11176#
// This also needs to work when no layout exists. Thus, for
// FlyFrames an alternative method is used now in that case.
- SwClientIter aIter( (SwFmt&)*pFmt );
-
if( RES_FLYFRMFMT == pFmt->Which() )
{
if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE( SwFlyFrm) ) )
- nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum();
+ SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFrmFmt );
+ if( pFly )
+ nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
}
else
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwFlyDrawContact) ) )
- nOrdNum = ((SwFlyDrawContact*)aIter())->GetMaster()->GetOrdNum();
+ SwFlyDrawContact* pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *pFrmFmt );
+ if( pContact )
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
}
}
else if( RES_DRAWFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwDrawContact) ) )
- nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum();
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
+ if( pContact )
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
}
else {
ASSERT( !this, "was ist das fuer ein Format?" );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 67bcd0d9d3cf..30ad4316b13e 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -832,13 +832,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
if( nOldAttrCnt != nNewAttrCnt )
{
SwUpdateAttr aHint( 0, 0, 0 );
- SwClientIter aIter( *pNode );
- SwClient* pGTO = aIter.First(TYPE( SwCrsrShell ));
- while( pGTO )
- {
- pGTO->Modify( 0, &aHint );
- pGTO = aIter.Next();
- }
+ pNode->ModifyBroadcast( 0, &aHint, TYPE( SwCrsrShell ) );
}
if( !DoesUndo() && !IsIgnoreRedline() && GetRedlineTbl().Count() )
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index a738c6bd0576..852df26cba93 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -74,6 +74,7 @@
#endif
#include <SwUndoField.hxx>
+#include "switerator.hxx"
using namespace ::com::sun::star::uno;
@@ -361,10 +362,10 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
if( !pNewHt )
{
SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL );
- (*pFldTypes)[i]->Modify( 0, &aUpdateDDE );
+ (*pFldTypes)[i]->ModifyNotification( 0, &aUpdateDDE );
}
else
- (*pFldTypes)[i]->Modify( 0, pNewHt );
+ (*pFldTypes)[i]->ModifyNotification( 0, pNewHt );
break;
}
case RES_GETEXPFLD:
@@ -375,7 +376,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB )
if( !pNewHt )
break;
default:
- (*pFldTypes)[i]->Modify( 0, pNewHt );
+ (*pFldTypes)[i]->ModifyNotification ( 0, pNewHt );
}
}
@@ -427,7 +428,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt )
SwFieldType* pFldType;
for( USHORT i = 0; i < pFldTypes->Count(); ++i )
if( RES_GETREFFLD == ( pFldType = (*pFldTypes)[i] )->Which() )
- pFldType->Modify( 0, pHt );
+ pFldType->ModifyNotification( 0, pHt );
}
void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
@@ -446,9 +447,9 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( pHt && RES_TABLEFML_UPDATE == pHt->Which() )
pUpdtFld = (SwTableFmlUpdate*)pHt;
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ {
if( pFmtFld->GetTxtFld() )
{
SwTblField* pFld = (SwTblField*)pFmtFld->GetFld();
@@ -499,6 +500,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
// setze bei allen das Value-Flag zurueck
pFld->ChgValid( FALSE );
}
+ }
break;
}
@@ -525,16 +527,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( pFldType )
{
- SwClient* pLast;
- SwClientIter aIter( *pFldType );
- // dann rechne mal schoen
- // JP 27.03.97: Beim Berechnen am Ende anfangen - weil neue
- // Felder immer am Anfang der Modifykette eingefuegt
- // werden. Beim Import haben wir damit eine bessere/
- // schnellere Berechnung bei "Kettenformeln"
- if( 0 != ( pLast = aIter.GoEnd() ))
- do {
- SwFmtFld* pFmtFld = (SwFmtFld*)pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFmtFld = aIter.Last(); pFmtFld; pFmtFld = aIter.Previous() )
+ {
+ // start calculation at the end
+ // new fields are inserted at the beginning of the modify chain
+ // that gives faster calculation on import
+ // mba: do we really need this "optimization"? Is it still valid?
SwTblField* pFld;
if( !pFmtFld->GetTxtFld() || (nsSwExtendedSubType::SUB_CMD &
(pFld = (SwTblField*)pFmtFld->GetFld())->GetSubType() ))
@@ -603,8 +602,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
}
pCalc->SetCalcError( CALC_NOERR );
}
- pFmtFld->Modify( 0, pHt );
- } while( 0 != ( pLast = aIter-- ));
+ pFmtFld->ModifyNotification( 0, pHt );
+ }
}
// dann berechene noch die Formeln an den Boxen
@@ -700,10 +699,10 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt )
case RES_CHAPTERFLD:
case RES_GETEXPFLD:
case RES_REFPAGEGETFLD:
- pFldType->Modify( 0, pMsgHnt );
+ pFldType->ModifyNotification( 0, pMsgHnt );
break;
case RES_DOCSTATFLD:
- pFldType->Modify( 0, 0 );
+ pFldType->ModifyNotification( 0, 0 );
break;
}
SetNewFldLst(true);
@@ -1542,7 +1541,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
}
} // switch
- pFmtFld->Modify( 0, 0 ); // Formatierung anstossen
+ pFmtFld->ModifyNotification( 0, 0 ); // Formatierung anstossen
if( pUpdtFld == pTxtFld ) // sollte nur dieses geupdatet werden
{
@@ -1685,9 +1684,8 @@ const SwDBData& SwDoc::GetDBDesc()
case RES_DBNUMSETFLD:
case RES_DBSETNUMBERFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- while(pFld)
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if(pFld->IsFldInDoc())
{
@@ -1699,7 +1697,6 @@ const SwDBData& SwDoc::GetDBDesc()
aDBData = (static_cast < SwDBNameInfField* > (pFld->GetFld()))->GetRealDBData();
break;
}
- pFld = (SwFmtFld*)aIter.Next();
}
}
break;
@@ -1957,7 +1954,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames,
SwDBFieldType* pTyp = (SwDBFieldType*)InsertFldType(
SwDBFieldType(this, pOldTyp->GetColumnName(), aNewDBData));
- pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen
+ pFmtFld->RegisterToFieldType( *pTyp );
pFld->ChgTyp(pTyp);
((SwDBField*)pFld)->ClearInitialized();
@@ -2102,10 +2099,8 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
for( ; nStt < 5; ++nStt )
{
SwFieldType* pFldType = GetSysFldType( aTypes[ nStt ] );
- SwClientIter aDocInfIter( *pFldType );
-
- for( SwFmtFld* pFld = (SwFmtFld*)aDocInfIter.First( TYPE( SwFmtFld ));
- pFld; pFld = (SwFmtFld*)aDocInfIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if( pFld && pFld->GetTxtFld() )
{
@@ -2173,7 +2168,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime )
// Formatierung anstossen
if( bChgd )
- pFld->Modify( 0, 0 );
+ pFld->ModifyNotification( 0, 0 );
}
}
}
@@ -2436,7 +2431,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
pFormel = 0;
// Formatierung anstossen
- ((SwFmtFld*)pFmtFld)->Modify( 0, 0 );
+ ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 );
}
break;
@@ -2456,7 +2451,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
// Feld Evaluieren
((SwHiddenTxtField*)pFld)->Evaluate(&rDoc);
// Formatierung anstossen
- ((SwFmtFld*)pFmtFld)->Modify( 0, 0 );
+ ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 );
}
break;
@@ -2757,7 +2752,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
if (bUpdateFlds)
UpdateTblFlds( &aTblUpdate );
else
- pNewFld->GetTyp()->Modify(0, &aTblUpdate);
+ pNewFld->GetTyp()->ModifyNotification(0, &aTblUpdate);
if (! bUpdateFlds)
bTblSelBreak = TRUE;
@@ -2768,7 +2763,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
case RES_MACROFLD:
if( bUpdateFlds && pDstTxtFld->GetpTxtNode() )
(pDstTxtFld->GetpTxtNode())->
- Modify( 0, pDstFmtFld );
+ ModifyNotification( 0, pDstFmtFld );
break;
case RES_DBNAMEFLD:
@@ -2795,7 +2790,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
// kein break;
default:
- pDstFmtFld->Modify( 0, pMsgHnt );
+ pDstFmtFld->ModifyNotification( 0, pMsgHnt );
}
// Die Felder die wir berechnen koennen werden hier expli.
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 307de496314e..14d7c8ef02e3 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -64,19 +64,14 @@
#include <undobj.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
-
-// --> OD 2009-07-20 #i73249#
#include <undoflystrattr.hxx>
-// <--
+#include <switerator.hxx>
extern USHORT GetHtmlMode( const SwDocShell* );
using namespace ::com::sun::star;
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
{
const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
@@ -118,9 +113,6 @@ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
return nCount;
}
-/*-----------------17.02.98 08:35-------------------
-
---------------------------------------------------*/
// If you change this, also update SwXFrameEnumeration in unocoll.
SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType )
{
@@ -161,16 +153,6 @@ SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType )
return pRetFmt;
}
-/* */
-
-/***********************************************************************
-#* Class : SwDoc
-#* Methode : SetFlyFrmAnchor
-#* Beschreibung: Das Ankerattribut des FlyFrms aendert sich.
-#* Datum : MA 01. Feb. 94
-#* Update : JP 09.03.98
-#***********************************************************************/
-
Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
const SwFrmFmt* pFlyFmt )
{
@@ -527,13 +509,6 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
}
// <--
-/***************************************************************************
- * Methode : BOOL SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& )
- * Beschreibung:
- * Erstellt : OK 14.04.94 15:40
- * Aenderung : JP 23.04.98
- ***************************************************************************/
-
BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, BOOL bKeepOrient )
{
@@ -617,7 +592,7 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
rFmt.MakeFrms();
if( pUndo )
- rFmt.Remove( pUndo );
+ pUndo->DeRegisterFromFormat( rFmt );
SetModified();
@@ -638,15 +613,6 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName,
pGrfNd->GetFileFilterNms( pGrfName, pFltName );
}
-/*************************************************************************
-|*
-|* SwDoc::ChgAnchor()
-|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung JP 08.07.98
-|*
-*************************************************************************/
-
sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
RndStdIds _eAnchorType,
const sal_Bool _bSameOnly,
@@ -898,9 +864,6 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
//Die Source darf noch keinen Follow haben.
@@ -999,9 +962,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
int nErr = Chainable( rSource, rDest );
@@ -1032,8 +993,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
SwFmtFrmSize aSize( rSource.GetFrmSize() );
if ( aSize.GetHeightSizeType() != ATT_FIX_SIZE )
{
- SwClientIter aIter( rSource );
- SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( rSource );
if ( pFly )
aSize.SetHeight( pFly->Frm().Height() );
aSize.SetHeightSizeType( ATT_FIX_SIZE );
@@ -1045,9 +1005,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
return nErr;
}
-/* -----------------23.07.98 13:56-------------------
- *
- * --------------------------------------------------*/
+
void SwDoc::Unchain( SwFrmFmt &rFmt )
{
SwFmtChain aChain( rFmt.GetChain() );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 810e9fb2310a..b901f63e554e 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1359,7 +1359,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
SwFmtChg aChgFmt( pDfltCharFmt );
// dann sage mal den Frames bescheid
- aCallMod.Modify( &aChgFmt, &aChgFmt );
+ aCallMod.ModifyNotification( &aChgFmt, &aChgFmt );
}
}
}
@@ -1368,7 +1368,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
{
SwAttrSetChg aChgOld( aOld, aOld );
SwAttrSetChg aChgNew( aNew, aNew );
- aCallMod.Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ aCallMod.ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
// und die default-Formate wieder beim Object austragen
@@ -2040,14 +2040,9 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
pDest = FindFmtByName( rDestArr, pSrc->GetName() );
pDest->SetAuto( FALSE );
-// pDest->ResetAllAttr();
-// pDest->CopyAttrs( *pSrc, TRUE ); // kopiere Attribute
-//JP 19.02.96: ist so wohl optimaler - loest ggfs. kein Modify aus!
pDest->DelDiffs( *pSrc );
- // --> OD 2009-03-23 #i94285#
- // copy existing <SwFmtPageDesc> instance, before copying attributes
-// pDest->SetFmtAttr( pSrc->GetAttrSet() ); // kopiere Attribute
- //JP 18.08.98: Bug 55115 - copy PageDescAttribute in this case
+
+ // #i94285#: existing <SwFmtPageDesc> instance, before copying attributes
const SfxPoolItem* pItem;
if( &GetAttrPool() != pSrc->GetAttrSet().GetPool() &&
SFX_ITEM_SET == pSrc->GetAttrSet().GetItemState(
@@ -2061,8 +2056,7 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pPageDesc = aPageDescs[ MakePageDesc( rNm ) ];
}
- pPageDesc->Add( &aPageDesc );
-// pDest->SetFmtAttr( aPageDesc );
+ aPageDesc.RegisterToPageDesc( *pPageDesc );
SwAttrSet aTmpAttrSet( pSrc->GetAttrSet() );
aTmpAttrSet.Put( aPageDesc );
pDest->SetFmtAttr( aTmpAttrSet );
@@ -2071,7 +2065,6 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
{
pDest->SetFmtAttr( pSrc->GetAttrSet() );
}
- // <--
pDest->SetPoolFmtId( pSrc->GetPoolFmtId() );
pDest->SetPoolHelpId( pSrc->GetPoolHelpId() );
@@ -2159,9 +2152,9 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader,
pNewFmt->ResetFmtAttr( RES_CNTNT );
}
if( bCpyHeader )
- pNewFmt->Add( (SwFmtHeader*)pNewItem );
+ ((SwFmtHeader*)pNewItem)->RegisterToFormat(*pNewFmt);
else
- pNewFmt->Add( (SwFmtFooter*)pNewItem );
+ ((SwFmtFooter*)pNewItem)->RegisterToFormat(*pNewFmt);
rDestFmt.SetFmtAttr( *pNewItem );
}
delete pNewItem;
@@ -2248,16 +2241,10 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
rDstDesc.SetFtnInfo( rSrcDesc.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
- SwClientIter aIter( rDstDesc.GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
- SwClientIter aIter( rDstDesc.GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
- pLast->Modify( &aInfo, 0 );
+ rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
}
}
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 092b05783977..ee4f10f37b9c 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -49,8 +49,8 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo)
{
if( rInfo.GetFtnTxtColl() )
rInfo.GetFtnTxtColl()->Add(this);
- else if ( pRegisteredIn)
- pRegisteredIn->Remove(this);
+ else if ( GetRegisteredIn())
+ GetRegisteredInNonConst()->Remove(this);
if ( rInfo.aPageDescDep.GetRegisteredIn() )
((SwModify*)rInfo.aPageDescDep.GetRegisteredIn())->Add( &aPageDescDep );
@@ -183,7 +183,7 @@ void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt )
pChFmt->Add( &((SwClient&)aAnchorCharFmtDep) );
}
-void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
@@ -207,7 +207,7 @@ void SwEndNoteInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
else
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo)
@@ -314,7 +314,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
SwFmtChg aOld( pOldChrFmt );
SwFmtChg aNew( pNewChrFmt );
- pFtnInfo->Modify( &aOld, &aNew );
+ pFtnInfo->ModifyNotification( &aOld, &aNew );
}
// --> OD 2008-01-09 #i81002#
@@ -379,7 +379,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
{
SwFmtChg aOld( pOldChrFmt );
SwFmtChg aNew( pNewChrFmt );
- pEndNoteInfo->Modify( &aOld, &aNew );
+ pEndNoteInfo->ModifyNotification( &aOld, &aNew );
}
// --> OD 2008-01-09 #i81002#
@@ -446,7 +446,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
pTxtFtn->CheckCondColl();
//#i11339# dispose UNO wrapper when a footnote is changed to an endnote or vice versa
SwPtrMsgPoolItem aMsgHint( RES_FOOTNOTE_DELETED, (void*)&pTxtFtn->GetAttr() );
- GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint );
+ GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 30a385442fc0..5ae6629a5715 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -53,7 +53,7 @@
#include <section.hxx>
#include <doctxm.hxx>
#include <poolfmt.hxx>
-
+#include <switerator.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -132,9 +132,8 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
{
pOutlNds = new SwOutlineNodes( 8, 8 );
- SwClientIter aIter( *(SwModify*)pSplitColl );
- for( SwTxtNode* pTNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode ));
- pTNd; pTNd = (SwTxtNode*)aIter.Next() )
+ SwIterator<SwTxtNode,SwFmtColl> aIter( *pSplitColl );
+ for( SwTxtNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() )
if( pTNd->GetNodes().IsDocNodes() )
pOutlNds->Insert( pTNd );
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 5244cd79606a..0413ad1c82a0 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1917,7 +1917,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
const sal_Bool bOldLockView = pStartSh->IsViewLocked();
pStartSh->LockView( sal_True );
- GetSysFldType( RES_CHAPTERFLD )->Modify( 0, 0 ); // KapitelFld
+ GetSysFldType( RES_CHAPTERFLD )->ModifyNotification( 0, 0 ); // KapitelFld
UpdateExpFlds( 0, sal_False ); // Expression-Felder Updaten
UpdateTblFlds(NULL); // Tabellen
UpdateRefFlds(NULL); // Referenzen
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 68ae706a4b51..06e898561174 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -603,10 +603,8 @@ SwDoc::~SwDoc()
// Delete fuer Collections
// damit die Abhaengigen wech sind
- SwTxtFmtColl *pFtnColl = pFtnInfo->GetFtnTxtColl();
- if ( pFtnColl ) pFtnColl->Remove(pFtnInfo);
- pFtnColl = pEndNoteInfo->GetFtnTxtColl();
- if ( pFtnColl ) pFtnColl->Remove(pEndNoteInfo);
+ pFtnInfo->ReleaseCollection();
+ pEndNoteInfo->ReleaseCollection();
ASSERT( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
"Default-Text-Collection muss immer am Anfang stehen" );
@@ -865,10 +863,8 @@ void SwDoc::ClearDoc()
// Delete fuer Collections
// damit die Abhaengigen wech sind
- SwTxtFmtColl* pFtnColl = pFtnInfo->GetFtnTxtColl();
- if( pFtnColl ) pFtnColl->Remove( pFtnInfo );
- pFtnColl = pEndNoteInfo->GetFtnTxtColl();
- if( pFtnColl ) pFtnColl->Remove( pEndNoteInfo );
+ pFtnInfo->ReleaseCollection();
+ pEndNoteInfo->ReleaseCollection();
// JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
// steht, sollte das als letztes geloescht werden, damit
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 1224c5c02f17..10818f25a96e 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -49,18 +49,15 @@
#include <txtfrm.hxx>
#include <pamtyp.hxx>
#include <redline.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <editeng/adjitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <frmatr.hxx>
#include <SwStyleNameMapper.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-03-13 #refactorlists#
#include <list.hxx>
#include <listfunc.hxx>
-// <--
+#include <switerator.hxx>
#include <map>
@@ -145,8 +142,6 @@ void SwDoc::PropagateOutlineRule()
// if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei
if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
- SwClientIter aIter(*pColl);
-
// --> OD 2006-11-20 #i71764#
// Check only the list style, which is set at the paragraph style
const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( FALSE );
@@ -1353,33 +1348,17 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut )
{
for( USHORT n = GetNumRuleTbl().Count(); n; )
{
- // --> OD 2008-02-19 #refactorlists#
-// SwNumRuleInfo aUpd( GetNumRuleTbl()[ --n ]->GetName() );
-// aUpd.MakeList( *this );
-
-// for( ULONG nFirst = 0, nLast = aUpd.GetList().Count();
-// nFirst < nLast; ++nFirst )
-// {
-// SwTxtNode* pTNd = aUpd.GetList().GetObject( nFirst );
-// SwClientIter aIter( *pTNd );
-// for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
-// pFrm; pFrm = (SwFrm*)aIter.Next() )
-// if( ((SwTxtFrm*)pFrm)->HasAnimation() )
-// ((SwTxtFrm*)pFrm)->StopAnimation( pOut );
-// }
SwNumRule::tTxtNodeList aTxtNodeList;
GetNumRuleTbl()[ --n ]->GetTxtNodeList( aTxtNodeList );
for ( SwNumRule::tTxtNodeList::iterator aTxtNodeIter = aTxtNodeList.begin();
aTxtNodeIter != aTxtNodeList.end(); ++aTxtNodeIter )
{
SwTxtNode* pTNd = *aTxtNodeIter;
- SwClientIter aIter( *pTNd );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm; pFrm = (SwFrm*)aIter.Next() )
- if( ((SwTxtFrm*)pFrm)->HasAnimation() )
- ((SwTxtFrm*)pFrm)->StopAnimation( pOut );
+ SwIterator<SwTxtFrm,SwTxtNode> aIter(*pTNd);
+ for(SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ if( pFrm->HasAnimation() )
+ pFrm->StopAnimation( pOut );
}
- // <--
}
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 32d26df19141..b2540c3501c8 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3279,7 +3279,7 @@ void SwRedline::InvalidateRange() // das Layout anstossen
{
aHt.nStart = n == nSttNd ? nSttCnt : 0;
aHt.nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len();
- ((SwTxtNode*)pNd)->Modify( &aHt, &aHt );
+ ((SwTxtNode*)pNd)->ModifyNotification( &aHt, &aHt );
}
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e6900e96c363..bbc0b9a9b934 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -75,6 +75,7 @@
#include <breakit.hxx>
#include <editsh.hxx>
#include <scriptinfo.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -259,15 +260,16 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
const SwTOXMark* pMax = &rCurTOXMark;
const SwTOXMark* pMin = &rCurTOXMark;
- const SwModify* pType = rCurTOXMark.GetRegisteredIn();
- SwClientIter aIter( *(SwModify*)pType );
+ const SwTOXType* pType = rCurTOXMark.GetTOXType();
+ SwTOXMarks aMarks;
+ SwTOXMark::InsertTOXMarks( aMarks, *pType );
const SwTOXMark* pTOXMark;
const SwCntntFrm* pCFrm;
Point aPt;
- for( pTOXMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pTOXMark;
- pTOXMark = (SwTOXMark*)aIter.Next() )
+ for( sal_Int32 nMark=0; nMark<aMarks.Count(); nMark++ )
{
+ pTOXMark = aMarks[nMark];
if( pTOXMark != &rCurTOXMark &&
0 != ( pMark = pTOXMark->GetTxtTOXMark()) &&
0 != ( pTOXSrc = pMark->GetpTxtNd() ) &&
@@ -357,7 +359,6 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
return *pNew;
}
-/* */
const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
const SwTOXBase& rTOX,
@@ -477,9 +478,7 @@ const SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) const
}
return 0;
}
-/* -----------------01.09.99 16:01-------------------
- --------------------------------------------------*/
const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
@@ -488,9 +487,7 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const
ASSERT( pFmt, "invalid TOXBaseSection!" );
return pFmt->GetAttrSet();
}
-/* -----------------02.09.99 07:48-------------------
- --------------------------------------------------*/
const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate )
{
SwTOXBase** prBase = 0;
@@ -512,9 +509,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate )
}
return (*prBase);
}
-/* -----------------02.09.99 08:06-------------------
- --------------------------------------------------*/
void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
{
SwTOXBase** prBase = 0;
@@ -640,9 +635,7 @@ USHORT SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
++nCnt;
return nCnt;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const
{
const SwTOXTypePtr * ppTTypes = pTOXTypes->GetData();
@@ -653,18 +646,14 @@ const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, USHORT nId ) const
return 0;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
const SwTOXType* SwDoc::InsertTOXType( const SwTOXType& rTyp )
{
SwTOXType * pNew = new SwTOXType( rTyp );
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
return pNew;
}
-/*--------------------------------------------------------------------
- --------------------------------------------------------------------*/
String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
const String* pChkStr ) const
{
@@ -719,9 +708,6 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
return aName += String::CreateFromInt32( ++nNum );
}
-/*--------------------------------------------------------------------
-
- --------------------------------------------------------------------*/
BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
{
ASSERT( rTOXBase.ISA( SwTOXBaseSection ),
@@ -739,7 +725,6 @@ BOOL SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName)
return bRet;
}
-/* */
const SwTxtNode* lcl_FindChapterNode( const SwNode& rNd, BYTE nLvl = 0 )
{
@@ -1204,18 +1189,17 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( USHORT nLevel )
void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
const SwTxtNode* pOwnChapterNode )
{
- const SwModify* pType = SwTOXBase::GetRegisteredIn();
+ const SwTOXType* pType = (SwTOXType*) SwTOXBase::GetRegisteredIn();
if( !pType->GetDepends() )
return;
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
TOXTypes eTOXTyp = GetTOXType()->GetType();
- SwClientIter aIter( *(SwModify*)pType );
+ SwIterator<SwTOXMark,SwTOXType> aIter( *pType );
SwTxtTOXMark* pTxtMark;
SwTOXMark* pMark;
- for( pMark = (SwTOXMark*)aIter.First( TYPE( SwTOXMark )); pMark;
- pMark = (SwTOXMark*)aIter.Next() )
+ for( pMark = aIter.First(); pMark; pMark = aIter.Next() )
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -1329,9 +1313,8 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei
continue;
- SwClientIter aIter( *pColl );
- SwTxtNode* pTxtNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode ));
- for( ; pTxtNd; pTxtNd = (SwTxtNode*)aIter.Next() )
+ SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl );
+ for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() )
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -1358,9 +1341,8 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
if(!pSeqFld)
return;
- SwClientIter aIter( *pSeqFld );
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pSeqFld );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
if(!pTxtFld)
@@ -1388,9 +1370,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
}
}
}
-/* -----------------15.09.99 14:18-------------------
- --------------------------------------------------*/
void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
{
SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
@@ -1398,9 +1378,8 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
if(!pAuthFld)
return;
- SwClientIter aIter( *pAuthFld );
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
- for( ; pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pAuthFld );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
//undo
@@ -2431,9 +2410,7 @@ BOOL SwTOXBase::IsTOXBaseInReadonly() const
}
return bRet;
}
-/* -----------------17.08.99 13:29-------------------
- --------------------------------------------------*/
const SfxItemSet* SwTOXBase::GetAttrSet() const
{
const SwTOXBaseSection *pSect = PTR_CAST(SwTOXBaseSection, this);
@@ -2464,6 +2441,3 @@ BOOL SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const
return TRUE;
}
-/* */
-
-
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index cb0b44b66822..f79febf7dd3a 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -34,20 +34,14 @@
#include <doc.hxx> // fuer GetAttrPool
#include <errhdl.hxx>
#include <fmtcol.hxx>
-// --> OD 2006-11-22 #i71574#
#include <fmtcolfunc.hxx>
-// <--
#include <hints.hxx>
#include <calc.hxx>
#include <node.hxx>
#include <numrule.hxx>
#include <paratr.hxx>
-
-//--> #outlinelevel added by zhaojianwei
-#ifndef _SFXINTITEM_HXX
+#include <switerator.hxx>
#include <svl/intitem.hxx>
-#endif
-//<--end
TYPEINIT1( SwTxtFmtColl, SwFmtColl );
TYPEINIT1( SwGrfFmtColl, SwFmtColl );
@@ -141,7 +135,7 @@ namespace TxtFmtCollFunc
* SwTxtFmtColl TXT
*/
-void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( GetDoc()->IsInDtor() )
{
@@ -361,10 +355,10 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
BOOL SwTxtFmtColl::IsAtDocNodeSet() const
{
- SwClientIter aIter( *(SwModify*)this );
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *this );
const SwNodes& rNds = GetDoc()->GetNodes();
- for( SwClient* pC = aIter.First(TYPE(SwCntntNode)); pC; pC = aIter.Next() )
- if( &((SwCntntNode*)pC)->GetNodes() == &rNds )
+ for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() )
+ if( &(pNode->GetNodes()) == &rNds )
return TRUE;
return FALSE;
@@ -547,6 +541,12 @@ SwCollCondition::~SwCollCondition()
delete aSubCondition.pFldExpression;
}
+void SwCollCondition::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+
int SwCollCondition::operator==( const SwCollCondition& rCmp ) const
{
@@ -684,9 +684,8 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
SetAttrOutlineLevel(nAssignedListLevel+1);
// --> OD 2009-03-18 #i100277#
- SwClientIter aIter( *this );
- SwTxtFmtColl* pDerivedTxtFmtColl =
- dynamic_cast<SwTxtFmtColl*>(aIter.First( TYPE( SwTxtFmtColl ) ));
+ SwIterator<SwTxtFmtColl,SwFmtColl> aIter( *this );
+ SwTxtFmtColl* pDerivedTxtFmtColl = aIter.First();
while ( pDerivedTxtFmtColl != 0 )
{
if ( !pDerivedTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
@@ -702,7 +701,7 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
}
}
- pDerivedTxtFmtColl = dynamic_cast<SwTxtFmtColl*>(aIter.Next());
+ pDerivedTxtFmtColl = aIter.Next();
}
// <--
}
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 19c5d4e2bdaa..24e7b67801cb 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -34,12 +34,8 @@
#ifdef TEST_DELAYED_RESIZE
#include <vcl/sound.hxx>
#endif
-#ifndef _WRKWIN_HXX //autogen
#include <vcl/wrkwin.hxx>
-#endif
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <sot/storage.hxx>
#include <fmtornt.hxx>
#include <fmtfsize.hxx>
@@ -55,9 +51,9 @@
#include "viewsh.hxx"
#include "tabfrm.hxx"
#include "viewopt.hxx"
-
#include "htmltbl.hxx"
#include "ndindex.hxx"
+#include "switerator.hxx"
using namespace ::com::sun::star;
@@ -66,8 +62,6 @@ using namespace ::com::sun::star;
#define MAX_TABWIDTH (USHRT_MAX - 2001)
-/* */
-
class SwHTMLTableLayoutConstraints
{
USHORT nRow; // Start-Zeile
@@ -421,11 +415,10 @@ USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm(
USHORT SwHTMLTableLayout::GetBrowseWidthByTable( const SwDoc& rDoc ) const
{
USHORT nBrowseWidth = 0;
- SwClientIter aIter( *(SwModify*)pSwTable->GetFrmFmt() );
- SwClient* pCli = aIter.First( TYPE( SwTabFrm ));
- if( pCli )
+ SwTabFrm* pFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement( *pSwTable->GetFrmFmt() );
+ if( pFrm )
{
- nBrowseWidth = GetBrowseWidthByTabFrm( *(SwTabFrm*)pCli );
+ nBrowseWidth = GetBrowseWidthByTabFrm( *pFrm );
}
else
{
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index 7e2d6164c637..cd1c9b70b69f 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -94,7 +94,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy)
if ( rCpy.GetRegisteredIn() )
((SwModify*)rCpy.GetRegisteredIn())->Add( this );
else if ( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
aType = rCpy.GetNumType();
aDivider = rCpy.GetDivider();
@@ -142,9 +142,9 @@ void SwLineNumberInfo::SetCharFmt( SwCharFmt *pChFmt )
pChFmt->Add( this );
}
-void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwLineNumberInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
SwDoc *pDoc = ((SwCharFmt*)GetRegisteredIn())->GetDoc();
SwRootFrm* pRoot = pDoc->GetCurrentLayout();
if( pRoot )
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index e3ec73f17a1e..5f5e71e16a0d 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -663,7 +663,7 @@ BOOL SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
}\
}
-void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
USHORT nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0;
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 847c6b229fd1..b26fe6ff6dcd 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -209,7 +209,7 @@ SwNumFmt::SwNumFmt() :
---------------------------------------------------------------------------*/
SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) :
SvxNumberFormat(rFmt),
- SwClient( rFmt.pRegisteredIn ),
+ SwClient( rFmt.GetRegisteredInNonConst() ),
pVertOrient(new SwFmtVertOrient( 0, rFmt.GetVertOrient()))
{
sal_Int16 eMyVertOrient = rFmt.GetVertOrient();
@@ -241,7 +241,7 @@ SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) :
pCFmt->Add( this );
}
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
/* -----------------------------22.02.01 13:42--------------------------------
@@ -323,9 +323,9 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
{
SvxNumberFormat::operator=(rNumFmt);
if( rNumFmt.GetRegisteredIn() )
- rNumFmt.pRegisteredIn->Add( this );
+ rNumFmt.GetRegisteredInNonConst()->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return *this;
}
/* -----------------------------23.02.01 09:28--------------------------------
@@ -334,7 +334,7 @@ SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt)
BOOL SwNumFmt::operator==( const SwNumFmt& rNumFmt) const
{
BOOL bRet = SvxNumberFormat::operator==(rNumFmt) &&
- pRegisteredIn == rNumFmt.pRegisteredIn;
+ GetRegisteredIn() == rNumFmt.GetRegisteredIn();
return bRet;
}
@@ -346,17 +346,18 @@ void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt)
if( pChFmt )
pChFmt->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
}
/* -----------------------------22.02.01 13:45--------------------------------
---------------------------------------------------------------------------*/
-void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses
// NumFormat gesetzt ist. Das Format muss es nicht geben!
const SwCharFmt* pFmt = 0;
- switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
+ USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
+ switch( nWhich )
{
case RES_ATTRSET_CHG:
case RES_FMT_CHG:
@@ -367,7 +368,7 @@ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pFmt && !pFmt->GetDoc()->IsInDtor() )
UpdateNumNodes( (SwDoc*)pFmt->GetDoc() );
else
- SwClient::Modify( pOld, pNew );
+ CheckRegistration( pOld, pNew );
}
/* -----------------------------23.02.01 11:08--------------------------------
@@ -381,11 +382,18 @@ void SwNumFmt::SetCharFmtName(const String& rSet)
---------------------------------------------------------------------------*/
const String& SwNumFmt::GetCharFmtName() const
{
- if((SwCharFmt*)pRegisteredIn)
- return ((SwCharFmt*)pRegisteredIn)->GetName();
+ if((SwCharFmt*)GetRegisteredIn())
+ return ((SwCharFmt*)GetRegisteredIn())->GetName();
else
return aEmptyStr;
}
+
+void SwNumFmt::ForgetCharFmt()
+{
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
+}
+
/* -----------------------------22.02.01 16:05--------------------------------
---------------------------------------------------------------------------*/
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 6119184d3209..a8b81ddf9c4b 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -61,6 +61,7 @@
#include <tblrwcl.hxx>
#include <unochart.hxx>
#include <boost/shared_ptr.hpp>
+#include <switerator.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -210,20 +211,14 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize );
for ( USHORT i = 0; i < GetTabLines().Count(); ++i ) \
{ \
SwFrmFmt* pFmt = GetTabLines()[i]->GetFrmFmt(); \
- SwClientIter aIter( *pFmt ); \
- SwClient* pLast = aIter.GoStart(); \
- if( pLast ) \
+ SwIterator<SwRowFrm,SwFmt> aIter( *pFmt ); \
+ for (SwRowFrm* pFrm=aIter.First(); pFrm; pFrm=aIter.Next())\
{ \
- do \
- { \
- SwFrm *pFrm = PTR_CAST( SwFrm, pLast ); \
- if ( pFrm && \
- ((SwRowFrm*)pFrm)->GetTabLine() == GetTabLines()[i] ) \
+ if ( pFrm->GetTabLine() == GetTabLines()[i] ) \
{ \
ASSERT( pFrm->GetUpper()->IsTabFrm(), \
"Table layout does not match table structure" ) \
} \
- } while ( 0 != ( pLast = aIter++ ) ); \
} \
} \
}
@@ -529,11 +524,10 @@ void lcl_InsCol( _FndLine* pFndLn, _CpyPara& rCpyPara, USHORT nCpyCnt,
SwRowFrm* GetRowFrm( SwTableLine& rLine )
{
- SwClientIter aIter( *rLine.GetFrmFmt() );
- for( SwClient* pFrm = aIter.First( TYPE( SwRowFrm )); pFrm;
- pFrm = aIter.Next() )
- if( ((SwRowFrm*)pFrm)->GetTabLine() == &rLine )
- return (SwRowFrm*)pFrm;
+ SwIterator<SwRowFrm,SwFmt> aIter( *rLine.GetFrmFmt() );
+ for( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ if( pFrm->GetTabLine() == &rLine )
+ return pFrm;
return 0;
}
@@ -629,7 +623,7 @@ BOOL SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
//Lines fuer das Layout-Update herausuchen.
const BOOL bLayout = !IsNewModel() &&
- 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+ 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if ( bLayout )
{
@@ -750,7 +744,7 @@ BOOL SwTable::AppendRow( SwDoc* pDoc, USHORT nCnt )
SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen
//Lines fuer das Layout-Update herausuchen.
- const BOOL bLayout = 0 != SwClientIter( *GetFrmFmt() ).First( TYPE(SwTabFrm) );
+ const BOOL bLayout = 0 != SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if( bLayout )
{
aFndBox.SetTableLines( *this );
@@ -3758,8 +3752,7 @@ BOOL SwTable::SetColWidth( SwTableBox& rAktBox, USHORT eType,
if( GetFrmFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
!rSz.GetWidthPercent() )
{
- SwTabFrm* pTabFrm = (SwTabFrm*)SwClientIter(
- *GetFrmFmt() ).First( TYPE( SwTabFrm ));
+ SwTabFrm* pTabFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement( *GetFrmFmt() );
if( pTabFrm &&
pTabFrm->Prt().Width() != rSz.GetWidth() )
{
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index ac9e6957707b..efc71eac9b23 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -92,7 +92,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
SwUpdateAttr aUpdateAttr( *pAttr->GetStart(),
*pAttr->GetEnd(),
RES_FMT_CHG );
- ((SwTxtNode*)pTxtNd)->Modify( &aUpdateAttr, &aUpdateAttr );
+ ((SwTxtNode*)pTxtNd)->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
if( bAction )
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 9c2ce7af3139..982f1b0a902e 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -455,7 +455,7 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SwNodeIndex aInsPos( *pEndNd );
SwTable& rTbl = (SwTable&)pTblNd->GetTable();
- pTblFmt->Add( &rTbl ); // das Frame-Format setzen
+ rTbl.RegisterToFormat( *pTblFmt );
rTbl.SetRowsToRepeat( GetTable().GetRowsToRepeat() );
rTbl.SetTblChgMode( GetTable().GetTblChgMode() );
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 651533c618ca..a14a4f61e4bc 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -575,7 +575,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, BOOL bDelNodes )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
// A ClearRedo could result in a rekursive call of this function and delete some section
@@ -1082,21 +1082,9 @@ SwFrm* SwClearDummies( SwFrm* pFrm )
SwSectionNode::~SwSectionNode()
{
- {
- SwClientIter aIter( *(m_pSection->GetFmt()) );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pSectFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pSectFrm, TRUE );
- pLast = aIter.GoStart();
- }
- else
- pLast = aIter++;
- }
- }
+ // mba: test if iteration works as clients will be removed in callback
+ m_pSection->GetFmt()->CallSwClientNotify( RES_OBJECTDYING );
+
SwDoc* pDoc = GetDoc();
SwSectionFmt* pFmt = m_pSection->GetFmt();
@@ -1415,7 +1403,7 @@ void SwSectionNode::NodesArrChgd()
if( !rNds.IsDocNodes() )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
pFmt->LockModify();
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 07b4c9a99d49..5caa0fc899be 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -29,17 +29,11 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
-
-#ifdef WTC
-#define private public
-#endif
#include <hintids.hxx>
-
#include <editeng/lrspitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/boxitem.hxx>
-// OD 06.08.2003 #i17174#
#include <editeng/shaditem.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
@@ -83,23 +77,17 @@
#include <section.hxx>
#include <frmtool.hxx>
#include <node2lay.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include "docsh.hxx"
#include <tabcol.hxx>
#include <unochart.hxx>
-
#include <node.hxx>
#include <ndtxt.hxx>
-
#include <map>
#include <algorithm>
-// --> OD 2005-12-05 #i27138#
#include <rootfrm.hxx>
-// <--
#include <fldupde.hxx>
-
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -498,7 +486,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
SwTable * pNdTbl = &pTblNd->GetTable();
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+ pNdTbl->RegisterToFormat( *pTableFmt );
pNdTbl->SetRowsToRepeat( nRowsToRepeat );
pNdTbl->SetTableModel( bNewModel );
@@ -794,7 +782,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
//Orientation am Fmt der Table setzen
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
+ pNdTbl->RegisterToFormat( *pTableFmt );
if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
{
@@ -1149,10 +1137,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwUndoTxtToTbl* pUndo = 0;
if( DoesUndo() )
{
-// StartUndo( UNDO_TEXTTOTABLE );
-// pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, eAdjust, pTAFmt );
-// AppendUndo( pUndo );
-
// das Splitten vom TextNode nicht in die Undohistory aufnehmen
DoUndo( FALSE );
}
@@ -1204,8 +1188,6 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
// die Tabelle bekommt USHRT_MAX als default SSize
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
-// if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
-// pTableFmt->SetAttr( SwFmtLayoutSplit( FALSE ));
/* #106283# If the first node in the selection is a context node and if it
has an item FRAMEDIR set (no default) propagate the item to the
@@ -1228,13 +1210,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
SwTable * pNdTbl = &pTblNd->GetTable();
ASSERT( pNdTbl, "kein Tabellen-Node angelegt." )
- pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-
-// const USHORT nRowsToRepeat =
-// tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ?
-// rInsTblOpts.mnRowsToRepeat :
-// 0;
-// pNdTbl->SetRowsToRepeat( nRowsToRepeat );
+ pNdTbl->RegisterToFormat( *pTableFmt );
BOOL bUseBoxFmt = FALSE;
if( !pBoxFmt->GetDepends() )
@@ -1244,28 +1220,11 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
bUseBoxFmt = TRUE;
pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() );
delete pBoxFmt;
-// eAdjust = HORI_NONE;
}
- //Orientation am Fmt der Table setzen
-// pTableFmt->SetAttr( SwFmtHoriOrient( 0, eAdjust ) );
-// pTableFmt->Add( pNdTbl ); // das Frame-Format setzen
-
-
ULONG nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
- {
-// SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang
-// rTmp.DeleteMark();
-// rTmp.GetPoint()->nNode = *pTblNd;
-// SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode );
-// rTmp.GetPoint()->nContent.Assign( pCNd, 0 );
- }
-
-// if( pUndo )
-// EndUndo( UNDO_TEXTTOTABLE );
-
SetModified();
SetFieldsDirty( true, NULL, 0 );
return pNdTbl;
@@ -2451,7 +2410,7 @@ SwTableNode::~SwTableNode()
SwFrmFmt* pTblFmt = GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
pTblFmt );
- pTblFmt->Modify( &aMsgHint, &aMsgHint );
+ pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint );
DelFrms();
delete pTable;
}
@@ -2537,14 +2496,12 @@ void SwTableNode::DelFrms()
//Sie muessen etwas umstaendlich zerstort werden, damit die Master
//die Follows mit in's Grab nehmen.
- SwClientIter aIter( *(pTable->GetFrmFmt()) );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
+ SwIterator<SwTabFrm,SwFmt> aIter( *(pTable->GetFrmFmt()) );
+ SwTabFrm *pFrm = aIter.First();
+ while ( pFrm )
{
BOOL bAgain = FALSE;
- if ( pLast->IsA( TYPE(SwFrm) ) )
{
- SwTabFrm *pFrm = (SwTabFrm*)pLast;
if ( !pFrm->IsFollow() )
{
while ( pFrm->HasFollow() )
@@ -2570,7 +2527,7 @@ void SwTableNode::DelFrms()
bAgain = TRUE;
}
}
- pLast = bAgain ? aIter.GoStart() : aIter++;
+ pFrm = bAgain ? aIter.First() : aIter.Next();
}
}
@@ -3044,7 +3001,7 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, USHORT nSet )
SwMsgPoolItem aChg( RES_TBLHEADLINECHG );
rTable.SetRowsToRepeat( nSet );
- rTable.GetFrmFmt()->Modify( &aChg, &aChg );
+ rTable.GetFrmFmt()->ModifyNotification( &aChg, &aChg );
SetModified();
}
@@ -3568,7 +3525,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, BOOL bAfter,
pOldTblFmt->GetDoc()->GetDfltFrmFmt() );
*pNewTblFmt = *pOldTblFmt;
- pNewTblFmt->Add( &pNewTblNd->GetTable() );
+ pNewTblNd->GetTable().RegisterToFormat( *pNewTblFmt );
// neue Size errechnen ? (lcl_ChgTblSize nur das 2. aufrufen, wenn es
// beim 1. schon geklappt hat; also absolute Groesse hat)
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 985ef3cdbc57..8842e0e758de 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -28,11 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#ifdef WTC
-#define private public
-#endif
-
#include "hintids.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
@@ -60,6 +55,7 @@
#include "docary.hxx"
#include "ndindex.hxx"
#include "undobj.hxx"
+#include "switerator.hxx"
using namespace ::com::sun::star;
@@ -462,12 +458,12 @@ BOOL SwDoc::BalanceRowHeight( const SwCursor& rCursor, BOOL bTstOnly )
for ( i = 0; i < aRowArr.Count(); ++i )
{
- SwClientIter aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() );
- SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwFmt> aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() );
+ SwFrm* pFrm = aIter.First();
while ( pFrm )
{
nHeight = Max( nHeight, pFrm->Frm().Height() );
- pFrm = (SwFrm*)aIter.Next();
+ pFrm = aIter.Next();
}
}
SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight );
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 4a6b87893474..327b1cd42004 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -28,12 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
-
-// --> OD 2005-02-21 #i42921#
#include <editeng/frmdiritem.hxx>
-// <--
#include <editeng/protitem.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hdl>
#include <fmtcntnt.hxx>
@@ -71,13 +67,11 @@
#include <crsskip.hxx>
#include <SwStyleNameMapper.hxx>
#include <scriptinfo.hxx>
-// --> OD 2005-12-05 #i27138#
#include <rootfrm.hxx>
-// <--
#include <istyleaccess.hxx>
-// --> OD 2007-10-31 #i83479#
#include <IDocumentListItems.hxx>
-// <--
+#include <switerator.hxx>
+#include "ndole.hxx"
using namespace ::com::sun::star::i18n;
@@ -787,10 +781,9 @@ SwFrmFmt* SwNode::GetFlyFmt() const
{
if( IsCntntNode() )
{
- SwClientIter aIter( *(SwCntntNode*)this );
- SwClient* pCli = aIter.First( TYPE( SwCntntFrm ));
- if( pCli )
- pRet = ((SwCntntFrm*)pCli)->FindFlyFrm()->GetFmt();
+ SwCntntFrm* pFrm = SwIterator<SwCntntFrm,SwCntntNode>::FirstElement( *(SwCntntNode*)this );
+ if( pFrm )
+ pRet = pFrm->FindFlyFrm()->GetFmt();
}
if( !pRet )
{
@@ -1060,7 +1053,7 @@ SwCntntNode::~SwCntntNode()
((SwAttrSet*)mpAttrSet.get())->SetModifyAtAttr( 0 );
}
-void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
USHORT nWhich = pOldValue ? pOldValue->Which() :
pNewValue ? pNewValue->Which() : 0 ;
@@ -1072,7 +1065,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject;
// nicht umhaengen wenn dieses das oberste Format ist !!
- if( pRegisteredIn == pFmt )
+ if( GetRegisteredIn() == pFmt )
{
if( pFmt->GetRegisteredIn() )
{
@@ -1139,7 +1132,7 @@ void SwCntntNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
break;
}
- SwModify::Modify( pOldValue, pNewValue );
+ NotifyClients( pOldValue, pNewValue );
}
BOOL SwCntntNode::InvalidateNumRule()
@@ -1218,8 +1211,6 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl )
{
SwFmtChg aTmp1( pOldColl );
SwFmtChg aTmp2( pNewColl );
- // damit alles was im Modify passiert hier nicht noch impl.
- // werden muss
SwCntntNode::Modify( &aTmp1, &aTmp2 );
}
}
@@ -1386,60 +1377,7 @@ void SwCntntNode::DelFrms()
if( !GetDepends() )
return;
- SwClientIter aIter( *this );
- SwCntntFrm *pFrm;
-
- for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm;
- pFrm = (SwCntntFrm*)aIter.Next() )
- {
- // --> OD 2005-12-01 #i27138#
- // notify accessibility paragraphs objects about changed
- // CONTENT_FLOWS_FROM/_TO relation.
- // Relation CONTENT_FLOWS_FROM for current next paragraph will change
- // and relation CONTENT_FLOWS_TO for current previous paragraph will change.
- if ( pFrm->IsTxtFrm() )
- {
- ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
- if ( pViewShell && pViewShell->GetLayout() &&
- pViewShell->GetLayout()->IsAnyShellAccessible() )
- {
- pViewShell->InvalidateAccessibleParaFlowRelation(
- dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
- dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
- }
- }
- // <--
- if( pFrm->HasFollow() )
- pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
- if( pFrm->IsFollow() )
- {
- SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
- pMaster->SetFollow( pFrm->GetFollow() );
- pFrm->_SetIsFollow( FALSE );
- }
- pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
- //Andernfalls kann es sein, dass ein Follow
- //vor seinem Master zerstoert wird, der Master
- //greift dann ueber den ungueltigen
- //Follow-Pointer auf fremdes Memory zu.
- //Die Kette darf hier zerknauscht werden, weil
- //sowieso alle zerstoert werden.
- if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() &&
- !pFrm->GetIndPrev() )
- {
- SwFtnFrm *pFtn = pFrm->FindFtnFrm();
- ASSERT( pFtn, "You promised a FtnFrm?" );
- SwCntntFrm* pCFrm;
- if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
- 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
- {
- ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
- ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
- }
- }
- pFrm->Cut();
- delete pFrm;
- }
+ SwCntntFrm::DelFrms(*this);
if( IsTxtNode() )
{
((SwTxtNode*)this)->SetWrong( NULL );
@@ -1510,7 +1448,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *(SwCntntNode*)this ).First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwCntntNode>::FirstElement(*this);
}
return FALSE;
}
@@ -1548,7 +1486,7 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -1624,7 +1562,7 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet )
// einige Sonderbehandlungen fuer Attribute
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
return bRet;
@@ -1674,7 +1612,7 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
mpAttrSet.reset();//DELETEZ( mpAttrSet );
@@ -1715,7 +1653,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
}
}
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
@@ -1754,7 +1692,7 @@ USHORT SwCntntNode::ResetAllAttr()
{
SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld );
SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew );
- Modify( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
+ ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt
if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen
mpAttrSet.reset();//DELETEZ( mpAttrSet );
@@ -1894,7 +1832,7 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl )
{
SwFmtChg aTmp1( pOldColl ? pOldColl : GetFmtColl() );
SwFmtChg aTmp2( pColl ? pColl : GetFmtColl() );
- SwModify::Modify( &aTmp1, &aTmp2 );
+ NotifyClients( &aTmp1, &aTmp2 );
}
if( IsInCache() )
{
@@ -2074,6 +2012,24 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
}
// <--
+SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize )
+{
+ SwOLENodes *pNodes = 0;
+ SwIterator<SwCntntNode,SwFmtColl> aIter( rColl );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
+ {
+ SwOLENode *pONd = pNd->GetOLENode();
+ if ( pONd && (!bOnlyWithInvalidSize || pONd->IsOLESizeInvalid()) )
+ {
+ if ( !pNodes )
+ pNodes = new SwOLENodes;
+ pNodes->Insert( pONd, pNodes->Count() );
+ }
+ }
+
+ return pNodes;
+}
+
//FEATURE::CONDCOLL
// Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
// os: nur fuer ICC, da der zum optimieren zu dumm ist
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index 62fa380097d3..d7ac37dc4bd8 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -28,8 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <calbck.hxx> // SwClientIter
+#include <switerator.hxx>
+#include <calbck.hxx>
#include <node.hxx>
#include <ndindex.hxx>
#include <swtable.hxx>
@@ -42,14 +42,14 @@
#include "section.hxx"
#include "node2lay.hxx"
-
/* -----------------25.02.99 10:31-------------------
* Die SwNode2LayImpl-Klasse erledigt die eigentliche Arbeit,
* die SwNode2Layout-Klasse ist nur die der Oefffentlichkeit bekannte Schnittstelle
* --------------------------------------------------*/
class SwNode2LayImpl
{
- SwClientIter *pIter; // Der eigentliche Iterator
+ SwIterator<SwFrm,SwModify>* pIter;
+ SwModify* pMod;
SvPtrarr *pUpperFrms;// Zum Einsammeln der Upper
ULONG nIndex; // Der Index des einzufuegenden Nodes
BOOL bMaster : 1; // TRUE => nur Master , FALSE => nur Frames ohne Follow
@@ -77,6 +77,71 @@ public:
* vor oder hinter den eingefuegt werden soll.
* --------------------------------------------------*/
+SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx)
+{
+ if( pIdx->GetIndex() >= rNodes.Count() - 1 )
+ return 0;
+
+ SwNodeIndex aTmp(*pIdx, +1);
+ SwNode* pNd = 0;
+ while( aTmp < rNodes.Count()-1 )
+ {
+ pNd = &aTmp.GetNode();
+ bool bFound = false;
+ if ( pNd->IsCntntNode() )
+ bFound = ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*(SwCntntNode*)pNd) != 0);
+ else if ( pNd->IsTableNode() )
+ bFound = ( SwIterator<SwFrm,SwFmt>::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 );
+ else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() )
+ {
+ pNd = 0;
+ break;
+ }
+ if ( bFound )
+ break;
+ aTmp++;
+ }
+
+ if( aTmp == rNodes.Count()-1 )
+ pNd = 0;
+ else if( pNd )
+ (*pIdx) = aTmp;
+ return pNd;
+}
+
+SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx)
+{
+ if( !pIdx->GetIndex() )
+ return 0;
+
+ SwNodeIndex aTmp( *pIdx, -1 );
+ SwNode* pNd(0);
+ while( aTmp.GetIndex() )
+ {
+ pNd = &aTmp.GetNode();
+ bool bFound = false;
+ if ( pNd->IsCntntNode() )
+ bFound = ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*(SwCntntNode*)pNd) != 0);
+ else if ( pNd->IsTableNode() )
+ bFound = ( SwIterator<SwFrm,SwFmt>::FirstElement(*((SwTableNode*)pNd)->GetTable().GetFrmFmt()) != 0 );
+ else if( pNd->IsStartNode() && !pNd->IsSectionNode() )
+ {
+ pNd = 0;
+ break;
+ }
+ if ( bFound )
+ break;
+ aTmp--;
+ }
+
+ if( !aTmp.GetIndex() )
+ pNd = 0;
+ else if( pNd )
+ (*pIdx) = aTmp;
+ return pNd;
+}
+
+
SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
: pUpperFrms( NULL ), nIndex( nIdx ), bInit( FALSE )
{
@@ -88,7 +153,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
if( !bSearch && rNode.GetIndex() < nIndex )
{
SwNodeIndex aTmp( *rNode.EndOfSectionNode(), +1 );
- pNd = rNode.GetNodes().GoPreviousWithFrm( &aTmp );
+ pNd = GoPreviousWithFrm( &aTmp );
if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
bMaster = FALSE;
@@ -96,7 +161,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
else
{
SwNodeIndex aTmp( rNode, -1 );
- pNd = rNode.GetNodes().GoNextWithFrm( &aTmp );
+ pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp );
bMaster = TRUE;
if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() )
pNd = NULL; // Nicht ueber den Bereich hinausschiessen
@@ -109,7 +174,6 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
}
if( pNd )
{
- SwModify *pMod;
if( pNd->IsCntntNode() )
pMod = (SwModify*)pNd->GetCntntNode();
else
@@ -117,10 +181,13 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, ULONG nIdx, BOOL bSearch )
ASSERT( pNd->IsTableNode(), "For Tablenodes only" );
pMod = pNd->GetTableNode()->GetTable().GetFrmFmt();
}
- pIter = new SwClientIter( *pMod );
+ pIter = new SwIterator<SwFrm,SwModify>( *pMod );
}
else
+ {
pIter = NULL;
+ pMod = 0;
+ }
}
/* -----------------25.02.99 10:41-------------------
@@ -141,11 +208,11 @@ SwFrm* SwNode2LayImpl::NextFrm()
return FALSE;
if( !bInit )
{
- pRet = (SwFrm*)pIter->First(TYPE(SwFrm));
+ pRet = pIter->First();
bInit = TRUE;
}
else
- pRet = (SwFrm*)pIter->Next();
+ pRet = pIter->Next();
while( pRet )
{
SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet );
@@ -188,7 +255,7 @@ SwFrm* SwNode2LayImpl::NextFrm()
}
return pRet;
}
- pRet = (SwFrm*)pIter->Next();
+ pRet = pIter->Next();
}
return NULL;
}
@@ -215,6 +282,7 @@ void SwNode2LayImpl::SaveUpperFrms()
}
delete pIter;
pIter = NULL;
+ pMod = 0;
}
SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
@@ -358,9 +426,8 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos,
const SwPosition *pPos,
const BOOL bCalcFrm ) const
{
- return pIter ? ::GetFrmOfModify( 0, pIter->GetModify(), USHRT_MAX,
- pDocPos, pPos, bCalcFrm )
- : 0;
+ // mba: test if change of member pIter -> pMod broke anything
+ return pMod ? ::GetFrmOfModify( 0, *pMod, USHRT_MAX, pDocPos, pPos, bCalcFrm ) : 0;
}
SwNode2Layout::SwNode2Layout( const SwNode& rNd, ULONG nIdx )
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 9a234d93f4c2..724fa0fae14a 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -366,7 +366,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
SwPtrMsgPoolItem aMsgHint( nDelMsg,
(void*)&pAttr->GetAttr() );
rNds.GetDoc()->GetUnoCallBack()->
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -663,7 +663,7 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt();
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
pTblFmt );
- pTblFmt->Modify( &aMsgHint, &aMsgHint );
+ pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
if( bNewFrms )
@@ -1525,79 +1525,6 @@ SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const
return (SwCntntNode*)pNd;
}
-SwNode* SwNodes::GoNextWithFrm(SwNodeIndex *pIdx) const
-{
- if( pIdx->GetIndex() >= Count() - 1 )
- return 0;
-
- SwNodeIndex aTmp(*pIdx, +1);
- SwNode* pNd = 0;
- while( aTmp < Count()-1 )
- {
- pNd = &aTmp.GetNode();
- SwModify *pMod = 0;
- if ( pNd->IsCntntNode() )
- pMod = (SwCntntNode*)pNd;
- else if ( pNd->IsTableNode() )
- pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt();
- else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() )
- {
- pNd = 0;
- break;
- }
- if ( pMod && pMod->GetDepends() )
- {
- SwClientIter aIter( *pMod );
- if( aIter.First( TYPE(SwFrm) ) )
- break;
- }
- aTmp++;
- }
- if( aTmp == Count()-1 )
- pNd = 0;
- else if( pNd )
- (*pIdx) = aTmp;
- return pNd;
-}
-
-SwNode* SwNodes::GoPreviousWithFrm(SwNodeIndex *pIdx) const
-{
- if( !pIdx->GetIndex() )
- return 0;
-
- SwNodeIndex aTmp( *pIdx, -1 );
- SwNode* pNd(0);
- while( aTmp.GetIndex() )
- {
- pNd = &aTmp.GetNode();
- SwModify *pMod = 0;
- if ( pNd->IsCntntNode() )
- pMod = (SwCntntNode*)pNd;
- else if ( pNd->IsTableNode() )
- pMod = ((SwTableNode*)pNd)->GetTable().GetFrmFmt();
- else if( pNd->IsStartNode() && !pNd->IsSectionNode() )
- {
- pNd = 0;
- break;
- }
- if ( pMod && pMod->GetDepends() )
- {
- SwClientIter aIter( *pMod );
- if( aIter.First( TYPE(SwFrm) ) )
- break;
- }
- aTmp--;
- }
-
- if( !aTmp.GetIndex() )
- pNd = 0;
- else if( pNd )
- (*pIdx) = aTmp;
- return pNd;
-}
-
-
-
/*************************************************************************
|*
|* BOOL SwNodes::CheckNodesRange()
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 2d54cb88f2e6..678a4c454f09 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <stdlib.h>
#include <hintids.hxx>
#include <svl/intitem.hxx>
@@ -38,7 +37,6 @@
#include <editeng/protitem.hxx>
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
-
#include <sfx2/sfxsids.hrc>
#include <sfx2/fcontnr.hxx>
#include <docary.hxx>
@@ -64,11 +62,10 @@
#include <fmtftntx.hxx>
#include <ftnidx.hxx>
#include <doctxm.hxx>
-// --> FME 2004-06-22 #114856# edit in readonly sections
#include <fmteiro.hxx>
-// <--
#include <swerror.h>
#include <unosection.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -250,7 +247,7 @@ SwSection::~SwSection()
// dann melden wir noch schnell unser Format um ans dflt FrameFmt,
// damit es keine Abhaengigkeiten gibt
if( pFmt->DerivedFrom() != pDoc->GetDfltFrmFmt() )
- pDoc->GetDfltFrmFmt()->Add( pFmt );
+ pFmt->RegisterToFormat( *pDoc->GetDfltFrmFmt() );
}
else
{
@@ -269,7 +266,7 @@ SwSection::~SwSection()
// ist die Section der letzte Client im Format, kann dieses
// geloescht werden
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt );
- pFmt->Modify( &aMsgHint, &aMsgHint );
+ pFmt->ModifyNotification( &aMsgHint, &aMsgHint );
if( !pFmt->GetDepends() )
{
// Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher
@@ -336,7 +333,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
// erstmal allen Childs sagen, das sie versteckt sind
SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN );
- pFmt->Modify( &aMsgItem, &aMsgItem );
+ pFmt->ModifyNotification( &aMsgItem, &aMsgItem );
// alle Frames loeschen
pFmt->DelFrms();
@@ -353,7 +350,7 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition)
// erstmal allen Childs sagen, das der Parent nicht mehr
// versteckt ist
SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN );
- pFmt->Modify( &aMsgItem, &aMsgItem );
+ pFmt->ModifyNotification( &aMsgItem, &aMsgItem );
pFmt->MakeFrms();
}
@@ -438,7 +435,7 @@ void SwSection::SetEditInReadonly(bool const bFlag)
}
// <--
-void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
bool bRemake = false;
bool bUpdateFtn = false;
@@ -487,7 +484,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pNew )
{
bool bNewFlag =
- static_cast<SvxProtectItem*>(pNew)->IsCntntProtected();
+ static_cast<const SvxProtectItem*>(pNew)->IsCntntProtected();
if( !bNewFlag )
{
// Abschalten: teste ob nicht vielleich ueber die Parents
@@ -511,7 +508,7 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pNew )
{
const bool bNewFlag =
- static_cast<SwFmtEditInReadonly*>(pNew)->GetValue();
+ static_cast<const SwFmtEditInReadonly*>(pNew)->GetValue();
m_Data.SetEditInReadonlyFlag( bNewFlag );
}
return;
@@ -543,6 +540,10 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
bUpdateFtn = true;
}
break;
+
+ default:
+ CheckRegistration( pOld, pNew );
+ break;
}
if( bRemake )
@@ -557,7 +558,6 @@ void SwSection::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pSectNd )
pSectNd->GetDoc()->GetFtnIdxs().UpdateFtn(SwNodeIndex( *pSectNd ));
}
- SwClient::Modify( pOld, pNew );
}
void SwSection::SetRefObject( SwServerObject* pObj )
@@ -700,19 +700,10 @@ SwSectionFmt::~SwSectionFmt()
rSect.SetHidden(false);
}
}
- SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pFrm, TRUE );
- pLast = aIter.GoStart();
- }
- else
- pLast = aIter++;
- }
+
+ // mba: test iteration; objects are removed while iterating
+ CallSwClientNotify( RES_OBJECTDYING );
+
// hebe die Section doch mal auf
SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() );
GetDoc()->GetNodes().SectionUp( &aRg );
@@ -726,14 +717,7 @@ SwSectionFmt::~SwSectionFmt()
SwSection * SwSectionFmt::GetSection() const
{
- if( GetDepends() )
- {
- SwClientIter aIter( *(SwSectionFmt*)this );
- return (SwSectionPtr)aIter.First( TYPE(SwSection) );
- }
-
- ASSERT( FALSE, "keine Section als Client." )
- return 0;
+ return SwIterator<SwSection,SwSectionFmt>::FirstElement( *this );
}
extern void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd );
@@ -746,34 +730,19 @@ void SwSectionFmt::DelFrms()
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
- SwClientIter aIter( *this );
- SwClient *pLast = aIter.GoStart();
- // --> OD 2007-08-14 #147431#
- // First delete the <SwSectionFrm> of the <SwSectionFmt> instance
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm *pFrm = (SwSectionFrm*)pLast;
- SwSectionFrm::MoveCntntAndDelete( pFrm, FALSE );
- pLast = aIter.GoStart();
- }
- else
- {
- pLast = aIter++;
- }
- }
+ // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
+ // mba: test iteration as objects are removed in iteration
+ CallSwClientNotify( RES_OBJECTDYING );
+
// Then delete frames of the nested <SwSectionFmt> instances
- pLast = aIter.GoStart();
+ SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this );
+ SwSectionFmt *pLast = aIter.First();
while ( pLast )
{
- if ( pLast->IsA( TYPE(SwSectionFmt) ) )
- {
- ((SwSectionFmt*)pLast)->DelFrms();
- }
- pLast = aIter++;
+ pLast->DelFrms();
+ pLast = aIter.Next();
}
- // <--
+
ULONG nEnde = pSectNd->EndOfSectionIndex();
ULONG nStart = pSectNd->GetIndex()+1;
lcl_DeleteFtn( pSectNd, nStart, nEnde );
@@ -790,7 +759,7 @@ void SwSectionFmt::DelFrms()
if( pCNd )
{
const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC );
- pCNd->Modify( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem );
+ pCNd->ModifyNotification( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem );
}
}
}
@@ -810,18 +779,7 @@ void SwSectionFmt::MakeFrms()
}
}
-void lcl_ClientIter( SwSectionFmt* pFmt, const SfxPoolItem* pOld,
- const SfxPoolItem* pNew )
-{
- SwClientIter aIter( *pFmt );
- SwClient * pLast = aIter.GoStart();
- if( pLast )
- do {
- pLast->Modify( (SfxPoolItem*)pOld, (SfxPoolItem*)pNew );
- } while( 0 != ( pLast = aIter++ ));
-}
-
-void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
BOOL bClients = FALSE;
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -836,7 +794,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_PROTECT, FALSE, &pItem ))
{
- lcl_ClientIter( this, pItem, pItem );
+ ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_PROTECT );
pOldSet->ClearItem( RES_PROTECT );
}
@@ -845,7 +803,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, FALSE, &pItem ) )
{
- lcl_ClientIter( this, pItem, pItem );
+ ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY );
}
@@ -854,16 +812,14 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, FALSE, &pItem ))
{
- lcl_ClientIter( this, &pOldSet->Get( RES_FTN_AT_TXTEND ),
- pItem );
+ ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_FTN_AT_TXTEND ), (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_FTN_AT_TXTEND );
pOldSet->ClearItem( RES_FTN_AT_TXTEND );
}
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_END_AT_TXTEND, FALSE, &pItem ))
{
- lcl_ClientIter( this, &pOldSet->Get( RES_END_AT_TXTEND ),
- pItem );
+ ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_END_AT_TXTEND ), (SfxPoolItem*)pItem );
pNewSet->ClearItem( RES_END_AT_TXTEND );
pOldSet->ClearItem( RES_END_AT_TXTEND );
}
@@ -883,12 +839,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pSect && ( bClients || ( RES_SECTION_HIDDEN == nWhich ?
!pSect->IsHiddenFlag() : pSect->IsHiddenFlag() ) ) )
{
- // selbst ueber die Clients iterieren, sollte schneller sein!
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- do {
- pLast->Modify( pOld, pNew );
- } while( 0 != ( pLast = aIter++ ));
+ ModifyBroadcast( pOld, pNew );
}
}
return ;
@@ -901,12 +852,7 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
// diese Messages bis zum Ende des Baums durchreichen !
if( GetDepends() )
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- pLast->Modify( pOld, pNew );
- } while( 0 != ( pLast = aIter++ ));
+ ModifyBroadcast( pOld, pNew );
}
return; // das wars
@@ -958,17 +904,16 @@ BOOL SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
- SwFrm* pFrm = (SwFrm*)SwClientIter( *(SwSectionFmt*)this ).First( TYPE(SwFrm) );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement(*this);
// if the current section has no own frame search for the children
if(!pFrm)
{
- SwClientIter aFormatIter( *(SwSectionFmt*)this );
- SwSectionFmt* pChild = (SwSectionFmt*)aFormatIter.
- First( TYPE(SwSectionFmt) );
+ SwIterator<SwSectionFmt,SwSectionFmt> aFormatIter(*this);
+ SwSectionFmt* pChild = aFormatIter.First();
while(pChild && !pFrm)
{
- pFrm = (SwFrm*)SwClientIter( *pChild ).First( TYPE(SwFrm) );
- pChild = (SwSectionFmt*)aFormatIter.Next();
+ pFrm = SwIterator<SwFrm,SwFmt>::FirstElement(*pChild);
+ pChild = aFormatIter.Next();
}
}
((SwPtrMsgPoolItem&)rInfo).pObject = pFrm;
@@ -1027,15 +972,14 @@ USHORT SwSectionFmt::GetChildSections( SwSections& rArr,
if( GetDepends() )
{
- SwClientIter aIter( *this );
- SwClient * pLast;
+ SwIterator<SwSectionFmt,SwSectionFmt> aIter(*this);
const SwNodeIndex* pIdx;
- for( pLast = aIter.First(TYPE(SwSectionFmt)); pLast; pLast = aIter.Next() )
+ for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() )
if( bAllSections ||
- ( 0 != ( pIdx = ((SwSectionFmt*)pLast)->GetCntnt(FALSE).
+ ( 0 != ( pIdx = pLast->GetCntnt(FALSE).
GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() ))
{
- const SwSection* Dummy=((SwSectionFmt*)pLast)->GetSection();
+ const SwSection* Dummy = pLast->GetSection();
rArr.C40_INSERT( SwSection,
Dummy,
rArr.Count() );
@@ -1085,8 +1029,8 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
// <--
bool bIsHidden = false;
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwClientIter aIter( *this ); // TODO
+ ::SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
if( pLast->IsA( TYPE(SwSectionFmt) ) )
@@ -1115,7 +1059,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pProtect->IsCntntProtected() !=
!pSection->IsProtectFlag())
{
- pLast->Modify( (SfxPoolItem*)pProtect,
+ pLast->ModifyNotification( (SfxPoolItem*)pProtect,
(SfxPoolItem*)pProtect );
}
@@ -1123,7 +1067,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
if (!pEditInReadonly->GetValue() !=
!pSection->IsEditInReadonlyFlag())
{
- pLast->Modify( (SfxPoolItem*)pEditInReadonly,
+ pLast->ModifyNotification( (SfxPoolItem*)pEditInReadonly,
(SfxPoolItem*)pEditInReadonly );
}
// <--
@@ -1133,7 +1077,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert
SwMsgPoolItem aMsgItem( static_cast<USHORT>(bIsHidden
? RES_SECTION_HIDDEN
: RES_SECTION_NOT_HIDDEN ) );
- pLast->Modify( &aMsgItem, &aMsgItem );
+ pLast->ModifyNotification( &aMsgItem, &aMsgItem );
}
}
else if( !pSection &&
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index cb804b102c0e..507b5b831b79 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -80,7 +80,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
// them havent't a loaded Graphic. - #86501#
rGrfNd.LockModify();
- SwClientIter aIter( rGrfNd );
+ SwClientIter aIter( rGrfNd ); // TODO
for( int n = 0; n < 2; ++n )
{
SwClient * pLast = aIter.GoStart();
@@ -88,7 +88,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
{
do {
if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) )
- pLast->Modify( &rItem, &rItem );
+ pLast->ModifyNotification( &rItem, &rItem );
} while( 0 != ( pLast = aIter++ ));
}
}
@@ -218,7 +218,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) )
{
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
- pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
bUpdate = FALSE;
}
}
@@ -283,7 +283,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
}
else
{
- pCntntNode->Modify( &aMsgHint, &aMsgHint );
+ pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint );
}
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 6ba70d9cfbcc..44643550139f 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -33,6 +33,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svx/svdpage.hxx>
+#include <svx/svditer.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdotext.hxx>
@@ -71,7 +72,7 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
#include <com/sun/star/text/WritingMode2.hpp>
-
+#include <switerator.hxx>
#include <algorithm>
using namespace ::com::sun::star;
@@ -309,13 +310,13 @@ void SwContact::_MoveObjToLayer( const bool _bToVisible,
return;
}
- if ( !pRegisteredIn )
+ if ( !GetRegisteredIn() )
{
ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no drawing frame format!" );
return;
}
- const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
+ const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
if ( !pIDDMA )
{
ASSERT( false, "SwDrawContact::_MoveObjToLayer(..) - no writer document!" );
@@ -408,7 +409,7 @@ sal_uInt32 SwContact::GetMinOrdNum() const
{
sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 );
- std::vector< SwAnchoredObject* > aObjs;
+ std::list< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -438,7 +439,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
{
sal_uInt32 nMaxOrdNum( 0L );
- std::vector< SwAnchoredObject* > aObjs;
+ std::list< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -545,88 +546,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
/*************************************************************************
|*
-|* SwFlyDrawContact::CreateNewRef()
-|*
-|* Ersterstellung MA 14. Dec. 94
-|* Letzte Aenderung MA 24. Apr. 95
-|*
-|*************************************************************************/
-
-SwVirtFlyDrawObj *SwFlyDrawContact::CreateNewRef( SwFlyFrm *pFly )
-{
- SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *GetMaster(), pFly );
- pDrawObj->SetModel( GetMaster()->GetModel() );
- pDrawObj->SetUserCall( this );
-
- //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu
- //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden
- //die Master aus der Liste entfernt und fuehren von da an ein
- //Schattendasein.
- SdrPage* pPg( 0L );
- if ( 0 != ( pPg = GetMaster()->GetPage() ) )
- {
- const UINT32 nOrdNum = GetMaster()->GetOrdNum();
- pPg->ReplaceObject( pDrawObj, nOrdNum );
- }
- // --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
- // into drawing page with correct order number
- else
- {
- GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
- InsertObject( pDrawObj, _GetOrdNumForNewRef( pFly ) );
- }
- // <--
- // --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
- // is in a visible layer.
- MoveObjToVisibleLayer( pDrawObj );
- // <--
- return pDrawObj;
-}
-
-/** method to determine new order number for new instance of <SwVirtFlyDrawObj>
-
- OD 2004-08-16 #i27030#
- Used in method <CreateNewRef(..)>
-
- @author OD
-*/
-sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm )
-{
- sal_uInt32 nOrdNum( 0L );
-
- // search for another Writer fly frame registered at same frame format
- SwClientIter aIter( *GetFmt() );
- const SwFlyFrm* pFlyFrm( 0L );
- for ( pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
- pFlyFrm;
- pFlyFrm = (SwFlyFrm*)aIter.Next() )
- {
- if ( pFlyFrm != _pFlyFrm )
- {
- break;
- }
- }
-
- if ( pFlyFrm )
- {
- // another Writer fly frame found. Take its order number
- nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum();
- }
- else
- {
- // no other Writer fly frame found. Take order number of 'master' object
- // --> OD 2004-11-11 #i35748# - use method <GetOrdNumDirect()> instead
- // of method <GetOrdNum()> to avoid a recalculation of the order number,
- // which isn't intended.
- nOrdNum = GetMaster()->GetOrdNumDirect();
- // <--
- }
-
- return nOrdNum;
-}
-
-/*************************************************************************
-|*
|* SwFlyDrawContact::Modify()
|*
|* Ersterstellung OK 08.11.94 10:21
@@ -634,7 +553,7 @@ sal_uInt32 SwFlyDrawContact::_GetOrdNumForNewRef( const SwFlyFrm* _pFlyFrm )
|*
|*************************************************************************/
-void SwFlyDrawContact::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwFlyDrawContact::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -716,17 +635,10 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
@author
*/
-void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
+void SwFlyDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const
{
const SwFrmFmt* pFmt = GetFmt();
-
- SwClientIter aIter( *(const_cast<SwFrmFmt*>(pFmt)) );
- for( SwFlyFrm* pFlyFrm = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
- pFlyFrm;
- pFlyFrm = (SwFlyFrm*)aIter.Next() )
- {
- _roAnchoredObjs.push_back( pFlyFrm );
- }
+ SwFlyFrm::GetAnchoredObjects( _roAnchoredObjs, *pFmt );
}
/*************************************************************************
@@ -769,7 +681,7 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
meEventTypeOfCurrentUserCall( SDRUSERCALL_MOVEONLY )
// <--
{
- // clear vector containing 'virtual' drawing objects.
+ // clear list containing 'virtual' drawing objects.
maDrawVirtObjs.clear();
// --> OD 2004-09-22 #i33909# - assure, that drawing object is inserted
@@ -818,6 +730,45 @@ SwDrawContact::~SwDrawContact()
}
}
+void SwDrawContact::GetTextObjectsFromFmt( std::list<SdrTextObj*>& rTextObjects, SwDoc* pDoc )
+{
+ for( sal_Int32 n=0; n<pDoc->GetSpzFrmFmts()->Count(); n++ )
+ {
+ SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[n];
+ if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
+ {
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFrmFmt>::FirstElement(*pFly);
+ if( pContact )
+ {
+ SdrObject* pSdrO = pContact->GetMaster();
+ if ( pSdrO )
+ {
+ if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
+ {
+ SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS );
+ //iterate inside of a grouped object
+ while( aListIter.IsMore() )
+ {
+ SdrObject* pSdrOElement = aListIter.Next();
+ if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) &&
+ static_cast<SdrTextObj*>( pSdrOElement)->HasText() )
+ {
+ rTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ }
+ }
+ }
+ else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
+ static_cast<SdrTextObj*>( pSdrO )->HasText() )
+ {
+ rTextObjects.push_back((SdrTextObj*) pSdrO);
+ }
+ }
+ }
+ }
+ }
+}
+
// OD 2004-03-29 #i26791#
const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj ) const
{
@@ -1405,7 +1356,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
{
if(::CheckControlLayer(maAnchoredDrawObj.DrawObj()))
{
- const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess();
+ const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->getIDocumentDrawModelAccess();
const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer());
const SdrLayerID aControlLayerID(pIDDMA->GetControlsId());
const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId());
@@ -1621,7 +1572,7 @@ namespace
|*
|*************************************************************************/
-void SwDrawContact::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
// OD 10.10.2003 #112299#
ASSERT( !mbDisconnectInProgress,
@@ -1834,7 +1785,7 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
// drawing page, move the 'master' drawing object into the corresponding
// invisible layer.
{
- //((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
+ //((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
// RemoveObject( GetMaster()->GetOrdNum() );
// OD 21.08.2003 #i18447# - in order to consider group object correct
// use new method <SwDrawContact::MoveObjToInvisibleLayer(..)>
@@ -1855,7 +1806,7 @@ void SwDrawContact::RemoveMasterFromDrawPage()
GetMaster()->SetUserCall( 0 );
if ( GetMaster()->IsInserted() )
{
- ((SwFrmFmt*)pRegisteredIn)->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
+ ((SwFrmFmt*)GetRegisteredIn())->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
RemoveObject( GetMaster()->GetOrdNum() );
}
}
@@ -1947,7 +1898,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
// <--
- SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)pRegisteredIn;
+ SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)GetRegisteredIn();
if( !pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() )
return;
@@ -2009,8 +1960,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
{
SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode );
SwCntntNode* pCNd = pDrawFrmFmt->GetDoc()->GetNodes().GoNext( &aIdx );
- SwClientIter aIter( *pCNd );
- if ( aIter.First( TYPE(SwFrm) ) )
+ if ( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
pModify = pCNd;
else
{
@@ -2042,11 +1992,9 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
pModify = pAnch->GetCntntAnchor()->nNode.GetNode().GetCntntNode();
}
}
- SwClientIter aIter( *pModify );
+ SwIterator<SwFrm,SwModify> aIter( *pModify );
SwFrm* pAnchorFrmOfMaster = 0;
- for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
+ for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// append drawing object, if
// (1) proposed anchor frame isn't a follow and
@@ -2216,7 +2164,7 @@ void SwDrawContact::ChangeMasterObject( SdrObject *pNewMaster )
@author
*/
-void SwDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
+void SwDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const
{
_roAnchoredObjs.push_back( const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj) );
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 83a2e29a2be7..aca39b5b29b7 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -444,7 +444,7 @@ void SwDrawView::_MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
const std::vector<SdrObject*>& _rMovedChildObjs ) const
{
// determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
- std::vector<SwAnchoredObject*> aAnchoredObjs;
+ std::list<SwAnchoredObject*> aAnchoredObjs;
{
const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
ASSERT( pContact,
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index 1e4f699fa203..ffe6ada138a8 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -45,7 +45,7 @@
#include <dbmgr.hxx>
#include <swddetbl.hxx>
#include <hints.hxx>
-
+#include <switerator.hxx>
/*--------------------------------------------------------------------
Beschreibung: Feldtypen zu einer ResId zaehlen
@@ -202,7 +202,7 @@ void SwEditShell::FieldToText( SwFieldType* pType )
BOOL bDDEFld = RES_DDEFLD == pType->Which();
// Modify-Object gefunden, trage alle Felder ins Array ein
- SwClientIter aIter( *pType );
+ SwClientIter aIter( *pType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
@@ -579,13 +579,13 @@ BOOL SwEditShell::IsAnyDatabaseFieldInDoc()const
case RES_DBNUMSETFLD:
case RES_DBSETNUMBERFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
return TRUE;
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
break;
diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx
index 1bc78a5a7482..821daba8a500 100644
--- a/sw/source/core/edit/edfldexp.cxx
+++ b/sw/source/core/edit/edfldexp.cxx
@@ -29,9 +29,7 @@
#include "precompiled_sw.hxx"
#include <editsh.hxx>
#include <dbfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -42,13 +40,11 @@
#include <fmtfld.hxx>
#include <edimp.hxx>
#include <flddat.hxx>
+#include <switerator.hxx>
using namespace com::sun::star;
using ::rtl::OUString;
-/* -----------------28.11.2002 17:53-----------------
- *
- * --------------------------------------------------*/
BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
{
const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes();
@@ -70,8 +66,8 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
{
case RES_DBFLD:
{
- SwClientIter aIter( rFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( rFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
@@ -88,7 +84,7 @@ BOOL SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const
return FALSE;
}
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
break;
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 7725ae834176..2e38e3c9957f 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -66,7 +66,7 @@
#include <numrule.hxx>
#include <SwNodeNum.hxx>
#include <unocrsr.hxx>
-
+#include <switerator.hxx>
using namespace com::sun::star;
@@ -423,8 +423,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
pNd->SetContour( pPoly );
SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
- (SwFmtSurround*)&rSur );
+ pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur );
GetDoc()->SetModified();
EndAllAction();
}
@@ -439,8 +438,7 @@ void SwEditShell::ClearAutomaticContour()
pNd->SetContour( NULL, FALSE );
SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
- pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
- (SwFmtSurround*)&rSur );
+ pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur );
GetDoc()->SetModified();
EndAllAction();
}
@@ -811,14 +809,13 @@ USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
for( USHORT n = pFmts->Count(); 1 < n; )
{
- SwClientIter aIter( *(*pFmts)[ --n ] );
-
- for( SwClient* pFnd = aIter.First(TYPE( SwTxtINetFmt ));
- pFnd; pFnd = aIter.Next() )
- if( 0 != ( pTxtNd = ((SwTxtINetFmt*)pFnd)->GetpTxtNode()) &&
+ SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
+ for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
+ {
+ if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) &&
pTxtNd->GetNodes().IsDocNodes() )
{
- SwTxtINetFmt& rAttr = *(SwTxtINetFmt*)pFnd;
+ SwTxtINetFmt& rAttr = *pFnd;
String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
*rAttr.GetEnd() - *rAttr.GetStart() ) );
@@ -832,6 +829,7 @@ USHORT SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
}
}
}
+ }
return rArr.Count();
}
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 90a34ea32a00..938ce6c36ae5 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -35,9 +35,7 @@
#include <unoflatpara.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <hintids.hxx>
#include <linguistic/lngprops.hxx>
#include <vcl/msgbox.hxx>
@@ -57,9 +55,7 @@
#include <viscrs.hxx> // SwShellCrsr
#include <SwGrammarMarkUp.hxx> // SwWrongList
#include <mdiexp.hxx> // Statusanzeige
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // StatLine-String
-#endif
#include <cntfrm.hxx>
#include <crsskip.hxx>
#include <splargs.hxx>
@@ -67,7 +63,7 @@
#include <docary.hxx> // SwRedlineTbl
#include <docsh.hxx>
#include <txatbase.hxx>
-
+#include <txtfrm.hxx>
using namespace ::svx;
using namespace ::com::sun::star;
@@ -77,8 +73,6 @@ using namespace ::com::sun::star::linguistic2;
#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
-extern void repaintTextFrames( SwModify& rModify );
-
/*************************************************************************
* class SwLinguIter
*************************************************************************/
@@ -1969,7 +1963,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition )
pWrong = pNode->GetWrong();
if( pWrong )
pWrong->RemoveEntry( nStart, nEnd );
- ::repaintTextFrames( *pNode );
+ SwTxtFrm::repaintTextFrames( *pNode );
}
++aIdx;
nStart = 0;
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 230e45f71079..89e1d6b570c4 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -365,13 +365,15 @@ void SwEditShell::ApplyAutoMark()
{
//1.
const SwTOXType* pTOXType = GetTOXType(TOX_INDEX, 0);
- SwClientIter aIter(*(SwTOXType*)pTOXType);
- SwTOXMark* pMark = (SwTOXMark*)aIter.First(TYPE(SwTOXMark));
- while( pMark )
+
+ SwTOXMarks aMarks;
+ SwTOXMark::InsertTOXMarks( aMarks, *pTOXType );
+ for( sal_uInt16 nMark=0; nMark<aMarks.Count(); nMark++ )
{
+ SwTOXMark* pMark = aMarks[nMark];
if(pMark->IsAutoGenerated() && pMark->GetTxtTOXMark())
+ // mba: test iteration; objects are deleted in iteration
DeleteTOXMark(pMark);
- pMark = (SwTOXMark*)aIter.Next();
}
//2.
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 2c6fe50625ac..b32f01074038 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -40,9 +40,7 @@
#include <editeng/langitem.hxx>
#include <swtypes.hxx>
#include <tools/resid.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <authfld.hxx>
#include <expfld.hxx>
#include <pam.hxx>
@@ -54,11 +52,9 @@
#include <txtfld.hxx>
#include <ndtxt.hxx>
#include <doc.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <unoprnms.hxx>
-
+#include <switerator.hxx>
#include <unomid.h>
using namespace ::com::sun::star::uno;
@@ -77,9 +73,6 @@ SV_DECL_PTRARR_DEL( SortKeyArr, TOXSortKeyPtr, 5, 5 )
SV_IMPL_PTRARR( SortKeyArr, TOXSortKeyPtr )
-/* -----------------16.09.99 11:53-------------------
-
- --------------------------------------------------*/
SwAuthEntry::SwAuthEntry(const SwAuthEntry& rCopy)
: nRefCount(0)
{
@@ -95,10 +88,6 @@ BOOL SwAuthEntry::operator==(const SwAuthEntry& rComp)
return TRUE;
}
// --------------------------------------------------------
-
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::SwAuthorityFieldType(SwDoc* pDoc)
: SwFieldType( RES_AUTHORITY ),
m_pDoc(pDoc),
@@ -129,9 +118,6 @@ SwAuthorityFieldType::SwAuthorityFieldType( const SwAuthorityFieldType& rFType)
m_pSortKeyArr->Insert((*rFType.m_pSortKeyArr)[i], i);
}
-/* -----------------17.09.99 13:52-------------------
-
- --------------------------------------------------*/
SwAuthorityFieldType::~SwAuthorityFieldType()
{
// DBG_ASSERT(!m_pDataArr->Count(), "Array is not empty");
@@ -140,16 +126,12 @@ SwAuthorityFieldType::~SwAuthorityFieldType()
delete m_pSequArr;
delete m_pDataArr;
}
-/*-- 14.09.99 16:22:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SwFieldType* SwAuthorityFieldType::Copy() const
{
return new SwAuthorityFieldType(m_pDoc);
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::RemoveField(long nHandle)
{
#ifdef DBG_UTIL
@@ -178,9 +160,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
DBG_ASSERT(bRemoved, "Field unknown" );
#endif
}
-/* -----------------17.09.99 13:43-------------------
- --------------------------------------------------*/
long SwAuthorityFieldType::AddField(const String& rFieldContents)
{
long nRet = 0;
@@ -210,9 +190,7 @@ long SwAuthorityFieldType::AddField(const String& rFieldContents)
}
return nRet;
}
-/* -----------------17.09.99 14:18-------------------
- --------------------------------------------------*/
BOOL SwAuthorityFieldType::AddField(long nHandle)
{
BOOL bRet = FALSE;
@@ -232,9 +210,7 @@ BOOL SwAuthorityFieldType::AddField(long nHandle)
DBG_ASSERT(bRet, "::AddField(long) failed");
return bRet;
}
-/* -----------------17.09.99 14:52-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
{
const SwAuthEntry* pRet = 0;
@@ -251,9 +227,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByHandle(long nHandle) const
ASSERT( pRet, "invalid Handle" );
return pRet;
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::GetAllEntryIdentifiers(
SvStringsDtor& rToFill )const
{
@@ -264,9 +238,7 @@ void SwAuthorityFieldType::GetAllEntryIdentifiers(
AUTH_FIELD_IDENTIFIER )), rToFill.Count() );
}
}
-/* -----------------21.09.99 13:34-------------------
- --------------------------------------------------*/
const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
const String& rIdentifier)const
{
@@ -282,9 +254,7 @@ const SwAuthEntry* SwAuthorityFieldType::GetEntryByIdentifier(
}
return pRet;
}
-/* -----------------------------21.12.99 13:20--------------------------------
- ---------------------------------------------------------------------------*/
bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
{
bool bChanged = false;
@@ -303,9 +273,9 @@ bool SwAuthorityFieldType::ChangeEntryContent(const SwAuthEntry* pNewEntry)
}
return bChanged;
}
-/*-- 11.10.99 08:49:22---------------------------------------------------
- Description: appends a new entry (if new) and returns the array position
+/*-------------------------------------------------------------------------
+ appends a new entry (if new) and returns the array position
-----------------------------------------------------------------------*/
USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
{
@@ -327,9 +297,6 @@ USHORT SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
return nRet;
}
-/*-- 11.10.99 08:49:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
long SwAuthorityFieldType::GetHandle(USHORT nPos)
{
long nRet = 0;
@@ -340,9 +307,7 @@ long SwAuthorityFieldType::GetHandle(USHORT nPos)
}
return nRet;
}
-/* -----------------19.10.99 13:46-------------------
- --------------------------------------------------*/
USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
{
//find the field in a sorted array of handles,
@@ -354,12 +319,11 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
if(!m_pSequArr->Count())
{
SwTOXSortTabBases aSortArr;
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
SwTOXInternational aIntl(m_eLanguage, 0, m_sSortAlgorithm);
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
if(!pTxtFld || !pTxtFld->GetpTxtNode())
@@ -439,9 +403,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
ASSERT(bCurrentFieldWithoutTextNode || nRet, "Handle not found")
return nRet;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -496,9 +458,7 @@ BOOL SwAuthorityFieldType::QueryValue( Any& rVal, USHORT nWhichId ) const
}
return TRUE;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId )
{
sal_Bool bRet = TRUE;
@@ -571,25 +531,19 @@ BOOL SwAuthorityFieldType::PutValue( const Any& rAny, USHORT nWhichId )
}
return bRet;
}
-/* -----------------19.10.99 13:25-------------------
- --------------------------------------------------*/
-void SwAuthorityFieldType::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwAuthorityFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
//re-generate positions of the fields
DelSequenceArray();
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
USHORT SwAuthorityFieldType::GetSortKeyCount() const
{
return m_pSortKeyArr->Count();
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const
{
SwTOXSortKey* pRet = 0;
@@ -598,9 +552,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(USHORT nIdx) const
DBG_ASSERT(pRet, "Sort key not found");
return pRet;
}
-/* -----------------20.10.99 13:38-------------------
- --------------------------------------------------*/
void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[])
{
m_pSortKeyArr->DeleteAndDestroy(0, m_pSortKeyArr->Count());
@@ -610,9 +562,6 @@ void SwAuthorityFieldType::SetSortKeys(USHORT nKeyCount, SwTOXSortKey aKeys[])
m_pSortKeyArr->Insert(new SwTOXSortKey(aKeys[i]), nArrIdx++);
}
-/* -----------------14.09.99 16:15-------------------
-
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
const String& rFieldContents )
: SwField(pInitType),
@@ -620,9 +569,7 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
m_nHandle = pInitType->AddField( rFieldContents );
}
-/* -----------------17.09.99 14:24-------------------
- --------------------------------------------------*/
SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
long nSetHandle )
: SwField( pInitType ),
@@ -631,16 +578,12 @@ SwAuthorityField::SwAuthorityField( SwAuthorityFieldType* pInitType,
{
pInitType->AddField( m_nHandle );
}
-/* -----------------15.09.99 15:00-------------------
- --------------------------------------------------*/
SwAuthorityField::~SwAuthorityField()
{
((SwAuthorityFieldType* )GetTyp())->RemoveField(m_nHandle);
}
-/*-- 14.09.99 16:20:59---------------------------------------------------
- -----------------------------------------------------------------------*/
String SwAuthorityField::Expand() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
@@ -666,45 +609,33 @@ String SwAuthorityField::Expand() const
sRet += pAuthType->GetSuffix();
return sRet;
}
-/*-- 14.09.99 16:21:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwField* SwAuthorityField::Copy() const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
return new SwAuthorityField(pAuthType, m_nHandle);
}
-/* -----------------21.09.99 12:55-------------------
- --------------------------------------------------*/
const String& SwAuthorityField::GetFieldText(ToxAuthorityField eField) const
{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
const SwAuthEntry* pEntry = pAuthType->GetEntryByHandle( m_nHandle );
return pEntry->GetAuthorField( eField );
}
-/* -----------------21.09.99 14:57-------------------
- --------------------------------------------------*/
void SwAuthorityField::SetPar1(const String& rStr)
{
SwAuthorityFieldType* pInitType = (SwAuthorityFieldType* )GetTyp();
pInitType->RemoveField(m_nHandle);
m_nHandle = pInitType->AddField(rStr);
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
String SwAuthorityField::GetDescription() const
{
return SW_RES(STR_AUTHORITY_ENTRY);
}
-
-/* -----------------------------15.11.00 17:33--------------------------------
-
- ---------------------------------------------------------------------------*/
const char* aFieldNames[] =
{
"Identifier",
@@ -739,9 +670,7 @@ const char* aFieldNames[] =
"Custom5",
"ISBN"
};
-/* -----------------------------16.11.00 12:27--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const
{
if(!GetTyp())
@@ -763,9 +692,7 @@ BOOL SwAuthorityField::QueryValue( Any& rAny, USHORT /*nWhichId*/ ) const
rAny <<= aRet;
return FALSE;
}
-/* -----------------------------15.11.00 17:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 lcl_Find(const OUString& rFieldName)
{
for(sal_Int16 i = 0; i < AUTH_FIELD_END; i++)
@@ -809,9 +736,7 @@ BOOL SwAuthorityField::PutValue( const Any& rAny, USHORT /*nWhichId*/ )
return FALSE;
}
-/* -----------------11.10.99 09:43-------------------
- --------------------------------------------------*/
SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp )
{
SwAuthorityFieldType* pSrcTyp = (SwAuthorityFieldType*)GetTyp(),
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index a06e5bc9eb64..9556fd70b39c 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -724,20 +724,6 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
-/*
-
- // oder besser ueber die Box den Frame suchen
-
- SwClientIter aIter( *pBox->GetFrmFmt() );
- ULONG nMinPos = ULONG_MAX;
- const SwFrm* pFnd = 0;
- for( SwFrm* pF = (SwFrm*)aIter.First( TYPE( SwCellFrm )); pF;
- pF = (SwFrm*)aIter.Next() )
- {
- if( pF->Frm().Y() <
- }
-*/
-
SwNodeIndex aIdx( *rBox.GetSttNd() );
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
ASSERT( pCNd, "Box hat keinen TextNode" );
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 15c44286921c..78d7bd70c522 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -44,16 +44,12 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <dbfld.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <docfld.hxx>
#include <expfld.hxx>
#include <txtatr.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
-
+#include <switerator.hxx>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star;
@@ -128,9 +124,6 @@ void SwDBFieldType::ReleaseRef()
}
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -152,9 +145,7 @@ BOOL SwDBFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/* -----------------24.02.99 14:51-------------------
- *
- * --------------------------------------------------*/
+
BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -172,8 +163,8 @@ BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
if( sTmp != sColumn )
{
sColumn = sTmp;
- SwClientIter aIter( *this );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
// Feld im Undo?
@@ -184,7 +175,7 @@ BOOL SwDBFieldType::PutValue( const uno::Any& rAny, USHORT nWhichId )
pDBField->ClearInitialized();
pDBField->InitContent();
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -420,9 +411,7 @@ void SwDBField::SetSubType(USHORT nType)
nSubType = nType;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -454,9 +443,7 @@ BOOL SwDBField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return TRUE;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -481,8 +468,8 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
//invalidate text node
if(GetTyp())
{
- SwClientIter aIter( *GetTyp() );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
SwTxtFld *pTxtFld = pFld->GetTxtFld();
@@ -492,7 +479,7 @@ BOOL SwDBField::PutValue( const uno::Any& rAny, USHORT nWhichId )
pTxtFld->NotifyContentChange(*pFld);
break;
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
}
}
@@ -564,9 +551,6 @@ String SwDBNameInfField::GetCntnt(BOOL bName) const
return lcl_DBTrennConv(sStr);
}
-/*-----------------06.03.98 16:55-------------------
-
---------------------------------------------------*/
BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -591,9 +575,7 @@ BOOL SwDBNameInfField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/*-----------------06.03.98 16:55-------------------
---------------------------------------------------*/
BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -625,16 +607,12 @@ BOOL SwDBNameInfField::PutValue( const uno::Any& rAny, USHORT nWhichId )
}
return TRUE;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
USHORT SwDBNameInfField::GetSubType() const
{
return nSubType;
}
-/* -----------------4/10/2003 15:03------------------
- --------------------------------------------------*/
void SwDBNameInfField::SetSubType(USHORT nType)
{
nSubType = nType;
@@ -709,9 +687,7 @@ void SwDBNextSetField::SetPar1(const String& rStr)
{
aCond = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
BOOL bRet = TRUE;
@@ -725,9 +701,7 @@ BOOL SwDBNextSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = TRUE;
@@ -743,21 +717,6 @@ BOOL SwDBNextSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
}
/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-/*
-String SwDBNextSetField::GetPar2() const
-{
- return GetDBName();
-}
-
-void SwDBNextSetField::SetPar2(const String& rStr)
-{
- GetDBName() = rStr;
-}
-*/
-
-/*--------------------------------------------------------------------
Beschreibung: Datensatz mit bestimmter ID
--------------------------------------------------------------------*/
@@ -845,9 +804,7 @@ void SwDBNumSetField::SetPar2(const String& rStr)
{
aPar2 = rStr;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
BOOL bRet = TRUE;
@@ -864,9 +821,7 @@ BOOL SwDBNumSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return bRet;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNumSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = TRUE;
@@ -946,16 +901,12 @@ SwField* SwDBNameField::Copy() const
return pTmp;
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
return SwDBNameInfField::QueryValue(rAny, nWhichId );
}
-/*-----------------06.03.98 16:16-------------------
---------------------------------------------------*/
BOOL SwDBNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
return SwDBNameInfField::PutValue(rAny, nWhichId );
@@ -997,7 +948,6 @@ String SwDBSetNumberField::Expand() const
return aEmptyStr;
else
return FormatNumber((USHORT)nNumber, GetFormat());
- //return(nNumber == 0 ? aEmptyStr : FormatNumber(nNumber, GetFormat()));
}
//------------------------------------------------------------------------------
@@ -1025,9 +975,7 @@ SwField* SwDBSetNumberField::Copy() const
pTmp->SetSubType(GetSubType());
return pTmp;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
BOOL bRet = TRUE;
@@ -1044,9 +992,7 @@ BOOL SwDBSetNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return bRet;
}
-/*-----------------06.03.98 16:15-------------------
---------------------------------------------------*/
BOOL SwDBSetNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = TRUE;
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index f208ac71dbb3..c4473b8510bc 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -40,9 +40,7 @@
#include <swtable.hxx>
#include <swbaslnk.hxx>
#include <swddetbl.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <hints.hxx>
using rtl::OUString;
@@ -124,7 +122,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
int bCallModify = FALSE;
rFldType.LockModify();
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -139,7 +137,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
else if( pSh )
pSh->StartAction();
}
- pLast->Modify( 0, &aUpdateDDE );
+ pLast->ModifyNotification( 0, &aUpdateDDE );
bCallModify = TRUE;
}
} while( 0 != ( pLast = aIter++ ));
@@ -186,7 +184,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
{
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
const SwNode* pNd = 0;
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -213,7 +211,7 @@ BOOL SwIntrnlRefLink::IsInRange( ULONG nSttNd, ULONG nEndNd,
{
// hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
SwNodes* pNds = &rFldType.GetDoc()->GetNodes();
- SwClientIter aIter( rFldType );
+ SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
if( pLast ) // konnte zum Anfang gesprungen werden ??
do {
@@ -401,8 +399,8 @@ SwDDEField::SwDDEField( SwDDEFieldType* pInitType )
SwDDEField::~SwDDEField()
{
- if( GetTyp()->IsLastDepend() ) // der Letzte mach das
- ((SwDDEFieldType*)GetTyp())->Disconnect(); // Licht aus
+ if( GetTyp()->IsLastDepend() )
+ ((SwDDEFieldType*)GetTyp())->Disconnect();
}
String SwDDEField::Expand() const
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 1756690d1384..f7764ed2ebca 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -62,10 +62,12 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
const SwNode& rNd = *GetTabSortBoxes()[0]->GetSttNd();
if( rNd.GetNodes().IsDocNodes() )
{
- // "aktivieren der Updates" (Modify nicht noch mal rufen)
- aDepend.LockModify();
+ // mba: swclient refactoring - this code shouldn't have done anything!
+ // the ModifyLock Flag is evaluated in SwModify only, though it was accessible via SwClient
+ // This has been fixed now
+// aDepend.LockModify();
pDDEType->IncRefCnt();
- aDepend.UnlockModify();
+// aDepend.UnlockModify();
// Setzen der Werte in die einzelnen Boxen
// update box content only if update flag is set (false in import)
@@ -91,7 +93,7 @@ __EXPORT SwDDETable::~SwDDETable()
}
}
-void SwDDETable::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( pNew && RES_UPDATEDDETBL == pNew->Which() )
ChangeContent();
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 862a073d9884..3fd6dc105238 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -103,6 +103,7 @@
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
+#include <switerator.hxx>
#define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS
@@ -176,14 +177,11 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage,
if( 0 != (pDesc = (SwFmtPageDesc*)rPool.GetItem( RES_PAGEDESC, n ) )
&& pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
{
- if( pDesc->GetDefinedIn()->ISA( SwCntntNode ))
+ SwCntntNode* pNd = PTR_CAST( SwCntntNode, pDesc->GetDefinedIn() );
+ if( pNd )
{
- SwClientIter aIter( *(SwModify*)pDesc->GetDefinedIn() );
- if( aIter.First( TYPE( SwFrm ) ) )
- {
+ if ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*pNd) )
bVirtuell = sal_True;
- break;
- }
}
else if( pDesc->GetDefinedIn()->ISA( SwFmt ))
{
@@ -249,9 +247,6 @@ sal_uInt16 SwPageNumberField::GetSubType() const
return nSubType;
}
-/*-----------------05.03.98 10:25-------------------
-
---------------------------------------------------*/
BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -282,9 +277,7 @@ BOOL SwPageNumberField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 10:25-------------------
---------------------------------------------------*/
BOOL SwPageNumberField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = TRUE;
@@ -383,9 +376,6 @@ SwField* SwAuthorField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 11:15-------------------
-
---------------------------------------------------*/
BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
sal_Bool bVal;
@@ -410,9 +400,7 @@ BOOL SwAuthorField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 11:15-------------------
---------------------------------------------------*/
BOOL SwAuthorField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -529,9 +517,6 @@ SwField* SwFileNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -571,9 +556,7 @@ BOOL SwFileNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
BOOL SwFileNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -705,9 +688,6 @@ SwField* SwTemplNameField::Copy() const
return pTmp;
}
-/*-----------------05.03.98 08:59-------------------
-
---------------------------------------------------*/
BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch ( nWhichId )
@@ -733,9 +713,7 @@ BOOL SwTemplNameField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 09:01-------------------
---------------------------------------------------*/
BOOL SwTemplNameField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch ( nWhichId )
@@ -860,9 +838,6 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm )
pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() );
}
-/*-----------------05.03.98 11:38-------------------
-
---------------------------------------------------*/
BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch ( nWhichId )
@@ -875,9 +850,7 @@ BOOL SwDocStatField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 11:38-------------------
---------------------------------------------------*/
BOOL SwDocStatField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = FALSE;
@@ -912,9 +885,7 @@ SwDocInfoFieldType::SwDocInfoFieldType(SwDoc* pDc)
{
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
+// ---------------------------------------------------------------------------
SwFieldType* SwDocInfoFieldType::Copy() const
{
SwDocInfoFieldType* pTyp = new SwDocInfoFieldType(GetDoc());
@@ -934,9 +905,7 @@ void lcl_GetLocalDataWrapper( ULONG nLang,
SvxCreateLocale( static_cast<LanguageType>(nLang) ) );
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
+// ---------------------------------------------------------------------------
String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
sal_uInt16 nLang, const String& rName ) const
{
@@ -1084,9 +1053,7 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
return aStr;
}
-/* ---------------------------------------------------------------------------
-
- ---------------------------------------------------------------------------*/
+// ---------------------------------------------------------------------------
SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt) :
SwValueField(pTyp, nFmt), nSubType(nSub)
{
@@ -1101,9 +1068,8 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const
aContent = rValue;
}
-/* ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
template<class T>
double lcl_TimeToDouble( const T& rTime )
{
@@ -1748,9 +1714,7 @@ SwField* SwHiddenParaField::Copy() const
return pFld;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch ( nWhichId )
@@ -1770,9 +1734,7 @@ BOOL SwHiddenParaField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 13:25-------------------
---------------------------------------------------*/
BOOL SwHiddenParaField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch ( nWhichId )
@@ -1913,9 +1875,6 @@ sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
return (mpText) ? mpText->Count() : 1;
}
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -1976,10 +1935,6 @@ BOOL SwPostItField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
return sal_True;
}
-
-/*-----------------05.03.98 13:42-------------------
-
---------------------------------------------------*/
BOOL SwPostItField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -2121,9 +2076,6 @@ void SwExtUserField::SetSubType(sal_uInt16 nSub)
nType = nSub;
}
-/*-----------------05.03.98 14:14-------------------
-
---------------------------------------------------*/
BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -2149,9 +2101,7 @@ BOOL SwExtUserField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 14:14-------------------
---------------------------------------------------*/
BOOL SwExtUserField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -2199,7 +2149,7 @@ SwFieldType* SwRefPageSetFieldType::Copy() const
---------------------------------------------------------------------------*/
// ueberlagert, weil es nichts zum Updaten gibt!
-void SwRefPageSetFieldType::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
@@ -2241,9 +2191,6 @@ void SwRefPageSetField::SetPar2(const String& rStr)
SetOffset( (short) rStr.ToInt32() );
}
-/*-----------------05.03.98 14:52-------------------
-
---------------------------------------------------*/
BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -2259,9 +2206,7 @@ BOOL SwRefPageSetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
BOOL SwRefPageSetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -2297,7 +2242,7 @@ SwFieldType* SwRefPageGetFieldType::Copy() const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// Update auf alle GetReferenz-Felder
if( !pNew && !pOld && GetDepends() )
@@ -2306,30 +2251,26 @@ void SwRefPageGetFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
_SetGetExpFlds aTmpLst( 10, 5 );
if( MakeSetList( aTmpLst ) )
{
- SwClientIter aIter( *this );
- if( aIter.GoStart() )
- do {
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
// nur die GetRef-Felder Updaten
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter();
if( pFmtFld->GetTxtFld() )
UpdateField( pFmtFld->GetTxtFld(), aTmpLst );
- } while( aIter++ );
}
}
// weiter an die Text-Felder, diese "Expandieren" den Text
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
{
- SwClientIter aIter( *pDoc->GetSysFldType( RES_REFPAGESETFLD));
- if( aIter.GoStart() )
- do {
+ SwIterator<SwFmtFld,SwFieldType> aIter(*pDoc->GetSysFldType( RES_REFPAGESETFLD));
+ for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
+ {
// nur die GetRef-Felder Updaten
- SwFmtFld* pFmtFld = (SwFmtFld*)aIter();
const SwTxtFld* pTFld = pFmtFld->GetTxtFld();
if( pTFld )
{
@@ -2369,7 +2310,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
if( !rTmpLst.Insert( pNew ))
delete pNew;
}
- } while( aIter++ );
+ }
return rTmpLst.Count();
}
@@ -2421,7 +2362,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
}
}
// dann die Formatierung anstossen
- ((SwFmtFld&)pTxtFld->GetFld()).Modify( 0, 0 );
+ ((SwFmtFld&)pTxtFld->GetFld()).ModifyNotification( 0, 0 );
}
/*--------------------------------------------------------------------
@@ -2512,9 +2453,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) );
}
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -2530,9 +2469,7 @@ BOOL SwRefPageGetField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 14:52-------------------
---------------------------------------------------*/
BOOL SwRefPageGetField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -2648,9 +2585,6 @@ void SwJumpEditField::SetPar2(const String& rStr)
sHelp = rStr;
}
-/*-----------------05.03.98 15:00-------------------
-
---------------------------------------------------*/
BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -2682,9 +2616,7 @@ BOOL SwJumpEditField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return sal_True;
}
-/*-----------------05.03.98 15:00-------------------
---------------------------------------------------*/
BOOL SwJumpEditField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 25b0cf932e83..d8f54e6c9242 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -63,6 +63,7 @@
#include <SwStyleNameMapper.hxx>
#include <unofldmid.h>
#include <numrule.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -276,10 +277,10 @@ SwFieldType* SwGetExpFieldType::Copy() const
return new SwGetExpFieldType(GetDoc());
}
-void SwGetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* pNew )
+void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew )
{
if( pNew && RES_DOCPOS_UPDATE == pNew->Which() )
- SwModify::Modify( 0, pNew );
+ NotifyClients( 0, pNew );
// sonst nichts weiter expandieren
}
@@ -420,9 +421,6 @@ void SwGetExpField::SetLanguage(USHORT nLng)
SwValueField::SetLanguage(nLng);
}
-/*-----------------07.03.98 16:08-------------------
-
---------------------------------------------------*/
BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -459,9 +457,7 @@ BOOL SwGetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/*-----------------07.03.98 16:08-------------------
---------------------------------------------------*/
BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
sal_Int32 nTmp = 0;
@@ -502,10 +498,6 @@ BOOL SwGetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
return TRUE;
}
-/*-----------------JP: 17.06.93 -------------------
- Set-Expression-Type
- --------------------------------------------------*/
-
SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, USHORT nTyp )
: SwValueFieldType( pDc, RES_SETEXPFLD ),
sName( rName ),
@@ -533,16 +525,15 @@ const String& SwSetExpFieldType::GetName() const
return sName;
}
-void SwSetExpFieldType::Modify( SfxPoolItem*, SfxPoolItem* )
+void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* )
{
return; // nicht weiter expandieren
}
void SwSetExpFieldType::SetSeqFormat(ULONG nFmt)
{
- SwClientIter aIter(*this);
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter(*this);
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
pFld->GetFld()->ChangeFormat( nFmt );
}
@@ -567,10 +558,9 @@ extern void InsertSort( SvUShorts& rArr, USHORT nIdx, USHORT* pInsPos = 0 );
// dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
// bestimmt werden muss.
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
const SwTxtNode* pNd;
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetFld() != &rFld && pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
@@ -605,10 +595,9 @@ USHORT SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
if( rList.Count() )
rList.Remove( 0, rList.Count() );
- SwClientIter aIter( *this );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
const SwTxtNode* pNd;
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
@@ -652,9 +641,6 @@ void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd )
}
}
-/* -----------------24.03.99 09:44-------------------
- *
- * --------------------------------------------------*/
BOOL SwSetExpFieldType::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -911,7 +897,7 @@ void SwGetExpField::SetValue( const double& rAny )
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue( rAny, GetFormat(),
GetLanguage());
}
-/* -----------------14.07.99 12:21-------------------
+/* -------------------------------------------------
Description: Find the index of the reference text
following the current field
--------------------------------------------------*/
@@ -1066,9 +1052,6 @@ String SwInputField::Expand() const
return sRet;
}
-/*-----------------06.03.98 11:12-------------------
-
---------------------------------------------------*/
BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -1090,9 +1073,7 @@ BOOL SwInputField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/*-----------------06.03.98 11:12-------------------
---------------------------------------------------*/
BOOL SwInputField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
switch( nWhichId )
@@ -1176,9 +1157,7 @@ void SwInputField::SetSubType(USHORT nSub)
{
nSubType = nSub;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -1243,9 +1222,7 @@ BOOL SwSetExpField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/*-----------------05.03.98 17:22-------------------
---------------------------------------------------*/
BOOL SwSetExpField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
sal_Int32 nTmp32 = 0;
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index abf688cbbf5f..2d55cdf70fa4 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include "switerator.hxx"
#include "editsh.hxx"
#include "doc.hxx"
#include <docary.hxx>
@@ -63,10 +63,8 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, BOOL bBuildTmpLst )
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
-
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
@@ -161,9 +159,8 @@ USHORT SwInputFieldList::BuildSortLst()
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 1d76dce43117..57c9a09ada24 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -47,7 +47,7 @@
#include <redline.hxx>
#include <scriptinfo.hxx>
#include <editeng/charhiddenitem.hxx>
-
+#include <switerator.hxx>
namespace {
@@ -93,9 +93,8 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLa
SwCntntNode* pNode = rPos.nNode.GetNode().GetCntntNode(); // getfirstcontentnode // getnext...
if( !pNode )
return aRet;
- SwClientIter aIter( *pNode );
- SwTxtFrm *pTxtFrm;
- for( pTxtFrm = (SwTxtFrm*)aIter.First( TYPE( SwTxtFrm )); pTxtFrm; pTxtFrm = (SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwCntntNode> aIter( *pNode );
+ for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm; pTxtFrm = aIter.Next() )
{
if( !pTxtFrm->IsFollow() )
{
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 4ca163c25dcb..f116bfd252c2 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -57,25 +57,18 @@
#include <flyfrm.hxx>
#include <pagedesc.hxx>
#include <IMark.hxx>
-// --> OD 2007-10-18 #i81002#
#include <crossrefbookmark.hxx>
-// <--
#include <ftnidx.hxx>
#include <viewsh.hxx>
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <SwStyleNameMapper.hxx>
#include <shellres.hxx>
#include <poolfmt.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <numrule.hxx>
#include <SwNodeNum.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -586,9 +579,6 @@ String SwGetRefField::GetPar2() const
return Expand();
}
-/*-----------------06.03.98 13:34-------------------
-
---------------------------------------------------*/
BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
switch( nWhichId )
@@ -660,9 +650,7 @@ BOOL SwGetRefField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return TRUE;
}
-/*-----------------06.03.98 13:34-------------------
---------------------------------------------------*/
BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
String sTmp;
@@ -737,9 +725,7 @@ BOOL SwGetRefField::PutValue( const uno::Any& rAny, USHORT nWhichId )
}
return TRUE;
}
-/* -----------------------------11.01.2002 12:50------------------------------
- ---------------------------------------------------------------------------*/
void SwGetRefField::ConvertProgrammaticToUIName()
{
if(GetTyp() && REF_SEQUENCEFLD == nSubType)
@@ -771,10 +757,6 @@ void SwGetRefField::ConvertProgrammaticToUIName()
}
}
}
-/*-----------------JP: 18.06.93 -------------------
- Get-Referenz-Type
- --------------------------------------------------*/
-
SwGetRefFieldType::SwGetRefFieldType( SwDoc* pDc )
: SwFieldType( RES_GETREFFLD ), pDoc( pDc )
@@ -787,14 +769,13 @@ SwFieldType* SwGetRefFieldType::Copy() const
}
-void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
// Update auf alle GetReferenz-Felder
if( !pNew && !pOld )
{
- SwClientIter aIter( *this );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
// nur die GetRef-Felder Updaten
//JP 3.4.2001: Task 71231 - we need the correct language
@@ -814,7 +795,7 @@ void SwGetRefFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
}
}
// weiter an die Text-Felder, diese "Expandieren" den Text
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
}
SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
@@ -845,9 +826,8 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
if( pFldType && pFldType->GetDepends() &&
nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType*)pFldType)->GetType() )
{
- SwClientIter aIter( *pFldType );
- for( SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFld; pFld = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
if( pFld->GetTxtFld() && nSeqNo ==
((SwSetExpField*)pFld->GetFld())->GetSeqNumber() )
@@ -958,22 +938,20 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
if( bField )
{
const SwTxtNode* pNd;
- SwModify* pMod;
- if( 0 != ( pMod = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
+ SwFieldType* pType;
+ if( 0 != ( pType = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
aIds.Insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
}
- if( 0 != ( pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
+ if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() &&
0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
pNd->GetNodes().IsDocNodes() )
@@ -1019,12 +997,11 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
// Id umsetzen
if( bField )
{
- SwModify* pMod = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
- if( pMod )
+ SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
+ if( pType )
{
- SwClientIter aIter( *pMod );
- for( SwFmtFld* pF = (SwFmtFld*)aIter.First( TYPE( SwFmtFld )); pF;
- pF = (SwFmtFld*)aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
if( pF->GetTxtFld() && nSeqNo ==
((SwSetExpField*)pF->GetFld())->GetSeqNumber() )
((SwSetExpField*)pF->GetFld())->SetSeqNumber( n );
@@ -1062,11 +1039,10 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
_RefIdsMap aFntMap( aEmptyStr );
_RefIdsMaps aFldMap;
- SwClientIter aIter( *this );
- for( SwClient* pFld = aIter.First( TYPE( SwFmtFld ));
- pFld; pFld = aIter.Next() )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *this );
+ for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
- SwGetRefField& rRefFld = *(SwGetRefField*)((SwFmtFld*)pFld)->GetFld();
+ SwGetRefField& rRefFld = *(SwGetRefField*)pFld->GetFld();
switch( rRefFld.GetSubType() )
{
case REF_SEQUENCEFLD:
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index ae340b9a7ba5..04daffde2412 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <switerator.hxx>
#include <cntfrm.hxx>
#include <doc.hxx>
#include <pam.hxx> // fuer GetBodyTxtNode
@@ -37,9 +37,7 @@
#include <txtfld.hxx>
#include <expfld.hxx>
#include <docfld.hxx> // fuer _SetGetExpFld
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -115,15 +113,10 @@ const SwNode* SwTblField::GetNodeOfFormula() const
if( !GetTyp()->GetDepends() )
return 0;
- SwClientIter aIter( *GetTyp() );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- const SwFmtFld* pFmtFld = (SwFmtFld*)pLast;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() );
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
if( this == pFmtFld->GetFld() )
return (SwTxtNode*)&pFmtFld->GetTxtFld()->GetTxtNode();
-
- } while( 0 != ( pLast = aIter++ ));
return 0;
}
@@ -191,9 +184,6 @@ void SwTblField::SetPar2(const String& rStr)
}
-/*-----------------04.03.98 10:33-------------------
-
---------------------------------------------------*/
BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
{
BOOL bRet = TRUE;
@@ -225,9 +215,7 @@ BOOL SwTblField::QueryValue( uno::Any& rAny, USHORT nWhichId ) const
}
return bRet;
}
-/*-----------------04.03.98 10:33-------------------
---------------------------------------------------*/
BOOL SwTblField::PutValue( const uno::Any& rAny, USHORT nWhichId )
{
BOOL bRet = TRUE;
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index f9437cd0fbd5..004d14d23ce0 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -235,12 +235,12 @@ const String& SwUserFieldType::GetName() const
return aName;
}
-void SwUserFieldType::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pOld && !pNew )
ChgValid( sal_False );
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
// und ggfs. am UserFeld haengende InputFelder updaten!
GetDoc()->GetSysFldType( RES_INPUTFLD )->UpdateFlds();
}
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 844d2b569547..5feae7816aa7 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -47,10 +47,7 @@
#include <editeng/protitem.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc> // fuer InitFldTypes
-#endif
#include <frmfmt.hxx>
#include <frmatr.hxx>
#include <fmtfsize.hxx>
@@ -84,12 +81,10 @@
#include "txtfrm.hxx"
#include "txatbase.hxx"
#include "mdiexp.hxx" // fuer Update der Statuszeile bei drag
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <switerator.hxx>
#define SCROLLVAL 75
@@ -141,10 +136,6 @@ extern BOOL bNoInterrupt; // in swapp.cxx
/*************************************************************************
|*
|* SwFEShell::SelectObj()
-|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 22. Oct. 96
-|*
*************************************************************************/
BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
@@ -267,9 +258,6 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj )
|*
|* sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
|*
-|* Created AMA 05/28/2002
-|* Last modify AMA 05/30/2002
-|*
|* Description: MoveAnchor( nDir ) looked for an another Anchor for
|* the selected drawing object (or fly frame) in the given direction.
|* An object "as character" doesn't moves anyway.
@@ -541,9 +529,6 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir )
|*
|* SwFEShell::GetSelFrmType()
|*
-|* Ersterstellung MA 12. Jan. 93
-|* Letzte Aenderung JP 19.03.96
-|*
*************************************************************************/
const SdrMarkList* SwFEShell::_GetMarkList() const
@@ -608,9 +593,6 @@ bool SwFEShell::IsSelContainsControl() const
|*
|* SwFEShell::Scroll()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 27. Jul. 95
-|*
*************************************************************************/
void SwFEShell::ScrollTo( const Point &rPt )
@@ -629,9 +611,6 @@ void SwFEShell::ScrollTo( const Point &rPt )
|*
|* SwFEShell::SetDragMode()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
void SwFEShell::SetDragMode( UINT16 eDragMode )
@@ -644,9 +623,6 @@ void SwFEShell::SetDragMode( UINT16 eDragMode )
|*
|* SwFEShell::BeginDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::BeginDrag( const Point* pPt, BOOL )
@@ -666,9 +642,6 @@ long SwFEShell::BeginDrag( const Point* pPt, BOOL )
|*
|* SwFEShell::Drag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::Drag( const Point *pPt, BOOL )
@@ -689,9 +662,6 @@ long SwFEShell::Drag( const Point *pPt, BOOL )
|*
|* SwFEShell::EndDrag()
|*
-|* Ersterstellung MS 10.06.92
-|* Letzte Aenderung MA 13. Mar. 96
-|*
*************************************************************************/
long SwFEShell::EndDrag( const Point *, BOOL )
@@ -718,7 +688,7 @@ long SwFEShell::EndDrag( const Point *, BOOL )
//pView->ShowShownXor( GetOut() );
pView->EndDragObj();
- // JP 18.08.95: DrawUndo-Action auf FlyFrames werden nicht gespeichert
+ // DrawUndo-Action auf FlyFrames werden nicht gespeichert
// Die Fly aendern das Flag
GetDoc()->SetNoDrawUndoObj( FALSE );
ChgAnchor( 0, TRUE );
@@ -742,9 +712,6 @@ long SwFEShell::EndDrag( const Point *, BOOL )
|*
|* SwFEShell::BreakDrag()
|*
-|* Ersterstellung OM 02. Okt. 95
-|* Letzte Aenderung OM 02. Okt. 95
-|*
*************************************************************************/
void SwFEShell::BreakDrag()
@@ -761,9 +728,6 @@ void SwFEShell::BreakDrag()
|*
|* Beschreibung Wenn ein Fly selektiert ist, zieht er den Crsr in
|* den ersten CntntFrm
-|* Ersterstellung MA 11. Dec. 92
-|* Letzte Aenderung MA 07. Oct. 96
-|*
*************************************************************************/
const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
@@ -775,8 +739,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
if( pFly )
{
- // --> OD 2004-06-11 #i28701# - no format here
-// pFly->GetAnchorFrm()->Calc();
SwCntntFrm *pCFrm = pFly->ContainsCntnt();
if ( pCFrm )
{
@@ -809,9 +771,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
|*
|* Beschreibung Selektion nach oben/unten (Z-Order)
|*
-|* Ersterstellung MA 05. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 96
-|*
*************************************************************************/
void lcl_NotifyNeighbours( const SdrMarkList *pLst )
@@ -941,9 +900,6 @@ void SwFEShell::SelectionToBottom( BOOL bBottom )
|*
|* Beschreibung Objekt ueber/unter dem Dokument?
|* 2 Controls, 1 Heaven, 0 Hell, -1 Uneindeutig
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 20. Dec. 94
-|*
*************************************************************************/
short SwFEShell::GetLayerId() const
@@ -976,8 +932,6 @@ short SwFEShell::GetLayerId() const
|* SwFEShell::SelectionToHeaven(), SelectionToHell()
|*
|* Beschreibung Objekt ueber/unter dem Dokument
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung AMA 04. Jun. 98
|*
*************************************************************************/
// OD 25.06.2003 #108784#
@@ -1037,9 +991,6 @@ void SwFEShell::SelectionToHell()
|*
|* SwFEShell::IsObjSelected(), IsFrmSelected()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 17. Jan. 95
-|*
*************************************************************************/
USHORT SwFEShell::IsObjSelected() const
@@ -1072,9 +1023,6 @@ sal_Bool SwFEShell::IsObjSelected( const SdrObject& rObj ) const
|*
|* SwFEShell::EndTextEdit()
|*
-|* Ersterstellung MA 19. Feb. 96
-|* Letzte Aenderung MA 19. Feb. 96
-|*
*************************************************************************/
void SwFEShell::EndTextEdit()
@@ -1133,9 +1081,6 @@ void SwFEShell::EndTextEdit()
|*
|* SwFEShell::IsInsideSelectedObj()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 08. Nov. 96
-|*
*************************************************************************/
int SwFEShell::IsInsideSelectedObj( const Point &rPt )
@@ -1157,9 +1102,6 @@ int SwFEShell::IsInsideSelectedObj( const Point &rPt )
|*
|* SwFEShell::IsObjSelectable()
|*
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung MA 02. Feb. 95
-|*
*************************************************************************/
bool SwFEShell::IsObjSelectable( const Point& rPt )
@@ -1291,11 +1233,9 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
|*
|* Beschreibung Wenn ein Obj selektiert ist, gehen wir von dessen
|* TopLeft aus, andernfalls von der Mitte des aktuellen CharRects.
-|* Ersterstellung MA 01. Jun. 95
-|* Letzte Aenderung MA 30. Apr. 96
|*
*************************************************************************/
-/* -----------------23.09.98 10:29-------------------
+/* ------------------------------------
* Beinhaltet das Objekt ein Control oder Gruppen,
* die nur aus Controls bestehen
* --------------------------------------------------*/
@@ -1540,9 +1480,6 @@ BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
|*
|* SwFEShell::BeginCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 21. Mar. 95
-|*
*************************************************************************/
BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos )
@@ -1591,9 +1528,6 @@ BOOL SwFEShell::BeginCreate( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, UINT32 eOb
|*
|* SwFEShell::MoveCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 24. Jan. 95
-|*
*************************************************************************/
void SwFEShell::MoveCreate( const Point &rPos )
@@ -1611,14 +1545,11 @@ void SwFEShell::MoveCreate( const Point &rPos )
|*
|* SwFEShell::EndCreate(), ImpEndCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 14. Oct. 96
-|*
*************************************************************************/
BOOL SwFEShell::EndCreate( UINT16 eSdrCreateCmd )
{
- // JP 18.08.95: Damit das Undo-Object aus der DrawEngine nicht bei uns
+ // Damit das Undo-Object aus der DrawEngine nicht bei uns
// gespeichert wird, (wir erzeugen ein eigenes Undo-Object!) hier kurz
// das Undo abschalten
ASSERT( Imp()->HasDrawView(), "EndCreate without DrawView?" );
@@ -1652,7 +1583,7 @@ BOOL SwFEShell::ImpEndCreate()
if( rSdrObj.GetSnapRect().IsEmpty() )
{
- //JP 10.04.95: das Object vergessen wir lieber, fuerht nur
+ // das Object vergessen wir lieber, fuerht nur
// zu Problemen
Imp()->GetDrawView()->DeleteMarked();
Imp()->GetDrawView()->UnmarkAll();
@@ -1696,7 +1627,7 @@ BOOL SwFEShell::ImpEndCreate()
Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 );
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080317
- //JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
+ //Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
if( !aPos.nNode.GetNode().IsProtect() )
{
pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, &aPos );
@@ -1741,7 +1672,7 @@ BOOL SwFEShell::ImpEndCreate()
SwPosition aPos( GetDoc()->GetNodes() );
GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
- //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
+ //nicht in ReadnOnly-Inhalt setzen
if( aPos.nNode.GetNode().IsProtect() )
// dann darf er nur seitengebunden sein. Oder sollte man
// die naechste nicht READONLY Position suchen?
@@ -1780,7 +1711,7 @@ BOOL SwFEShell::ImpEndCreate()
pAnch = ::FindAnchor( pPage, aPt, bBodyOnly );
aPos.nNode = *((SwCntntFrm*)pAnch)->GetNode();
- //JP 22.01.99: nicht in ReadnOnly-Inhalt setzen
+ //nicht in ReadnOnly-Inhalt setzen
if( aPos.nNode.GetNode().IsProtect() )
// dann darf er nur seitengebunden sein. Oder sollte man
// die naechste nicht READONLY Position suchen?
@@ -1989,9 +1920,6 @@ BOOL SwFEShell::ImpEndCreate()
|*
|* SwFEShell::BreakCreate()
|*
-|* Ersterstellung MA 20. Dec. 94
-|* Letzte Aenderung MA 09. Jan. 95
-|*
*************************************************************************/
void SwFEShell::BreakCreate()
@@ -2005,9 +1933,6 @@ void SwFEShell::BreakCreate()
|*
|* SwFEShell::IsDrawCreate()
|*
-|* Ersterstellung OM 16. Mar. 95
-|* Letzte Aenderung OM 16. Mar. 95
-|*
*************************************************************************/
BOOL SwFEShell::IsDrawCreate() const
@@ -2019,9 +1944,6 @@ BOOL SwFEShell::IsDrawCreate() const
|*
|* SwFEShell::BeginMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
BOOL SwFEShell::BeginMark( const Point &rPos )
@@ -2046,9 +1968,6 @@ BOOL SwFEShell::BeginMark( const Point &rPos )
|*
|* SwFEShell::MoveMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::MoveMark( const Point &rPos )
@@ -2074,9 +1993,6 @@ void SwFEShell::MoveMark( const Point &rPos )
|*
|* SwFEShell::EndMark()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung MA 08. Feb. 95
-|*
*************************************************************************/
BOOL SwFEShell::EndMark()
@@ -2142,9 +2058,6 @@ BOOL SwFEShell::EndMark()
|*
|* SwFEShell::BreakSelect()
|*
-|* Ersterstellung OM 07. Feb. 95
-|* Letzte Aenderung OM 07. Feb. 95
-|*
*************************************************************************/
void SwFEShell::BreakMark()
@@ -2157,9 +2070,6 @@ void SwFEShell::BreakMark()
|*
|* SwFEShell::GetAnchorId()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. Jan. 95
-|*
*************************************************************************/
short SwFEShell::GetAnchorId() const
@@ -2196,9 +2106,6 @@ short SwFEShell::GetAnchorId() const
|*
|* SwFEShell::ChgAnchor()
|*
-|* Ersterstellung MA 10. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr )
@@ -2223,9 +2130,6 @@ void SwFEShell::ChgAnchor( int eAnchorId, BOOL bSameOnly, BOOL bPosCorr )
|*
|* SwFEShell::DelSelectedObj()
|*
-|* Ersterstellung MA 03. Nov. 92
-|* Letzte Aenderung MA 14. Nov. 95
-|*
*************************************************************************/
void SwFEShell::DelSelectedObj()
@@ -2246,8 +2150,6 @@ void SwFEShell::DelSelectedObj()
|*
|* Beschreibung Fuer die Statuszeile zum Erfragen der aktuellen
|* Verhaeltnisse
-|* Ersterstellung MA 25. Apr. 95
-|* Letzte Aenderung MA 25. Apr. 95
|*
*************************************************************************/
@@ -2305,9 +2207,6 @@ Point SwFEShell::GetObjAbsPos() const
|*
|* SwFEShell::IsGroupSelected()
|*
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 30. May. 96
-|*
*************************************************************************/
BOOL SwFEShell::IsGroupSelected()
@@ -2418,8 +2317,6 @@ bool SwFEShell::IsGroupAllowed() const
|*
|* Beschreibung Die Gruppe bekommt den Anker und das Contactobjekt
|* des ersten in der Selektion
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 23. Apr. 95
|*
*************************************************************************/
@@ -2443,8 +2340,6 @@ void SwFEShell::GroupSelection()
|*
|* Beschreibung Die Einzelobjekte bekommen eine Kopie vom Anker und
|* Contactobjekt der Gruppe.
-|* Ersterstellung MA 30. Jan. 95
-|* Letzte Aenderung MA 01. Feb. 95
|*
*************************************************************************/
@@ -2466,9 +2361,6 @@ void SwFEShell::UnGroupSelection()
|*
|* SwFEShell::MirrorSelection()
|*
-|* Ersterstellung MA 06. Aug. 95
-|* Letzte Aenderung MA 06. Aug. 95
-|*
*************************************************************************/
void SwFEShell::MirrorSelection( BOOL bHorizontal )
@@ -2500,14 +2392,12 @@ static BYTE __READONLY_DATA aChkArr[ 4 ] = {
{
SET_CURR_SHELL( this );
- SwClientIter aIter( *(SwModify*)pFlyFmt );
- SwFlyFrm* pFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm ));
+ SwFlyFrm* pFrm = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *pFlyFmt );
if( pFrm )
{
- ASSERT( pFrm->IsFlyFrm(), "Wrong FrmType" );
if( bSelFrm )
{
- SelectObj( pFrm->Frm().Pos(), 0, ((SwFlyFrm*)pFrm)->GetVirtDrawObj() );
+ SelectObj( pFrm->Frm().Pos(), 0, pFrm->GetVirtDrawObj() );
if( !ActionPend() )
MakeVisible( pFrm->Frm() );
}
@@ -2800,9 +2690,7 @@ int SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
}
return SW_CHAIN_NOT_FOUND;
}
-/* -----------------------------09.08.2002 07:40------------------------------
- ---------------------------------------------------------------------------*/
int SwFEShell::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
return GetDoc()->Chain(rSource, rDest);
@@ -2911,30 +2799,20 @@ long SwFEShell::GetSectionWidth( SwFmt& rFmt ) const
do
{
// Ist es der Gewuenschte?
- if( pSect->GetRegisteredIn() == &rFmt )
+ if( pSect->KnowsFormat( rFmt ) )
return pSect->Frm().Width();
// fuer geschachtelte Bereiche
pSect = pSect->GetUpper()->FindSctFrm();
}
while( pSect );
}
- SwClientIter aIter( rFmt );
- SwClient *pLast = aIter.GoStart();
- while ( pLast )
- {
- if ( pLast->IsA( TYPE(SwFrm) ) )
- {
- SwSectionFrm* pSct = (SwSectionFrm*)pLast;
+ SwIterator<SwSectionFrm,SwFmt> aIter( rFmt );
+ for ( SwSectionFrm* pSct = aIter.First(); pFrm; pFrm = aIter.Next() )
if( !pSct->IsFollow() )
return pSct->Frm().Width();
- }
- pLast = aIter++;
- }
return 0;
}
-/* -----------------------------2002/06/24 15:07------------------------------
- ---------------------------------------------------------------------------*/
void SwFEShell::CreateDefaultShape( UINT16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect,
USHORT nSlotId)
{
@@ -3221,9 +3099,7 @@ bool SwFEShell::IsShapeDefaultHoriTextDirR2L() const
return bRet;
}
-/* -----------------20.03.2003 14:35-----------------
- --------------------------------------------------*/
Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
{
Point aRet(-1, -1);
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 9f48c725dc4b..dd0de07fc125 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -52,9 +52,9 @@
#include <swtblfmt.hxx>
#include <undobj.hxx>
#include <mvsave.hxx>
-// OD 26.08.2003 #i18103#
#include <sectfrm.hxx>
#include <frmtool.hxx>
+#include <switerator.hxx>
//siehe auch swtable.cxx
#define COLFUZZY 20L
@@ -1607,31 +1607,6 @@ SwTwips lcl_CalcWish( const SwLayoutFrm *pCell, long nWish,
return nRet;
}
-/* MA: 20. Sep. 93 wird nicht mehr gebraucht.
-static const SwLayoutFrm *GetPrevCell( const SwLayoutFrm *pCell )
-{
- const SwLayoutFrm *pLay = pCell->GetPrevLayoutLeaf();
- if ( pLay && pLay->IsLayoutFrm() && !pLay->IsTab() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch die Umgebung einer Tab zurueck
- //(naehmlich genau dann, wenn die Zelle noch Vorgaenger hat).
- const SwFrm *pFrm = pLay->Lower();
- while ( pFrm->GetNext() )
- pFrm = pFrm->GetNext();
- pLay = pFrm->IsTabFrm() ? (SwLayoutFrm*)pFrm : 0;
- }
- if ( pLay && pLay->IsTabFrm() )
- {
- //GetPrevLayoutLeaf() liefert ggf. auch Tabellen zurueck die letzte
- //Zelle dieser Tabelle ist das das gesuchte Blatt.
- pLay = ((SwTabFrm*)pLay)->FindLastCntnt()->GetUpper();
- while ( !pLay->IsCellFrm() )
- pLay = pLay->GetUpper();
- }
- return pLay;
-}
-*/
-
void lcl_FindStartEndRow( const SwLayoutFrm *&rpStart,
const SwLayoutFrm *&rpEnd,
const int bChkProtected )
@@ -2309,14 +2284,10 @@ void _FndBox::DelFrms( SwTable &rTable )
for ( USHORT i = nStPos; i <= nEndPos; ++i)
{
SwFrmFmt *pFmt = rTable.GetTabLines()[i]->GetFrmFmt();
- SwClientIter aIter( *pFmt );
- SwClient* pLast = aIter.GoStart();
- if( pLast )
+ SwIterator<SwRowFrm,SwFmt> aIter( *pFmt );
+ for ( SwRowFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- do {
- SwFrm *pFrm = PTR_CAST( SwFrm, pLast );
- if ( pFrm &&
- ((SwRowFrm*)pFrm)->GetTabLine() == rTable.GetTabLines()[i] )
+ if ( pFrm->GetTabLine() == rTable.GetTabLines()[i] )
{
BOOL bDel = TRUE;
SwTabFrm *pUp = !pFrm->GetPrev() && !pFrm->GetNext() ?
@@ -2404,7 +2375,6 @@ void _FndBox::DelFrms( SwTable &rTable )
delete pFrm;
}
}
- } while( 0 != ( pLast = aIter++ ));
}
}
}
@@ -2472,13 +2442,12 @@ void _FndBox::MakeFrms( SwTable &rTable )
--nEndPos;
}
//Jetzt die grosse Einfuegeoperation fuer alle Tabllen.
- SwClientIter aTabIter( *rTable.GetFrmFmt() );
- for ( SwTabFrm *pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aTabIter( *rTable.GetFrmFmt() );
+ for ( SwTabFrm *pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if ( !pTable->IsFollow() )
{
- SwFrm *pSibling = 0;
+ SwRowFrm *pSibling = 0;
SwFrm *pUpperFrm = 0;
int i;
for ( i = rTable.GetTabLines().Count()-1;
@@ -2486,19 +2455,19 @@ void _FndBox::MakeFrms( SwTable &rTable )
{
SwTableLine *pLine = pLineBehind ? pLineBehind :
rTable.GetTabLines()[static_cast<USHORT>(i)];
- SwClientIter aIter( *pLine->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLine->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLine ||
+ pSibling->GetTabLine() != pLine ||
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// --> FME 2005-08-24 #i53647# If !pLineBehind,
// IsInSplitTableRow() should be checked.
( pLineBehind && pSibling->IsInFollowFlowRow() ) ||
(!pLineBehind && pSibling->IsInSplitTableRow() ) ) )
// <--
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
if ( pSibling )
@@ -2546,32 +2515,31 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
(nBfPos != USHRT_MAX ? nBfPos + 1 : 0)) / (nNumber + 1);
//Den Master-TabFrm suchen
- SwClientIter aTabIter( *rTable.GetFrmFmt() );
+ SwIterator<SwTabFrm,SwFmt> aTabIter( *rTable.GetFrmFmt() );
SwTabFrm *pTable;
- for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if( !pTable->IsFollow() )
{
- SwFrm *pSibling = 0;
+ SwRowFrm* pSibling = 0;
SwLayoutFrm *pUpperFrm = 0;
if ( bBehind )
{
if ( pLineBehind )
{
- SwClientIter aIter( *pLineBehind->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLineBehind->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
// only consider row frames associated with pLineBehind:
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLineBehind ||
+ pSibling->GetTabLine() != pLineBehind ||
// only consider row frames that are in pTables Master-Follow chain:
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
// only consider row frames that are not repeated headlines:
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// only consider row frames that are not follow flow rows
pSibling->IsInFollowFlowRow() ) )
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
if ( pSibling )
@@ -2602,16 +2570,16 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
{
SwTableLine* pLine = pLineBefore ? pLineBefore : rTable.GetTabLines()[i];
- SwClientIter aIter( *pLine->GetFrmFmt() );
- pSibling = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwIterator<SwRowFrm,SwFmt> aIter( *pLine->GetFrmFmt() );
+ pSibling = aIter.First();
while ( pSibling && (
// only consider row frames associated with pLineBefore:
- static_cast<SwRowFrm*>(pSibling)->GetTabLine() != pLine ||
+ pSibling->GetTabLine() != pLine ||
// only consider row frames that are in pTables Master-Follow chain:
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
// only consider row frames that are not repeated headlines:
- static_cast<SwRowFrm*>(pSibling)->IsRepeatedHeadline() ||
+ pSibling->IsRepeatedHeadline() ||
// 1. case: pLineBefore == 0:
// only consider row frames that are not follow flow rows
// 2. case: pLineBefore != 0:
@@ -2622,13 +2590,13 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
( pLineBefore && pSibling->IsInSplitTableRow() ) ) ) )
// <--
{
- pSibling = (SwFrm*)aIter.Next();
+ pSibling = aIter.Next();
}
}
pUpperFrm = pSibling->GetUpper();
if ( pLineBefore )
- pSibling = pSibling->GetNext();
+ pSibling = (SwRowFrm*) pSibling->GetNext();
USHORT nMax = nBhPos != USHRT_MAX ?
nBhPos - nCnt :
@@ -2651,8 +2619,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const USHORT nNumber,
( ( !bBehind && ( nBfPos == USHRT_MAX || nBfPos + 1 < nRowsToRepeat ) ) ||
( bBehind && ( ( nBfPos == USHRT_MAX && nRowsToRepeat > 1 ) || nBfPos + 2 < nRowsToRepeat ) ) ) )
{
- for ( pTable = (SwTabFrm*)aTabIter.First( TYPE(SwFrm) ); pTable;
- pTable = (SwTabFrm*)aTabIter.Next() )
+ for ( pTable = aTabIter.First(); pTable; pTable = aTabIter.Next() )
{
if ( pTable->Lower() )
{
@@ -2703,9 +2670,8 @@ BOOL _FndBox::AreLinesToRestore( const SwTable &rTable ) const
{
// ups. sollte unsere zu wiederholende Kopfzeile geloescht worden
// sein??
- SwClientIter aIter( *rTable.GetFrmFmt() );
- for( SwTabFrm* pTable = (SwTabFrm*)aIter.First( TYPE( SwFrm ));
- pTable; pTable = (SwTabFrm*)aIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aIter( *rTable.GetFrmFmt() );
+ for( SwTabFrm* pTable = aIter.First(); pTable; pTable = aIter.Next() )
{
if( pTable->IsFollow() )
{
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 772f776d92c2..0f6c29015dfc 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -216,7 +216,7 @@ BOOL SwGrfNode::ReRead(
if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) )
{
SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
// --> OD 2006-11-03 #i59688#
// do not load linked graphic, if it isn't a new linked graphic.
@@ -310,7 +310,7 @@ BOOL SwGrfNode::ReRead(
if( bReadGrf && bNewGrf )
{
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
return bReadGrf;
@@ -438,7 +438,7 @@ short SwGrfNode::SwapIn( BOOL bWaitForData )
// keine default Bitmap mehr, also neu Painten!
aGrfObj.SetGraphic( Graphic() );
SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
else if( aGrfObj.IsSwappedOut() ) {
@@ -488,7 +488,7 @@ short SwGrfNode::SwapIn( BOOL bWaitForData )
if( 1 == nRet )
{
SwMsgPoolItem aMsg( RES_GRAPHIC_SWAPIN );
- Modify( &aMsg, &aMsg );
+ ModifyNotification( &aMsg, &aMsg );
}
}
else
@@ -1176,7 +1176,7 @@ void SwGrfNode::ApplyInputStream(
mbIsStreamReadOnly = bIsStreamReadOnly;
mbLinkedInputStreamReady = true;
SwMsgPoolItem aMsgHint( RES_LINKED_GRAPHIC_STREAM_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
}
}
}
@@ -1188,7 +1188,7 @@ void SwGrfNode::UpdateLinkWithInputStream()
GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly );
GetLink()->Update();
SwMsgPoolItem aMsgHint( RES_GRAPHIC_ARRIVED );
- Modify( &aMsgHint, &aMsgHint );
+ ModifyNotification( &aMsgHint, &aMsgHint );
// --> OD 2008-06-18 #i88291#
mxInputStream.clear();
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 90c6a44fa239..e51ae5139881 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -104,9 +104,6 @@ namespace sw { namespace mark
virtual ~MarkBase();
- // SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
-
const ::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextContent> & GetXBookmark() const
{ return m_wXBookmark; }
@@ -115,6 +112,9 @@ namespace sw { namespace mark
{ m_wXBookmark = xBkmk; }
protected:
+ // SwClient
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
+
MarkBase(const SwPaM& rPaM,
const ::rtl::OUString& rName);
::boost::scoped_ptr<SwPosition> m_pPos1;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 2f2b81e6ebe9..832126a710ee 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -41,13 +41,13 @@ class SwCellFrm: public SwLayoutFrm
protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
~SwCellFrm();
virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
virtual void CheckDirection( BOOL bVert );
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 5050c5172606..cb8d7baf386c 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -53,7 +53,7 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm
// <--
virtual void MakeAll();
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL& );
@@ -64,7 +64,7 @@ protected:
BOOL MakePrtArea( const SwBorderAttrs & );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
@@ -108,6 +108,9 @@ public:
inline SwCntntFrm* GetNextCntntFrm() const;
inline SwCntntFrm* GetPrevCntntFrm() const;
+ static bool CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, long nBottom, bool bSkipRowSpanCells );
+ void RegisterToNode( SwCntntNode& );
+ static void DelFrms( const SwCntntNode& );
};
inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index a346fd5a9e2d..3f65b63ad22e 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -28,6 +28,7 @@
#define _FLYFRM_HXX
#include "layfrm.hxx"
+#include <list>
class SwPageFrm;
class SwFlyFrmFmt;
@@ -38,8 +39,10 @@ class SwVirtFlyDrawObj;
class SwSpzFrmFmts;
class SwAttrSetChg;
class PolyPolygon;
+class SwFlyDrawContact;
+class SwDrawContact;
+class SwFmt;
-// OD 2004-03-22 #i26791#
#include <anchoredobject.hxx>
//Sucht ausgehend von pOldAnch einen Anker fuer Absatzgebundene Rahmen.
@@ -64,11 +67,14 @@ class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
void InitDrawObj( BOOL bNotify ); //Wird von den CToren gerufen.
void FinitDrawObj(); //Wird vom CTor gerufen.
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
using SwLayoutFrm::CalcRel;
+ sal_uInt32 _GetOrdNumForNewRef( const SwFlyDrawContact* );
+ SwVirtFlyDrawObj* CreateNewRef( SwFlyDrawContact* );
+
protected:
SwFlyFrm *pPrevLink, // Vorgaenger/Nachfolger fuer Verkettung mit
@@ -141,20 +147,17 @@ protected:
*/
virtual void RegisterAtCorrectPage();
- // --> OD 2006-08-10 #i68520#
virtual bool _SetObjTop( const SwTwips _nTop );
virtual bool _SetObjLeft( const SwTwips _nLeft );
- // <--
- // --> OD 2006-10-05 #i70122#
virtual const SwRect GetObjBoundRect() const;
- // <--
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+
public:
// OD 2004-03-23 #i26791#
TYPEINFO();
virtual ~SwFlyFrm();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
// erfrage vom Client Informationen
virtual BOOL GetInfo( SfxPoolItem& ) const;
virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
@@ -282,5 +285,6 @@ public:
@author OD
*/
virtual bool IsFormatPossible() const;
+ static void GetAnchoredObjects( std::list<SwAnchoredObject*>&, const SwFmt& rFmt );
};
#endif
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index a648c1175138..b76aadb871ad 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -132,9 +132,8 @@ public:
SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
SwFlyLayFrm( SwFlyLayFrm& );
-
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
};
//Die Flys, die an einem Cntnt haengen nicht aber im Inhalt
@@ -154,6 +153,7 @@ protected:
@author OD
*/
virtual void RegisterAtCorrectPage();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
// --> OD 2004-06-29 #i28701#
@@ -161,8 +161,6 @@ public:
SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
-
void SetAbsPos( const Point &rNew );
// OD 2004-03-23 #i26791#
@@ -193,6 +191,7 @@ protected:
virtual void NotifyBackground( SwPageFrm *pPage,
const SwRect& rRect, PrepareHint eHint);
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
// --> OD 2004-06-29 #i28701#
@@ -202,7 +201,6 @@ public:
virtual ~SwFlyInCntFrm();
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
void SetRefPoint( const Point& rPoint, const Point &rRelAttr,
const Point &rRelPos );
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 7e34fdd67d2d..4a1e3fef6e79 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -30,6 +30,7 @@
#include "swtypes.hxx" // fuer SwTwips
#include "swrect.hxx"
#include "calbck.hxx" // fuer SwClient
+#include <svl/brdcst.hxx>
class SwLayoutFrm;
class SwRootFrm;
@@ -54,11 +55,9 @@ class SwSelectionList;
struct SwPosition;
struct SwCrsrMoveState;
class SwPrtOptions;
-
-// --> OD 2004-07-06 #i28701#
+class SwFmt;
class SwSortedObjs;
class SwAnchoredObject;
-// <--
//Jeder FrmTyp findet sich hier in einem Bit wieder.
//Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
@@ -239,7 +238,7 @@ enum MakePageType
//typedef SdrObject* SdrObjectPtr;
//SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
-class SwFrm: public SwClient
+class SwFrm: public SwClient, public SfxBroadcaster
{
//Der verkappte Frm
friend class SwFlowFrm;
@@ -344,7 +343,7 @@ class SwFrm: public SwClient
SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
- void _UpdateAttrFrm( SfxPoolItem*, SfxPoolItem*, BYTE & );
+ void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, BYTE & );
SwFrm* _GetIndNext();
void SetDirFlags( BOOL bVert );
@@ -422,8 +421,8 @@ protected:
virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE ) = 0;
- SwModify *GetDep() { return pRegisteredIn; }
- const SwModify *GetDep() const { return pRegisteredIn; }
+ SwModify *GetDep() { return GetRegisteredInNonConst(); }
+ const SwModify *GetDep() const { return GetRegisteredIn(); }
SwFrm( SwModify*, SwFrm* );
@@ -460,6 +459,7 @@ protected:
//Schatten und Umrandung painten
void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const;
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
TYPEINFO(); //Bereits in Basisklasse Client drin.
@@ -602,7 +602,6 @@ public:
//Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
BOOL IsFtnAllowed() const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual void CheckDirection( BOOL bVert );
@@ -910,6 +909,8 @@ public:
// FME 2007-08-30 #i81146# new loop control
void ValidateThisAndAllLowers( const USHORT nStage );
+ bool KnowsFormat( const SwFmt& rFmt ) const;
+ void RegisterToFormat( SwFmt& rFmt );
};
inline BOOL SwFrm::IsInDocBody() const
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index dcc24294ca4b..bfc14d2b8185 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -568,7 +568,7 @@ class SwDeletionChecker
SwDeletionChecker( const SwFrm* pFrm )
: mpFrm( pFrm ),
- mpRegIn( pFrm ? pFrm->GetRegisteredIn() : 0 )
+ mpRegIn( pFrm ? const_cast<SwFrm*>(pFrm)->GetRegisteredIn() : 0 )
{
}
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index b2e6f45f6c67..ee4f1483e1d1 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -51,11 +51,11 @@ class SwNoTxtFrm: public SwCntntFrm
void PaintPicture( OutputDevice*, const SwRect& ) const;
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwNoTxtFrm( SwNoTxtNode * const, SwFrm* );
~SwNoTxtFrm();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual void Paint(const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
virtual BOOL GetCharRect( SwRect &, const SwPosition&,
SwCrsrMoveState* = 0) const;
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 9c0b8af55e95..fc1489c7af3f 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -92,7 +92,7 @@ class SwPageFrm: public SwFtnBossFrm
static const sal_Int8 mnBorderPxWidth;
static const sal_Int8 mnShadowPxWidth;
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
// Anpassen der max. Fussnotenhoehen in den einzelnen Spalten
@@ -191,6 +191,7 @@ class SwPageFrm: public SwFtnBossFrm
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
@@ -251,7 +252,6 @@ public:
virtual BOOL GetCrsrOfst( SwPosition *, Point&,
SwCrsrMoveState* = 0 ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
// erfrage vom Client Informationen
virtual BOOL GetInfo( SfxPoolItem& ) const;
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 18ce78dc41ff..4a8d3607d54b 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -54,13 +54,13 @@ class SwRowFrm: public SwLayoutFrm
protected:
virtual void MakeAll();
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwRowFrm( const SwTableLine &, SwFrm*, bool bInsertContent = true );
~SwRowFrm();
virtual void Cut();
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
//Zum Anmelden der Flys nachdem eine Zeile erzeugt _und_ eingefuegt wurde.
//Muss vom Erzeuger gerufen werden, denn erst nach dem Konstruieren wird
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index f32d5cdba1e3..0c09ca46612b 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -45,7 +45,7 @@ class SwSectionFrm: public SwLayoutFrm, public SwFlowFrm
{
SwSection* pSection;
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
void _Cut( BOOL bRemove );
// Is there a FtnContainer?
@@ -59,6 +59,9 @@ protected:
virtual void MakeAll();
virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
+ virtual void SwClientNotify( SwModify* pModify, USHORT nWhich );
+
public:
SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt!
SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows
@@ -69,7 +72,6 @@ public:
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
inline const SwSectionFrm *GetFollow() const;
inline SwSectionFrm *GetFollow();
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index f5f8975c228e..7fc8b35a5f15 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -102,7 +102,7 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
bool Join();
- void _UpdateAttr( SfxPoolItem*, SfxPoolItem*, BYTE &,
+ void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, BYTE &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
@@ -112,6 +112,7 @@ protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
//Aendert nur die Framesize, nicht die PrtArea-SSize
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das
//Regist Flys rufen!
@@ -127,7 +128,6 @@ public:
inline SwTabFrm *GetFollow();
SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual BOOL GetInfo( SfxPoolItem &rHnt ) const;
virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
virtual void CheckDirection( BOOL bVert );
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 42593b174314..a371f3557985 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -227,6 +227,8 @@ class SwTxtFrm: public SwCntntFrm
xub_StrLen nInsertPos, xub_StrLen nActPos,
xub_StrLen &nChgStart, xub_StrLen &nChgEnd,
xub_StrLen &nInvStart, xub_StrLen &nInvEnd);
+protected:
+ virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
@@ -293,7 +295,6 @@ public:
void PaintExtraData( const SwRect & rRect ) const; //Seitennummer usw.
SwRect Paint();
virtual void Paint( const SwRect &, const SwPrtOptions *pPrintData = NULL ) const;
- virtual void Modify( SfxPoolItem*, SfxPoolItem* );
virtual sal_Bool GetInfo( SfxPoolItem & ) const;
//Layoutorientiertes Cursortravelling: Linker, rechter Rand,
@@ -609,6 +610,8 @@ public:
{
return mnHeightOfLastLine;
}
+
+ static void repaintTextFrames( const SwTxtNode& rNode );
};
/*************************************************************************
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index cc645e674e70..3f85c7fbad62 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -98,24 +98,17 @@
#include <unoframe.hxx>
#include <unotextbodyhf.hxx>
#include <SwStyleNameMapper.hxx>
-/// OD 22.08.2002 #99657#
-/// include definition of class SvxBrushItem and GraphicObject
-/// in order to determine, if background is transparent.
#include <editeng/brshitem.hxx>
#include <svtools/grfmgr.hxx>
-
#include <cmdid.h>
#include <unomid.h>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <svx/svdundo.hxx> // #111827#
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
-// <--
#include <svl/cjkoptions.hxx>
+#include <switerator.hxx>
+#include <ftninfo.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -191,7 +184,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
{
// Klammer, weil im DTOR SwClientIter das Flag bTreeChg zurueck
// gesetzt wird. Unguenstig, wenn das Format vorher zerstoert wird.
- SwClientIter aIter( *pFmt );
+ SwClientIter aIter( *pFmt ); // TODO
SwClient *pLast = aIter.GoStart();
if( pLast )
do {
@@ -225,16 +218,12 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
if ( pNode->IsCntntNode() &&
((SwCntntNode*)pNode)->GetDepends() )
{
- SwClientIter aIter( *(SwCntntNode*)pNode );
- do
+ SwCrsrShell *pShell = SwIterator<SwCrsrShell,SwCntntNode>::FirstElement( *(SwCntntNode*)pNode );
+ if( pShell )
{
- if( aIter()->ISA( SwCrsrShell ) )
- {
- ((SwCrsrShell*)aIter())->ParkCrsr( aIdx );
+ pShell->ParkCrsr( aIdx );
aIdx = nEnd-1;
- break;
- }
- } while ( aIter++ );
+ }
}
aIdx++;
pNode = pDoc->GetNodes()[ aIdx ];
@@ -538,7 +527,7 @@ SwFmtHeader::SwFmtHeader( sal_Bool bOn )
int SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- return ( pRegisteredIn == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
+ return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtHeader&)rAttr).IsActive() );
}
@@ -547,6 +536,11 @@ SfxPoolItem* SwFmtHeader::Clone( SfxItemPool* ) const
return new SwFmtHeader( *this );
}
+void SwFmtHeader::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add(this);
+}
+
// class SwFmtFooter
// Implementierung teilweise inline im hxx
@@ -577,10 +571,15 @@ SwFmtFooter::SwFmtFooter( sal_Bool bOn )
DelHFFormat( this, GetFooterFmt() );
}
+void SwFmtFooter::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add(this);
+}
+
int SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
- return ( pRegisteredIn == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
+ return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
bActive == ((SwFmtFooter&)rAttr).IsActive() );
}
@@ -654,6 +653,21 @@ SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc )
SwFmtPageDesc::~SwFmtPageDesc() {}
+void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rFmt )
+{
+ rFmt.Add(this);
+}
+
+bool SwFmtPageDesc::KnowsPageDesc() const
+{
+ return (GetRegisteredIn() != 0);
+}
+
+bool SwFmtPageDesc::IsRegisteredAt( SwEndNoteInfo* pInfo ) const
+{
+ return (pInfo->GetPageDescDep() == this);
+}
+
int SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
@@ -667,7 +681,7 @@ SfxPoolItem* SwFmtPageDesc::Clone( SfxItemPool* ) const
return new SwFmtPageDesc( *this );
}
-void SwFmtPageDesc::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pDefinedIn )
return;
@@ -2443,7 +2457,7 @@ SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const
TYPEINIT1( SwFrmFmt, SwFmt );
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 )
-void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
SwFmtHeader *pH = 0;
SwFmtFooter *pF = 0;
@@ -2465,13 +2479,13 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if( pH && pH->IsActive() && !pH->GetHeaderFmt() )
{ //Hat er keinen, mach ich ihm einen
SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_HEADER, 0 );
- pFmt->Add( pH );
+ pH->RegisterToFormat( *pFmt );
}
if( pF && pF->IsActive() && !pF->GetFooterFmt() )
{ //Hat er keinen, mach ich ihm einen
SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_FOOTER, 0 );
- pFmt->Add( pF );
+ pF->RegisterToFormat( *pFmt );
}
// MIB 24.3.98: Modify der Basisklasse muss immer gerufen werden, z.B.
@@ -2489,16 +2503,13 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
void SwFrmFmt::DelFrms()
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwIterator<SwFrm,SwFmt> aIter( *this );
+ SwFrm * pLast = aIter.First();
if( pLast )
do {
- if ( pLast->ISA(SwFrm) )
- {
- ((SwFrm*)pLast)->Cut();
+ pLast->Cut();
delete pLast;
- }
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pLast = aIter.Next() ));
}
void SwFrmFmt::MakeFrms()
@@ -2522,7 +2533,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
pFrm = aTmp.NextFrm();
- if( pFrm && pFrm->GetRegisteredIn() != this )
+ if( pFrm && !pFrm->KnowsFormat(*this) )
{
// die Section hat keinen eigenen frame::Frame, also falls
// jemand die tatsaechliche Groe?e braucht, so muss das
@@ -2560,8 +2571,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
SwContact* SwFrmFmt::FindContactObj()
{
- SwClientIter aIter( *this );
- return (SwContact*)aIter.First( TYPE( SwContact ) );
+ return SwIterator<SwContact,SwFmt>::FirstElement( *this );
}
SdrObject* SwFrmFmt::FindSdrObject()
@@ -2590,12 +2600,10 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const
{
//Auch eine Verkettung von Innen nach aussen oder von aussen
//nach innen ist nicht zulaessig.
- SwClientIter aIter( *(SwModify*)this );
- SwFlyFrm *pSFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pSFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*this);
if( pSFly )
{
- SwClientIter aOtherIter( (SwModify&)rFmt );
- SwFlyFrm *pAskFly = (SwFlyFrm*)aOtherIter.First( TYPE(SwFlyFrm) );
+ SwFlyFrm *pAskFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(rFmt);
if( pAskFly )
return pSFly->IsLowerOf( pAskFly );
}
@@ -2677,22 +2685,20 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwFlyFrmFmt, 10, 10 )
SwFlyFrmFmt::~SwFlyFrmFmt()
{
- SwClientIter aIter( *this );
- SwClient * pLast = aIter.GoStart();
+ SwIterator<SwFlyFrm,SwFmt> aIter( *this );
+ SwFlyFrm * pLast = aIter.First();
if( pLast )
do {
- if ( pLast->ISA( SwFlyFrm ) )
delete pLast;
+ } while( 0 != ( pLast = aIter.Next() ));
- } while( 0 != ( pLast = aIter++ ));
-
- pLast = aIter.GoStart();
- if( pLast )
+ SwIterator<SwFlyDrawContact,SwFmt> a2ndIter( *this );
+ SwFlyDrawContact* pC = a2ndIter.First();
+ if( pC )
do {
- if ( pLast->ISA( SwFlyDrawContact ) )
- delete pLast;
+ delete pC;
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pC = a2ndIter.Next() ));
}
//Erzeugen der Frms wenn das Format einen Absatzgebundenen Rahmen beschreibt.
@@ -2735,8 +2741,7 @@ void SwFlyFrmFmt::MakeFrms()
if ( pCNd )
// <--
{
- SwClientIter aIter( *pCNd );
- if ( aIter.First( TYPE(SwFrm) ) )
+ if( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
{
pModify = pCNd;
}
@@ -2769,12 +2774,10 @@ void SwFlyFrmFmt::MakeFrms()
{
SwCntntNode *pCNd =
aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
- SwClientIter aIter( *pCNd );
- do
+ SwIterator<SwFrm,SwCntntNode> aIter( *pCNd );
+ for (SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- if( aIter()->ISA( SwFrm ) )
- {
- pPage = ((SwFrm*)aIter())->FindPageFrm();
+ pPage = pFrm->FindPageFrm();
if( pPage )
{
nPgNum = pPage->GetPhyPageNum();
@@ -2785,7 +2788,6 @@ void SwFlyFrmFmt::MakeFrms()
}
break;
}
- } while ( aIter++ );
}
while ( pPage )
{
@@ -2806,10 +2808,8 @@ void SwFlyFrmFmt::MakeFrms()
if( pModify )
{
- SwClientIter aIter( *pModify );
- for( SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm;
- pFrm = (SwFrm*)aIter.Next() )
+ SwIterator<SwFrm,SwModify> aIter( *pModify );
+ for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
BOOL bAdd = !pFrm->IsCntntFrm() ||
!((SwCntntFrm*)pFrm)->IsFollow();
@@ -2908,8 +2908,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
{
case RES_CONTENT_VISIBLE:
{
- ((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *(SwFlyFrmFmt*)this ).First( TYPE(SwFrm) );
+ ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *this );
}
return sal_False;
@@ -2935,7 +2934,7 @@ void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() );
SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle );
pMasterObject->SetTitle( rTitle );
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -2971,7 +2970,7 @@ void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast
SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
pMasterObject->SetDescription( rDescription );
- Modify( &aOld, &aNew );
+ ModifyNotification( &aOld, &aNew );
}
else
{
@@ -3079,33 +3078,32 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt,
{
// determine 'old' number of anchor frames
sal_uInt32 nOldNumOfAnchFrm( 0L );
- SwClientIter aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
- for( aOldIter.First( TYPE(SwFrm) ); aOldIter(); aOldIter.Next() )
+ SwIterator<SwFrm,SwCntntNode> aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
+ for( SwFrm* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
{
++nOldNumOfAnchFrm;
}
// determine 'new' number of anchor frames
sal_uInt32 nNewNumOfAnchFrm( 0L );
- SwClientIter aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
- for( aNewIter.First( TYPE(SwFrm) ); aNewIter(); aNewIter.Next() )
+ SwIterator<SwFrm,SwCntntNode> aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
+ for( SwFrm* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
{
++nNewNumOfAnchFrm;
}
if ( nOldNumOfAnchFrm != nNewNumOfAnchFrm )
{
// delete existing fly frames except <_pKeepThisFlyFrm>
- SwClientIter aIter( mrFlyFrmFmt );
- SwClient* pLast = aIter.GoStart();
- if ( pLast )
+ SwIterator<SwFrm,SwFmt> aIter( mrFlyFrmFmt );
+ SwFrm* pFrm = aIter.First();
+ if ( pFrm )
{
do {
- SwFrm* pFrm( dynamic_cast<SwFrm*>(pLast) );
- if ( pFrm && pFrm != _pKeepThisFlyFrm )
+ if ( pFrm != _pKeepThisFlyFrm )
{
pFrm->Cut();
delete pFrm;
}
- } while( 0 != ( pLast = aIter++ ));
+ } while( 0 != ( pFrm = aIter.Next() ));
}
// indicate, that re-creation of fly frames necessary
mbAnchorNodeChanged = true;
@@ -3219,7 +3217,7 @@ IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint,
if( !pFly )
{
- pFly = (SwFlyFrm*) SwClientIter( *(SwFrmFmt*)this ).First( TYPE( SwFlyFrm ));
+ pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *this );
if( !pFly )
return 0;
}
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 3a295a80cbb0..5382ef4c9f61 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -45,6 +45,7 @@
#include "bodyfrm.hxx" // ColumnFrms jetzt mit BodyFrm
#include "rootfrm.hxx" // wg. RemoveFtns
#include "sectfrm.hxx" // wg. FtnAtEnd-Flag
+#include "switerator.hxx"
// ftnfrm.cxx:
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes );
@@ -143,8 +144,8 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
if ( pCont->IsBodyFrm() )
pAttrOwner = pCont->FindPageFrm();
SwLayoutFrm *pNeighbourCol = 0;
- SwClientIter aIter( *pAttrOwner->GetFmt() );
- SwLayoutFrm *pNeighbour = (SwLayoutFrm*)aIter.First( TYPE(SwLayoutFrm) );
+ SwIterator<SwLayoutFrm,SwFmt> aIter( *pAttrOwner->GetFmt() );
+ SwLayoutFrm *pNeighbour = aIter.First();
USHORT nAdd = 0;
SwFrm *pCol = pCont->Lower();
@@ -157,7 +158,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
pNeighbourCol != pCont )
break;
pNeighbourCol = 0;
- pNeighbour = (SwLayoutFrm*)aIter.Next();
+ pNeighbour = aIter.Next();
}
BOOL bRet;
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 11f39261ad0b..52ca109c4e91 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -47,8 +47,8 @@
#include "ftnfrm.hxx"
#include "txtftn.hxx"
#include "fmtftn.hxx"
-// OD 09.01.2004 #i11859#
#include <txtfrm.hxx> // SwTxtFrm
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -1683,13 +1683,10 @@ const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurren
GetTabBox()->FindStartOfRowSpan( *pTable, nMax ) :
GetTabBox()->FindEndOfRowSpan( *pTable, nMax );
- SwClientIter aIter( const_cast<SwFrmFmt&>( *rMasterBox.GetFrmFmt()) );
+ SwIterator<SwCellFrm,SwFmt> aIter( *rMasterBox.GetFrmFmt() );
- for ( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for ( SwCellFrm* pMasterCell = aIter.First(); pMasterCell; pMasterCell = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsCellFrm(), "Non-row frame registered in table line" )
- const SwCellFrm* pMasterCell = static_cast<const SwCellFrm*>(pLast);
-
if ( pMasterCell->GetTabBox() == &rMasterBox )
{
const SwTabFrm* pMasterTable = static_cast<const SwTabFrm*>(pMasterCell->GetUpper()->GetUpper());
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 4c35ff65ea27..724eeb2a5b92 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -51,7 +51,6 @@
#include <fmtftn.hxx>
#include <editeng/pgrditem.hxx>
#include <paratr.hxx>
-
#include "ftnfrm.hxx"
#include "txtfrm.hxx"
#include "tabfrm.hxx"
@@ -63,15 +62,11 @@
#include "section.hxx"
#include "dbg_lay.hxx"
#include "lineinfo.hxx"
-// OD 2004-03-02 #106629#
#include <fmtclbl.hxx>
-// --> OD 2004-06-23 #i28701#
#include <sortedobjs.hxx>
#include <layouter.hxx>
-// <--
-// --> OD 2004-10-15 #i26945#
#include <fmtfollowtextflow.hxx>
-// <--
+#include <switerator.hxx>
BOOL SwFlowFrm::bMoveBwdJump = FALSE;
@@ -739,20 +734,13 @@ SwSectionFrm* SwSectionFrm::FindMaster() const
{
ASSERT( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" );
- SwClientIter aIter( *pSection->GetFmt() );
- SwClient *pLast = aIter.GoStart();
-
- while ( pLast )
+ SwIterator<SwSectionFrm,SwFmt> aIter( *pSection->GetFmt() );
+ SwSectionFrm* pSect = aIter.First();
+ while ( pSect )
{
- if ( pLast->ISA( SwFrm ) )
- {
- ASSERT( ((SwFrm*)pLast)->IsSctFrm(),
- "Non-section frame registered in section format" )
- SwSectionFrm* pSect = (SwSectionFrm*)pLast;
if( pSect->GetFollow() == this )
return pSect;
- }
- pLast = aIter++;
+ pSect = aIter.Next();
}
ASSERT( FALSE, "Follow ist lost in Space." );
@@ -763,17 +751,10 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
{
ASSERT( IsFollow(), "SwTabFrm::FindMaster(): !IsFollow" );
- SwClientIter aIter( *GetTable()->GetFrmFmt() );
- SwClient* pLast = aIter.GoStart();
-
- while ( pLast )
+ SwIterator<SwTabFrm,SwFmt> aIter( *GetTable()->GetFrmFmt() );
+ SwTabFrm* pTab = aIter.First();
+ while ( pTab )
{
- if ( pLast->ISA( SwFrm ) )
- {
- ASSERT( ((SwFrm*)pLast)->IsTabFrm(),
- "Non-table frame registered in table format" )
- SwTabFrm* pTab = (SwTabFrm*)pLast;
-
if ( bFirstMaster )
{
//
@@ -797,8 +778,8 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
if ( pTab->GetFollow() == this )
return pTab;
}
- }
- pLast = aIter++;
+
+ pTab = aIter.Next();
}
ASSERT( FALSE, "Follow ist lost in Space." );
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index e8d0493ea7e9..aa121d93bf9e 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -50,27 +50,16 @@
#include <fmtcnct.hxx>
#include <layhelp.hxx>
#include <ndtxt.hxx>
-
-// --> OD 2010-09-14 #i113730#
#include <svx/svdogrp.hxx>
-// <--
-// OD 16.04.2003 #i13147# - for <SwFlyFrm::GetContour(..)>
#include <ndgrf.hxx>
-// OD 29.10.2003 #113049#
#include <tolayoutanchoredobjectposition.hxx>
-// OD 06.11.2003 #i22305#
#include <fmtfollowtextflow.hxx>
-// --> OD 2004-06-28 #i28701#
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
-// <--
-// OD 2004-04-06 #i26791#
#include <anchoredobject.hxx>
-// --> OD 2006-01-31 #i53298#
#include <ndole.hxx>
-// <--
#include <swtable.hxx>
-
+#include <svx/svdpage.hxx>
#include "doc.hxx"
#include "viewsh.hxx"
#include "layouter.hxx"
@@ -99,6 +88,7 @@
#include "sectfrm.hxx"
#include <vcl/svapp.hxx>
#include <vcl/salbtype.hxx> // FRound
+#include "switerator.hxx"
using namespace ::com::sun::star;
@@ -388,15 +378,81 @@ void SwFlyFrm::DeleteCnt()
|* Letzte Aenderung MA 30. Nov. 95
|*
|*************************************************************************/
+
+sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
+{
+ sal_uInt32 nOrdNum( 0L );
+
+ // search for another Writer fly frame registered at same frame format
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pContact->GetFmt() );
+ const SwFlyFrm* pFlyFrm( 0L );
+ for ( pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() )
+ {
+ if ( pFlyFrm != this )
+ {
+ break;
+ }
+ }
+
+ if ( pFlyFrm )
+ {
+ // another Writer fly frame found. Take its order number
+ nOrdNum = pFlyFrm->GetVirtDrawObj()->GetOrdNum();
+ }
+ else
+ {
+ // no other Writer fly frame found. Take order number of 'master' object
+ // --> OD 2004-11-11 #i35748# - use method <GetOrdNumDirect()> instead
+ // of method <GetOrdNum()> to avoid a recalculation of the order number,
+ // which isn't intended.
+ nOrdNum = pContact->GetMaster()->GetOrdNumDirect();
+ // <--
+ }
+
+ return nOrdNum;
+}
+
+SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact )
+{
+ SwVirtFlyDrawObj *pDrawObj = new SwVirtFlyDrawObj( *pContact->GetMaster(), this );
+ pDrawObj->SetModel( pContact->GetMaster()->GetModel() );
+ pDrawObj->SetUserCall( pContact );
+
+ //Der Reader erzeugt die Master und setzt diese, um die Z-Order zu
+ //transportieren, in die Page ein. Beim erzeugen der ersten Referenz werden
+ //die Master aus der Liste entfernt und fuehren von da an ein
+ //Schattendasein.
+ SdrPage* pPg( 0L );
+ if ( 0 != ( pPg = pContact->GetMaster()->GetPage() ) )
+ {
+ const UINT32 nOrdNum = pContact->GetMaster()->GetOrdNum();
+ pPg->ReplaceObject( pDrawObj, nOrdNum );
+ }
+ // --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
+ // into drawing page with correct order number
+ else
+ {
+ pContact->GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
+ InsertObject( pDrawObj, _GetOrdNumForNewRef( pContact ) );
+ }
+ // <--
+ // --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
+ // is in a visible layer.
+ pContact->MoveObjToVisibleLayer( pDrawObj );
+ // <--
+ return pDrawObj;
+}
+
+
+
void SwFlyFrm::InitDrawObj( BOOL bNotify )
{
//ContactObject aus dem Format suchen. Wenn bereits eines existiert, so
//braucht nur eine neue Ref erzeugt werden, anderfalls ist es jetzt an
//der Zeit das Contact zu erzeugen.
- SwClientIter aIter( *GetFmt() );
- SwFlyDrawContact *pContact = (SwFlyDrawContact*)
- aIter.First( TYPE(SwFlyDrawContact) );
+
IDocumentDrawModelAccess* pIDDMA = GetFmt()->getIDocumentDrawModelAccess();
+ SwFlyDrawContact *pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *GetFmt() );
if ( !pContact )
{
// --> OD 2005-08-08 #i52858# - method name changed
@@ -406,7 +462,7 @@ void SwFlyFrm::InitDrawObj( BOOL bNotify )
}
ASSERT( pContact, "InitDrawObj failed" );
// OD 2004-03-22 #i26791#
- SetDrawObj( *(pContact->CreateNewRef( this )) );
+ SetDrawObj( *(CreateNewRef( pContact )) );
//Den richtigen Layer setzen.
// OD 2004-01-19 #110582#
@@ -458,18 +514,19 @@ void SwFlyFrm::FinitDrawObj()
SwFlyDrawContact *pMyContact = 0;
if ( GetFmt() )
{
- SwClientIter aIter( *GetFmt() );
- aIter.GoStart();
- do {
- if ( aIter()->ISA(SwFrm) && (SwFrm*)aIter() != this )
+ bool bContinue = true;
+ SwIterator<SwFrm,SwFmt> aFrmIter( *GetFmt() );
+ for ( SwFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() )
+ if ( pFrm != this )
{
- pMyContact = 0;
+ // don't delete Contact if there is still a Frm
+ bContinue = false;
break;
}
- if( !pMyContact && aIter()->ISA(SwFlyDrawContact) )
- pMyContact = (SwFlyDrawContact*)aIter();
- aIter++;
- } while( aIter() );
+
+ if ( bContinue )
+ // no Frm left, find Contact object to destroy
+ pMyContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *GetFmt() );
}
// OD, OS 2004-03-31 #116203# - clear user call of Writer fly frame 'master'
@@ -617,8 +674,8 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
pLay = pLay->GetUpper();
}
- SwClientIter aIter( rChain );
- SwFlyFrm *pFly = (SwFlyFrm*)aIter.First( TYPE(SwFlyFrm ) );
+ SwIterator<SwFlyFrm,SwFmt> aIter( rChain );
+ SwFlyFrm *pFly = aIter.First();
if ( pLay )
{
while ( pFly )
@@ -633,7 +690,7 @@ SwFlyFrm *SwFlyFrm::FindChainNeighbour( SwFrmFmt &rChain, SwFrm *pAnch )
else if ( pLay == pFly->FindFooterOrHeader() )
break;
}
- pFly = (SwFlyFrm*)aIter.Next();
+ pFly = aIter.Next();
}
}
else if ( pFly )
@@ -736,7 +793,7 @@ BOOL SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
|*
|*************************************************************************/
-void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BYTE nInvFlags = 0;
@@ -804,7 +861,7 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
// <--
}
-void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -2876,3 +2933,11 @@ bool SwFlyFrm::IsFormatPossible() const
return SwAnchoredObject::IsFormatPossible() &&
!IsLocked() && !IsColLocked();
}
+
+void SwFlyFrm::GetAnchoredObjects( std::list<SwAnchoredObject*>& aList, const SwFmt& rFmt )
+{
+ SwIterator<SwFlyFrm,SwFmt> aIter( rFmt );
+ for( SwFlyFrm* pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() )
+ aList.push_back( pFlyFrm );
+}
+
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 7f3dc5e2a027..4a7b816acd73 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -101,7 +101,7 @@ TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm);
|*
|*************************************************************************/
-void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
USHORT nWhich = pNew ? pNew->Which() : 0;
const SwFmtAnchor *pAnch = 0;
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 2d64357e0e20..4b0e0890aa6d 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -123,7 +123,7 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
|* Letzte Aenderung MA 02. Sep. 93
|*
|*************************************************************************/
-void SwFlyInCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyInCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
BOOL bCallPrepare = FALSE;
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 26445d82a9e0..813688e27eb6 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -566,7 +566,7 @@ TYPEINIT1(SwFlyLayFrm,SwFlyFreeFrm);
|*
|*************************************************************************/
-void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
USHORT nWhich = pNew ? pNew->Which() : 0;
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index ae27eb8ed805..f6dedb46a66f 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -28,13 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "doc.hxx"
#include "node.hxx"
#include <docary.hxx>
-
-
#include <fmtanchr.hxx>
#include "flypos.hxx"
#include "frmfmt.hxx"
@@ -43,8 +39,7 @@
#include "flyfrm.hxx"
#include "dflyobj.hxx"
#include "ndindex.hxx"
-
-
+#include "switerator.hxx"
SV_IMPL_OP_PTRARR_SORT( SwPosFlyFrms, SwPosFlyFrmPtr )
@@ -60,22 +55,27 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
}
else if( pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
- SwClientIter aIter( (SwFmt&)*pFmt );
if( RES_FLYFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE( SwFlyFrm) ) )
- nOrdNum = ((SwFlyFrm*)aIter())->GetVirtDrawObj()->GetOrdNum(),
+ SwFlyFrm* pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*pFmt);
+ if( pFly )
+ {
+ nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum();
bFnd = TRUE;
}
+ }
else if( RES_DRAWFRMFMT == pFmt->Which() )
{
// Schauen, ob es ein SdrObject dafuer gibt
- if( aIter.First( TYPE(SwDrawContact) ) )
- nOrdNum = ((SwDrawContact*)aIter())->GetMaster()->GetOrdNum(),
+ SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
+ if( pContact )
+ {
+ nOrdNum = pContact->GetMaster()->GetOrdNum();
bFnd = TRUE;
}
}
+ }
if( !bFnd )
{
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 7da50d2d0dae..8bfa04a13858 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -38,10 +38,8 @@
#include <editeng/lrspitem.hxx>
#include <editeng/boxitem.hxx>
#include <sfx2/printer.hxx>
-// OD 08.01.2004 #i11859#
#include <editeng/lspcitem.hxx>
-
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmthdft.hxx>
@@ -79,18 +77,13 @@
#include "hints.hxx"
#include <layhelp.hxx>
#include <laycache.hxx>
-
#include <rootfrm.hxx>
-
#include "mdiexp.hxx"
#include "statstr.hrc"
-// OD 21.05.2003 #108789#
#include <paratr.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2005-03-04 #b6234250#
#include <objectformatter.hxx>
-// <--
+#include <switerator.hxx>
// ftnfrm.cxx:
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes );
@@ -107,14 +100,7 @@ BOOL StackHack::bLocked = FALSE;
-/*************************************************************************
-|*
-|* SwFrmNotify::SwFrmNotify()
-|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
pFrm( pF ),
@@ -122,9 +108,7 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
aPrt( pF->Prt() ),
bInvaKeep( FALSE ),
bValidSize( pF->GetValidSizeFlag() ),
- // --> OD 2005-07-29 #i49383#
- mbFrmDeleted( false )
- // <--
+ mbFrmDeleted( false ) // #i49383#
{
if ( pF->IsTxtFrm() )
{
@@ -142,23 +126,15 @@ SwFrmNotify::SwFrmNotify( SwFrm *pF ) :
FALSE;
}
-/*************************************************************************
-|*
-|* SwFrmNotify::~SwFrmNotify()
-|*
-|* Ersterstellung MA 27. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFrmNotify::~SwFrmNotify()
{
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
if ( mbFrmDeleted )
{
return;
}
- // <--
SWRECTFN( pFrm )
const BOOL bAbsP = POS_DIFF( aFrm, pFrm->Frm() );
@@ -218,19 +194,18 @@ SwFrmNotify::~SwFrmNotify()
pFrm->SetCompletePaint();
SwFrm* pNxt = pFrm->GetIndNext();
- // --> OD 2005-05-20 #121888# - skip empty section frames
+ // #121888# - skip empty section frames
while ( pNxt &&
pNxt->IsSctFrm() && !static_cast<SwSectionFrm*>(pNxt)->GetSection() )
{
pNxt = pNxt->GetIndNext();
}
- // <--
if ( pNxt )
pNxt->InvalidatePos();
else
{
- // OD 04.11.2002 #104100# - correct condition for setting retouche
+ // #104100# - correct condition for setting retouche
// flag for vertical layout.
if( pFrm->IsRetoucheFrm() &&
(aFrm.*fnRect->fnTopDist)( (pFrm->Frm().*fnRect->fnGetTop)() ) > 0 )
@@ -261,7 +236,7 @@ SwFrmNotify::~SwFrmNotify()
}
else
{
- // OD 13.11.2002 #97597# - consider case that *only* margins between
+ // #97597# - consider case that *only* margins between
// frame and printing area has changed. Then, frame has to be repainted,
// in order to force paint of the margin areas.
if ( !bAbsP && (bChgWidth || bChgHeight) )
@@ -457,15 +432,7 @@ SwFrmNotify::~SwFrmNotify()
}
}
-/*************************************************************************
-|*
-|* SwLayNotify::SwLayNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 03. Jun. 93
-|*
-|*************************************************************************/
-
+/*************************************************************************/
SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
SwFrmNotify( pLayFrm ),
@@ -473,14 +440,7 @@ SwLayNotify::SwLayNotify( SwLayoutFrm *pLayFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwLayNotify::~SwLayNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 13. Jun. 96
-|*
-|*************************************************************************/
+/*************************************************************************/
// OD 2004-05-11 #i28701# - local method to invalidate the position of all
// frames inclusive its floating screen objects, which are lowers of the given
@@ -692,14 +652,7 @@ SwLayNotify::~SwLayNotify()
((SwFlyFrm*)pLay)->AnchorFrm()->InvalidateSize();
}
-/*************************************************************************
-|*
-|* SwFlyNotify::SwFlyNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 26. Aug. 93
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
SwLayNotify( pFlyFrm ),
@@ -711,14 +664,7 @@ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwFlyNotify::~SwFlyNotify()
-|*
-|* Ersterstellung MA 17. Nov. 92
-|* Letzte Aenderung MA 09. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwFlyNotify::~SwFlyNotify()
{
@@ -827,14 +773,7 @@ SwFlyNotify::~SwFlyNotify()
}
}
-/*************************************************************************
-|*
-|* SwCntntNotify::SwCntntNotify()
-|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 16. May. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
SwFrmNotify( pCntntFrm ),
@@ -862,14 +801,7 @@ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
}
}
-/*************************************************************************
-|*
-|* SwCntntNotify::~SwCntntNotify()
-|*
-|* Ersterstellung MA 24. Nov. 92
-|* Letzte Aenderung MA 09. Apr. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCntntNotify::~SwCntntNotify()
{
@@ -1110,17 +1042,7 @@ SwCntntNotify::~SwCntntNotify()
// <--
}
-/*************************************************************************
-|*
-|* InsertCnt
-|*
-|* Beschreibung Hilfsfunktionen, die friend von irgendwem sind, damit
-|* nicht immer gleich 'ne ganze Klasse befreundet werden
-|* muss.
-|* Ersterstellung MA 13. Apr. 93
-|* Letzte Aenderung MA 11. May. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
SwFrm *pFrm, SwPageFrm *pPage )
@@ -1202,13 +1124,12 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
{
- SwClientIter aIter( *pFmt );
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pFmt );
if ( RES_FLYFRMFMT == pFmt->Which() )
{
const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
const SwFlyFrm* pTmpFrm;
- for( pTmpFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm )); pTmpFrm;
- pTmpFrm = (SwFlyFrm*)aIter.Next() )
+ for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
{
if(! pRoot || pRoot == pTmpFrm->getRootFrm() )
return true;
@@ -1216,8 +1137,8 @@ bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
}
else
{
- SwDrawContact *pContact;
- if ( 0 != (pContact = (SwDrawContact*)aIter.First( TYPE(SwDrawContact))))
+ SwDrawContact *pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement(*pFmt);
+ if ( pContact )
return pContact->GetAnchorFrm() != 0;
}
return false;
@@ -1933,14 +1854,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
-/*************************************************************************
-|*
-|* SwBorderAttrs::Ctor, DTor
-|*
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 25. Jan. 97
-|*
-|*************************************************************************/
+/*************************************************************************/
SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor ) :
SwCacheObj( pMod ),
@@ -1993,8 +1907,6 @@ SwBorderAttrs::~SwBorderAttrs()
|* der Sicherheitsabstand wird nur einkalkuliert, wenn Umrandung und/oder
|* Schatten im Spiel sind; er soll vermeiden, dass aufgrund der
|* groben physikalischen Gegebenheiten Raender usw. uebermalt werden.
-|* Ersterstellung MA 19. May. 93
-|* Letzte Aenderung MA 08. Jul. 93
|*
|*************************************************************************/
@@ -2076,8 +1988,6 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
|* Es kann auch ohne Linien ein Abstand erwuenscht sein,
|* dieser wird dann nicht vom Attribut sondern hier
|* beruecksichtigt (bBorderDist, z.B. fuer Zellen).
-|* Ersterstellung MA 21. May. 93
-|* Letzte Aenderung MA 07. Jun. 99
|*
|*************************************************************************/
@@ -2117,14 +2027,7 @@ void SwBorderAttrs::_CalcRightLine()
bRightLine = FALSE;
}
-/*************************************************************************
-|*
-|* SwBorderAttrs::_IsLine()
-|*
-|* Ersterstellung MA 29. Sep. 94
-|* Letzte Aenderung MA 29. Sep. 94
-|*
-|*************************************************************************/
+/*************************************************************************/
void SwBorderAttrs::_IsLine()
{
@@ -2151,9 +2054,6 @@ void SwBorderAttrs::_IsLine()
|* 3. Die Umrandungen links und rechts vor Vorgaenger bzw. Nachfolger
|* sind identisch.
|*
-|* Ersterstellung MA 22. Mar. 95
-|* Letzte Aenderung MA 22. May. 95
-|*
|*************************************************************************/
inline int CmpLines( const SvxBorderLine *pL1, const SvxBorderLine *pL2 )
{
@@ -2319,14 +2219,7 @@ void SwBorderAttrs::_GetBottomLine( const SwFrm& _rFrm )
nGetBottomLine = nRet;
}
-/*************************************************************************
-|*
-|* SwBorderAttrAccess::CTor
-|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 29. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
SwCacheAccess( rCach, (pFrm->IsCntntFrm() ?
@@ -2339,14 +2232,7 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
{
}
-/*************************************************************************
-|*
-|* SwBorderAttrAccess::NewObj, Get
-|*
-|* Ersterstellung MA 20. Mar. 95
-|* Letzte Aenderung MA 20. Mar. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwCacheObj *SwBorderAttrAccess::NewObj()
{
@@ -2359,14 +2245,7 @@ SwBorderAttrs *SwBorderAttrAccess::Get()
return (SwBorderAttrs*)SwCacheAccess::Get();
}
-/*************************************************************************
-|*
-|* SwOrderIter::Ctor
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwOrderIter::SwOrderIter( const SwPageFrm *pPg, BOOL bFlys ) :
pPage( pPg ),
@@ -2375,14 +2254,7 @@ SwOrderIter::SwOrderIter( const SwPageFrm *pPg, BOOL bFlys ) :
{
}
-/*************************************************************************
-|*
-|* SwOrderIter::Top()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Top()
{
@@ -2411,14 +2283,7 @@ const SdrObject *SwOrderIter::Top()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Bottom()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Bottom()
{
@@ -2447,14 +2312,7 @@ const SdrObject *SwOrderIter::Bottom()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Next()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Next()
{
@@ -2484,14 +2342,7 @@ const SdrObject *SwOrderIter::Next()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SwOrderIter::Prev()
-|*
-|* Ersterstellung MA 06. Jan. 95
-|* Letzte Aenderung MA 22. Nov. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
const SdrObject *SwOrderIter::Prev()
{
@@ -2521,14 +2372,7 @@ const SdrObject *SwOrderIter::Prev()
return pCurrent;
}
-/*************************************************************************
-|*
-|* SaveCntnt(), RestoreCntnt()
-|*
-|* Ersterstellung MA 10. Jun. 93
-|* Letzte Aenderung MA 07. Mar. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
//Unterstruktur eines LayoutFrms fuer eine Aktion aufheben und wieder
//restaurieren.
@@ -2864,9 +2708,6 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
|* SqRt() Berechnung der Quadratwurzel, damit die math.lib
|* nicht auch noch dazugelinkt werden muss.
|*
-|* Ersterstellung OK ??
-|* Letzte Aenderung MA 09. Jan. 97
-|*
|*************************************************************************/
ULONG MA_FASTCALL SqRt( BigInt nX )
@@ -2885,14 +2726,7 @@ ULONG MA_FASTCALL SqRt( BigInt nX )
return nErg >= BigInt(SAL_MAX_UINT32) ? ULONG_MAX : (ULONG)nErg;
}
-/*************************************************************************
-|*
-|* InsertNewPage() Einsetzen einer neuen Seite.
-|*
-|* Ersterstellung MA 01. Jul. 93
-|* Letzte Aenderung MA 31. Jul. 95
-|*
-|*************************************************************************/
+/*************************************************************************/
SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
BOOL bOdd, BOOL bInsertEmpty, BOOL bFtn,
@@ -2932,9 +2766,6 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
|* eine Layoutstruktur und melden alle FlyFrms, die einen beliebigen Frm
|* innerhalb der Struktur als Anker haben bei der Seite an.
|*
-|* Ersterstellung MA 08. Jul. 93
-|* Letzte Aenderung MA 07. Jul. 95
-|*
|*************************************************************************/
void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
@@ -3005,8 +2836,6 @@ void RegistFlys( SwPageFrm *pPage, const SwLayoutFrm *pLay )
|*
|* Beschreibung Benachrichtigt den Hintergrund je nach der
|* Veraenderung zwischen altem und neuem Rechteckt.
-|* Ersterstellung MA 18. Jun. 93
-|* Letzte Aenderung MA 06. Jun. 96
|*
|*************************************************************************/
@@ -3087,11 +2916,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
}
}
-/*************************************************************************
-|*
-|* NotifyBackground()
-|*
-|*************************************************************************/
+/*************************************************************************/
void lcl_CheckFlowBack( SwFrm* pFrm, const SwRect &rRect )
{
@@ -3374,11 +3199,7 @@ const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos )
return pFrm;
}
-/*************************************************************************
-|*
-|* IsLowerOf()
-|*
-|*************************************************************************/
+/*************************************************************************/
BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
{
@@ -3526,21 +3347,61 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage )
return pPage;
}
+
+#include <svl/smplhint.hxx>
+class SwFrmHolder : private SfxListener
+{
+ SwFrm* pFrm;
+ bool bSet;
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+public:
+ SwFrmHolder() : pFrm(0), bSet(false) {}
+ void SetFrm( SwFrm* pHold );
+ SwFrm* GetFrm() { return pFrm; }
+ void Reset();
+ bool IsSet() { return bSet; }
+};
+
+void SwFrmHolder::SetFrm( SwFrm* pHold )
+{
+ bSet = true;
+ pFrm = pHold;
+ StartListening(*pHold);
+}
+
+void SwFrmHolder::Reset()
+{
+ if (pFrm)
+ EndListening(*pFrm);
+ bSet = false;
+ pFrm = 0;
+}
+
+void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ {
+ if ( ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DYING && &rBC == pFrm )
+ pFrm = 0;
+ }
+}
+
SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType,
const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm )
{
SwFrm *pMinFrm = 0, *pTmpFrm;
+ SwFrmHolder aHolder;
SwRect aCalcRect;
bool bClientIterChanged = false;
- SwClientIter aIter( rMod );
+ SwIterator<SwFrm,SwModify> aIter( rMod );
do {
pMinFrm = 0;
+ aHolder.Reset();
sal_uInt64 nMinDist = 0;
bClientIterChanged = false;
- for( pTmpFrm = (SwFrm*)aIter.First( TYPE( SwFrm )); pTmpFrm;
- pTmpFrm = (SwFrm*)aIter.Next() )
+ for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
{
if( pTmpFrm->GetType() & nFrmType &&
( !pLayout || pLayout == pTmpFrm->getRootFrm() ) &&
@@ -3549,13 +3410,11 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT co
{
if( pPoint )
{
- // --> FME 2006-02-03 #127369#
- // Set pointer to be watched. If a client is removed from
- // rMod (e.g., by deleting a frame), the bWatchDeleted flag
- // is set at the SwClientIter.
- const bool bWatchClientSet = pMinFrm != 0;
- aIter.SetWatchClient( pMinFrm );
- // <--
+ // watch for Frm being deleted
+ if ( pMinFrm )
+ aHolder.SetFrm( pMinFrm );
+ else
+ aHolder.Reset();
if( bCalcFrm )
{
@@ -3573,14 +3432,13 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT co
pTmpFrm->Calc();
}
- // --> FME 2006-02-03 #127369#
- // The SwClientIter list has changed. Restart.
- // aIter.IsChanged basically checks if pTmpFrm has been
- // deleted. bWatchClientSet && aIter.GetWatchClient()
- // checks if pMinFrm has been deleted.
- // <--
- if( aIter.IsChanged() || ( bWatchClientSet && !aIter.GetWatchClient() ) )
+ // #127369#
+ // aIter.IsChanged checks if the current pTmpFrm has been deleted while
+ // it is the current iterator
+ // FrmHolder watches for deletion of the current pMinFrm
+ if( aIter.IsChanged() || ( aHolder.IsSet() && !aHolder.GetFrm() ) )
{
+ // restart iteration
bClientIterChanged = true;
break;
}
@@ -3734,15 +3592,13 @@ bool SwDeletionChecker::HasBeenDeleted()
if ( !mpFrm || !mpRegIn )
return false;
- SwClientIter aIter( const_cast<SwModify&>(*mpRegIn) );
- const SwClient* pLast = aIter.GoStart();
-
+ SwIterator<SwFrm,SwModify> aIter(*mpRegIn);
+ SwFrm* pLast = aIter.First();
while ( pLast )
{
- if ( pLast->ISA( SwFrm ) && pLast == mpFrm )
+ if ( pLast == mpFrm )
return false;
-
- pLast = aIter++;
+ pLast = aIter.Next();
}
return true;
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index b808f22452af..4ae9c67bacde 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -48,11 +48,10 @@
#include <ndindex.hxx>
#include <sectfrm.hxx>
#include <pam.hxx>
-// --> OD 2005-05-17 #i49383#
#include <objectformatter.hxx>
-// <--
#include "viewopt.hxx"
#include "viewsh.hxx"
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -60,9 +59,6 @@
|* Dokument, dort stehen die Fussnoten gluecklicherweise nach ihrem
|* Index sortiert.
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 13. Dec. 93
-|*
|*************************************************************************/
#define ENDNOTE 0x80000000
@@ -121,9 +117,6 @@ BOOL SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
|* oder eine Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird
|* enthaelt pPage die neue Seite und die Funktion liefert TRUE.
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
@@ -173,9 +166,6 @@ BOOL lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
|* liefert die Spaltennummer, wenn pBoss eine Spalte ist,
|* sonst eine Null (bei Seiten).
|*
-|* Ersterstellung AMA 06. Nov. 98
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
USHORT lcl_ColumnNum( const SwFrm* pBoss )
@@ -210,9 +200,6 @@ USHORT lcl_ColumnNum( const SwFrm* pBoss )
|*
|* SwFtnContFrm::SwFtnContFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 02. Mar. 93
-|*
|*************************************************************************/
@@ -259,8 +246,6 @@ long lcl_Undersize( const SwFrm* pFrm )
|*
|* Beschreibung: "Formatiert" den Frame;
|* Die Fixsize wird hier nicht eingestellt.
-|* Ersterstellung MA 01. Mar. 93
-|* Letzte Aenderung MA 17. Nov. 98
|*
|*************************************************************************/
@@ -349,9 +334,6 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
|*
|* SwFtnContFrm::GrowFrm(), ShrinkFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung AMA 05. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
@@ -525,9 +507,6 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo )
|*
|* SwFtnFrm::SwFtnFrm()
|*
-|* Ersterstellung MA 24. Feb. 93
-|* Letzte Aenderung MA 11. Oct. 93
-|*
|*************************************************************************/
@@ -549,9 +528,6 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt
|*
|* SwFtnFrm::InvalidateNxtFtnCnts()
|*
-|* Ersterstellung MA 29. Jun. 93
-|* Letzte Aenderung MA 29. Jun. 93
-|*
|*************************************************************************/
@@ -619,9 +595,6 @@ SwTwips SwFtnFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|*
|* SwFtnFrm::Cut()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 24. Jul. 95
-|*
|*************************************************************************/
@@ -680,9 +653,6 @@ void SwFtnFrm::Cut()
|*
|* SwFtnFrm::Paste()
|*
-|* Ersterstellung MA 23. Feb. 94
-|* Letzte Aenderung MA 23. Feb. 94
-|*
|*************************************************************************/
@@ -752,8 +722,6 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
|* Beschreibung Liefert das naechste LayoutBlatt in den das
|* Frame gemoved werden kann.
|* Neue Seiten werden nur dann erzeugt, wenn der Parameter TRUE ist.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 09. Nov. 98
|*
|*************************************************************************/
@@ -847,8 +815,6 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
|*
|* Beschreibung Liefert das vorhergehende LayoutBlatt in das der
|* Frame gemoved werden kann.
-|* Ersterstellung MA 16. Nov. 92
-|* Letzte Aenderung AMA 06. Nov. 98
|*
|*************************************************************************/
@@ -980,9 +946,6 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
|*
|* SwFrm::IsFtnAllowed()
|*
-|* Ersterstellung MA 22. Mar. 94
-|* Letzte Aenderung MA 01. Dec. 94
-|*
|*************************************************************************/
@@ -1005,9 +968,6 @@ BOOL SwFrm::IsFtnAllowed() const
|*
|* SwRootFrm::UpdateFtnNums()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung MA 09. Dec. 97
-|*
|*************************************************************************/
@@ -1030,9 +990,6 @@ void SwRootFrm::UpdateFtnNums()
|* RemoveFtns() Entfernen aller Fussnoten (nicht etwa die Referenzen)
|* und Entfernen aller Fussnotenseiten.
|*
-|* Ersterstellung MA 05. Dec. 97
-|* Letzte Aenderung AMA 06. Nov. 98
-|*
|*************************************************************************/
void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes )
@@ -1126,9 +1083,6 @@ void SwRootFrm::RemoveFtns( SwPageFrm *pPage, BOOL bPageOnly, BOOL bEndNotes )
|*
|* SetFtnPageDescs() Seitenvorlagen der Fussnotenseiten aendern
|*
-|* Ersterstellung MA 11. Dec. 97
-|* Letzte Aenderung MA 11. Dec. 97
-|*
|*************************************************************************/
void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote )
@@ -1147,9 +1101,6 @@ void SwRootFrm::CheckFtnPageDescs( BOOL bEndNote )
|*
|* SwFtnBossFrm::MakeFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1176,9 +1127,6 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
|*
|* SwFtnBossFrm::FindFtnCont()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1208,9 +1156,6 @@ SwFtnContFrm *SwFtnBossFrm::FindFtnCont()
|*
|* SwFtnBossFrm::FindNearestFtnCont() Sucht den naechst greifbaren Fussnotencontainer.
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave )
@@ -1243,8 +1188,6 @@ SwFtnContFrm *SwFtnBossFrm::FindNearestFtnCont( BOOL bDontLeave )
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibung Erste Fussnote des Fussnotenbosses suchen.
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 99
|*
|*************************************************************************/
@@ -1332,8 +1275,6 @@ SwFtnFrm *SwFtnBossFrm::FindFirstFtn()
|* SwFtnBossFrm::FindFirstFtn()
|*
|* Beschreibunt Erste Fussnote zum Cnt suchen.
-|* Ersterstellung MA 04. Mar. 93
-|* Letzte Aenderung AMA 28. Oct. 98
|*
|*************************************************************************/
@@ -1375,9 +1316,6 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
|*
|* SwFtnBossFrm::ResetFtn()
|*
-|* Ersterstellung MA 11. May. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1392,13 +1330,10 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
if ( !pNd )
pNd = pCheck->GetFmt()->GetDoc()->
GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
- SwClientIter aIter( *pNd );
- SwClient* pLast = aIter.GoStart();
- while( pLast )
+ SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
+ SwFrm* pFrm = aIter.First();
+ while( pFrm )
{
- if ( pLast->ISA(SwFrm) )
- {
- SwFrm *pFrm = (SwFrm*)pLast;
if( pFrm->getRootFrm() == pCheck->getRootFrm() )
{
SwFrm *pTmp = pFrm->GetUpper();
@@ -1419,8 +1354,8 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
}
}
}
- }
- pLast = ++aIter;
+
+ pFrm = aIter.Next();
}
}
@@ -1428,9 +1363,6 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
|*
|* SwFtnBossFrm::InsertFtn()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1706,9 +1638,6 @@ void SwFtnBossFrm::InsertFtn( SwFtnFrm* pNew )
|*
|* SwFtnBossFrm::AppendFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1941,9 +1870,6 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::FindFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -1958,14 +1884,12 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
if ( !pNd )
return 0;
- SwClientIter aIter( *pNd );
- SwClient *pClient;
- if ( 0 != (pClient = aIter.GoStart()) )
+ SwIterator<SwFrm,SwCntntNode> aIter( *pNd );
+ SwFrm* pFrm = aIter.First();
+ if( pFrm )
do
{
- if ( pClient->IsA( TYPE(SwFrm) ) )
- {
- SwFrm *pFrm = ((SwFrm*)pClient)->GetUpper();
+ pFrm = pFrm->GetUpper();
// #i28500#, #i27243# Due to the endnode collector, there are
// SwFtnFrms, which are not in the layout. Therefore the
// bInfFtn flags are not set correctly, and a cell of FindFtnFrm
@@ -1983,8 +1907,8 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
pFtn = pFtn->GetMaster();
return pFtn;
}
- }
- } while ( 0 != (pClient = aIter++) );
+
+ } while ( 0 != (pFrm = aIter.Next()) );
return 0;
}
@@ -1992,9 +1916,6 @@ SwFtnFrm *SwFtnBossFrm::FindFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr )
|*
|* SwFtnBossFrm::RemoveFtn()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2026,9 +1947,6 @@ void SwFtnBossFrm::RemoveFtn( const SwCntntFrm *pRef, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::ChangeFtnRef()
|*
-|* Ersterstellung MA 25. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2047,9 +1965,6 @@ void SwFtnBossFrm::ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *pAttr,
|*
|* SwFtnBossFrm::CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2115,9 +2030,6 @@ void SwFtnBossFrm::CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_CollectFtns()
|*
-|* Ersterstellung MA 24. Jul. 95
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
inline void FtnInArr( SvPtrarr& rFtnArr, SwFtnFrm* pFtn )
{
@@ -2277,9 +2189,6 @@ void SwFtnBossFrm::_CollectFtns( const SwCntntFrm* _pRef,
|*
|* SwFtnBossFrm::_MoveFtns()
|*
-|* Ersterstellung MA 26. Feb. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2495,9 +2404,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, BOOL bCalc )
|*
|* SwFtnBossFrm::MoveFtns()
|*
-|* Ersterstellung BP 05. Aug. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2543,9 +2449,6 @@ void SwFtnBossFrm::MoveFtns( const SwCntntFrm *pSrc, SwCntntFrm *pDest,
|*
|* SwFtnBossFrm::RearrangeFtns()
|*
-|* Ersterstellung MA 20. Jan. 94
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
@@ -2787,9 +2690,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const BOOL bLock,
|*
|* SwPageFrm::UpdateFtnNum()
|*
-|* Ersterstellung MA 02. Mar. 93
-|* Letzte Aenderung AMA 29. Oct. 98
-|*
|*************************************************************************/
void SwPageFrm::UpdateFtnNum()
@@ -2852,9 +2752,6 @@ void SwPageFrm::UpdateFtnNum()
|*
|* SwFtnBossFrm::SetFtnDeadLine()
|*
-|* Ersterstellung MA 02. Aug. 93
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
@@ -2889,9 +2786,6 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
|*
|* SwFtnBossFrm::GetVarSpace()
|*
-|* Ersterstellung MA 03. Apr. 95
-|* Letzte Aenderung MA 16. Nov. 98
-|*
|*************************************************************************/
SwTwips SwFtnBossFrm::GetVarSpace() const
{
@@ -2977,9 +2871,6 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
|* gibt und die Fussnoten nicht vom Bereich eingesammelt werden, ist ein Adjust..,
|* ansonsten ein Grow/Shrink notwendig.
|*
-|* Ersterstellung AMA 09. Dec 98
-|* Letzte Aenderung AMA 09. Dec 98
-|*
|*************************************************************************/
BYTE SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
@@ -3015,9 +2906,6 @@ BYTE SwFtnBossFrm::_NeighbourhoodAdjustment( const SwFrm* ) const
|*
|* SwPageFrm::SetColMaxFtnHeight()
|*
-|* Ersterstellung AMA 29. Oct 98
-|* Letzte Aenderung AMA 29. Oct 98
-|*
|*************************************************************************/
void SwPageFrm::SetColMaxFtnHeight()
{
@@ -3037,9 +2925,6 @@ void SwPageFrm::SetColMaxFtnHeight()
|*
|* SwLayoutFrm::MoveLowerFtns
|*
-|* Ersterstellung MA 01. Sep. 94
-|* Letzte Aenderung MA 05. Sep. 95
-|*
|*************************************************************************/
@@ -3135,9 +3020,6 @@ BOOL SwLayoutFrm::MoveLowerFtns( SwCntntFrm *pStart, SwFtnBossFrm *pOldBoss,
|*
|* SwLayoutFrm::MoveFtnCntFwd()
|*
-|* Ersterstellung MA 24. Nov. 94
-|* Letzte Aenderung MA 15. Jun. 95
-|*
|*************************************************************************/
@@ -3277,9 +3159,6 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
|*
|* class SwSaveFtnHeight
|*
-|* Ersterstellung MA 19. Jan. 94
-|* Letzte Aenderung MA 19. Jan. 94
-|*
|*************************************************************************/
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 8155c7503cc8..88659af6f74c 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -710,7 +710,7 @@ void SwPageFrm::PrepareHeader()
if ( !pLay )
return;
- const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader();
+ const SwFmtHeader &rH = ((SwFrmFmt*)GetRegisteredIn())->GetHeader();
const ViewShell *pSh = getRootFrm()->GetCurrShell();
const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
@@ -759,7 +759,7 @@ void SwPageFrm::PrepareFooter()
if ( !pLay )
return;
- const SwFmtFooter &rF = ((SwFrmFmt*)pRegisteredIn)->GetFooter();
+ const SwFmtFooter &rF = ((SwFrmFmt*)GetRegisteredIn())->GetFooter();
while ( pLay->GetNext() )
pLay = (SwLayoutFrm*)pLay->GetNext();
diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
index 2b980612a98c..7ad0464a75c8 100644
--- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
+++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
@@ -29,11 +29,10 @@
#include "precompiled_sw.hxx"
#include <movedfwdfrmsbyobjpos.hxx>
#include <txtfrm.hxx>
-// --> OD 2004-10-05 #i26945#
#include <rowfrm.hxx>
#include <pagefrm.hxx>
#include <ndtxt.hxx>
-// <--
+#include <switerator.hxx>
SwMovedFwdFrmsByObjPos::SwMovedFwdFrmsByObjPos()
{
@@ -86,10 +85,8 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm
const NodeMapEntry& rEntry = *(aIter);
if ( rEntry.second >= nPageNumOfRow )
{
- SwClientIter aFrmIter( *const_cast<SwTxtNode*>( rEntry.first ) );
- for( SwTxtFrm* pTxtFrm = (SwTxtFrm*)aFrmIter.First( TYPE(SwTxtFrm) );
- pTxtFrm;
- pTxtFrm = (SwTxtFrm*)aFrmIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *rEntry.first );
+ for( SwTxtFrm* pTxtFrm = aFrmIter.First(); pTxtFrm; pTxtFrm = (SwTxtFrm*)aFrmIter.Next() )
{
// --> OD 2004-12-03 #115759# - assure that found text frame
// is the first one.
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 697f4abfaa96..1daf7f8554f8 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -555,7 +555,7 @@ SwRootFrm::~SwRootFrm()
pTurbo = 0;
if(pBlink)
pBlink->FrmDelete( this );
- ((SwFrmFmt*)pRegisteredIn)->GetDoc()->DelFrmFmt( (SwFrmFmt*)pRegisteredIn );
+ static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
delete pDestroy;
pDestroy = 0;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 828729d74a53..d49ea386303f 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -74,9 +74,8 @@
#include "poolfmt.hxx"
#include <editeng/frmdiritem.hxx>
#include <swfntcch.hxx> // SwFontAccess
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-
+#include <switerator.hxx>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -456,12 +455,10 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
}
else
{
- SwClientIter aIter( *pFmt );
- SwClient *pTmp = aIter.First( TYPE(SwFrm) );
- SwFlyFrm *pFly;
- if ( pTmp )
+ SwIterator<SwFlyFrm,SwFmt> aIter( *pFmt );
+ SwFlyFrm *pFly = aIter.First();
+ if ( pFly)
{
- pFly = (SwFlyFrm*)pTmp;
if( pFly->GetAnchorFrm() )
pFly->AnchorFrm()->RemoveFly( pFly );
}
@@ -531,7 +528,7 @@ void SwPageFrm::PreparePage( BOOL bFtn )
|* Letzte Aenderung MA 03. Mar. 96
|*
|*************************************************************************/
-void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
@@ -578,7 +575,7 @@ void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -1677,13 +1674,13 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
//Umhaengen kann er sich selbst, indem wir ihm
//einfach ein Modify mit seinem AnkerAttr schicken.
#ifndef DBG_UTIL
- rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
+ rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch );
#else
const sal_uInt32 nCnt = pPage->GetSortedObjs()->Count();
- rFmt.SwModify::Modify( 0, (SwFmtAnchor*)&rAnch );
+ rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch );
ASSERT( !pPage->GetSortedObjs() ||
nCnt != pPage->GetSortedObjs()->Count(),
- "Kann das Obj nicht umhaengen." );
+ "Object couldn't be reattached!" );
#endif
--i;
}
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 0120fb8fb990..87f9259b8292 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -50,6 +50,7 @@
#include <frmtool.hxx>
#include <doc.hxx> // fuer GetAttrPool
#include <poolfmt.hxx>
+#include <switerator.hxx>
/*************************************************************************
|*
@@ -257,20 +258,18 @@ void SwPageDesc::RegisterChange()
nRegHeight = 0;
{
- SwClientIter aIter( GetMaster() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( GetMaster() );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwFrm*)pLast)->IsPageFrm() )
+ if( pLast->IsPageFrm() )
((SwPageFrm*)pLast)->PrepareRegisterChg();
}
}
{
- SwClientIter aIter( GetLeft() );
- for( SwClient* pLast = aIter.First(TYPE(SwFrm)); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( GetLeft() );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwFrm*)pLast)->IsPageFrm() )
+ if( pLast->IsPageFrm() )
((SwPageFrm*)pLast)->PrepareRegisterChg();
}
}
@@ -288,10 +287,10 @@ void SwPageDesc::RegisterChange()
*************************************************************************/
-void SwPageDesc::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- SwModify::Modify( pOld, pNew );
+ NotifyClients( pOld, pNew );
if ( (RES_ATTRSET_CHG == nWhich) || (RES_FMT_CHG == nWhich)
|| isCHRATR(nWhich) || (RES_PARATR_LINESPACING == nWhich) )
@@ -343,14 +342,12 @@ const SwFrmFmt* SwPageDesc::GetPageFmtOfNode( const SwNode& rNd,
const SwPageDesc* pPd = bCheckForThisPgDc ? this :
((SwPageFrm*)pChkFrm)->GetPageDesc();
pRet = &pPd->GetMaster();
- ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd,
- "Falcher Node fuers erkennen des Seitenformats" );
+ ASSERT( ((SwPageFrm*)pChkFrm)->GetPageDesc() == pPd, "Wrong node for detection of page format!" );
// an welchem Format haengt diese Seite?
- if( pRet != pChkFrm->GetRegisteredIn() )
+ if( !pChkFrm->KnowsFormat(*pRet) )
{
pRet = &pPd->GetLeft();
- ASSERT( pRet == pChkFrm->GetRegisteredIn(),
- "Falcher Node fuers erkennen des Seitenformats" );
+ ASSERT( pChkFrm->KnowsFormat(*pRet), "Wrong node for detection of page format!" );
}
}
else
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 2b1a1a5373bb..9ccf2f44061f 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -29,10 +29,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/text/HoriOrientation.hpp>
-
-
#include <hintids.hxx>
-
#include <vcl/sound.hxx>
#include <tools/poly.hxx>
#define _SVSTDARR_LONGS
@@ -44,14 +41,11 @@
#include <editeng/prntitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/shaditem.hxx>
-// --> collapsing borders FME 2005-05-27 #i29550#
#include <svx/framelink.hxx>
-// <--
#include <vcl/graph.hxx>
#include <svx/svdpagv.hxx>
#include <tgrditem.hxx>
-
-
+#include <switerator.hxx>
#include <fmtsrnd.hxx>
#include <fmtclds.hxx>
#include <tools/shl.hxx>
@@ -83,35 +77,23 @@
#include <ptqueue.hxx>
#include <noteurl.hxx>
#include <virtoutp.hxx>
-#ifndef _LINEINFO_HXX
#include <lineinfo.hxx>
-#endif
#include <dbg_lay.hxx>
#include <accessibilityoptions.hxx>
-// OD 20.12.2002 #94627#
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-// OD 28.02.2003 #b4779636#, #107692#
#include <swtable.hxx>
-// OD 02.07.2003 #108784#
#include <svx/svdogrp.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-
-// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
-
#include <ndole.hxx>
#include <svtools/chartprettypainter.hxx>
-
#include <PostItMgr.hxx>
#include <tools/color.hxx>
+#include <vcl/svapp.hxx>
+
#define COL_NOTES_SIDEPANE RGB_COLORDATA(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER RGB_COLORDATA(200,200,200)
#define COL_NOTES_SIDEPANE_SCROLLAREA RGB_COLORDATA(230,230,220)
-#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
@@ -6614,10 +6596,10 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
{
Graphic aRet;
//irgendeinen Fly suchen!
- SwClientIter aIter( *this );
- SwClient *pFirst = aIter.First( TYPE(SwFrm) );
+ SwIterator<SwFrm,SwFmt> aIter( *this );
+ SwFrm *pFirst = aIter.First();
ViewShell *pSh;
- if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->getRootFrm()->GetCurrShell()) )
+ if ( pFirst && 0 != ( pSh = pFirst->getRootFrm()->GetCurrShell()) )
{
ViewShell *pOldGlobal = pGlobalShell;
pGlobalShell = pSh;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index b64ab79a3e37..32aed8691795 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2442,7 +2442,7 @@ void SwSectionFrm::CalcEndAtEndFlag()
|*
|*************************************************************************/
-void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BYTE nInvFlags = 0;
@@ -2477,7 +2477,14 @@ void SwSectionFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwSectionFrm::SwClientNotify( SwModify*, USHORT nWhich )
+{
+ if ( nWhich == RES_OBJECTDYING )
+ SwSectionFrm::MoveCntntAndDelete( this, TRUE );
+}
+
+
+void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx
index 4d487a2506ad..fe981d2e3b0a 100644
--- a/sw/source/core/layout/softpagebreak.cxx
+++ b/sw/source/core/layout/softpagebreak.cxx
@@ -35,12 +35,12 @@
#include "frmfmt.hxx"
#include "rowfrm.hxx"
#include "tabfrm.hxx"
+#include "switerator.hxx"
void SwTxtNode::fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const
{
- SwClientIter aIter( const_cast<SwTxtNode&>(*this) );
- for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) );
- pFrm; pFrm = (const SwTxtFrm*)aIter.Next() )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// No soft page break in header or footer
if( pFrm->FindFooterOrHeader() || pFrm->IsInFly() )
@@ -110,13 +110,12 @@ bool SwTableLine::hasSoftPageBreak() const
// No soft page break for sub tables
if( GetUpper() || !GetFrmFmt() )
return false;
- SwClientIter aIter( *GetFrmFmt() );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast;
- pLast = aIter.Next() )
+ SwIterator<SwRowFrm,SwFmt> aIter( *GetFrmFmt() );
+ for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
+ if( pLast->GetTabLine() == this )
{
- const SwTabFrm* pTab = static_cast<SwRowFrm*>(pLast)->FindTabFrm();
+ const SwTabFrm* pTab = pLast->FindTabFrm();
// No soft page break for
// tables with prevs, i.e. if the frame is not the first in its layout frame
// tables in footer or header
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 33e971b63e85..a2a3aab06f26 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
+#include <ftnfrm.hxx>
#include <pagefrm.hxx>
#include <rootfrm.hxx>
#include <cntfrm.hxx>
@@ -53,10 +53,9 @@
#include <fmtclds.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
-
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
#include <hints.hxx>
+#include <switerator.hxx>
// No inline cause we need the function pointers
long SwFrm::GetTopMargin() const
@@ -216,7 +215,7 @@ void SwFrm::SetRightLeftMargins( long nRight, long nLeft)
const USHORT nMinVertCellHeight = 1135;
-/*-----------------11.9.2001 11:11------------------
+/*-----------------------------------
* SwFrm::CheckDirChange(..)
* checks the layout direction and
* invalidates the lower frames rekursivly, if necessary.
@@ -315,7 +314,7 @@ void SwFrm::CheckDirChange()
}
}
-/*-----------------13.9.2002 11:11------------------
+/*-----------------------------------
* SwFrm::GetFrmAnchorPos(..)
* returns the position for anchors based on frame direction
* --------------------------------------------------*/
@@ -360,12 +359,8 @@ Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const
|*
|* SwFrm::~SwFrm()
|*
-|* Ersterstellung MA 02. Mar. 94
-|* Letzte Aenderung MA 25. Jun. 95
-|*
|*************************************************************************/
-
SwFrm::~SwFrm()
{
// accessible objects for fly and cell frames have been already disposed
@@ -417,8 +412,6 @@ SwFrm::~SwFrm()
/*************************************************************************
|*
|* SwLayoutFrm::SetFrmFmt()
-|* Ersterstellung MA 22. Apr. 93
-|* Letzte Aenderung MA 02. Nov. 94
|*
|*************************************************************************/
@@ -430,7 +423,7 @@ void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew )
SwFmtChg aOldFmt( GetFmt() );
pNew->Add( this );
SwFmtChg aNewFmt( pNew );
- Modify( &aOldFmt, &aNewFmt );
+ ModifyNotification( &aOldFmt, &aNewFmt );
}
}
@@ -449,7 +442,7 @@ SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) :
SwCntntFrm::~SwCntntFrm()
{
SwCntntNode* pCNd;
- if( 0 != ( pCNd = PTR_CAST( SwCntntNode, pRegisteredIn )) &&
+ if( 0 != ( pCNd = PTR_CAST( SwCntntNode, GetRegisteredIn() )) &&
!pCNd->GetDoc()->IsInDtor() )
{
//Bei der Root abmelden wenn ich dort noch im Turbo stehe.
@@ -486,13 +479,70 @@ SwCntntFrm::~SwCntntFrm()
}
}
+void SwCntntFrm::RegisterToNode( SwCntntNode& rNode )
+{
+ rNode.Add( this );
+}
+
+void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
+{
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( rNode );
+ for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ {
+ // --> OD 2005-12-01 #i27138#
+ // notify accessibility paragraphs objects about changed
+ // CONTENT_FLOWS_FROM/_TO relation.
+ // Relation CONTENT_FLOWS_FROM for current next paragraph will change
+ // and relation CONTENT_FLOWS_TO for current previous paragraph will change.
+ if ( pFrm->IsTxtFrm() )
+ {
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
+ if ( pViewShell && pViewShell->GetLayout() &&
+ pViewShell->GetLayout()->IsAnyShellAccessible() )
+ {
+ pViewShell->InvalidateAccessibleParaFlowRelation(
+ dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
+ dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
+ }
+ }
+ // <--
+ if( pFrm->HasFollow() )
+ pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
+ if( pFrm->IsFollow() )
+ {
+ SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
+ pMaster->SetFollow( pFrm->GetFollow() );
+ pFrm->_SetIsFollow( FALSE );
+ }
+ pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
+ //Andernfalls kann es sein, dass ein Follow
+ //vor seinem Master zerstoert wird, der Master
+ //greift dann ueber den ungueltigen
+ //Follow-Pointer auf fremdes Memory zu.
+ //Die Kette darf hier zerknauscht werden, weil
+ //sowieso alle zerstoert werden.
+ if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() &&
+ !pFrm->GetIndPrev() )
+ {
+ SwFtnFrm *pFtn = pFrm->FindFtnFrm();
+ ASSERT( pFtn, "You promised a FtnFrm?" );
+ SwCntntFrm* pCFrm;
+ if( !pFtn->GetFollow() && !pFtn->GetMaster() &&
+ 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() )
+ {
+ ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" );
+ ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE );
+ }
+ }
+ pFrm->Cut();
+ delete pFrm;
+ }
+}
+
/*************************************************************************
|*
|* SwLayoutFrm::~SwLayoutFrm
|*
-|* Ersterstellung AK 28-Feb-1991
-|* Letzte Aenderung MA 11. Jan. 95
-|*
|*************************************************************************/
@@ -584,9 +634,6 @@ SwLayoutFrm::~SwLayoutFrm()
|*
|* SwFrm::PaintArea()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The paintarea is the area, in which the content of a frame is allowed
|* to be displayed. This region could be larger than the printarea (Prt())
|* of the upper, it includes e.g. often the margin of the page.
@@ -687,9 +734,6 @@ const SwRect SwFrm::PaintArea() const
|*
|* SwFrm::UnionFrm()
|*
-|* Created AMA 08/22/2000
-|* Last change AMA 08/23/2000
-|*
|* The unionframe is the framearea (Frm()) of a frame expanded by the
|* printarea, if there's a negative margin at the left or right side.
|*
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 8e8c573b6cf3..1297b12c0fd2 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -45,7 +45,6 @@
#include "viewopt.hxx"
#include "hints.hxx"
#include "dbg_lay.hxx"
-
#include <ftnidx.hxx>
#include <svl/itemiter.hxx>
#include <docary.hxx>
@@ -53,9 +52,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brshitem.hxx>
-// --> collapsing borders FME 2005-05-27 #i29550#
#include <editeng/boxitem.hxx>
-// <--
#include <vcl/outdev.hxx>
#include <fmtlsplt.hxx>
#include <fmtrowsplt.hxx>
@@ -65,7 +62,6 @@
#include <fmtfsize.hxx>
#include <swtblfmt.hxx>
#include <ndtxt.hxx>
-
#include "tabfrm.hxx"
#include "rowfrm.hxx"
#include "cellfrm.hxx"
@@ -73,15 +69,11 @@
#include "txtfrm.hxx" //HasFtn()
#include "htmltbl.hxx"
#include "sectfrm.hxx" //SwSectionFrm
-// OD 30.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
-// --> OD 2004-06-28 #i28701#
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
-// <--
-// --> OD 2004-10-05 #i26945#
#include <layouter.hxx>
-// <--
+#include <switerator.hxx>
extern void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
SwFrm *pFrm, SwPageFrm *pPage );
@@ -219,8 +211,6 @@ void SwTabFrm::RegistFlys()
|* Some prototypes
|*************************************************************************/
void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom );
-bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm *pLay, const SwLayoutFrm* pDontLeave,
- long nBottom, bool bSkipRowSpanCells );
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom );
BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva );
// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
@@ -1543,7 +1533,7 @@ void lcl_InvalidateAllLowersPrt( SwLayoutFrm* pLayFrm )
}
// <-- collapsing
-bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
+bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
long nBottom, bool bSkipRowSpanCells )
{
if ( !pLay )
@@ -1596,7 +1586,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
ASSERT( !pCnt->IsTxtFrm() ||
pCnt->IsValid() ||
static_cast<SwTxtFrm*>(pCnt)->IsJoinLocked(),
- "<lcl_CalcLowers(..)> - text frame invalid and not locked." );
+ "<SwCntntFrm::CalcLowers(..)> - text frame invalid and not locked." );
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
// --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame to
@@ -1621,7 +1611,7 @@ bool MA_FASTCALL lcl_CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeav
}
#if OSL_DEBUG_LEVEL > 1
- ASSERT( false, "LoopControl in lcl_CalcLowers" )
+ ASSERT( false, "LoopControl in SwCntntFrm::CalcLowers" )
#endif
}
}
@@ -1728,7 +1718,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
{
// --> OD 2004-11-23 #115759# - force another format of the
// lowers, if at least one of it was invalid.
- bCheck = lcl_CalcLowers( &rRow, rRow.GetUpper(), nBottom, true );
+ bCheck = SwCntntFrm::CalcLowers( &rRow, rRow.GetUpper(), nBottom, true );
// <--
// NEW TABLES
@@ -1748,7 +1738,7 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
SwCellFrm& rToRecalc = 0 == i ?
const_cast<SwCellFrm&>(pCellFrm->FindStartEndOfRowSpanCell( true, true )) :
*pCellFrm;
- bCheck |= lcl_CalcLowers( &rToRecalc, &rToRecalc, nBottom, false );
+ bCheck |= SwCntntFrm::CalcLowers( &rToRecalc, &rToRecalc, nBottom, false );
}
pCellFrm = static_cast<SwCellFrm*>(pCellFrm->GetNext());
@@ -3271,7 +3261,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 06. Dec. 96
|*
|*************************************************************************/
-void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BYTE nInvFlags = 0;
BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
@@ -3336,7 +3326,7 @@ void SwTabFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
@@ -3921,7 +3911,7 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage )
|* Letzte Aenderung MA 12. Nov. 97
|*
|*************************************************************************/
-void SwRowFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
@@ -4401,13 +4391,9 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
// If we found a 'previous' row, we look for the appropriate row frame:
if ( pPrevTabLine )
{
- SwClientIter aIter( *pPrevTabLine->GetFrmFmt() );
- SwClient* pLast;
- for ( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwRowFrm,SwFmt> aIter( *pPrevTabLine->GetFrmFmt() );
+ for ( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() )
{
- ASSERT( ((SwFrm*)pLast)->IsRowFrm(),
- "Non-row frame registered in table line" )
- SwRowFrm* pRow = (SwRowFrm*)pLast;
// --> OD 2004-11-23 #115759# - do *not* take repeated
// headlines, because during split of table it can be
// invalid and thus can't provide correct border values.
@@ -5441,7 +5427,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
|*
|*************************************************************************/
-void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BOOL bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
const SfxPoolItem *pItem = 0;
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 5a8c8b00d7c9..7b8783b30273 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -118,6 +118,16 @@ SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
bCompletePaint = bInfInvalid = TRUE;
}
+bool SwFrm::KnowsFormat( const SwFmt& rFmt ) const
+{
+ return GetRegisteredIn() == &rFmt;
+}
+
+void SwFrm::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse )
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
@@ -232,15 +242,8 @@ void SwTxtFrm::CheckDirection( BOOL bVert )
sal_True, bBrowseMode );
}
-/*************************************************************************
-|*
-|* SwFrm::Modify()
-|*
-|* Ersterstellung AK 01-Mar-1991
-|* Letzte Aenderung MA 20. Jun. 96
-|*
-|*************************************************************************/
-void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+/*************************************************************************/
+void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BYTE nInvFlags = 0;
@@ -289,7 +292,7 @@ void SwFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwFrm::_UpdateAttrFrm( SfxPoolItem *pOld, SfxPoolItem *pNew,
+void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
BYTE &rInvFlags )
{
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -2122,7 +2125,7 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|* Letzte Aenderung MA 13. Oct. 95
|*
|*************************************************************************/
-void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
+void SwCntntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
BYTE nInvFlags = 0;
@@ -2195,7 +2198,7 @@ void SwCntntFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
}
}
-void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
+void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
BYTE &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
{
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 0509c14f5733..a67cca8c1796 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -83,7 +83,7 @@ SwFmtDrop::SwFmtDrop()
SwFmtDrop::SwFmtDrop( const SwFmtDrop &rCpy )
: SfxPoolItem( RES_PARATR_DROP ),
- SwClient( rCpy.pRegisteredIn ),
+ SwClient( rCpy.GetRegisteredInNonConst() ),
pDefinedIn( 0 ),
nDistance( rCpy.GetDistance() ),
nReadFmt( rCpy.nReadFmt ),
@@ -104,8 +104,8 @@ SwFmtDrop::~SwFmtDrop()
void SwFmtDrop::SetCharFmt( SwCharFmt *pNew )
{
//Ummelden
- if ( pRegisteredIn )
- pRegisteredIn->Remove( this );
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
if(pNew)
pNew->Add( this );
nReadFmt = USHRT_MAX;
@@ -113,26 +113,19 @@ void SwFmtDrop::SetCharFmt( SwCharFmt *pNew )
-void SwFmtDrop::Modify( SfxPoolItem *, SfxPoolItem * )
+void SwFmtDrop::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
if( pDefinedIn )
{
if( !pDefinedIn->ISA( SwFmt ))
- pDefinedIn->Modify( this, this );
+ pDefinedIn->ModifyNotification( this, this );
else if( pDefinedIn->GetDepends() &&
!pDefinedIn->IsModifyLocked() )
{
// selbst den Abhaengigen vom Format bescheid sagen. Das
// Format selbst wuerde es nicht weitergeben, weil es ueber
// die Abpruefung nicht hinauskommt.
- SwClientIter aIter( *pDefinedIn );
- SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
- do {
- pLast->Modify( this, this );
- if( !pDefinedIn->GetDepends() ) // Baum schon Weg ??
- break;
- } while( 0 != ( pLast = aIter++ ));
+ pDefinedIn->ModifyBroadcast( this, this );
}
}
}
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 2f7d65cf1e1d..7c3bc0d44f28 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -46,6 +46,7 @@
#include <editeng/boxitem.hxx>
#include <editeng/protitem.hxx>
#include <swtblfmt.hxx>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -591,11 +592,9 @@ SwBoxSelection* SwTable::CollectBoxSelection( const SwPaM& rPam ) const
void lcl_InvalidateCellFrm( const SwTableBox& rBox )
{
- SwClientIter aIter( *rBox.GetFrmFmt() );
- SwClient* pLast;
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwCellFrm,SwFmt> aIter( *rBox.GetFrmFmt() );
+ for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() )
{
- SwCellFrm *pCell = (SwCellFrm*)pLast;
if( pCell->GetTabBox() == &rBox )
{
pCell->InvalidateSize();
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 281aac016e43..769a40410cf0 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -28,10 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifdef WTC
-#define private public
-#endif
-
#include <ctype.h>
#include <float.h>
#include <hintids.hxx>
@@ -42,8 +38,6 @@
#include <editeng/colritem.hxx>
#include <sfx2/linkmgr.hxx>
#include <editeng/boxitem.hxx>
-
-
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtpdsc.hxx>
@@ -72,6 +66,7 @@
#include <viewsh.hxx>
#include <redline.hxx>
#include <list>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -267,9 +262,6 @@ void _InsTblBox( SwDoc* pDoc, SwTableNode* pTblNd,
|*
|* SwTable::SwTable()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 05. May. 93
-|*
|*************************************************************************/
SwTable::SwTable( SwTableFmt* pFmt )
: SwClient( pFmt ),
@@ -331,14 +323,10 @@ SwTable::~SwTable()
delete pHTMLLayout;
}
-
/*************************************************************************
|*
|* SwTable::Modify()
|*
-|* Ersterstellung JP ??
-|* Letzte Aenderung MA 06. May. 93
-|*
|*************************************************************************/
inline void FmtInArr( SvPtrarr& rFmtArr, SwFmt* pBoxFmt )
{
@@ -415,7 +403,7 @@ void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld,
}
}
-void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
// fange SSize Aenderungen ab, um die Lines/Boxen anzupassen
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
@@ -432,6 +420,8 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
pOldSize = (const SwFmtFrmSize*)pOld;
pNewSize = (const SwFmtFrmSize*)pNew;
}
+ else
+ CheckRegistration( pOld, pNew );
if( pOldSize || pNewSize )
{
@@ -443,8 +433,6 @@ void SwTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
AdjustWidths( pOldSize->GetWidth(), pNewSize->GetWidth() );
}
}
- else
- SwClient::Modify( pOld, pNew ); // fuers ObjectDying
}
void SwTable::AdjustWidths( const long nOld, const long nNew )
@@ -457,9 +445,6 @@ void SwTable::AdjustWidths( const long nOld, const long nNew )
|*
|* SwTable::GetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 30. Nov. 95
-|*
|*************************************************************************/
void lcl_RefreshHidden( SwTabCols &rToFill, USHORT nPos )
{
@@ -711,9 +696,6 @@ void SwTable::GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
|*
|* SwTable::SetTabCols()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 26. Aug. 98
-|*
|*************************************************************************/
//Struktur zur Parameteruebergabe
struct Parm
@@ -1407,9 +1389,6 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
|* const SwTableBox* SwTable::GetTblBox( const Strn?ng& rName ) const
|* gebe den Pointer auf die benannte Box zurueck.
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
BOOL IsValidRowName( const String& rStr )
@@ -1560,8 +1539,7 @@ SwTableBox* SwTable::GetTblBox( ULONG nSttIdx )
pModify = pTblNd->GetTable().GetFrmFmt();
// <--
- SwClientIter aIter( *pModify );
- SwFrm *pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
+ SwFrm* pFrm = SwIterator<SwFrm,SwModify>::FirstElement( *pModify );
while ( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
if ( pFrm )
@@ -1595,9 +1573,6 @@ BOOL SwTable::IsTblComplex() const
|*
|* SwTableLine::SwTableLine()
|*
-|* Ersterstellung MA 09. Mar. 93
-|* Letzte Aenderung MA 09. Mar. 93
-|*
|*************************************************************************/
SwTableLine::SwTableLine( SwTableLineFmt *pFmt, USHORT nBoxes,
SwTableBox *pUp )
@@ -1621,55 +1596,51 @@ SwTableLine::~SwTableLine()
|*
|* SwTableLine::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 03. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableLine::ClaimFrmFmt()
{
- //Wenn noch andere TableLines ausser mir selbst an dem FrmFmt haengen,
- //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich
- //bei diesem anzumelden.
- SwTableLineFmt *pOld = (SwTableLineFmt*)GetFrmFmt();
- SwClientIter aIter( *pOld );
-
- SwClient* pLast;
-
- for( pLast = aIter.First( TYPE( SwTableLine )); pLast && pLast == this;
- pLast = aIter.Next() )
- ;
-
- if( pLast )
- {
- SwTableLineFmt *pNewFmt = pOld->GetDoc()->MakeTableLineFmt();
- *pNewFmt = *pOld;
-
- //Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
- pNewFmt->Add( pLast );
-
- //Jetzt noch mich selbst ummelden.
- pNewFmt->Add( this );
- pOld = pNewFmt;
+ // This method makes sure that this object is an exclusive SwTableLine client
+ // of an SwTableLineFmt object
+ // If other SwTableLine objects currently listen to the same SwTableLineFmt as
+ // this one, something needs to be done
+ SwTableLineFmt *pRet = (SwTableLineFmt*)GetFrmFmt();
+ SwIterator<SwTableLine,SwFmt> aIter( *pRet );
+ for( SwTableLine* pLast = aIter.First(); pLast; pLast = aIter.Next() )
+ {
+ if ( pLast != this )
+ {
+ // found another SwTableLine that is a client of the current Fmt
+ // create a new Fmt as a copy and use it for this object
+ SwTableLineFmt *pNewFmt = pRet->GetDoc()->MakeTableLineFmt();
+ *pNewFmt = *pRet;
+
+ // register SwRowFrms that know me as clients at the new Fmt
+ SwIterator<SwRowFrm,SwFmt> aFrmIter( *pRet );
+ for( SwRowFrm* pFrm = aFrmIter.First(); pFrm; pFrm = aFrmIter.Next() )
+ if( pFrm->GetTabLine() == this )
+ pFrm->RegisterToFormat( *pNewFmt );
+
+ // register myself
+ pNewFmt->Add( this );
+ pRet = pNewFmt;
+ break;
+ }
}
- return pOld;
+ return pRet;
}
void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
{
SwFrmFmt *pOld = GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
+ SwIterator<SwRowFrm,SwFmt> aIter( *pOld );
//Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() )
{
- SwRowFrm *pRow = (SwRowFrm*)pLast;
if( pRow->GetTabLine() == this )
{
- pNewFmt->Add( pLast );
+ pRow->RegisterToFormat( *pNewFmt );
pRow->InvalidateSize();
pRow->_InvalidatePrt();
@@ -1700,7 +1671,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
//Jetzt noch mich selbst ummelden.
pNewFmt->Add( this );
- if ( !aIter.GoStart() )
+ if ( !pOld->GetDepends() )
delete pOld;
}
@@ -1708,16 +1679,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
{
SwTwips nRet = 0;
bLayoutAvailable = false;
- SwClientIter aIter( *GetFrmFmt() );
+ SwIterator<SwRowFrm,SwFmt> aIter( *GetFrmFmt() );
// A row could appear several times in headers/footers so only one chain of master/follow tables
// will be accepted...
const SwTabFrm* pChain = NULL; // My chain
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast;
- pLast = aIter.Next() )
+ for( SwRowFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( ((SwRowFrm*)pLast)->GetTabLine() == this )
+ if( pLast->GetTabLine() == this )
{
- const SwTabFrm* pTab = static_cast<SwRowFrm*>(pLast)->FindTabFrm();
+ const SwTabFrm* pTab = pLast->FindTabFrm();
bLayoutAvailable = ( pTab && pTab->IsVertical() ) ?
( 0 < pTab->Frm().Height() ) :
( 0 < pTab->Frm().Width() );
@@ -1728,15 +1698,15 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
{
pChain = pTab; // defines my chain (even it is already)
if( pTab->IsVertical() )
- nRet += static_cast<SwRowFrm*>(pLast)->Frm().Width();
+ nRet += pLast->Frm().Width();
else
- nRet += static_cast<SwRowFrm*>(pLast)->Frm().Height();
+ nRet += pLast->Frm().Height();
// Optimization, if there are no master/follows in my chain, nothing more to add
if( !pTab->HasFollow() && !pTab->IsFollow() )
break;
// This is not an optimization, this is necessary to avoid double additions of
// repeating rows
- if( pTab->IsInHeadline( *static_cast<SwRowFrm*>(pLast) ) )
+ if( pTab->IsInHeadline(*pLast) )
break;
}
}
@@ -1748,9 +1718,6 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
|*
|* SwTableBox::SwTableBox()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 04. May. 93
-|*
|*************************************************************************/
SwTableBox::SwTableBox( SwTableBoxFmt* pFmt, USHORT nLines, SwTableLine *pUp )
: SwClient( 0 ),
@@ -1832,7 +1799,7 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
if( SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_VALUE, FALSE ) ||
SFX_ITEM_SET == pFmt->GetItemState( RES_BOXATR_FORMULA, FALSE ) )
{
- SwClient* pOther = SwClientIter( *pFmt ).First( TYPE( SwTableBox ));
+ SwTableBox* pOther = SwIterator<SwTableBox,SwFmt>::FirstElement( *pFmt );
if( pOther )
{
SwTableBoxFmt* pNewFmt = pFmt->GetDoc()->MakeTableBoxFmt();
@@ -1853,59 +1820,54 @@ SwTableBoxFmt* SwTableBox::CheckBoxFmt( SwTableBoxFmt* pFmt )
|*
|* SwTableBox::ClaimFrmFmt(), ChgFrmFmt()
|*
-|* Ersterstellung MA 04. May. 93
-|* Letzte Aenderung MA 07. Feb. 96
-|*
|*************************************************************************/
SwFrmFmt* SwTableBox::ClaimFrmFmt()
{
- //Wenn noch andere TableBoxen ausser mir selbst an dem FrmFmt haengen,
- //sehe ich mich leider gezwungen mir ein eingenes zu machen und mich
- //bei diesem anzumelden.
- SwTableBoxFmt *pOld = (SwTableBoxFmt*)GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
-
- for( pLast = aIter.First( TYPE( SwTableBox )); pLast && pLast == this;
- pLast = aIter.Next() )
- ;
-
- if( pLast )
+ // This method makes sure that this object is an exclusive SwTableBox client
+ // of an SwTableBoxFmt object
+ // If other SwTableBox objects currently listen to the same SwTableBoxFmt as
+ // this one, something needs to be done
+ SwTableBoxFmt *pRet = (SwTableBoxFmt*)GetFrmFmt();
+ SwIterator<SwTableBox,SwFmt> aIter( *pRet );
+ for( SwTableBox* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- SwTableBoxFmt* pNewFmt = pOld->GetDoc()->MakeTableBoxFmt();
-
- pNewFmt->LockModify();
- *pNewFmt = *pOld;
-
- // Values und Formeln nie kopieren
- pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE );
- pNewFmt->UnlockModify();
+ if ( pLast != this )
+ {
+ // Found another SwTableBox object
+ // create a new Fmt as a copy and assign me to it
+ // don't copy values and formulas
+ SwTableBoxFmt* pNewFmt = pRet->GetDoc()->MakeTableBoxFmt();
+ pNewFmt->LockModify();
+ *pNewFmt = *pRet;
+ pNewFmt->ResetFmtAttr( RES_BOXATR_FORMULA, RES_BOXATR_VALUE );
+ pNewFmt->UnlockModify();
- //Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwCellFrm*)pLast)->GetTabBox() == this )
- pNewFmt->Add( pLast );
+ // re-register SwCellFrm objects that know me
+ SwIterator<SwCellFrm,SwFmt> aFrmIter( *pRet );
+ for( SwCellFrm* pCell = aFrmIter.First(); pCell; pCell = aFrmIter.Next() )
+ if( pCell->GetTabBox() == this )
+ pCell->RegisterToFormat( *pNewFmt );
- //Jetzt noch mich selbst ummelden.
- pNewFmt->Add( this );
- pOld = pNewFmt;
+ // re-register myself
+ pNewFmt->Add( this );
+ pRet = pNewFmt;
+ break;
+ }
}
- return pOld;
+ return pRet;
}
void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
{
SwFrmFmt *pOld = GetFrmFmt();
- SwClientIter aIter( *pOld );
- SwClient* pLast;
+ SwIterator<SwCellFrm,SwFmt> aIter( *pOld );
//Erstmal die Frms ummelden.
- for( pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ for( SwCellFrm* pCell = aIter.First(); pCell; pCell = aIter.Next() )
{
- SwCellFrm *pCell = (SwCellFrm*)pLast;
if( pCell->GetTabBox() == this )
{
- pNewFmt->Add( pLast );
+ pCell->RegisterToFormat( *pNewFmt );
pCell->InvalidateSize();
pCell->_InvalidatePrt();
pCell->SetCompletePaint();
@@ -1930,7 +1892,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
//Jetzt noch mich selbst ummelden.
pNewFmt->Add( this );
- if( !aIter.GoStart() )
+ if( !pOld->GetDepends() )
delete pOld;
}
@@ -1940,9 +1902,6 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
|* gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt
|* und ergibt sich aus der Position in den Lines/Boxen/Tabelle
|*
-|* Ersterstellung JP 30. Jun. 93
-|* Letzte Aenderung JP 30. Jun. 93
-|*
|*************************************************************************/
void lcl_GetTblBoxColStr( USHORT nCol, String& rNm )
{
@@ -2053,8 +2012,7 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const
case RES_CONTENT_VISIBLE:
{
- ((SwPtrMsgPoolItem&)rInfo).pObject =
- SwClientIter( *GetFrmFmt() ).First( TYPE(SwFrm) );
+ ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *GetFrmFmt() );
}
return FALSE;
}
@@ -2064,7 +2022,7 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const
SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt )
{
return (pFmt)
- ? static_cast<SwTable*>(SwClientIter(*pFmt).First( TYPE(SwTable) ))
+ ? SwIterator<SwTable,SwFmt>::FirstElement(*pFmt)
: 0;
}
@@ -2303,7 +2261,7 @@ void ChgNumToText( SwTableBox& rBox, ULONG nFmt )
}
// zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
-void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTableBoxFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !IsModifyLocked() && !IsInDocDTOR() )
{
@@ -2355,8 +2313,8 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
SFX_ITEM_SET == GetItemState( RES_BOXATR_FORMULA, FALSE ) )
{
// die Box holen
- SwClientIter aIter( *this );
- SwTableBox* pBox = (SwTableBox*)aIter.First( TYPE( SwTableBox ) );
+ SwIterator<SwTableBox,SwFmt> aIter( *this );
+ SwTableBox* pBox = aIter.First();
if( pBox )
{
ASSERT( !aIter.Next(), "keine Box oder mehrere am Format" );
@@ -2541,21 +2499,6 @@ BOOL SwTableBox::HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
rFmtIndex = 0;
bRet = pNumFmtr->IsNumberFormat( aTxt, rFmtIndex, rNum );
-
-/*
-// wie bekommt man aus dem neuen String den neuen Wert?
-// denn der Numberformater erkennt aus "123.--DM" kein Zahlenformat!
- if( !bRet && rFmtIndex && !pNumFmtr->IsTextFormat( rFmtIndex ) &&
- SFX_ITEM_SET == GetFrmFmt()->GetItemState( RES_BOXATR_VALUE,
- FALSE, &pItem ))
- {
- Color* pCol;
- String sNewTxt;
- pNumFmtr->GetOutputString( ((SwTblBoxValue*)pItem)->GetValue(),
- rFmtIndex, sNewTxt, &pCol );
- bRet = aTxt == sNewTxt;
- }
-*/
}
else
rIsEmptyTxtNd = FALSE;
@@ -2745,11 +2688,7 @@ public:
void setTable(const SwTable * pTable) {
m_pTable = pTable;
SwFrmFmt * pFrmFmt = m_pTable->GetFrmFmt();
- SwClientIter aIter(*pFrmFmt);
-
- m_pTabFrm =
- static_cast<const SwTabFrm *>(aIter.First(TYPE(SwTabFrm)));
-
+ m_pTabFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement(*pFrmFmt);
if (m_pTabFrm->IsFollow())
m_pTabFrm = m_pTabFrm->FindMaster(true);
}
@@ -2883,3 +2822,26 @@ const SwTableBox * SwTableCellInfo::getTableBox() const
return pRet;
}
+
+void SwTable::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableLine::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableBox::RegisterToFormat( SwFmt& rFmt )
+{
+ rFmt.Add( this );
+}
+
+void SwTableBox::ForgetFrmFmt()
+{
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove(this);
+}
+
+
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 09c13b8fb250..3ee651997691 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -81,7 +81,7 @@
#include "i18npool/mslangid.hxx"
#include <IMark.hxx>
#include <SwNodeNum.hxx>
-
+#include <switerator.hxx>
#include <stack>
#include <tools/globname.hxx>
@@ -1589,22 +1589,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( pPDFExtOutDevData->GetIsExportNotes() )
{
SwFieldType* pType = mrSh.GetFldType( RES_POSTITFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- const SwClient * pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pFirst = aIter.First(); pFirst; )
{
- if( ((SwFmtFld*)pFirst)->GetTxtFld() &&
- ((SwFmtFld*)pFirst)->IsFldInDoc())
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
- const SwTxtNode* pTNd =
- (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
+ const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
// 3. Check for hidden text attribute
if ( !pTNd->IsHidden() &&
- mrSh.GotoFld( *(SwFmtFld*)pFirst ) &&
+ mrSh.GotoFld( *pFirst ) &&
!mrSh.SelectHiddenRange() )
{
// Link Rectangle
@@ -1618,7 +1615,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
vcl::PDFNote aNote;
// Use the NumberFormatter to get the date string:
- const SwPostItField* pField = (SwPostItField*)((SwFmtFld*)pFirst)->GetFld();
+ const SwPostItField* pField = (SwPostItField*)pFirst->GetFld();
SvNumberFormatter* pNumFormatter = pDoc->GetNumberFormatter();
const Date aDateDiff( pField->GetDate() -
*pNumFormatter->GetNullDate() );
@@ -1641,7 +1638,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
}
}
}
- pFirst = aIter++;
+ pFirst = aIter.Next();
mrSh.SwCrsrShell::ClearMark();
}
}
@@ -1831,22 +1828,19 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// REFERENCES
//
SwFieldType* pType = mrSh.GetFldType( RES_GETREFFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- const SwClient * pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pFirst = aIter.First(); pFirst; )
{
- if( ((SwFmtFld*)pFirst)->GetTxtFld() &&
- ((SwFmtFld*)pFirst)->IsFldInDoc())
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
- const SwTxtNode* pTNd =
- (SwTxtNode*)((SwFmtFld*)pFirst)->GetTxtFld()->GetpTxtNode();
+ const SwTxtNode* pTNd = (SwTxtNode*)pFirst->GetTxtFld()->GetpTxtNode();
ASSERT( 0 != pTNd, "Enhanced pdf export - text node is missing" )
// 1. Check if the whole paragraph is hidden
// 2. Move to the field
// 3. Check for hidden text attribute
if ( !pTNd->IsHidden() &&
- mrSh.GotoFld( *(SwFmtFld*)pFirst ) &&
+ mrSh.GotoFld( *pFirst ) &&
!mrSh.SelectHiddenRange() )
{
// Select the field:
@@ -1862,7 +1856,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Rectangle
const SwGetRefField* pField =
- (SwGetRefField*)((SwFmtFld*)pFirst)->GetFld();
+ (SwGetRefField*)pFirst->GetFld();
const String& rRefName = pField->GetSetRefName();
mrSh.GotoRefMark( rRefName, pField->GetSubType(), pField->GetSeqNo() );
const SwRect& rDestRect = mrSh.GetCharRect();
@@ -1915,7 +1909,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
}
}
}
- pFirst = aIter++;
+ pFirst = aIter.Next();
mrSh.SwCrsrShell::ClearMark();
}
@@ -2175,15 +2169,10 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
// the offset of the link rectangle calculates as follows:
const Point aOffset = rLinkRect.Pos() + mrOut.GetMapMode().GetOrigin();
- SwClientIter aClientIter( const_cast<SwTxtNode&>(rTNd) );
- SwClient* pLast = aClientIter.GoStart();
-
- while( pLast )
- {
- if ( pLast->ISA( SwTxtFrm ) )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rTNd );
+ for ( SwTxtFrm* pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() )
{
// Add offset to current page:
- SwTxtFrm* pTmpFrm = static_cast<SwTxtFrm*>(pLast);
const SwPageFrm* pPageFrm = pTmpFrm->FindPageFrm();
SwRect aHFLinkRect( rLinkRect );
aHFLinkRect.Pos() = pPageFrm->Frm().Pos() + aOffset;
@@ -2210,8 +2199,5 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP
}
}
}
-
- pLast = ++aClientIter;
- }
}
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 208d8a7ec9eb..02b5217593da 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -63,6 +63,7 @@
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
#include <editeng/lrspitem.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
@@ -997,15 +998,10 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
nWidth = Max( nWidth, nProWidth );
// search for a text frame this node belongs to
- SwClientIter aClientIter( *(SwTxtNode*)this );
- SwClient* pLastFrm = aClientIter.GoStart();
+ SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *this );
SwTxtFrm* pFrm = 0;
-
- while( pLastFrm )
+ for( SwTxtFrm* pTmpFrm = aFrmIter.First(); pTmpFrm; pTmpFrm = aFrmIter.Next() )
{
- if ( pLastFrm->ISA( SwTxtFrm ) )
- {
- SwTxtFrm* pTmpFrm = ( SwTxtFrm* )pLastFrm;
if ( pTmpFrm->GetOfst() <= nStt &&
( !pTmpFrm->GetFollow() ||
pTmpFrm->GetFollow()->GetOfst() > nStt ) )
@@ -1014,8 +1010,6 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
break;
}
}
- pLastFrm = ++aClientIter;
- }
// search for the line containing nStt
if ( pFrm && pFrm->HasPara() )
@@ -1056,16 +1050,12 @@ USHORT SwTxtNode::GetWidthOfLeadingTabs() const
aPos.nContent += nIdx;
// Find the non-follow text frame:
- SwClientIter aClientIter( (SwTxtNode&)*this );
- SwClient* pLastFrm = aClientIter.GoStart();
-
- while( pLastFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( SwTxtFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
// Only consider master frames:
- if ( pLastFrm->ISA(SwTxtFrm) &&
- !static_cast<SwTxtFrm*>(pLastFrm)->IsFollow() )
+ if ( !pFrm->IsFollow() )
{
- const SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(pLastFrm);
SWRECTFN( pFrm )
SwRect aRect;
pFrm->GetCharRect( aRect, aPos );
@@ -1075,7 +1065,6 @@ USHORT SwTxtNode::GetWidthOfLeadingTabs() const
(aRect.*fnRect->fnGetLeft)() - (pFrm->*fnRect->fnGetPrtLeft)() );
break;
}
- pLastFrm = ++aClientIter;
}
}
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index dd2c1c3a1d38..f235ee704526 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -59,11 +59,8 @@
#include <fchrfmt.hxx>
#include <docary.hxx> // SwRedlineTbl
#include <redline.hxx> // SwRedline
-
-// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <section.hxx>
-// <--
-
+#include <switerator.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentContentOperations.hxx>
@@ -2238,15 +2235,12 @@ USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
sal_Bool bAllowInvalid )
{
- SwClientIter aClientIter( (SwTxtNode&)rTNd );
- SwClient* pLast = aClientIter.GoStart();
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rTNd );
SwScriptInfo* pScriptInfo = 0;
- while( pLast )
+ for( SwTxtFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if ( pLast->ISA( SwTxtFrm ) )
- {
- pScriptInfo = (SwScriptInfo*)((SwTxtFrm*)pLast)->GetScriptInfo();
+ pScriptInfo = (SwScriptInfo*)pLast->GetScriptInfo();
if ( pScriptInfo )
{
if ( !bAllowInvalid && STRING_LEN != pScriptInfo->GetInvalidity() )
@@ -2254,8 +2248,6 @@ SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
else break;
}
}
- pLast = ++aClientIter;
- }
return pScriptInfo;
}
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 3e67e1037dfe..9f759ccaade8 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -43,13 +43,12 @@
#include <txtpaint.hxx> // SwSaveClip
#include <blink.hxx> // pBlink
#include <breakit.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
#include <com/sun/star/i18n/WordType.hpp>
#include <editeng/langitem.hxx>
#include <charatr.hxx>
#include <editeng/fhgtitem.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
@@ -228,21 +227,19 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
}
// get text frame
- SwClientIter aClientIter( (SwTxtNode&)*this );
- SwClient* pLastFrm = aClientIter.GoStart();
-
- while( pLastFrm )
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( *this );
+ for( SwTxtFrm* pLastFrm = aIter.First(); pLastFrm; pLastFrm = aIter.Next() )
{
// Only (master-) text frames can have a drop cap.
- if ( pLastFrm->ISA( SwTxtFrm ) && !((SwTxtFrm*)pLastFrm)->IsFollow() )
+ if ( !pLastFrm->IsFollow() )
{
- if( !((SwTxtFrm*)pLastFrm)->HasPara() )
- ((SwTxtFrm*)pLastFrm)->GetFormatted();
+ if( !pLastFrm->HasPara() )
+ pLastFrm->GetFormatted();
- if ( !((SwTxtFrm*)pLastFrm)->IsEmpty() )
+ if ( !pLastFrm->IsEmpty() )
{
- const SwParaPortion* pPara = ((SwTxtFrm*)pLastFrm)->GetPara();
+ const SwParaPortion* pPara = pLastFrm->GetPara();
ASSERT( pPara, "GetDropSize could not find the ParaPortion, I'll guess the drop cap size" )
if ( pPara )
@@ -265,7 +262,6 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
}
break;
}
- pLastFrm = ++aClientIter;
}
if (rFontHeight==0 && rDropHeight==0 && rDropDescent==0)
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 562682c73af3..e0f49a61fe3a 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -74,21 +74,16 @@
#include <SwGrammarMarkUp.hxx>
#include <lineinfo.hxx>
#include <SwPortionHandler.hxx>
-// OD 2004-01-15 #110582#
#include <dcontact.hxx>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2005-03-30 #???#
#include <txtflcnt.hxx> // SwTxtFlyCnt
#include <fmtflcnt.hxx> // SwFmtFlyCnt
#include <fmtcntnt.hxx> // SwFmtCntnt
-// <--
-// --> OD 2008-01-31 #newlistlevelattrs#
#include <numrule.hxx>
-// <--
#include <swtable.hxx>
#include <fldupde.hxx>
#include <IGrammarContact.hxx>
+#include <switerator.hxx>
#if OSL_DEBUG_LEVEL > 1
#include <txtpaint.hxx> // DbgRect
@@ -905,7 +900,7 @@ void lcl_ModifyOfst( SwTxtFrm* pFrm, xub_StrLen nPos, xub_StrLen nLen )
* SwTxtFrm::Modify()
*************************************************************************/
-void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const MSHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
@@ -2754,3 +2749,18 @@ void SwTxtFrm::CalcBaseOfstForFly()
mnFlyAnchorOfst = nRet1 - nLeft;
mnFlyAnchorOfstNoWrap = nRet2 - nLeft;
}
+
+/* repaint all text frames of the given text node */
+void SwTxtFrm::repaintTextFrames( const SwTxtNode& rNode )
+{
+ SwIterator<SwTxtFrm,SwTxtNode> aIter( rNode );
+ for( const SwTxtFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
+ {
+ SwRect aRec( pFrm->PaintArea() );
+ const SwRootFrm *pRootFrm = pFrm->getRootFrm();
+ ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL;
+ if( pCurShell )
+ pCurShell->InvalidateWindows( aRec );
+ }
+}
+
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index bc3565216ae0..28a41ea7d364 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -28,9 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
#include <tools/resid.hxx>
#include <hintids.hxx>
#include <swtypes.hxx>
@@ -39,22 +36,18 @@
#include <ndtxt.hxx>
#include <txttxmrk.hxx>
#include <tox.hxx>
-#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <paratr.hxx>
#include <editeng/tstpitem.hxx>
#include <SwStyleNameMapper.hxx>
#include <hints.hxx> // SwPtrMsgPoolItem
-
-// -> #i21237#
#include <algorithm>
#include <functional>
+#include <switerator.hxx>
using namespace std;
-// <- #i21237#
const sal_Char* SwForm::aFormEntry = "<E>";
const sal_Char* SwForm::aFormTab = "<T>";
@@ -81,9 +74,6 @@ SV_IMPL_PTRARR(SwTOXMarks, SwTOXMark*)
TYPEINIT2( SwTOXMark, SfxPoolItem, SwClient ); // fuers rtti
-/* -----------------23.09.99 13:59-------------------
-
- --------------------------------------------------*/
struct PatternIni
{
USHORT n1;
@@ -126,14 +116,9 @@ const PatternIni aPatternIni[] =
{AUTH_FIELD_AUTHOR, AUTH_FIELD_TITLE, AUTH_FIELD_YEAR, USHRT_MAX, USHRT_MAX}, //AUTH_FIELD_CUSTOM5,
{USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX}
};
-/* -----------------23.09.99 13:58-------------------
-
- --------------------------------------------------*/
-// -> #i21237#
SwFormTokens lcl_GetAuthPattern(USHORT nTypeId)
{
- SwFormTokens aRet; // #i21237#
-
+ SwFormTokens aRet;
PatternIni aIni = aPatternIni[nTypeId];
USHORT nVals[5];
@@ -199,7 +184,7 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp )
SwTOXMark::SwTOXMark( const SwTOXMark& rCopy )
: SfxPoolItem( RES_TXTATR_TOXMARK )
- , SwModify(rCopy.pRegisteredIn)
+ , SwModify(rCopy.GetRegisteredInNonConst())
,
aPrimaryKey( rCopy.aPrimaryKey ), aSecondaryKey( rCopy.aSecondaryKey ),
aTextReading( rCopy.aTextReading ),
@@ -219,6 +204,11 @@ SwTOXMark::~SwTOXMark()
}
+void SwTOXMark::RegisterToTOXType( SwTOXType& rMark )
+{
+ rMark.Add(this);
+}
+
int SwTOXMark::operator==( const SfxPoolItem& rAttr ) const
{
ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
@@ -231,9 +221,9 @@ SfxPoolItem* SwTOXMark::Clone( SfxItemPool* ) const
return new SwTOXMark( *this );
}
-void SwTOXMark::Modify(SfxPoolItem* pOld, SfxPoolItem* pNew)
+void SwTOXMark::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew)
{
- SwModify::Modify(pOld, pNew);
+ NotifyClients(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
SetXTOXMark(::com::sun::star::uno::Reference<
@@ -245,7 +235,7 @@ void SwTOXMark::InvalidateTOXMark()
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
&static_cast<SwModify&>(*this) ); // cast to base class!
- Modify(&aMsgHint, &aMsgHint);
+ NotifyClients(&aMsgHint, &aMsgHint);
}
String SwTOXMark::GetText() const
@@ -266,6 +256,18 @@ String SwTOXMark::GetText() const
return aStr;
}
+void SwTOXMark::InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType )
+{
+ SwIterator<SwTOXMark,SwTOXType> aIter(rType);
+ SwTOXMark* pMark = aIter.First();
+ while( pMark )
+ {
+ if(pMark->GetTxtTOXMark())
+ aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count());
+ pMark = aIter.Next();
+ }
+}
+
/*--------------------------------------------------------------------
Beschreibung: Typen von Verzeichnissen verwalten
--------------------------------------------------------------------*/
@@ -528,11 +530,16 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm,
SwTOXBase::SwTOXBase( const SwTOXBase& rSource, SwDoc* pDoc )
- : SwClient( rSource.pRegisteredIn )
+ : SwClient( rSource.GetRegisteredInNonConst() )
{
CopyTOXBase( pDoc, rSource );
}
+void SwTOXBase::RegisterToTOXType( SwTOXType& rType )
+{
+ rType.Add( this );
+}
+
SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource )
{
SwTOXType* pType = (SwTOXType*)rSource.GetTOXType();
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index 966a3d6f0225..6997474e5128 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -38,9 +38,6 @@
#include <rootfrm.hxx>
#include <viewsh.hxx>
-extern void repaintTextFrames( SwModify& rModify );
-
-
/* SwGrammarContact
This class is responsible for the delayed display of grammar checks when a paragraph is edited
It's a client of the paragraph the cursor points to.
@@ -58,7 +55,7 @@ class SwGrammarContact : public IGrammarContact, public SwClient
Timer aTimer;
SwGrammarMarkUp *mpProxyList;
bool mbFinished;
- SwTxtNode* getMyTxtNode() { return (SwTxtNode*)pRegisteredIn; }
+ SwTxtNode* getMyTxtNode() { return (SwTxtNode*)GetRegisteredIn(); }
DECL_LINK( TimerRepaint, Timer * );
public:
@@ -69,9 +66,9 @@ public:
virtual void updateCursorPosition( const SwPosition& rNewPos );
virtual SwGrammarMarkUp* getGrammarCheck( SwTxtNode& rTxtNode, bool bCreate );
virtual void finishGrammarCheck( SwTxtNode& rTxtNode );
-
+protected:
// virtual function of SwClient
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
SwGrammarContact::SwGrammarContact() : mpProxyList(0), mbFinished( false )
@@ -85,11 +82,11 @@ IMPL_LINK( SwGrammarContact, TimerRepaint, Timer *, pTimer )
if( pTimer )
{
pTimer->Stop();
- if( pRegisteredIn )
+ if( GetRegisteredIn() )
{ //Replace the old wrong list by the proxy list and repaint all frames
getMyTxtNode()->SetGrammarCheck( mpProxyList, true );
mpProxyList = 0;
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
}
return 0;
@@ -107,9 +104,9 @@ void SwGrammarContact::updateCursorPosition( const SwPosition& rNewPos )
if( mpProxyList )
{ // replace old list by the proxy list and repaint
getMyTxtNode()->SetGrammarCheck( mpProxyList, true );
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
- pRegisteredIn->Remove( this ); // good bye old paragraph
+ GetRegisteredInNonConst()->Remove( this ); // good bye old paragraph
mpProxyList = 0;
}
if( pTxtNode )
@@ -158,16 +155,16 @@ SwGrammarMarkUp* SwGrammarContact::getGrammarCheck( SwTxtNode& rTxtNode, bool bC
return pRet;
}
-void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * )
+void SwGrammarContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem * )
{
if( !pOld || pOld->Which() != RES_OBJECTDYING )
return;
SwPtrMsgPoolItem *pDead = (SwPtrMsgPoolItem *)pOld;
- if( pDead->pObject == pRegisteredIn )
+ if( pDead->pObject == GetRegisteredIn() )
{ // if my current paragraph dies, I throw the proxy list away
aTimer.Stop();
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
delete mpProxyList;
mpProxyList = 0;
}
@@ -175,8 +172,8 @@ void SwGrammarContact::Modify( SfxPoolItem *pOld, SfxPoolItem * )
void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode )
{
- if( &rTxtNode != pRegisteredIn ) // not my paragraph
- repaintTextFrames( rTxtNode ); // can be repainted directly
+ if( &rTxtNode != GetRegisteredIn() ) // not my paragraph
+ SwTxtFrm::repaintTextFrames( rTxtNode ); // can be repainted directly
else
{
if( mpProxyList )
@@ -187,7 +184,7 @@ void SwGrammarContact::finishGrammarCheck( SwTxtNode& rTxtNode )
else if( getMyTxtNode()->GetGrammarCheck() )
{ // all grammar problems seems to be gone, no delay needed
getMyTxtNode()->SetGrammarCheck( 0, true );
- repaintTextFrames( *pRegisteredIn );
+ SwTxtFrm::repaintTextFrames( *getMyTxtNode() );
}
}
}
@@ -197,21 +194,6 @@ IGrammarContact* createGrammarContact()
return new SwGrammarContact();
}
-/* repaint all text frames of the given text node */
-void repaintTextFrames( SwModify& rModify )
-{
- SwClientIter aIter( rModify );
- for( const SwTxtFrm *pFrm = (const SwTxtFrm*)aIter.First( TYPE(SwTxtFrm) );
- pFrm; pFrm = (const SwTxtFrm*)aIter.Next() )
- {
- SwRect aRec( pFrm->PaintArea() );
- const SwRootFrm *pRootFrm = pFrm->getRootFrm();
- ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL;
- if( pCurShell )
- pCurShell->InvalidateWindows( aRec );
- }
-}
-
void finishGrammarCheck( SwTxtNode& rTxtNode )
{
IGrammarContact* pGrammarContact = getGrammarContact( rTxtNode );
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 6b1adc76fbec..8d4721ff23ff 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -126,6 +126,12 @@ SwFmtFld::~SwFmtFld()
}
}
+void SwFmtFld::RegisterToFieldType( SwFieldType& rType )
+{
+ rType.Add(this);
+}
+
+
// #111840#
void SwFmtFld::SetFld(SwField * _pField)
{
@@ -153,7 +159,7 @@ SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const
return new SwFmtFld( *this );
}
-void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( !pTxtAttr )
return;
@@ -171,7 +177,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_TXTATR_FLDCHG:
// "Farbe hat sich geaendert !"
// this, this fuer "nur Painten"
- pTxtNd->Modify( this, this );
+ pTxtNd->ModifyNotification( this, this );
return;
case RES_REFMARKFLD_UPDATE:
// GetReferenz-Felder aktualisieren
@@ -185,12 +191,12 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
break;
case RES_DOCPOS_UPDATE:
// Je nach DocPos aktualisieren (SwTxtFrm::Modify())
- pTxtNd->Modify( pNew, this );
+ pTxtNd->ModifyNotification( pNew, this );
return;
case RES_ATTRSET_CHG:
case RES_FMT_CHG:
- pTxtNd->Modify( pOld, pNew );
+ pTxtNd->ModifyNotification( pOld, pNew );
return;
default:
break;
@@ -206,7 +212,7 @@ void SwFmtFld::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
case RES_DBNUMSETFLD:
case RES_DBNEXTSETFLD:
case RES_DBNAMEFLD:
- pTxtNd->Modify( 0, pNew);
+ pTxtNd->ModifyNotification( 0, pNew);
return;
}
@@ -315,7 +321,7 @@ void SwTxtFld::Expand() const
// aenderung an die Frames posten
if( m_pTxtNode->CalcHiddenParaField() )
{
- m_pTxtNode->Modify( 0, 0 );
+ m_pTxtNode->ModifyNotification( 0, 0 );
}
return;
}
@@ -324,7 +330,7 @@ void SwTxtFld::Expand() const
m_aExpand = aNewExpand;
// 0, this for formatting
- m_pTxtNode->Modify( 0, const_cast<SwFmtFld*>( &GetFld() ) );
+ m_pTxtNode->ModifyNotification( 0, const_cast<SwFmtFld*>( &GetFld() ) );
}
/*************************************************************************
@@ -394,7 +400,7 @@ void SwTxtFld::NotifyContentChange(SwFmtFld& rFmtFld)
//if not in undo section notify the change
if (m_pTxtNode && m_pTxtNode->GetNodes().IsDocNodes())
{
- m_pTxtNode->Modify(0, &rFmtFld);
+ m_pTxtNode->ModifyNotification(0, &rFmtFld);
}
}
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index c00a284f4109..f98ca5595bb5 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -28,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
#include "hintids.hxx"
#include "cntfrm.hxx" // _GetFly
#include "doc.hxx"
@@ -43,9 +41,8 @@
#include "swfont.hxx"
#include "txtfrm.hxx"
#include "flyfrms.hxx"
-// --> OD 2004-11-09 #i26945#
#include <objectformatter.hxx>
-// <--
+#include <switerator.hxx>
SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt )
: SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -238,17 +235,15 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
return NULL;
}
- SwClientIter aIter( *GetFlyCnt().pFmt );
+ SwIterator<SwFlyFrm,SwFmt> aIter( *GetFlyCnt().pFmt );
ASSERT( pCurrFrm->IsTxtFrm(), "SwTxtFlyCnt::_GetFlyFrm for TxtFrms only." );
-
- if( aIter.GoStart() )
+ SwFrm* pFrm = aIter.First();
+ if ( pFrm )
{
SwTxtFrm *pFirst = (SwTxtFrm*)pCurrFrm;
while ( pFirst->IsFollow() )
pFirst = pFirst->FindMaster();
do
- { SwFrm * pFrm = PTR_CAST( SwFrm, aIter() );
- if ( pFrm )
{
SwTxtFrm *pTmp = pFirst;
do
@@ -263,8 +258,10 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
}
pTmp = pTmp->GetFollow();
} while ( pTmp );
- }
- } while( aIter++ );
+
+ pFrm = aIter.Next();
+
+ } while( pFrm );
}
// Wir haben keinen passenden FlyFrm gefunden, deswegen wird ein
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 1d8bd92e69a7..de7f96217751 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -47,15 +47,12 @@
#include <ndindex.hxx>
#include <fmtftntx.hxx>
#include <section.hxx>
+#include <switerator.hxx>
/*************************************************************************
|*
|* class SwFmtFtn
|*
-|* Beschreibung
-|* Ersterstellung JP 09.08.94
-|* Letzte Aenderung JP 08.08.94
-|*
*************************************************************************/
@@ -272,7 +269,7 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
SwNodes &rNodes = m_pTxtNode->GetDoc()->GetNodes();
- m_pTxtNode->Modify( 0, &rFtn );
+ m_pTxtNode->ModifyNotification( 0, &rFtn );
if ( m_pStartNode )
{
// must iterate over all TxtNodes because of footnotes on other pages
@@ -283,7 +280,7 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
{
// Es koennen ja auch Grafiken in der Fussnote stehen ...
if( ( pNd = rNodes[ nSttIdx ] )->IsTxtNode() )
- ((SwTxtNode*)pNd)->Modify( 0, &rFtn );
+ ((SwTxtNode*)pNd)->ModifyNotification( 0, &rFtn );
}
}
}
@@ -372,9 +369,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
BOOL bFrmFnd = FALSE;
{
- SwClientIter aIter( *m_pTxtNode );
- for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
- pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
+ SwIterator<SwCntntFrm,SwTxtNode> aIter( *m_pTxtNode );
+ for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
{
if( pRoot != pFnd->getRootFrm() && pRoot )
continue;
@@ -394,9 +390,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
SwCntntNode* pCNd = m_pTxtNode->GetNodes().GoNext( &aIdx );
if( pCNd )
{
- SwClientIter aIter( *pCNd );
- for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
- pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( *pCNd );
+ for( SwCntntFrm* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
{
if( pRoot != pFnd->getRootFrm() && pRoot )
continue;
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index 245ec916fd4a..3bc60d5b4628 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -114,10 +114,10 @@ SfxPoolItem* SwFmtCharFmt::Clone( SfxItemPool* ) const
// weiterleiten an das TextAttribut
-void SwFmtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if( pTxtAttr )
- pTxtAttr->Modify( pOld, pNew );
+ pTxtAttr->ModifyNotification( pOld, pNew );
}
@@ -657,7 +657,7 @@ void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode)
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
&static_cast<SwModify&>(*m_pMeta) ); // cast to base class!
- m_pMeta->Modify(&aMsgHint, &aMsgHint);
+ m_pMeta->ModifyNotification(&aMsgHint, &aMsgHint);
}
else
{ // do not call Modify, that would call SwXMeta::Modify!
@@ -737,15 +737,15 @@ void Meta::NotifyChangeTxtNode()
}
else if (!pTxtNode && GetRegisteredIn())
{
- const_cast<SwModify *>(GetRegisteredIn())->Remove(this);
+ GetRegisteredInNonConst()->Remove(this);
}
}
// SwClient
-void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void Meta::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
{
NotifyChangeTxtNode();
- SwModify::Modify(pOld, pNew);
+ NotifyClients(pOld, pNew);
if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
{ // invalidate cached uno object
SetXMeta(uno::Reference<rdf::XMetadatable>(0));
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 931407980027..0663d7bdf793 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -34,9 +34,7 @@
#include <editeng/brkitem.hxx>
#include <editeng/escpitem.hxx>
#include <editeng/lrspitem.hxx>
-// --> OD 2008-01-17 #newlistlevelattrs#
#include <editeng/tstpitem.hxx>
-// <--
#include <svl/urihelper.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_ULONGS
@@ -87,17 +85,13 @@
#include <istyleaccess.hxx>
#include <SwStyleNameMapper.hxx>
#include <numrule.hxx>
-
-//--> #outlinelevel added by zhaojianwei
#include <svl/intitem.hxx>
-//<--end
#include <swtable.hxx>
#include <docsh.hxx>
#include <SwNodeNum.hxx>
-// --> OD 2008-02-25 #refactorlists#
#include <svl/intitem.hxx>
#include <list.hxx>
-// <--
+#include <switerator.hxx>
SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0, 4 )
@@ -335,8 +329,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
{
if( !pFrm )
{
- SwClientIter aNew( rNode );
- pFrm = (SwCntntFrm*)aNew.First( TYPE(SwCntntFrm) );
+ pFrm = SwIterator<SwCntntFrm,SwTxtNode>::FirstElement( rNode );
if( !pFrm )
return;
}
@@ -349,8 +342,9 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
GetNodes().GoNextSection( &aIdx, TRUE, FALSE );
if ( !pNd )
continue;
- SwClientIter aIter( *pNd );
- SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm));
+
+ SwIterator<SwCntntFrm,SwCntntNode> aIter( *pNd );
+ SwCntntFrm* pCntnt = aIter.First();
if( pCntnt )
{
ASSERT( pCntnt->getRootFrm() == pFrm->getRootFrm(),
@@ -370,7 +364,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
}
}
#ifdef DBG_UTIL
- while( 0 != (pCntnt = (SwCntntFrm*)aIter.Next()) )
+ while( 0 != (pCntnt = aIter.Next()) )
{
SwFtnFrm *pDbgFtn = pCntnt->FindFtnFrm();
ASSERT( !pDbgFtn || pDbgFtn->GetRef() == pFrm,
@@ -513,21 +507,13 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
}
- SwClientIter aIter( *this );
- SwClient* pLastFrm = aIter.GoStart();
- if( pLastFrm )
- {
- do
- { SwCntntFrm *pFrm = PTR_CAST( SwCntntFrm, pLastFrm );
- if ( pFrm )
+ SwIterator<SwCntntFrm,SwTxtNode> aIter( *this );
+ for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- pNode->Add( pFrm );
- if( pFrm->IsTxtFrm() && !pFrm->IsFollow() &&
- ((SwTxtFrm*)pFrm)->GetOfst() )
+ pFrm->RegisterToNode( *pNode );
+ if( pFrm->IsTxtFrm() && !pFrm->IsFollow() && ((SwTxtFrm*)pFrm)->GetOfst() )
((SwTxtFrm*)pFrm)->SetOfst( 0 );
- }
- pLastFrm = aIter++;
- } while ( pLastFrm );
+ pFrm = aIter.Next();
}
if ( IsInCache() )
@@ -550,12 +536,12 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
if( 1 == nTxtLen - nSplitPos )
{
SwDelChr aHint( nSplitPos );
- pNode->SwModify::Modify( 0, &aHint );
+ pNode->NotifyClients( 0, &aHint );
}
else
{
SwDelTxt aHint( nSplitPos, nTxtLen - nSplitPos );
- pNode->SwModify::Modify( 0, &aHint );
+ pNode->NotifyClients( 0, &aHint );
}
}
if ( HasHints() )
@@ -638,7 +624,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
if( GetDepends() && SFX_ITEM_SET == pNode->GetSwAttrSet().
GetItemState( RES_PAGEDESC, TRUE, &pItem ) )
{
- pNode->Modify( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
+ pNode->ModifyNotification( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem );
}
}
return pNode;
@@ -1501,7 +1487,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
{
// Frames benachrichtigen, sonst verschwinden die Ftn-Nummern
SwUpdateAttr aHint( nOldPos, nOldPos, 0 );
- pDest->Modify( 0, &aHint );
+ pDest->ModifyNotification( 0, &aHint );
}
}
@@ -1860,7 +1846,7 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx,
if ( GetDepends() )
{
SwInsTxt aHint( aPos, nLen );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
// By inserting a character, the hidden flags
@@ -2254,9 +2240,9 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
// Frames benachrichtigen;
SwInsTxt aInsHint( nDestStart, nLen );
- pDest->Modify( 0, &aInsHint );
+ pDest->ModifyNotification( 0, &aInsHint );
SwDelTxt aDelHint( nTxtStartIdx, nLen );
- Modify( 0, &aDelHint );
+ ModifyNotification( 0, &aDelHint );
}
@@ -2351,12 +2337,12 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
if( 1 == nCnt )
{
SwDelChr aHint( nStartIdx );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
else
{
SwDelTxt aHint( nStartIdx, nCnt );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
ASSERT(rIdx.GetIndex() == nStartIdx, "huh? start index has changed?");
@@ -2416,9 +2402,9 @@ void SwTxtNode::GCAttr()
{
//TxtFrm's reagieren auf aHint, andere auf aNew
SwUpdateAttr aHint( nMin, nMax, 0 );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
SwFmtChg aNew( GetTxtColl() );
- SwModify::Modify( 0, &aNew );
+ NotifyClients( 0, &aNew );
}
}
@@ -2566,9 +2552,9 @@ void SwTxtNode::NumRuleChgd()
}
SetInSwFntCache( FALSE );
- SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace();
- SwModify::Modify( &rLR, &rLR );
+ SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace();
+ NotifyClients( &rLR, &rLR );
}
// -> #i27615#
@@ -3460,10 +3446,10 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
SetIgnoreDontExpand( bOldExpFlg );
SwDelTxt aDelHint( nStartPos, nDelLen );
- SwModify::Modify( 0, &aDelHint );
+ NotifyClients( 0, &aDelHint );
SwInsTxt aHint( nStartPos, rText.Len() );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
// --> OD 2008-03-27 #refactorlists#
@@ -3689,7 +3675,7 @@ namespace {
}
// <--
-void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
+void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
bool bWasNotifiable = m_bNotifiable;
m_bNotifiable = false;
@@ -3700,7 +3686,7 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue )
// Bug25481:
// bei Nodes im Undo nie _ChgTxtCollUpdateNum rufen.
if( pOldValue && pNewValue && RES_FMT_CHG == pOldValue->Which() &&
- pRegisteredIn == ((SwFmtChg*)pNewValue)->pChangedFmt &&
+ GetRegisteredIn() == ((SwFmtChg*)pNewValue)->pChangedFmt &&
GetNodes().IsDocNodes() )
{
_ChgTxtCollUpdateNum(
@@ -5056,7 +5042,6 @@ USHORT SwTxtNode::ResetAllAttr()
}
// <--
-
// sw::Metadatable
::sfx2::IXmlIdRegistry& SwTxtNode::GetRegistry()
{
@@ -5078,6 +5063,12 @@ bool SwTxtNode::IsInContent() const
return !GetDoc()->IsInHeaderFooter( SwNodeIndex(*this) );
}
+void SwTxtNode::SwClientNotify( SwModify* pModify, USHORT nWhich )
+{
+ if ( nWhich == RES_CONDTXTFMTCOLL && pModify == GetRegisteredIn() )
+ ChkCondColl();
+}
+
#include <unoparagraph.hxx>
using namespace ::com::sun::star;
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index ac2f281b0d90..82a3642e4b2d 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -213,22 +213,20 @@ splitPolicy(const USHORT nWhichNew, const USHORT nWhichOther)
}
}
-static void
-lcl_InitINetFmt(SwTxtNode & rNode, SwTxtINetFmt * pNew)
+void SwTxtINetFmt::InitINetFmt(SwTxtNode & rNode)
{
- pNew->ChgTxtNode(&rNode);
+ ChgTxtNode(&rNode);
SwCharFmt * const pFmt(
rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_INET_NORMAL) );
- pFmt->Add( pNew );
+ pFmt->Add( this );
}
-static void
-lcl_InitRuby(SwTxtNode & rNode, SwTxtRuby * pNew)
+void SwTxtRuby::InitRuby(SwTxtNode & rNode)
{
- pNew->ChgTxtNode(&rNode);
+ ChgTxtNode(&rNode);
SwCharFmt * const pFmt(
rNode.GetDoc()->GetCharFmtFromPool(RES_POOLCHR_RUBYTEXT) );
- pFmt->Add( pNew );
+ pFmt->Add( this );
}
/**
@@ -244,12 +242,12 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting,
{
case RES_TXTATR_INETFMT:
{
- lcl_InitINetFmt(rNode, static_cast<SwTxtINetFmt*>(pNew));
+ static_cast<SwTxtINetFmt*>(pNew)->InitINetFmt(rNode);
break;
}
case RES_TXTATR_CJK_RUBY:
{
- lcl_InitRuby(rNode, static_cast<SwTxtRuby*>(pNew));
+ static_cast<SwTxtRuby*>(pNew)->InitRuby(rNode);
break;
}
default:
@@ -1192,7 +1190,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr )
if( nDelMsg && !pDoc->IsInDtor() && GetNodes().IsDocNodes() )
{
SwPtrMsgPoolItem aMsgHint( nDelMsg, (void*)&pAttr->GetAttr() );
- pDoc->GetUnoCallBack()->Modify( &aMsgHint, &aMsgHint );
+ pDoc->GetUnoCallBack()->ModifyNotification( &aMsgHint, &aMsgHint );
}
SwTxtAttr::Destroy( pAttr, pDoc->GetAttrPool() );
@@ -1520,7 +1518,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr )
*pAttr->GetStart(), *pAttr->GetEnd(), pAttr->Which() );
m_pSwpHints->Delete( pAttr );
SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() );
- SwModify::Modify( 0, &aHint ); // notify Frames
+ NotifyClients( 0, &aHint );
TryDeleteSwpHints();
}
@@ -1588,7 +1586,7 @@ void SwTxtNode::DeleteAttributes( const USHORT nWhich,
SwUpdateAttr aHint( nStart, *pEndIdx, nWhich );
m_pSwpHints->DeleteAtPos( nPos ); // gefunden, loeschen,
SwTxtAttr::Destroy( pTxtHt, GetDoc()->GetAttrPool() );
- SwModify::Modify( 0, &aHint ); // die Frames benachrichtigen
+ NotifyClients( 0, &aHint );
}
}
}
@@ -2340,7 +2338,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd )
if( aNdSet.Count() )
{
SwFmtChg aTmp1( pNd->GetFmtColl() );
- pNd->SwModify::Modify( &aTmp1, &aTmp1 );
+ pNd->NotifyClients( &aTmp1, &aTmp1 );
}
}
}
@@ -2631,7 +2629,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
}
// <--
case RES_TXTATR_INETFMT:
- lcl_InitINetFmt(rNode, static_cast<SwTxtINetFmt*>(pHint));
+ static_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode);
break;
case RES_TXTATR_FIELD:
{
@@ -2684,7 +2682,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
{
SwFmtFld* pFmtFld = (SwFmtFld*)&((SwTxtFld*)pHint)
->GetFld();
- pFldType->Add( pFmtFld ); // ummelden
+ pFmtFld->RegisterToFieldType( *pFldType );
pFmtFld->GetFld()->ChgTyp( pFldType );
}
pFldType->SetSeqRefNo( *(SwSetExpField*)pFld );
@@ -2765,7 +2763,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
break;
case RES_TXTATR_CJK_RUBY:
- lcl_InitRuby(rNode, static_cast<SwTxtRuby*>(pHint));
+ static_cast<SwTxtRuby*>(pHint)->InitRuby(rNode);
break;
case RES_TXTATR_META:
@@ -2798,7 +2796,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
if ( rNode.GetDepends() )
{
SwUpdateAttr aHint( nHtStart, nHtStart, nWhich );
- rNode.Modify( 0, &aHint );
+ rNode.ModifyNotification( 0, &aHint );
}
return true;
}
@@ -2880,7 +2878,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
if ( rNode.GetDepends() )
{
SwUpdateAttr aHint( nHtStart, nHtStart == nHintEnd ? nHintEnd + 1 : nHintEnd, nWhich );
- rNode.Modify( 0, &aHint );
+ rNode.ModifyNotification( 0, &aHint );
}
#ifdef DBG_UTIL
diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx
index 5499eeab4439..d63fe84420b3 100644
--- a/sw/source/core/txtnode/txtatr2.cxx
+++ b/sw/source/core/txtnode/txtatr2.cxx
@@ -67,7 +67,7 @@ SwTxtCharFmt::~SwTxtCharFmt( )
{
}
-void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtCharFmt::ModifyNotification( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -77,12 +77,12 @@ void SwTxtCharFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
// erfrage vom Modify Informationen
-BOOL SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
+bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const
{
if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode ||
&m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes )
@@ -181,12 +181,12 @@ SwCharFmt* SwTxtINetFmt::GetCharFmt()
if( pRet )
pRet->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return pRet;
}
-void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -196,7 +196,7 @@ void SwTxtINetFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -235,7 +235,7 @@ SwTxtRuby::~SwTxtRuby()
{
}
-void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
ASSERT( isCHRATR(nWhich) || (RES_OBJECTDYING == nWhich)
@@ -245,7 +245,7 @@ void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( m_pTxtNode )
{
SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich );
- m_pTxtNode->Modify( &aUpdateAttr, &aUpdateAttr );
+ m_pTxtNode->ModifyNotification( &aUpdateAttr, &aUpdateAttr );
}
}
@@ -298,7 +298,7 @@ SwCharFmt* SwTxtRuby::GetCharFmt()
if( pRet )
pRet->Add( this );
else if( GetRegisteredIn() )
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
return pRet;
}
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 823bedb96772..b37b30461bbc 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -617,9 +617,9 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
}
//TxtFrm's reagieren auf aHint, andere auf aNew
SwUpdateAttr aHint( nMin, nMax, 0 );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
SwFmtChg aNew( GetFmtColl() );
- SwModify::Modify( 0, &aNew );
+ NotifyClients( 0, &aNew );
}
}
@@ -1868,10 +1868,10 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
// notify the layout!
SwDelTxt aDelHint( nPos, nTLen );
- SwModify::Modify( 0, &aDelHint );
+ NotifyClients( 0, &aDelHint );
SwInsTxt aHint( nPos, nTLen );
- SwModify::Modify( 0, &aHint );
+ NotifyClients( 0, &aHint );
}
void SwTxtNode::CountWords( SwDocStat& rStat,
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 9a395375eabe..b51bca0280c0 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -68,13 +68,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pHeaderFmt = rHead.GetHeaderFmt();
if( pHeaderFmt )
{
- SwClientIter aIter( *pHeaderFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nHeaderCount;
- } while( 0 != ( pLast = aIter++ ));
+ nHeaderCount = pHeaderFmt->GetClientCount();
const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -85,13 +79,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt();
if( pLeftHeaderFmt )
{
- SwClientIter aIter( *pLeftHeaderFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nLeftHeaderCount;
- } while( 0 != ( pLast = aIter++ ));
+ nLeftHeaderCount = pLeftHeaderFmt->GetClientCount();
const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
@@ -104,13 +92,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pFooterFmt = rFoot.GetFooterFmt();
if( pFooterFmt )
{
- SwClientIter aIter( *pFooterFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nFooterCount;
- } while( 0 != ( pLast = aIter++ ));
+ nFooterCount = pFooterFmt->GetClientCount();
const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt();
if( pCntnt->GetCntntIdx() )
nFooterMaster = pCntnt->GetCntntIdx()->GetIndex();
@@ -121,13 +103,7 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt();
if( pLeftFooterFmt )
{
- SwClientIter aIter( *pLeftFooterFmt );
- SwClient *pLast = aIter.GoStart();
- if( pLast )
- do
- {
- ++nLeftFooterCount;
- } while( 0 != ( pLast = aIter++ ));
+ nLeftFooterCount = pLeftFooterFmt->GetClientCount();
const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt();
if( pLeftCntnt->GetCntntIdx() )
nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex();
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 6848f1b13644..ea605cd23f02 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -366,7 +366,7 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, ULONG nNodePos )
, m_nStart( *pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
{
- const_cast<SwModify*>(m_TOXMark.GetRegisteredIn())->Remove( &m_TOXMark );
+ m_TOXMark.DeRegister();
}
@@ -395,7 +395,7 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
}
SwTOXMark aNew( m_TOXMark );
- pToxType->Add( &aNew );
+ aNew.RegisterToTOXType( *pToxType );
pTxtNd->InsertItem( aNew, m_nStart, m_nEnd,
nsSetAttrMode::SETATTR_NOTXTATRCHR );
@@ -1387,7 +1387,7 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst )
_MakeSetWhichIds();
}
-void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
if ( m_pHistory && ( pOld || pNew ) )
{
@@ -1399,7 +1399,7 @@ void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
SwHistoryHint* pNewHstr;
const SfxItemSet& rSet =
- *static_cast<SwAttrSetChg*>(pOld)->GetChgSet();
+ *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet();
if ( 1 < rSet.Count() )
{
pNewHstr =
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index a4e5ded47f07..27fb1040010d 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -61,7 +61,7 @@
#include <redline.hxx>
#include <section.hxx>
#include <charfmt.hxx>
-
+#include <switerator.hxx>
inline SwDoc& SwUndoIter::GetDoc() const
@@ -76,49 +76,52 @@ SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
{
}
-void SwUndoFmtAttrHelper::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- if( pOld && pNew )
+ if( pOld )
{
- if( POOLATTR_END >= pOld->Which() )
+ if ( pOld->Which() == RES_OBJECTDYING )
{
- if ( GetUndo() )
- {
- m_pUndo->PutAttr( *pOld );
- }
- else
- {
- m_pUndo.reset( new SwUndoFmtAttr( *pOld,
- *static_cast<SwFmt*>(pRegisteredIn), m_bSaveDrawPt ) );
- }
+ CheckRegistration( pOld, pNew );
}
- else if ( RES_ATTRSET_CHG == pOld->Which() )
+ else if ( pNew )
{
- if ( GetUndo() )
+ if( POOLATTR_END >= pOld->Which() )
{
- SfxItemIter aIter(
- *(static_cast<SwAttrSetChg*>(pOld))->GetChgSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- while ( pItem )
+ if ( GetUndo() )
{
- m_pUndo->PutAttr( *pItem );
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ m_pUndo->PutAttr( *pOld );
+ }
+ else
+ {
+ m_pUndo.reset( new SwUndoFmtAttr( *pOld,
+ *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
}
}
- else
+ else if ( RES_ATTRSET_CHG == pOld->Which() )
{
- m_pUndo.reset( new SwUndoFmtAttr(
- *static_cast<SwAttrSetChg*>(pOld)->GetChgSet(),
- *static_cast<SwFmt*>(pRegisteredIn), m_bSaveDrawPt ) );
+ if ( GetUndo() )
+ {
+ SfxItemIter aIter(
+ *(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet() );
+ const SfxPoolItem* pItem = aIter.GetCurItem();
+ while ( pItem )
+ {
+ m_pUndo->PutAttr( *pItem );
+ if( aIter.IsAtEnd() )
+ break;
+ pItem = aIter.NextItem();
+ }
+ }
+ else
+ {
+ m_pUndo.reset( new SwUndoFmtAttr(
+ *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(),
+ *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) );
+ }
}
}
- else
- SwClient::Modify( pOld, pNew );
}
- else
- SwClient::Modify( pOld, pNew );
}
// -----------------------------------------------------
@@ -165,8 +168,7 @@ void SwUndoFmtAttr::Init()
static_cast<const SwFrmFmtPtr>(m_pFmt)))
{
// Table Format: save table position, table formats are volatile!
- SwTable * pTbl = static_cast<SwTable*>(
- SwClientIter( *m_pFmt ).First( TYPE( SwTable )) );
+ SwTable * pTbl = SwIterator<SwTable,SwFmt>::FirstElement( *m_pFmt );
if ( pTbl )
{
m_nNodeIndex = pTbl->GetTabSortBoxes()[ 0 ]->GetSttNd()
@@ -180,8 +182,7 @@ void SwUndoFmtAttr::Init()
}
else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) )
{
- SwTableBox* pTblBox = static_cast< SwTableBox* >(
- SwClientIter( *m_pFmt ).First( TYPE( SwTableBox )));
+ SwTableBox * pTblBox = SwIterator<SwTableBox,SwFmt>::FirstElement( *m_pFmt );
if ( pTblBox )
{
m_nNodeIndex = pTblBox->GetSttIdx();
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 3d38407a9e56..5bb97370b674 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -168,7 +168,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
// alle Uno-Objecte sollten sich jetzt abmelden
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrmFmt );
- pFrmFmt->Modify( &aMsgHint, &aMsgHint );
+ pFrmFmt->ModifyNotification( &aMsgHint, &aMsgHint );
}
if ( RES_DRAWFRMFMT != pFrmFmt->Which() )
@@ -485,6 +485,11 @@ SwUndoSetFlyFmt::~SwUndoSetFlyFmt()
delete pItemSet;
}
+void SwUndoSetFlyFmt::DeRegisterFromFormat( SwFmt& rFmt )
+{
+ rFmt.Remove(this);
+}
+
void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
ULONG nNode, xub_StrLen nCntnt )
{
@@ -678,7 +683,7 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
pItemSet->InvalidateItem( nWhich );
}
-void SwUndoSetFlyFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* )
+void SwUndoSetFlyFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* )
{
if( pOld )
{
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 4b9505797c57..2b4565c8fc71 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -59,9 +59,6 @@ struct SwUndoGroupObjImpl
SwDrawFrmFmt* pFmt;
SdrObject* pObj;
ULONG nNodeIdx;
-
- // OD 2004-04-15 #i26791# - keeping the anchor and the relative position
- // of drawing objects no longer needed
};
@@ -81,7 +78,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
{
ClearRedo();
const SdrMarkList* pMarkList = 0;
- ViewShell* pSh = GetCurrentViewShell() ? GetCurrentViewShell() : 0; //swmod 071108//swmod 071225
+ ViewShell* pSh = GetCurrentViewShell();
if( pSh && pSh->HasDrawView() )
pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
@@ -129,7 +126,7 @@ String SwSdrUndo::GetComment() const
void lcl_SendRemoveToUno( SwFmt& rFmt )
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFmt );
- rFmt.Modify( &aMsgHint, &aMsgHint );
+ rFmt.ModifyNotification( &aMsgHint, &aMsgHint );
}
void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
@@ -147,15 +144,15 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
{
nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex();
- // TextAttribut zerstoeren
+ // destroy TextAttribute
SwTxtNode *pTxtNd = pFmt->GetDoc()->GetNodes()[ rNodePos ]->GetTxtNode();
- ASSERT( pTxtNd, "Kein Textnode gefunden" );
+ ASSERT( pTxtNd, "No text node found!" );
SwTxtFlyCnt* pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntntPos, RES_TXTATR_FLYCNT ));
- // Attribut steht noch im TextNode, loeschen
+ // attribute still in text node, delete
if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFmt )
{
- // Pointer auf 0, nicht loeschen
+ // just set pointer to 0, don't delete
((SwFmtFlyCnt&)pAttr->GetFlyCnt()).SetFlyFmt();
SwIndex aIdx( pTxtNd, nCntntPos );
pTxtNd->EraseText( aIdx, 1 );
@@ -218,7 +215,7 @@ SwUndoDrawGroup::~SwUndoDrawGroup()
delete pTmp->pFmt;
}
else
- delete pObjArr->pFmt; // das GroupObject-Format
+ delete pObjArr->pFmt;
delete [] pObjArr;
}
@@ -227,22 +224,22 @@ void SwUndoDrawGroup::Undo( SwUndoIter& )
{
bDelFmt = FALSE;
- // das Group-Object sichern
+ // save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
SwDrawContact* pDrawContact = (SwDrawContact*)pFmt->FindContactObj();
SdrObject* pObj = pDrawContact->GetMaster();
pObjArr->pObj = pObj;
- //loescht sich selbst!
+ // object will destroy itself
pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -258,19 +255,15 @@ void SwUndoDrawGroup::Undo( SwUndoIter& )
SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj );
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
}
@@ -278,7 +271,7 @@ void SwUndoDrawGroup::Redo( SwUndoIter& )
{
bDelFmt = TRUE;
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pObjArr->pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
SdrObject* pObj;
@@ -290,38 +283,35 @@ void SwUndoDrawGroup::Redo( SwUndoIter& )
pObj = rSave.pObj;
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
- //loescht sich selbst!
+
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *rSave.pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt ));
}
- // das Group-Object wieder einfuegen
+ // re-insert group object
::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx );
rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() );
SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj );
- // OD 2004-04-15 #i26791# - correction: connect object to layout
+ // #i26791# - correction: connect object to layout
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
- // <--
}
void SwUndoDrawGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
@@ -331,10 +321,10 @@ void SwUndoDrawGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj )
rSave.pFmt = pFmt;
::lcl_SaveAnchor( pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
}
@@ -360,16 +350,16 @@ SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj )
pObjArr->pObj = pObj;
pObjArr->pFmt = pFmt;
- //loescht sich selbst!
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pFmt->GetDoc()->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
}
@@ -383,7 +373,7 @@ SwUndoDrawUnGroup::~SwUndoDrawUnGroup()
delete pTmp->pFmt;
}
else
- delete pObjArr->pFmt; // das GroupObject-Format
+ delete pObjArr->pFmt;
delete [] pObjArr;
}
@@ -392,7 +382,7 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
{
bDelFmt = TRUE;
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = &rIter.GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
@@ -400,65 +390,50 @@ void SwUndoDrawUnGroup::Undo( SwUndoIter& rIter )
{
SwUndoGroupObjImpl& rSave = *( pObjArr + n );
- // --> OD 2006-11-01 #130889# - taken over by <SwUndoDrawUnGroupConnectToLayout>
-// SwDrawContact* pContact = (SwDrawContact*)rSave.pFmt->FindContactObj();
-
-// rSave.pObj = pContact->GetMaster();
-
-// //loescht sich selbst!
-// pContact->Changed( *rSave.pObj, SDRUSERCALL_DELETE,
-// rSave.pObj->GetLastBoundRect() );
-// rSave.pObj->SetUserCall( 0 );
- // <--
-
::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *rSave.pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( rSave.pFmt ));
}
- // das Group-Object wieder einfuegen
+ // re-insert group object
::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx );
rFlyFmts.Insert( pObjArr->pFmt, rFlyFmts.Count() );
SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj );
pContact->ConnectToLayout();
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( pObjArr->pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet();
}
- // <--
}
void SwUndoDrawUnGroup::Redo( SwUndoIter& )
{
bDelFmt = FALSE;
- // das Group-Object sichern
+ // save group object
SwDrawFrmFmt* pFmt = pObjArr->pFmt;
SwDrawContact* pContact = (SwDrawContact*)pFmt->FindContactObj();
- //loescht sich selbst!
+ // object will destroy itself
pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE,
pObjArr->pObj->GetLastBoundRect() );
pObjArr->pObj->SetUserCall( 0 );
::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -470,25 +445,13 @@ void SwUndoDrawUnGroup::Redo( SwUndoIter& )
::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx );
rFlyFmts.Insert( rSave.pFmt, rFlyFmts.Count() );
- // --> OD 2006-11-01 #130889# - taken over by <SwUndoDrawUnGroupConnectToLayout>
-// SdrObject* pObj = rSave.pObj;
-
-// SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, rSave.pObj );
-// pContact->ConnectToLayout();
-// // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
-// // move object to visible layer
-// pContact->MoveObjToVisibleLayer( rSave.pObj );
-// // <--
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
}
@@ -499,8 +462,6 @@ void SwUndoDrawUnGroup::AddObj( USHORT nPos, SwDrawFrmFmt* pFmt )
rSave.pObj = 0;
}
-//-------------------------------------
-// --> OD 2006-11-01 #130889#
SwUndoDrawUnGroupConnectToLayout::SwUndoDrawUnGroupConnectToLayout()
: SwUndo( UNDO_DRAWUNGROUP )
{
@@ -548,7 +509,6 @@ void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
aDrawFmtsAndObjs.push_back(
std::pair< SwDrawFrmFmt*, SdrObject* >( pDrawFrmFmt, pDrawObject ) );
}
-// <--
//-------------------------------------
@@ -583,19 +543,15 @@ void SwUndoDrawDelete::Undo( SwUndoIter &rIter )
SdrObject *pObj = rSave.pObj;
SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj );
pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL );
- // --> OD 2005-03-22 #i45718# - follow-up of #i35635#
- // move object to visible layer
+ // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj );
- // <--
- // --> OD 2005-05-10 #i45952# - notify that position attributes
- // are already set
+ // #i45952# - notify that position attributes are already set
ASSERT( rSave.pFmt->ISA(SwDrawFrmFmt),
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( rSave.pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
rIter.pMarkList = pMarkLst;
}
@@ -610,11 +566,12 @@ void SwUndoDrawDelete::Redo( SwUndoIter &rIter )
SdrObject *pObj = rSave.pObj;
SwDrawContact *pContact = (SwDrawContact*)GetUserCall(pObj);
SwDrawFrmFmt *pFmt = (SwDrawFrmFmt*)pContact->GetFmt();
- //loescht sich selbst!
+
+ // object will destroy itself
pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() );
pObj->SetUserCall( 0 );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
@@ -630,10 +587,10 @@ void SwUndoDrawDelete::AddObj( USHORT , SwDrawFrmFmt* pFmt,
rSave.pFmt = pFmt;
::lcl_SaveAnchor( pFmt, rSave.nNodeIdx );
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // notify UNO objects to decouple
::lcl_SendRemoveToUno( *pFmt );
- // aus dem Array austragen
+ // remove from array
SwDoc* pDoc = pFmt->GetDoc();
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFmt ));
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index f66cae89ce21..c463c62edcf0 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -62,6 +62,7 @@
#include <fmtanchr.hxx>
#include <comcore.hrc>
#include <unochart.hxx>
+#include <switerator.hxx>
#ifndef DBG_UTIL
#define CHECK_TABLE(t)
@@ -134,7 +135,7 @@ public:
~_SaveTable();
USHORT AddFmt( SwFrmFmt* pFmt, bool bIsLine );
- void NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine, USHORT nFmtPos,
+ void NewFrmFmt( const SwTableLine* , const SwTableBox*, USHORT nFmtPos,
SwFrmFmt* pOldFmt );
void RestoreAttr( SwTable& rTbl, BOOL bModifyBox = FALSE );
@@ -494,7 +495,7 @@ void SwUndoTblToTxt::Undo( SwUndoIter& rUndoIter )
SwTableNode* pTblNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves );
pTblNd->GetTable().SetTableModel( pTblSave->IsNewModel() );
SwTableFmt* pTableFmt = rDoc.MakeTblFrmFmt( sTblNm, rDoc.GetDfltFrmFmt() );
- pTableFmt->Add( &pTblNd->GetTable() ); // das Frame-Format setzen
+ pTblNd->GetTable().RegisterToFormat( *pTableFmt );
pTblNd->GetTable().SetRowsToRepeat( nHdlnRpt );
// erzeuge die alte Tabellen Struktur
@@ -986,12 +987,12 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, BOOL bMdfyBox )
}
// zur Sicherheit alle Tableframes invalidieren
- SwClientIter aIter( *pFmt );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
- if( ((SwTabFrm*)pLast)->GetTable() == &rTbl )
+ SwIterator<SwTabFrm,SwFmt> aIter( *pFmt );
+ for( SwTabFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
+ if( pLast->GetTable() == &rTbl )
{
- ((SwTabFrm*)pLast)->InvalidateAll();
- ((SwTabFrm*)pLast)->SetCompletePaint();
+ pLast->InvalidateAll();
+ pLast->SetCompletePaint();
}
// FrmFmts mit Defaults (0) fuellen
@@ -1123,7 +1124,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, BOOL bCreateFrms,
}
-void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine,
+void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
USHORT nFmtPos, SwFrmFmt* pOldFmt )
{
SwDoc* pDoc = pOldFmt->GetDoc();
@@ -1131,7 +1132,7 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine,
SwFrmFmt* pFmt = aFrmFmts[ nFmtPos ];
if( !pFmt )
{
- if( bIsLine )
+ if( pTblLn )
pFmt = pDoc->MakeTableLineFmt();
else
pFmt = pDoc->MakeTableBoxFmt();
@@ -1140,16 +1141,16 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine,
}
//Erstmal die Frms ummelden.
- SwClientIter aIter( *pOldFmt );
- for( SwClient* pLast = aIter.First( TYPE( SwFrm ) ); pLast; pLast = aIter.Next() )
+ SwIterator<SwTabFrm,SwFmt> aIter( *pOldFmt );
+ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() )
{
- if( bIsLine ? pLnBx == ((SwRowFrm*)pLast)->GetTabLine()
- : pLnBx == ((SwCellFrm*)pLast)->GetTabBox() )
+ if( pTblLn ? ((SwRowFrm*)pLast)->GetTabLine() == pTblLn
+ : ((SwCellFrm*)pLast)->GetTabBox() == pTblBx )
{
- pFmt->Add( pLast );
- ((SwFrm*)pLast)->InvalidateAll();
- ((SwFrm*)pLast)->ReinitializeFrmSizeAttrFlags();
- if ( !bIsLine )
+ pLast->RegisterToFormat(*pFmt);
+ pLast->InvalidateAll();
+ pLast->ReinitializeFrmSizeAttrFlags();
+ if ( !pTblLn )
{
((SwCellFrm*)pLast)->SetDerivedVert( FALSE );
((SwCellFrm*)pLast)->CheckDirChange();
@@ -1158,14 +1159,17 @@ void _SaveTable::NewFrmFmt( const SwClient* pLnBx, BOOL bIsLine,
}
//Jetzt noch mich selbst ummelden.
- pFmt->Add( (SwClient*)pLnBx );
+ if ( pTblLn )
+ const_cast<SwTableLine*>(pTblLn)->RegisterToFormat( *pFmt );
+ else if ( pTblBx )
+ const_cast<SwTableBox*>(pTblBx)->RegisterToFormat( *pFmt );
- if( bModifyBox && !bIsLine )
+ if( bModifyBox && !pTblLn )
{
const SfxPoolItem& rOld = pOldFmt->GetFmtAttr( RES_BOXATR_FORMAT ),
& rNew = pFmt->GetFmtAttr( RES_BOXATR_FORMAT );
if( rOld != rNew )
- pFmt->Modify( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew );
+ pFmt->ModifyNotification( (SfxPoolItem*)&rOld, (SfxPoolItem*)&rNew );
}
if( !pOldFmt->GetDepends() )
@@ -1198,7 +1202,7 @@ _SaveLine::~_SaveLine()
void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl )
{
- rSTbl.NewFrmFmt( &rLine, TRUE, nItemSet, rLine.GetFrmFmt() );
+ rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() );
_SaveBox* pBx = pBox;
for( USHORT n = 0; n < rLine.GetTabBoxes().Count(); ++n, pBx = pBx->pNext )
@@ -1288,7 +1292,7 @@ _SaveBox::~_SaveBox()
void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
{
- rSTbl.NewFrmFmt( &rBox, FALSE, nItemSet, rBox.GetFrmFmt() );
+ rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() );
if( ULONG_MAX == nSttNode ) // keine EndBox
{
@@ -1405,7 +1409,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
ASSERT( pBox, "Wo ist meine TabellenBox geblieben?" );
SwFrmFmt* pOld = pBox->GetFrmFmt();
- pFmt->Add( pBox );
+ pBox->RegisterToFormat( *pFmt );
if( !pOld->GetDepends() )
delete pOld;
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 590ddb6e803e..b02ebbb16324 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -91,7 +91,7 @@ public:
}
void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk);
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
@@ -594,7 +594,7 @@ uno::Type SwXFieldmarkParameters::getElementType()
return !getCoreParameters()->empty();
}
-void SwXFieldmarkParameters::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFieldmarkParameters::Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 703389a58f7e..c1d4cdb882d0 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1595,7 +1595,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames
}
-void SwChartDataProvider::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwChartDataProvider::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
// actually this function should be superfluous (need to check later)
ClientModify(this, pOld, pNew );
@@ -2496,7 +2496,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames
}
-void SwChartDataSequence::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwChartDataSequence::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 0b8f938d307d..ea3104aa69e4 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -31,9 +31,7 @@
#include <swtypes.hxx>
#include <cmdid.h>
#include <hintids.hxx>
-#ifndef _SVX_SVXIDS_HRC //autogen
#include <svx/svxids.hrc>
-#endif
#include <doc.hxx>
#include <docary.hxx>
#include <fmtcol.hxx>
@@ -72,14 +70,13 @@
#include <comphelper/sequence.hxx>
#include <slist>
#include <iterator>
-
#include <unosection.hxx>
#include <unoparagraph.hxx>
#include <unobookmark.hxx>
#include <unorefmark.hxx>
#include <unometa.hxx>
#include "docsh.hxx"
-
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -272,9 +269,6 @@ const ProvNamesId_Type __FAR_DATA aProvNamesId[] =
{ CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY }
};
-/* -----------------------------23.03.01 13:38--------------------------------
-
- ---------------------------------------------------------------------------*/
const SvEventDescription* lcl_GetSupportedMacroItems()
{
static const SvEventDescription aMacroDescriptionsImpl[] =
@@ -290,9 +284,6 @@ const SvEventDescription* lcl_GetSupportedMacroItems()
/******************************************************************
* SwXServiceProvider
******************************************************************/
-/*-- 13.01.99 13:31:44---------------------------------------------------
-
- -----------------------------------------------------------------------*/
OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -302,9 +293,7 @@ OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
sRet = C2U(aProvNamesId[nObjectType].pName);
return sRet;
}
-/* -----------------11.03.99 12:05-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
{
sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
@@ -325,9 +314,6 @@ uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
}
-/*-- 13.01.99 13:31:45---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
{
sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
@@ -338,9 +324,7 @@ sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
}
return SW_SERVICE_INVALID;
}
-/* -----------------13.01.99 14:37-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -570,8 +554,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
}
else
{
- SwClientIter aIter( *pType );
- SwXFieldMaster* pMaster = (SwXFieldMaster*)aIter.First( TYPE( SwXFieldMaster ));
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(pMaster)
xRet = (cppu::OWeakObject*)pMaster;
}
@@ -625,24 +608,17 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
******************************************************************/
//SMART_UNO_IMPLEMENTATION( SwXTextTables, UsrObject );
-/*-- 13.01.99 12:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTables::SwXTextTables(SwDoc* pDc) :
SwUnoCollection(pDc)
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTables::~SwXTextTables()
{
}
-/*-- 13.01.99 12:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -651,9 +627,7 @@ sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException )
nRet = GetDoc()->GetTblFrmFmtCount(sal_True);
return nRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -675,9 +649,7 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -706,9 +678,7 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 13.01.99 12:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -729,9 +699,7 @@ uno::Sequence< OUString > SwXTextTables::getElementNames(void)
}
return aSeq;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw( uno::RuntimeException )
{
@@ -755,18 +723,14 @@ sal_Bool SwXTextTables::hasByName(const OUString& rName)
throw uno::RuntimeException();
return bRet;
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextTables::getElementType( )
throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextTable>*)0);
}
-/*-- 13.01.99 12:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -774,23 +738,17 @@ sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return 0 != GetDoc()->GetTblFrmFmtCount(sal_True);
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName == C2U("com.sun.star.text.TextTables");
}
-/* -----------------25.10.99 16:01-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -798,14 +756,11 @@ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( u
pArr[0] = C2U("com.sun.star.text.TextTables");
return aRet;
}
-/*-- 13.01.99 12:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
XTextTable* SwXTextTables::GetObject( SwFrmFmt& rFmt )
{
vos::OGuard aGuard(Application::GetSolarMutex());
- SwXTextTable* pTbl = (SwXTextTable*)SwClientIter( rFmt ).
- First( TYPE( SwXTextTable ));
+ SwXTextTable* pTbl = SwIterator<SwXTextTable,SwFmt>::FirstElement( rFmt );
if( !pTbl )
pTbl = new SwXTextTable(rFmt);
return pTbl ;
@@ -846,7 +801,7 @@ namespace
template<FlyCntType T>
static uno::Any lcl_UnoWrapFrame(SwFrmFmt* pFmt)
{
- SwXFrame* pFrm = static_cast<SwXFrame*>(SwClientIter(*pFmt).First(TYPE(SwXFrame)));
+ SwXFrame* pFrm = SwIterator<SwXFrame,SwFmt>::FirstElement( *pFmt );
if(!pFrm)
pFrm = new typename UnoFrameWrap_traits<T>::core_frame_t(*pFmt);
Reference< typename UnoFrameWrap_traits<T>::uno_frame_t > xFrm =
@@ -1114,7 +1069,7 @@ sal_Bool SwXFrames::hasElements(void) throw(uno::RuntimeException)
SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType)
{
- SwXFrame* pFrm = (SwXFrame*)SwClientIter(rFmt).First(TYPE(SwXFrame));
+ SwXFrame* pFrm = SwIterator<SwXFrame,SwFmt>::FirstElement( rFmt );
if(pFrm) return pFrm;
switch(eType)
{
@@ -1132,23 +1087,16 @@ SwXFrame* SwXFrames::GetObject(SwFrmFmt& rFmt, FlyCntType eType)
/******************************************************************
* SwXTextFrames
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextFrames");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextFrames") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1156,16 +1104,12 @@ Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( Runtim
pArray[0] = C2U("com.sun.star.text.TextFrames");
return aRet;
}
-/*-- 14.01.99 08:06:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::SwXTextFrames(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_FRM)
{
}
-/*-- 14.01.99 08:06:17---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrames::~SwXTextFrames()
{
}
@@ -1173,25 +1117,17 @@ SwXTextFrames::~SwXTextFrames()
/******************************************************************
* SwXTextGraphicObjects
******************************************************************/
-//SMART_UNO_IMPLEMENTATION( SwXTextGraphicObjects, UsrObject );
-
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextGraphicObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextGraphicObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1199,16 +1135,12 @@ Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.text.TextGraphicObjects");
return aRet;
}
-/*-- 14.01.99 08:45:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::SwXTextGraphicObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_GRF)
{
}
-/*-- 14.01.99 08:45:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObjects::~SwXTextGraphicObjects()
{
}
@@ -1216,23 +1148,16 @@ SwXTextGraphicObjects::~SwXTextGraphicObjects()
/******************************************************************
* SwXTextEmbeddedObjects
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextEmbeddedObjects");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextEmbeddedObjects") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1240,16 +1165,12 @@ Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextEmbeddedObjects");
return aRet;
}
-/*-- 14.01.99 08:45:13---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::SwXTextEmbeddedObjects(SwDoc* _pDoc) :
SwXFrames(_pDoc, FLYCNTTYPE_OLE)
{
}
-/*-- 14.01.99 08:45:31---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects()
{
}
@@ -1258,23 +1179,16 @@ SwXTextEmbeddedObjects::~SwXTextEmbeddedObjects()
*
******************************************************************/
#define PASSWORD_STD_TIMEOUT 1000
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXTextSections");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.TextSections") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1282,22 +1196,16 @@ Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( Runt
pArray[0] = C2U("com.sun.star.text.TextSections");
return aRet;
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::SwXTextSections(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextSections::~SwXTextSections()
{
}
-/*-- 14.01.99 09:06:05---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1312,9 +1220,7 @@ sal_Int32 SwXTextSections::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1347,9 +1253,7 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return makeAny(xRet);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextSections::getByName(const OUString& Name)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -1378,9 +1282,7 @@ uno::Any SwXTextSections::getByName(const OUString& Name)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextSections::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -1413,9 +1315,7 @@ uno::Sequence< OUString > SwXTextSections::getElementNames(void)
}
return aSeq;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasByName(const OUString& Name)
throw( uno::RuntimeException )
{
@@ -1443,16 +1343,12 @@ sal_Bool SwXTextSections::hasByName(const OUString& Name)
}
return bRet;
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTextSections::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextSection>*)0);
}
-/*-- 14.01.99 09:06:06---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1466,9 +1362,7 @@ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return nCount > 0;
}
-/*-- 14.01.99 09:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt )
{
return SwXTextSection::CreateXTextSection(&rFmt);
@@ -1642,23 +1536,16 @@ sal_Bool SwXNumberingRulesCollection::hasElements(void) throw( uno::RuntimeExcep
return GetDoc()->GetNumRuleTbl().Count() > 0;
}
-/* -----------------------------06.04.00 12:44--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXFootnotes");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.Footnotes") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1666,23 +1553,17 @@ Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( Runtime
pArray[0] = C2U("com.sun.star.text.Footnotes");
return aRet;
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::SwXFootnotes(sal_Bool bEnd, SwDoc* _pDoc)
: SwUnoCollection(_pDoc)
, m_bEndnote(bEnd)
{
}
-/*-- 14.01.99 09:03:52---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFootnotes::~SwXFootnotes()
{
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1701,9 +1582,7 @@ sal_Int32 SwXFootnotes::getCount(void) throw( uno::RuntimeException )
}
return nCount;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1737,16 +1616,12 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:53---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXFootnotes::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XFootnote>*)0);
}
-/*-- 14.01.99 09:03:54---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1754,9 +1629,7 @@ sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return GetDoc()->GetFtnIdxs().Count() > 0;
}
-/* -----------------------------05.09.00 12:48--------------------------------
- ---------------------------------------------------------------------------*/
Reference<XFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt )
{
return SwXFootnote::CreateXFootnote(rDoc, rFmt);
@@ -1765,23 +1638,17 @@ Reference<XFootnote> SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rF
/******************************************************************
*
******************************************************************/
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException )
{
return C2U("SwXReferenceMarks");
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return C2U("com.sun.star.text.ReferenceMarks") == rServiceName;
}
-/* -----------------------------06.04.00 12:44--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
@@ -1789,22 +1656,16 @@ Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( Ru
pArray[0] = C2U("com.sun.star.text.ReferenceMarks");
return aRet;
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::SwXReferenceMarks(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 14.01.99 09:03:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMarks::~SwXReferenceMarks()
{
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1812,9 +1673,7 @@ sal_Int32 SwXReferenceMarks::getCount(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw( IndexOutOfBoundsException, WrappedTargetException, uno::RuntimeException )
{
@@ -1836,9 +1695,7 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
throw IndexOutOfBoundsException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException )
{
@@ -1859,9 +1716,7 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName)
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1879,9 +1734,7 @@ uno::Sequence< OUString > SwXReferenceMarks::getElementNames(void) throw( uno::R
throw uno::RuntimeException();
return aRet;
}
-/*-- 14.01.99 09:03:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1889,16 +1742,12 @@ sal_Bool SwXReferenceMarks::hasByName(const OUString& rName) throw( uno::Runtime
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMark( rName);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXReferenceMarks::getElementType() throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<XTextContent>*)0);
}
-/*-- 14.01.99 09:03:18---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1906,9 +1755,7 @@ sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return 0 != GetDoc()->GetRefMarks();
}
-/*-- 14.01.99 09:03:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1919,9 +1766,7 @@ SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark*
/******************************************************************
*
******************************************************************/
-/*-----------------11.03.98 11:18-------------------
- Gueltigkeitspruefung
---------------------------------------------------*/
+
void SwUnoCollection::Invalidate()
{
bObjectValid = sal_False;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 0379f9bdc82d..fe5dbba991df 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -385,7 +385,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
{
if( pAny )
{
- SwXTextField* pField = CreateSwXTextField(*rPam.GetDoc(),
+ SwXTextField* pField = SwXTextField::CreateSwXTextField(*rPam.GetDoc(),
pTxtAttr->GetFld());
*pAny <<= uno::Reference< XTextField >( pField );
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 9cb7775e3bee..a39931a715f5 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -60,7 +60,6 @@
#include <fmtornt.hxx>
#include <fmtanchr.hxx>
#include <fmtsrnd.hxx>
-// OD 2004-04-21 #i26791#
#include <fmtfollowtextflow.hxx>
#include <rootfrm.hxx>
#include <editeng/lrspitem.hxx>
@@ -86,6 +85,7 @@
#include <vcl/svapp.hxx>
#include <slist>
#include <iterator>
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -94,9 +94,6 @@ DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, SwShapeImplementati
static SwShapeImplementationIdMap aImplementationIdMap;
-/* -----------------22.01.99 13:19-------------------
- *
- * --------------------------------------------------*/
class SwShapeDescriptor_Impl
{
SwFmtHoriOrient* pHOrient;
@@ -282,67 +279,50 @@ public:
class SwFmDrawPage
****************************************************************************/
-/* -----------------28.01.99 12:03-------------------
- *
- * --------------------------------------------------*/
SwFmDrawPage::SwFmDrawPage( SdrPage* pPage ) :
SvxFmDrawPage( pPage ), pPageView(0)
{
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwFmDrawPage::~SwFmDrawPage() throw ()
{
RemovePageView();
}
-/*-- 22.01.99 11:13:07---------------------------------------------------
- -----------------------------------------------------------------------*/
const SdrMarkList& SwFmDrawPage::PreGroup(const uno::Reference< drawing::XShapes > & xShapes)
{
_SelectObjectsInView( xShapes, GetPageView() );
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
return rMarkList;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::PreUnGroup(const uno::Reference< drawing::XShapeGroup > xShapeGroup)
{
uno::Reference< drawing::XShape > xShape( xShapeGroup, uno::UNO_QUERY);
_SelectObjectInView( xShape, GetPageView() );
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrPageView* SwFmDrawPage::GetPageView()
{
if(!pPageView)
pPageView = mpView->ShowSdrPage( mpPage );
return pPageView;
}
-/*-- 22.01.99 11:13:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFmDrawPage::RemovePageView()
{
if(pPageView && mpView)
mpView->HideSdrPage();
pPageView = 0;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj )
{
uno::Reference< XInterface > xShape;
if( pObj )
{
SwFrmFmt* pFmt = ::FindFrmFmt( pObj );
- SwXShape* pxShape = (SwXShape*)SwClientIter( *pFmt ).
- First( TYPE( SwXShape ));
+ SwXShape* pxShape = SwIterator<SwXShape,SwFmt>::FirstElement( *pFmt );
if(pxShape)
{
xShape = *(cppu::OWeakObject*)pxShape;
@@ -352,17 +332,12 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj
}
return xShape;
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
- -----------------------------------------------------------------------*/
SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) throw ()
{
//TODO: stimmt das so - kann die Methode weg?
return SvxFmDrawPage::_CreateSdrObject( xShape );
}
-/*-- 22.01.99 11:13:09---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) const throw ()
{
@@ -507,23 +482,17 @@ uno::Reference< container::XEnumeration > SwXDrawPage::createEnumeration(void) t
return uno::Reference< container::XEnumeration >(
new SwXShapesEnumeration(this));
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
rtl::OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXDrawPage");
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXDrawPage::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.drawing.GenericDrawPage") == rServiceName;
}
-/* -----------------------------06.04.00 13:14--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aRet(1);
@@ -531,17 +500,13 @@ uno::Sequence< rtl::OUString > SwXDrawPage::getSupportedServiceNames(void) throw
pArray[0] = C2U("com.sun.star.drawing.GenericDrawPage");
return aRet;
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::SwXDrawPage(SwDoc* pDc) :
pDoc(pDc),
pDrawPage(0)
{
}
-/*-- 22.01.99 11:22:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXDrawPage::~SwXDrawPage()
{
if(xPageAgg.is())
@@ -550,9 +515,7 @@ SwXDrawPage::~SwXDrawPage()
xPageAgg->setDelegator(xInt);
}
}
-/* -----------------------------15.06.00 15:00--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException )
{
@@ -572,9 +535,7 @@ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType )
}
return aRet;
}
-/* -----------------------------15.06.00 15:01--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException )
{
uno::Sequence< uno::Type > aPageTypes = SwXDrawPageBaseClass::getTypes();
@@ -593,9 +554,7 @@ uno::Sequence< uno::Type > SwXDrawPage::getTypes() throw( uno::RuntimeException
pPageTypes[nIndex] = ::getCppuType((uno::Reference<form::XFormsSupplier2>*)0);
return aPageTypes;
}
-/*-- 22.01.99 11:33:44---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -609,9 +568,7 @@ sal_Int32 SwXDrawPage::getCount(void) throw( uno::RuntimeException )
return pDrawPage->getCount();
}
}
-/*-- 22.01.99 11:33:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -625,16 +582,12 @@ uno::Any SwXDrawPage::getByIndex(sal_Int32 nIndex)
((SwXDrawPage*)this)->GetSvxPage();
return pDrawPage->getByIndex( nIndex );
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
uno::Type SwXDrawPage::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<drawing::XShape>*)0);
}
-/* -----------------22.01.99 13:13-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -646,9 +599,6 @@ sal_Bool SwXDrawPage::hasElements(void) throw( uno::RuntimeException )
return ((SwXDrawPage*)this)->GetSvxPage()->hasElements();
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
throw( uno::RuntimeException )
{
@@ -821,9 +771,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
delete pPam;
delete pInternalPam;
}
-/* -----------------22.01.99 12:42-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -832,9 +780,7 @@ void SwXDrawPage::remove(const uno::Reference< drawing::XShape > & xShape) throw
uno::Reference<lang::XComponent> xComp(xShape, uno::UNO_QUERY);
xComp->dispose();
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< drawing::XShapes > & xShapes) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -888,9 +834,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference<
}
return xRet;
}
-/* -----------------17.02.99 10:38-------------------
- *
- * --------------------------------------------------*/
+
void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeGroup) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -914,9 +858,7 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
pPage->RemovePageView();
}
}
-/* -----------------05.05.98 17:05-------------------
- *
- * --------------------------------------------------*/
+
SwFmDrawPage* SwXDrawPage::GetSvxPage()
{
if(!xPageAgg.is() && pDoc)
@@ -952,17 +894,13 @@ void SwXDrawPage::InvalidateSwDoc()
****************************************************************************/
TYPEINIT1(SwXShape, SwClient);
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -996,9 +934,7 @@ namespace
}
}
-/* -----------------01.02.99 11:38-------------------
- *
- * --------------------------------------------------*/
+
SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE)),
m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE)),
@@ -1048,9 +984,6 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
}
}
-/*-- 09.04.09 15:06:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
{
SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS );
@@ -1085,9 +1018,7 @@ void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXShape::~SwXShape()
{
if (xShapeAgg.is())
@@ -1097,9 +1028,7 @@ SwXShape::~SwXShape()
}
delete pImpl;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeException )
{
uno::Any aRet = SwXShapeBaseClass::queryInterface(aType);
@@ -1116,9 +1045,7 @@ uno::Any SwXShape::queryInterface( const uno::Type& aType ) throw( uno::RuntimeE
// <--
return aRet;
}
-/* -----------------------------16.06.00 12:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aRet = SwXShapeBaseClass::getTypes();
@@ -1142,9 +1069,7 @@ uno::Sequence< uno::Type > SwXShape::getTypes( ) throw(uno::RuntimeException)
}
return aRet;
}
-/* -----------------------------04.04.01 07:37--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -1186,9 +1111,7 @@ uno::Sequence< sal_Int8 > SwXShape::getImplementationId( ) throw(uno::RuntimeEx
return *pImplementationId;
}
}
-/*-- 22.01.99 11:42:26---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1211,9 +1134,7 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th
aRet = m_pPropSet->getPropertySetInfo();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException,
@@ -1575,9 +1496,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
}
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -1807,12 +1726,6 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
return aRet;
}
-/** method to get property from aggregation object
-
- OD 2004-10-28 #i36248#
-
- @author OD
-*/
uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -1834,9 +1747,6 @@ uno::Any SwXShape::_getPropAtAggrObj( const ::rtl::OUString& _rPropertyName )
}
-/* -----------------------------02.11.00 09:41--------------------------------
-
- ---------------------------------------------------------------------------*/
beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1847,9 +1757,7 @@ beans::PropertyState SwXShape::getPropertyState( const rtl::OUString& rPropertyN
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aNames);
return aStates.getConstArray()[0];
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -1951,9 +1859,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
throw uno::RuntimeException();
return aRet;
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -2015,9 +1921,7 @@ void SwXShape::setPropertyToDefault( const rtl::OUString& rPropertyName )
else
throw uno::RuntimeException();
}
-/* -----------------------------02.11.00 09:41--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -2053,9 +1957,7 @@ uno::Any SwXShape::getPropertyDefault( const rtl::OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addPropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener )
@@ -2070,9 +1972,7 @@ void SwXShape::addPropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->addPropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removePropertyChangeListener(
const rtl::OUString& _propertyName,
const uno::Reference< beans::XPropertyChangeListener > & _listener)
@@ -2087,9 +1987,7 @@ void SwXShape::removePropertyChangeListener(
if ( xShapeAgg->queryAggregation( beans::XPropertySet::static_type() ) >>= xShapeProps )
xShapeProps->removePropertyChangeListener( _propertyName, _listener );
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::addVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/ )
@@ -2098,9 +1996,7 @@ void SwXShape::addVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXShape::removeVetoableChangeListener(
const rtl::OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
@@ -2109,16 +2005,12 @@ void SwXShape::removeVetoableChangeListener(
{
DBG_WARNING("not implemented");
}
-/*-- 22.01.99 11:42:28---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXShape::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXShape::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2186,9 +2078,7 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
}
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2210,9 +2100,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim
aRef = pImpl->GetTextRange();
return aRef;
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2263,9 +2151,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
xComp->dispose();
}
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::addEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2275,9 +2161,7 @@ void SwXShape::addEventListener(
if(pSvxShape)
pSvxShape->addEventListener(aListener);
}
-/* -----------------14.04.99 13:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXShape::removeEventListener(
const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
@@ -2286,16 +2170,12 @@ void SwXShape::removeEventListener(
if(pSvxShape)
pSvxShape->removeEventListener(aListener);
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
rtl::OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXShape");
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -2309,9 +2189,7 @@ sal_Bool SwXShape::supportsService(const rtl::OUString& rServiceName) throw( uno
}
return bRet;
}
-/* -----------------03.06.99 08:53-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< rtl::OUString > aSeq;
@@ -2329,9 +2207,7 @@ uno::Sequence< rtl::OUString > SwXShape::getSupportedServiceNames(void) throw( u
}
return aSeq;
}
-/* -----------------------------15.03.00 14:54--------------------------------
- ---------------------------------------------------------------------------*/
SvxShape* SwXShape::GetSvxShape()
{
SvxShape* pSvxShape = 0;
@@ -2909,9 +2785,7 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
return aConvertedPath;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
SwXShape(xShape)
{
@@ -2921,15 +2795,11 @@ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
#endif
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXGroupShape::~SwXGroupShape()
{
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
{
uno::Any aRet;
@@ -2939,23 +2809,17 @@ uno::Any SwXGroupShape::queryInterface( const uno::Type& rType ) throw(uno::Runt
aRet = SwXShape::queryInterface(rType);
return aRet;
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::acquire( ) throw()
{
SwXShape::acquire();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::release( ) throw()
{
SwXShape::release();
}
-/*-- 31.05.01 09:59:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3014,9 +2878,7 @@ void SwXGroupShape::add( const uno::Reference< XShape >& xShape ) throw (uno::Ru
else
throw uno::RuntimeException();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3031,9 +2893,7 @@ void SwXGroupShape::remove( const uno::Reference< XShape >& xShape ) throw (uno:
throw uno::RuntimeException();
xShapes->remove(xShape);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3048,9 +2908,7 @@ sal_Int32 SwXGroupShape::getCount(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return xAcc->getCount();
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException )
@@ -3067,9 +2925,7 @@ uno::Any SwXGroupShape::getByIndex(sal_Int32 nIndex)
throw uno::RuntimeException();
return xAcc->getByIndex(nIndex);
}
-/*-- 31.05.01 09:59:20---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3084,9 +2940,7 @@ uno::Type SwXGroupShape::getElementType( ) throw(uno::RuntimeException)
throw uno::RuntimeException();
return xAcc->getElementType();
}
-/*-- 31.05.01 09:59:22---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXGroupShape::hasElements( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index bd4a4ce5ef98..4608b0b6d05b 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -93,6 +93,7 @@
#include <editeng/outliner.hxx>
#include <docsh.hxx>
#include <fmtmeta.hxx> // MetaFieldManager
+#include <switerator.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -392,17 +393,13 @@ USHORT lcl_GetPropertyMapOfService( USHORT nServiceId )
* SwXFieldMaster
******************************************************************/
TYPEINIT1(SwXFieldMaster, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -414,16 +411,12 @@ sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >
}
return 0;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldMaster");
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
sal_Bool bRet = sal_False;
@@ -452,9 +445,7 @@ BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::R
}
return bRet;
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(2);
@@ -479,9 +470,7 @@ uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw(
}
return aRet;
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
aLstnrCntnr( (XPropertySet*)this),
nResTypeId(nResId),
@@ -494,9 +483,7 @@ SwXFieldMaster::SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 14.12.98 11:08:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
SwClient(&rType),
aLstnrCntnr( (XPropertySet*)this),
@@ -509,16 +496,12 @@ SwXFieldMaster::SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc) :
{
}
-/*-- 14.12.98 11:08:34---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldMaster::~SwXFieldMaster()
{
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
@@ -528,9 +511,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFieldMaster::getPropertySetInfo(vo
lcl_GetPropMapIdForFieldType( nResTypeId ) )->getPropertySetInfo();
return aRef;
}
-/*-- 14.12.98 11:08:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -712,9 +693,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
}
}
}
-/* -----------------------------30.03.01 14:40--------------------------------
- ---------------------------------------------------------------------------*/
SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
{
if(!bDontCreate && RES_DBFLD == nResTypeId && m_bIsDescriptor && m_pDoc)
@@ -743,9 +722,7 @@ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
return (SwFieldType*)GetRegisteredIn();
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
typedef SwFmtFld* SwFmtFldPtr;
SV_DECL_PTRARR(SwDependentFields, SwFmtFldPtr, 5, 5)
SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr)
@@ -772,21 +749,22 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DEPENDENT_TEXT_FIELDS)) )
{
//fill all text fields into a sequence
- SwClientIter aIter( *pType );
SwDependentFields aFldArr;
- SwFmtFldPtr pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFldPtr pFld = aIter.First();
while(pFld)
{
if(pFld->IsFldInDoc())
aFldArr.Insert(pFld, aFldArr.Count());
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
+
uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(aFldArr.Count());
uno::Reference<text::XDependentTextField>* pRetSeq = aRetSeq.getArray();
for(USHORT i = 0; i < aFldArr.Count(); i++)
{
pFld = aFldArr.GetObject(i);
- SwXTextField * pInsert = CreateSwXTextField(*GetDoc(), *pFld);
+ SwXTextField * pInsert = SwXTextField::CreateSwXTextField(*GetDoc(), *pFld);
pRetSeq[i] = uno::Reference<text::XDependentTextField>(pInsert);
}
@@ -900,38 +878,28 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:08:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 25.02.99 11:01:57---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -947,8 +915,8 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
}
// zuerst alle Felder loeschen
- SwClientIter aIter( *pFldType );
- SwFmtFld* pFld = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+ SwFmtFld* pFld = aIter.First();
while(pFld)
{
// Feld im Undo?
@@ -961,7 +929,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
aPam.Move();
GetDoc()->DeleteAndJoin(aPam);
}
- pFld = (SwFmtFld*)aIter.Next();
+ pFld = aIter.Next();
}
// dann den FieldType loeschen
GetDoc()->RemoveFldType(nTypeIdx);
@@ -969,9 +937,7 @@ void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 25.02.99 11:02:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -979,9 +945,7 @@ void SwXFieldMaster::addEventListener(const uno::Reference< lang::XEventListener
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 25.02.99 11:02:02---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
@@ -989,10 +953,8 @@ void SwXFieldMaster::removeEventListener(const uno::Reference< lang::XEventListe
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:08:38---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFieldMaster::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -1001,31 +963,7 @@ void SwXFieldMaster::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
m_pDoc = 0;
}
}
-/* -----------------------------06.11.00 09:44--------------------------------
-
-const Programmatic2UIName_Impl* lcl_GetFieldNameTable()
-{
- static BOOL bInitialized = FALSE;
- static Programmatic2UIName_Impl aFieldNames[5];
- if(!bInitialized)
- {
- bInitialized = TRUE;
- int nName = 0;
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_ABB ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_ABB));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_TABLE ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_TABLE));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_FRAME));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_FRAME));
- aFieldNames[nName].sUIName = String (SW_RES(STR_POOLCOLL_LABEL_DRAWING ));
- aFieldNames[nName++].sProgrammaticName = String (SW_RES(STR_POCO_PRGM_LABEL_DRAWING));
- }
- return &aFieldNames[0];
-}
- ---------------------------------------------------------------------------*/
-/* -----------------------------06.11.00 10:26--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc)
{
OUString sRet(rType.GetName());
@@ -1043,9 +981,7 @@ OUString SwXFieldMaster::GetProgrammaticName(const SwFieldType& rType, SwDoc& rD
}
return sRet;
}
-/* -----------------------------06.11.00 14:12--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldMaster::LocalizeFormula(
const SwSetExpField& rFld,
const OUString& rFormula,
@@ -1068,12 +1004,11 @@ OUString SwXFieldMaster::LocalizeFormula(
}
-SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
+SwXTextField* SwXTextField::CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
{
- SwClientIter aIter(*rFmt.GetFld()->GetTyp());
+ SwIterator<SwXTextField,SwFieldType> aIter(*rFmt.GetFld()->GetTyp());
SwXTextField * pField = 0;
- SwXTextField * pTemp =
- static_cast<SwXTextField*>(aIter.First( TYPE(SwXTextField) ));
+ SwXTextField * pTemp = aIter.First();
while (pTemp)
{
if (pTemp->GetFldFmt() == &rFmt)
@@ -1081,7 +1016,7 @@ SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt)
pField = pTemp;
break;
}
- pTemp = static_cast<SwXTextField*>(aIter.Next());
+ pTemp = aIter.Next();
}
return pField ? pField : new SwXTextField( rFmt, &rDoc );
}
@@ -1136,17 +1071,13 @@ struct SwFieldProperties_Impl
};
TYPEINIT1(SwXTextField, SwClient);
-/* -----------------------------13.03.00 12:15--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -1158,9 +1089,6 @@ sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 14.12.98 11:37:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
aLstnrCntnr( (XTextContent*)this),
@@ -1184,9 +1112,7 @@ SwXTextField::SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc) :
m_pProps->nUSHORT2 = USHRT_MAX;
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
aLstnrCntnr( (XTextContent*)this),
pFmtFld(&rFmt),
@@ -1199,9 +1125,7 @@ SwXTextField::SwXTextField(const SwFmtFld& rFmt, SwDoc* pDc) :
{
pDc->GetUnoCallBack()->Add(this);
}
-/*-- 14.12.98 11:37:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextField::~SwXTextField()
{
if ( m_pTextObject )
@@ -1212,9 +1136,7 @@ SwXTextField::~SwXTextField()
delete m_pProps;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertySet > & xFieldMaster)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -1237,9 +1159,7 @@ void SwXTextField::attachTextFieldMaster(const uno::Reference< beans::XPropertyS
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1254,16 +1174,14 @@ uno::Reference< beans::XPropertySet > SwXTextField::getTextFieldMaster(void) th
throw uno::RuntimeException();
pType = pFmtFld->GetFld()->GetTyp();
}
- SwXFieldMaster* pMaster = (SwXFieldMaster*)
- SwClientIter(*pType).First(TYPE(SwXFieldMaster));
+
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(!pMaster)
pMaster = new SwXFieldMaster(*pType, GetDoc());
return pMaster;
}
-/*-- 14.12.98 11:37:16---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1275,9 +1193,7 @@ OUString SwXTextField::getPresentation(sal_Bool bShowCommand) throw( uno::Runtim
throw uno::RuntimeException();
return sRet;
}
-/* -----------------18.02.99 13:39-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextField::attachToRange(
const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
@@ -1851,18 +1767,14 @@ void SwXTextField::attachToRange(
else
throw lang::IllegalArgumentException();
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
attachToRange( xTextRange );
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1883,9 +1795,7 @@ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::Ru
return aRef;
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1908,26 +1818,20 @@ void SwXTextField::dispose(void) throw( uno::RuntimeException )
m_pTextObject = 0;
}
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 14.12.98 11:37:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void)
throw( uno::RuntimeException )
{
@@ -1949,9 +1853,7 @@ uno::Reference< beans::XPropertySetInfo > SwXTextField::getPropertySetInfo(void
throw uno::RuntimeException();
return aRef;
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::Any& rValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException )
@@ -2112,9 +2014,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
else
throw uno::RuntimeException();
}
-/*-- 14.12.98 11:37:19---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2300,37 +2200,27 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 14.12.98 11:37:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/* -----------------------------23.03.01 13:15--------------------------------
- ---------------------------------------------------------------------------*/
void SwXTextField::update( ) throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2381,22 +2271,17 @@ void SwXTextField::update( ) throw (uno::RuntimeException)
}
// --> FME 2004-10-06 #116480#
// Text formatting has to be triggered.
- const_cast<SwFmtFld*>(pFmtFld)->Modify( 0, 0 );
+ const_cast<SwFmtFld*>(pFmtFld)->ModifyNotification( 0, 0 );
// <--
}
else
m_bCallUpdate = sal_True;
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextField::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextField");
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
static OUString OldNameToNewName_Impl( const OUString &rOld )
{
@@ -2426,9 +2311,7 @@ sal_Bool SwXTextField::supportsService(const OUString& rServiceName) throw( uno:
rServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextContent"));
}
-/* -----------------19.03.99 14:11-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextField::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
OUString sServiceName = SwXServiceProvider::GetProviderName(m_nServiceId);
@@ -2458,10 +2341,8 @@ void SwXTextField::Invalidate()
}
}
-/* -----------------14.12.98 12:00-------------------
- *
- * --------------------------------------------------*/
-void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+
+void SwXTextField::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
{
@@ -2483,9 +2364,7 @@ void SwXTextField::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
break;
}
}
-/*-- 14.12.98 11:37:21---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwField* SwXTextField::GetField() const
{
if(GetRegisteredIn() && pFmtFld)
@@ -2494,29 +2373,18 @@ const SwField* SwXTextField::GetField() const
}
/******************************************************************
- *
- ******************************************************************/
-/******************************************************************
* SwXTextFieldMasters
******************************************************************/
-/* -----------------------------06.04.00 13:22--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldMasters");
}
-/* -----------------------------06.04.00 13:22--------------------------------
-
- ---------------------------------------------------------------------------*/
BOOL SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFieldMasters" ));
}
-/* -----------------------------06.04.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2524,21 +2392,17 @@ uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.TextFieldMasters");
return aRet;
}
-/*-- 21.12.98 10:37:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::SwXTextFieldMasters(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 21.12.98 10:37:32---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldMasters::~SwXTextFieldMasters()
{
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
+/*-----------------------------------------------------------------------
Iteration ueber nicht-Standard Feldtypen
USER/SETEXP/DDE/DATABASE
Der Name ist demnach:
@@ -2610,17 +2474,14 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
SwFieldType* pType = GetDoc()->GetFldType(nResId, sName, sal_True);
if(!pType)
throw container::NoSuchElementException();
- SwXFieldMaster* pMaster = (SwXFieldMaster*)
- SwClientIter(*pType).First(TYPE(SwXFieldMaster));
+ SwXFieldMaster* pMaster = SwIterator<SwXFieldMaster,SwFieldType>::FirstElement( *pType );
if(!pMaster)
pMaster = new SwXFieldMaster(*pType, GetDoc());
uno::Reference< beans::XPropertySet > aRef = pMaster;
uno::Any aRet(&aRef, ::getCppuType( static_cast<const uno::Reference<beans::XPropertySet>* >(0)));
return aRet;
}
-/*-- 06.03.2001 11:29:34,5-------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::getInstanceName(
const SwFieldType& rFldType, String& rName)
{
@@ -2667,9 +2528,6 @@ sal_Bool SwXTextFieldMasters::getInstanceName(
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
throw( uno::RuntimeException )
{
@@ -2707,9 +2565,7 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void)
return aSeq;
}
-/*-- 21.12.98 10:37:33---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2726,17 +2582,13 @@ sal_Bool SwXTextFieldMasters::hasByName(const OUString& rName) throw( uno::Runti
}
return bRet;
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldMasters::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<beans::XPropertySet>*>(0));
}
-/*-- 21.12.98 10:37:34---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2748,24 +2600,18 @@ sal_Bool SwXTextFieldMasters::hasElements(void) throw( uno::RuntimeException )
/******************************************************************
*
******************************************************************/
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFieldTypes");
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.TextFields" ));
}
-/* -----------------------------06.04.00 13:24--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2773,31 +2619,23 @@ uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) thro
pArray[0] = C2U("com.sun.star.text.TextFields");
return aRet;
}
-/*-- 21.12.98 10:35:15---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::SwXTextFieldTypes(SwDoc* _pDoc) :
SwUnoCollection (_pDoc),
aRefreshCont ( static_cast< XEnumerationAccess * >(this) )
{
}
-/*-- 21.12.98 10:35:16---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFieldTypes::~SwXTextFieldTypes()
{
}
-/*-- 11.07.02 14:25:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFieldTypes::Invalidate()
{
SwUnoCollection::Invalidate();
aRefreshCont.Disposing();
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -2807,16 +2645,12 @@ uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration(
return new SwXFieldEnumeration(GetDoc());
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFieldTypes::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<const uno::Reference<text::XDependentTextField>*>(0));
}
-/*-- 21.12.98 10:35:17---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2825,9 +2659,7 @@ sal_Bool SwXTextFieldTypes::hasElements(void) throw( uno::RuntimeException )
//es gibt sie immer
return sal_True;
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2841,9 +2673,7 @@ void SwXTextFieldTypes::refresh(void) throw( uno::RuntimeException )
// call refresh listeners
aRefreshCont.Refreshed();
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
@@ -2852,9 +2682,7 @@ void SwXTextFieldTypes::addRefreshListener(const uno::Reference< util::XRefreshL
throw uno::RuntimeException();
aRefreshCont.AddListener ( reinterpret_cast < const uno::Reference < lang::XEventListener > &> ( l ));
}
-/* -----------------24.02.99 16:19-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefreshListener > & l)
throw( uno::RuntimeException )
{
@@ -2865,24 +2693,18 @@ void SwXTextFieldTypes::removeRefreshListener(const uno::Reference< util::XRefre
/******************************************************************
* SwXFieldEnumeration
******************************************************************/
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFieldEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFieldEnumeration");
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
"com.sun.star.text.FieldEnumeration" ));
}
-/* -----------------------------06.04.00 13:25--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -2890,9 +2712,7 @@ uno::Sequence< OUString > SwXFieldEnumeration::getSupportedServiceNames(void) th
pArray[0] = C2U("com.sun.star.text.FieldEnumeration");
return aRet;
}
-/* -----------------21.12.98 14:57-------------------
- *
- * --------------------------------------------------*/
+
SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
nNextIndex(0),
pDoc(pDc)
@@ -2910,9 +2730,8 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
for(sal_uInt16 nType = 0; nType < nCount; ++nType)
{
const SwFieldType *pCurType = pFldTypes->GetObject(nType);
-
- SwClientIter aIter( *(SwFieldType*)pCurType );
- const SwFmtFld* pCurFldFmt = (SwFmtFld*)aIter.First( TYPE( SwFmtFld ));
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pCurType );
+ const SwFmtFld* pCurFldFmt = aIter.First();
while (pCurFldFmt)
{
const SwTxtFld *pTxtFld = pCurFldFmt->GetTxtFld();
@@ -2922,7 +2741,7 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
!pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes();
if (!bSkip)
pItems[ nFillPos++ ] = new SwXTextField(*pCurFldFmt, pDoc);
- pCurFldFmt = (SwFmtFld*)aIter.Next();
+ pCurFldFmt = aIter.Next();
// enlarge sequence if necessary
if (aItems.getLength() == nFillPos)
@@ -2951,25 +2770,19 @@ SwXFieldEnumeration::SwXFieldEnumeration(SwDoc* pDc) :
// resize sequence to actual used size
aItems.realloc( nFillPos );
}
-/*-- 21.12.98 14:57:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFieldEnumeration::~SwXFieldEnumeration()
{
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXFieldEnumeration::hasMoreElements(void)
throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return nNextIndex < aItems.getLength();
}
-/*-- 21.12.98 14:57:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFieldEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2987,10 +2800,8 @@ uno::Any SwXFieldEnumeration::nextElement(void)
rxFld = 0; // free memory for item that is not longer used
return aRet;
}
-/* -----------------21.12.98 15:08-------------------
- *
- * --------------------------------------------------*/
-void SwXFieldEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+
+void SwXFieldEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index f349cbb40027..fd1918d0d22d 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -308,7 +308,7 @@ SwXFlatParagraphIterator::~SwXFlatParagraphIterator()
}
-void SwXFlatParagraphIterator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwXFlatParagraphIterator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
ClientModify( this, pOld, pNew );
// check if document gets closed...
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 3a3df506b457..1e64c370839b 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -113,12 +113,10 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <tools/urlobj.hxx>
#include <editeng/frmdiritem.hxx>
-// DVO, OD 01.10.2003 #i18732#
#include <fmtfollowtextflow.hxx>
-// OD 2004-05-05 #i28701#
#include <fmtwrapinfluenceonobjpos.hxx>
-
#include <toolkit/helper/vclunohelper.hxx>
+#include <switerator.hxx>
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -153,33 +151,21 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0;
};
-/* -----------------------------12.06.01 15:46--------------------------------
- ---------------------------------------------------------------------------*/
BaseFrameProperties_Impl::~BaseFrameProperties_Impl()
{
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
void BaseFrameProperties_Impl::SetProperty(USHORT nWID, BYTE nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWID, nMemberId, rVal );
}
-/* -----------------------------12.06.01 15:43--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool BaseFrameProperties_Impl::GetProperty(USHORT nWID, BYTE nMemberId, const uno::Any*& rpAny)
{
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
-//void BaseFrameProperties_Impl::GetProperty( const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any & rAny )
-//{
-// rAny = rxPropertySet->getPropertyValue( rPropertyName );
-//}
-/* -----------------29.06.98 09:55-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, sal_Bool& rSizeFound)
{
sal_Bool bRet = sal_True;
@@ -527,31 +513,21 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const
return bRet;
}
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
class SwFrameProperties_Impl : public BaseFrameProperties_Impl
{
-protected:
-// SwFrameProperties_Impl(/*const :: SfxItemPropertyMap* pMap*/) :
-// BaseFrameProperties_Impl(/*pMap*/){}
public:
SwFrameProperties_Impl();
virtual ~SwFrameProperties_Impl(){}
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------22.06.98 09:17-------------------
- *
- * --------------------------------------------------*/
+
SwFrameProperties_Impl::SwFrameProperties_Impl():
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ )
{
}
-/* -----------------22.06.98 11:27-------------------
- *
- * --------------------------------------------------*/
+
inline void lcl_FillCol ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const :: uno::Any *pAny)
{
if ( pAny )
@@ -611,17 +587,13 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------27.06.98 14:53-------------------
- *
- * --------------------------------------------------*/
+
SwGraphicProperties_Impl::SwGraphicProperties_Impl( ) :
BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ )
{
}
-/* -----------------27.06.98 14:40-------------------
- *
- * --------------------------------------------------*/
+
inline void lcl_FillMirror ( SfxItemSet &rToSet, const :: SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, sal_Bool &rRet )
{
if(pHEvenMirror || pHOddMirror || pVMirror )
@@ -708,9 +680,6 @@ sal_Bool SwGraphicProperties_Impl::AnyToItemSet(
return bRet;
}
-/* -----------------4/1/2003 13:54-------------------
-
- --------------------------------------------------*/
class SwOLEProperties_Impl : public SwFrameProperties_Impl
{
@@ -721,9 +690,6 @@ public:
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound);
};
-/* -----------------4/1/2003 15:32-------------------
-
- --------------------------------------------------*/
sal_Bool SwOLEProperties_Impl::AnyToItemSet(
SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound)
@@ -739,17 +705,13 @@ sal_Bool SwOLEProperties_Impl::AnyToItemSet(
/******************************************************************
* SwXFrame
******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -761,30 +723,21 @@ sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& r
}
return 0;
}
-/*-----------------24.03.98 14:49-------------------
-
---------------------------------------------------*/
TYPEINIT1(SwXFrame, SwClient);
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXFrame");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
{
return !rServiceName.compareToAscii("com.sun.star.text.BaseFrame")||
!rServiceName.compareToAscii("com.sun.star.text.TextContent") ||
!rServiceName.compareToAscii("com.sun.star.document.LinkTarget");
}
-/* -----------------------------06.04.00 14:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(3);
@@ -796,9 +749,6 @@ uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::R
}
-/*-- 14.01.99 11:31:52---------------------------------------------------
- Dieser CTor legt den Frame als Descriptor an
- -----------------------------------------------------------------------*/
SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pDoc) :
aLstnrCntnr( (container::XNamed*)this),
m_pPropSet(pSet),
@@ -850,9 +800,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const :: SfxItemPropertySet* pSet, SwDoc *pD
}
}
-/*-- 11.12.98 15:05:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertySet* pSet) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (container::XNamed*)this),
@@ -865,20 +813,13 @@ SwXFrame::SwXFrame(SwFrmFmt& rFrmFmt, FlyCntType eSet, const :: SfxItemPropertyS
{
}
-/*-- 11.12.98 15:05:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXFrame::~SwXFrame()
{
delete m_pCopySource;
delete pProps;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXFrame::getName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -892,9 +833,7 @@ OUString SwXFrame::getName(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return sRet;
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -913,9 +852,7 @@ void SwXFrame::setName(const :: OUString& rName) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) throw( uno::RuntimeException )
{
uno::Reference< beans::XPropertySetInfo > xRef;
@@ -944,9 +881,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo(void) th
}
return xRef;
}
-/*-- 15.05.06 12:21:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::SetSelection(SwPaM& rCopySource)
{
if(m_pCopySource)
@@ -955,9 +890,6 @@ void SwXFrame::SetSelection(SwPaM& rCopySource)
m_pCopySource->SetMark();
*m_pCopySource->GetMark() = *rCopySource.End();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
{
@@ -1470,9 +1402,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1697,11 +1627,9 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
// format document completely in order to get correct value
pFmt->GetDoc()->GetEditShell()->CalcLayout();
- SwClientIter aIter( *pFmt );
- SwClient* pC = aIter.First( TYPE( SwFrm ) );
- if (pC)
+ SwFrm* pTmpFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
+ if ( pTmpFrm )
{
- SwFrm *pTmpFrm = static_cast< SwFrm * >(pC);
DBG_ASSERT( pTmpFrm->IsValid(), "frame not valid" );
const SwRect &rRect = pTmpFrm->Frm();
Size aMM100Size = OutputDevice::LogicToLogic(
@@ -1733,45 +1661,35 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
throw uno::RuntimeException();
return aAny;
}
-/*-- 11.12.98 15:05:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 15:05:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 12.09.00 14:04:53---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1782,9 +1700,7 @@ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aPropertyNames);
return aStates.getConstArray()[0];
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
const uno::Sequence< OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -1848,9 +1764,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
throw uno::RuntimeException();
return aStates;
}
-/*-- 12.09.00 14:04:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -1947,9 +1861,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
}
-/*-- 12.09.00 14:04:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -1975,27 +1887,21 @@ uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
throw uno::RuntimeException();
return aRet;
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/* -----------------22.04.99 14:59-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 15:05:06---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -2007,9 +1913,7 @@ void SwXFrame::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2038,9 +1942,7 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException )
}
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2062,9 +1964,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim
throw uno::RuntimeException();
return aRef;
}
-/* -----------------14.01.99 12:02-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::ResetDescriptor()
{
bIsDescriptor = sal_False;
@@ -2072,9 +1972,7 @@ void SwXFrame::ResetDescriptor()
mxStyleFamily.clear();
DELETEZ(pProps);
}
-/* -----------------18.02.99 13:34-------------------
- *
- * --------------------------------------------------*/
+
void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2406,9 +2304,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
//setzt das Flag zurueck und loescht den Descriptor-Pointer
ResetDescriptor();
}
-/* -----------------------------04.04.01 14:27--------------------------------
- ---------------------------------------------------------------------------*/
void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2443,9 +2339,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw lang::IllegalArgumentException();
}
}
-/*-- 22.04.99 08:03:20---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2453,9 +2347,7 @@ awt::Point SwXFrame::getPosition(void) throw( uno::RuntimeException )
aRuntime.Message = C2U("position cannot be determined with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2463,27 +2355,21 @@ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeE
aRuntime.Message = C2U("position cannot be changed with this method");
throw aRuntime;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException )
{
const ::uno::Any aVal = getPropertyValue(C2U("Size"));
awt::Size* pRet = (awt::Size*)aVal.getValue();
return *pRet;
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXFrame::setSize(const awt::Size& aSize)
throw( beans::PropertyVetoException, uno::RuntimeException )
{
const ::uno::Any aVal(&aSize, ::getCppuType(static_cast<const awt::Size*>(0)));
setPropertyValue(C2U("Size"), aVal);
}
-/*-- 22.04.99 08:03:21---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException )
{
return C2U("FrameShape");
@@ -2493,46 +2379,34 @@ OUString SwXFrame::getShapeType(void) throw( uno::RuntimeException )
/******************************************************************
* SwXTextFrame
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame( SwDoc *_pDoc ) :
SwXText(0, CURSOR_FRAME),
SwXFrame(FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME), _pDoc )
{
}
-/*-- 11.12.98 15:23:01---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::SwXTextFrame(SwFrmFmt& rFmt) :
SwXText(rFmt.GetDoc(), CURSOR_FRAME),
SwXFrame(rFmt, FLYCNTTYPE_FRM, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_FRAME))
{
}
-/*-- 11.12.98 15:23:02---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextFrame::~SwXTextFrame()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextFrame::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -2543,9 +2417,7 @@ void SAL_CALL SwXTextFrame::release( )throw()
aRet = SwXTextFrameBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextFrameTypes = SwXTextFrameBaseClass::getTypes();
@@ -2570,9 +2442,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim
return aTextFrameTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2585,16 +2455,12 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(u
}
return aId;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException )
{
return this;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXTextFrame::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -2615,9 +2481,7 @@ SwXTextFrame::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2664,9 +2528,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw(
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2693,9 +2555,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 15:23:03---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2716,77 +2576,57 @@ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void)
}
return aRef;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXTextFrame::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType(static_cast<uno::Reference<text::XTextRange>*>(0));
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextFrame::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 15:23:04---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextFrame::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 15:23:05---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextFrame");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.Text")||
COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextFrame")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
@@ -2796,16 +2636,12 @@ uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( un
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.Text");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextFrame::operator new( size_t t) throw()
{
return SwXTextFrameBaseClass::operator new( t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextFrame::operator delete( void * p) throw()
{
SwXTextFrameBaseClass::operator delete(p);
@@ -2816,9 +2652,7 @@ uno::Reference<container::XNameReplace > SAL_CALL SwXTextFrame::getEvents()
{
return new SwFrameEventDescriptor( *this );
}
-/* -----------------------------10.01.01 13:27--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2828,9 +2662,7 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
return nRet;
}
-/* -----------------------------19.03.2002 16:43------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2850,45 +2682,33 @@ sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >&
/******************************************************************
* SwXTextGraphicObject
******************************************************************/
-/*-- 14.01.99 11:27:51---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc)
{
}
-/*-- 11.12.98 16:02:25---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::SwXTextGraphicObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_GRF, aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC))
{
}
-/*-- 11.12.98 16:02:26---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextGraphicObject::~SwXTextGraphicObject()
{
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::acquire( )throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::release( )throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextGraphicObject::queryInterface( const uno::Type& aType )
throw(uno::RuntimeException)
{
@@ -2897,9 +2717,7 @@ void SAL_CALL SwXTextGraphicObject::release( )throw()
aRet = SwXTextGraphicObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL
SwXTextGraphicObject::getTypes( ) throw(uno::RuntimeException)
{
@@ -2919,9 +2737,7 @@ uno::Sequence< uno::Type > SAL_CALL
return aGraphicTypes;
}
-/* -----------------------------15.03.00 16:30--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2934,63 +2750,47 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( )
}
return aId;
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:02:27---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextGraphicObject::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:02:28---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:02:29---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextGraphicObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextGraphicObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextGraphicObject") ||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3000,23 +2800,17 @@ uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextGraphicObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextGraphicObject::operator new( size_t t) throw()
{
return SwXTextGraphicObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextGraphicObject::operator delete( void * p) throw()
{
SwXTextGraphicObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextGraphicObject::getEvents()
throw(uno::RuntimeException)
@@ -3027,48 +2821,33 @@ uno::Reference<container::XNameReplace> SAL_CALL
/******************************************************************
*
******************************************************************/
-/*-- 11.12.98 16:16:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject( SwDoc *pDoc ) :
SwXFrame(FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc)
{
}
-/*-- 11.12.98 16:16:53---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::SwXTextEmbeddedObject(SwFrmFmt& rFmt) :
SwXFrame(rFmt, FLYCNTTYPE_OLE, aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT))
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextEmbeddedObject::~SwXTextEmbeddedObject()
{
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
-/* -----------------------------15.03.00 16:32--------------------------------
-
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::acquire()throw()
{
SwXFrame::acquire();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::release()throw()
{
SwXFrame::release();
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
::uno::Any SAL_CALL SwXTextEmbeddedObject::queryInterface( const uno::Type& aType )
throw( uno::RuntimeException)
{
@@ -3077,9 +2856,7 @@ void SAL_CALL SwXTextEmbeddedObject::release()throw()
aRet = SwXTextEmbeddedObjectBaseClass::queryInterface(aType);
return aRet;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(uno::RuntimeException)
{
uno::Sequence< uno::Type > aTextEmbeddedTypes = SwXTextEmbeddedObjectBaseClass::getTypes();
@@ -3099,9 +2876,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un
return aTextEmbeddedTypes;
}
-/* -----------------------------15.03.00 16:32--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3114,46 +2889,33 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId(
}
return aId;
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
SwXFrame::attach(xTextRange);
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextEmbeddedObject::getAnchor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwXFrame::getAnchor();
}
-/*-- 11.12.98 16:16:54---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
SwXFrame::dispose();
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::addEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
SwXFrame::removeEventListener(aListener);
}
-/*-- 11.12.98 16:16:55---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( uno::RuntimeException )
{
@@ -3181,9 +2943,7 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
uno::Reference< frame::XModel > xModel( xRet, uno::UNO_QUERY);
if( xBrdcst.is() && xModel.is() )
{
- SwClientIter aIter( *pFmt );
- SwXOLEListener* pListener = (SwXOLEListener*)aIter.
- First( TYPE( SwXOLEListener ));
+ SwXOLEListener* pListener = SwIterator<SwXOLEListener,SwFmt>::FirstElement( *pFmt );
//create a new one if the OLE object doesn't have one already
if( !pListener )
{
@@ -3196,11 +2956,6 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
return xRet;
}
-/* --18.05.2006 16:39---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
-
uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject()
throw( uno::RuntimeException )
{
@@ -3228,9 +2983,7 @@ uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExte
uno::Reference< frame::XModel > xModel( xComp, uno::UNO_QUERY);
if( xBrdcst.is() && xModel.is() )
{
- SwClientIter aIter( *pFmt );
- SwXOLEListener* pListener = (SwXOLEListener*)aIter.
- First( TYPE( SwXOLEListener ));
+ SwXOLEListener* pListener = SwIterator<SwXOLEListener,SwFmt>::FirstElement( *pFmt );
//create a new one if the OLE object doesn't have one already
if( !pListener )
{
@@ -3294,25 +3047,19 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme
return uno::Reference< graphic::XGraphic >();
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextEmbeddedObject");
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return COMPARE_EQUAL == rServiceName.compareToAscii("com.sun.star.text.TextEmbeddedObject")||
SwXFrame::supportsService(rServiceName);
}
-/* -----------------03.05.99 12:28-------------------
- *
- * --------------------------------------------------*/
+
uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
@@ -3322,23 +3069,17 @@ uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)
pArray[aRet.getLength() - 1] = C2U("com.sun.star.text.TextEmbeddedObject");
return aRet;
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void * SAL_CALL SwXTextEmbeddedObject::operator new( size_t t) throw()
{
return SwXTextEmbeddedObjectBaseClass::operator new(t);
}
-/* -----------------------------20.06.00 10:02--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXTextEmbeddedObject::operator delete( void * p) throw()
{
SwXTextEmbeddedObjectBaseClass::operator delete(p);
}
-/* -----------------------------15.12.00 12:45--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XNameReplace> SAL_CALL
SwXTextEmbeddedObject::getEvents()
throw(uno::RuntimeException)
@@ -3351,17 +3092,13 @@ uno::Reference<container::XNameReplace> SAL_CALL
*
******************************************************************/
TYPEINIT1(SwXOLEListener, SwClient);
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::SwXOLEListener( SwFmt& rOLEFmt, uno::Reference< XModel > xOLE) :
SwClient(&rOLEFmt),
xOLEModel(xOLE)
{
}
-/* -----------------------------18.01.2002 09:59------------------------------
- ---------------------------------------------------------------------------*/
SwXOLEListener::~SwXOLEListener()
{}
@@ -3424,7 +3161,7 @@ void SwXOLEListener::disposing( const lang::EventObject& rEvent )
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-void SwXOLEListener::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
+void SwXOLEListener::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index d0d74fa023c7..c07ef6431a5a 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -99,7 +99,7 @@ public:
}
void Invalidate();
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
@@ -177,24 +177,6 @@ SwXFootnote::GetXFootnote(
// to do this properly requires the SwXFootnote to register at the
// SwFmtFtn directly, not at the unocallback
// also this function must return a uno Reference!
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXFootnote::Impl * pXFootnote = static_cast<SwXFootnote::Impl*>(
- aIter.First( TYPE( SwXFootnote::Impl )));
- while (pXFootnote)
- {
- SwDoc *const pDoc = pXFootnote->m_rThis.GetDoc();
- if (pDoc)
- {
- SwFmtFtn const*const pFtn = pXFootnote->GetFootnoteFormat();
- if (pFtn == &rFootnoteFmt)
- {
- return & pXFootnote->m_rThis;
- }
- }
- pXFootnote = static_cast<SwXFootnote::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 94ee14450f08..e5c18496c4c2 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -147,8 +147,8 @@ lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName)
SwTOXType aNewType(TOX_USER, rNewName);
pNewType = pDoc->InsertTOXType( aNewType );
}
- //has to be non-const-casted
- ((SwTOXType*)pNewType)->Add(&rTOXBase);
+
+ rTOXBase.RegisterToTOXType( *((SwTOXType*)pNewType) );
}
//-----------------------------------------------------------------------------
static const char cUserDefined[] = "User-Defined";
@@ -404,7 +404,7 @@ public:
? SwForm::GetFormMaxLevel(m_eTOXType)
: rSection.GetTOXForm().GetFormMax();
}
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
@@ -1247,25 +1247,13 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
case WID_INDEX_MARKS:
{
SwTOXMarks aMarks;
- SwTOXType const*const pType = pTOXBase->GetTOXType();
- SwClientIter aIter(*pType);
- SwTOXMark * pMark =
- static_cast<SwTOXMark*>(aIter.First(TYPE(SwTOXMark)));
- while( pMark )
- {
- if(pMark->GetTxtTOXMark())
- {
- aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count());
- }
- pMark = static_cast<SwTOXMark*>(aIter.Next());
- }
- uno::Sequence< uno::Reference<text::XDocumentIndexMark> >
- aXMarks(aMarks.Count());
- uno::Reference<text::XDocumentIndexMark>* pxMarks =
- aXMarks.getArray();
+ const SwTOXType* pType = pTOXBase->GetTOXType();
+ SwTOXMark::InsertTOXMarks( aMarks, *pType );
+ uno::Sequence< uno::Reference<text::XDocumentIndexMark> > aXMarks(aMarks.Count());
+ uno::Reference<text::XDocumentIndexMark>* pxMarks = aXMarks.getArray();
for(USHORT i = 0; i < aMarks.Count(); i++)
{
- pMark = aMarks.GetObject(i);
+ SwTOXMark* pMark = aMarks.GetObject(i);
pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark(
*m_pImpl->m_pDoc,
*const_cast<SwTOXType*>(pType), *pMark);
@@ -1666,7 +1654,7 @@ public:
}
void Invalidate();
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
};
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index f572b5f3e91c..2c11908044a3 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -397,7 +397,7 @@ SwUnoCursorHelper::SetPageDesc(
{
throw lang::IllegalArgumentException();
}
- pPageDesc->Add( pNewDesc.get() );
+ pNewDesc.get()->RegisterToPageDesc( *pPageDesc );
bPut = sal_True;
}
if(!bPut)
@@ -828,7 +828,7 @@ public:
m_bIsDisposed = true;
m_ListenerContainer.Disposing();
}
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 355857385903..fc9a3df689f6 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -116,16 +116,13 @@
#include <dcontact.hxx>
#include <dflyobj.hxx>
#include <crsskip.hxx>
-// OD 2004-05-07 #i28701#
#include <vector>
-// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
#include <sortopt.hxx>
-
#include <algorithm>
#include <iterator>
#include <boost/bind.hpp>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -279,9 +276,6 @@ UnoActionContext::UnoActionContext(SwDoc *const pDoc)
}
}
-/*-----------------04.03.98 11:56-------------------
-
---------------------------------------------------*/
UnoActionContext::~UnoActionContext()
{
// Doc may already have been removed here
@@ -321,10 +315,7 @@ UnoActionRemoveContext::~UnoActionRemoveContext()
}
-/*-- 10.12.98 11:52:15---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
+void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew)
{
switch( pOld ? pOld->Which() : 0 )
{
@@ -344,9 +335,6 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew)
}
-/*-- 09.12.98 14:19:03---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
const SfxItemSet& rSet,
const SetAttrMode nAttrMode, const bool bTableMode)
@@ -390,9 +378,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
}
//<-end,zhaojianwei
}
-/*-- 09.12.98 14:19:04---------------------------------------------------
- -----------------------------------------------------------------------*/
// --> OD 2006-07-12 #i63870#
// split third parameter <bCurrentAttrOnly> into new parameters <bOnlyTxtAttr>
// and <bGetFromChrFmt> to get better control about resulting <SfxItemSet>
@@ -534,7 +520,7 @@ public:
uno::Reference< text::XTextContent > NextElement_Impl()
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException);
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
@@ -545,9 +531,6 @@ void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
ClientModify(this, pOld, pNew);
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::SwXParagraphEnumeration(
uno::Reference< text::XText > const& xParent,
::std::auto_ptr<SwUnoCrsr> pCursor,
@@ -557,24 +540,17 @@ SwXParagraphEnumeration::SwXParagraphEnumeration(
pStartNode, pTable) )
{
}
-/*-- 10.12.98 11:52:12---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParagraphEnumeration::~SwXParagraphEnumeration()
{
}
-/* -----------------------------06.04.00 16:33--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParagraphEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParagraphEnumeration");
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParagraphEnum[] =
{
"com.sun.star.text.ParagraphEnumeration",
@@ -589,9 +565,7 @@ throw (uno::RuntimeException)
return ::sw::SupportsServiceImpl(
g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:33--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParagraphEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
@@ -600,9 +574,6 @@ throw (uno::RuntimeException)
g_nServicesParagraphEnum, g_ServicesParagraphEnum);
}
-/*-- 10.12.98 11:52:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
@@ -610,9 +581,6 @@ SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException)
return (m_pImpl->m_bFirstParagraph) ? sal_True : m_pImpl->m_xNextPara.is();
}
-/*-- 14.08.03 13:10:14---------------------------------------------------
-
- -----------------------------------------------------------------------*/
//!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx
static SwTableNode *
@@ -753,9 +721,7 @@ throw (container::NoSuchElementException, lang::WrappedTargetException,
return xRef;
}
-/*-- 10.12.98 11:52:14---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParagraphEnumeration::nextElement()
throw (container::NoSuchElementException, lang::WrappedTargetException,
uno::RuntimeException)
@@ -825,7 +791,7 @@ public:
}
const ::sw::mark::IMark * GetBookmark() const { return m_pMark; }
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
@@ -1267,8 +1233,7 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos)
SwFrmFmt *const pFmt = pSttNode->GetFlyFmt();
if (0 != pFmt)
{
- SwXTextFrame* pFrame( static_cast<SwXTextFrame*>(
- SwClientIter( *pFmt ).First( TYPE( SwXTextFrame ) ) ) );
+ SwXTextFrame* pFrame = SwIterator<SwXTextFrame,SwFmt>::FirstElement( *pFmt );
xParentText = pFrame ? pFrame : new SwXTextFrame( *pFmt );
}
}
@@ -1624,23 +1589,17 @@ public:
}
void MakeRanges();
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
};
-/*-- 10.12.98 13:57:02---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------10.12.98 14:25-------------------
- *
- * --------------------------------------------------*/
void SwXTextRanges::Impl::MakeRanges()
{
SwUnoCrsr *const pCursor = GetCursor();
@@ -1667,32 +1626,21 @@ const SwUnoCrsr* SwXTextRanges::GetCursor() const
return m_pImpl->GetCursor();
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::SwXTextRanges(SwPaM *const pPaM)
: m_pImpl( new SwXTextRanges::Impl(pPaM) )
{
}
-/*-- 10.12.98 13:57:22---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextRanges::~SwXTextRanges()
{
}
-/* -----------------------------13.03.00 12:15--------------------------------
-
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL
SwXTextRanges::getSomething(const uno::Sequence< sal_Int8 >& rId)
throw (uno::RuntimeException)
@@ -1706,17 +1654,12 @@ throw (uno::RuntimeException)
* danach wird ein Array mit uno::Reference< XTextPosition > angelegt
*
****************************************************************************/
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXTextRanges::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXTextRanges");
}
-/* -----------------------------06.04.00 16:36--------------------------------
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesTextRanges[] =
{
"com.sun.star.text.TextRanges",
@@ -1731,9 +1674,6 @@ throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges, rServiceName);
}
-/* -----------------------------06.04.00 16:36--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
{
@@ -1741,18 +1681,13 @@ SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextRanges, g_ServicesTextRanges);
}
-/*-- 10.12.98 13:57:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Int32 SAL_CALL SwXTextRanges::getCount() throw (uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
return static_cast<sal_Int32>(m_pImpl->m_Ranges.size());
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXTextRanges::getByIndex(sal_Int32 nIndex)
throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
uno::RuntimeException)
@@ -1769,26 +1704,18 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException,
return ret;
}
-/*-- 10.12.98 13:57:25---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL
SwXTextRanges::getElementType() throw (uno::RuntimeException)
{
return text::XTextRange::static_type();
}
-/*-- 10.12.98 13:57:26---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException)
{
// no mutex necessary: getCount() does locking
return getCount() > 0;
}
-/* -----------------11.12.98 10:07-------------------
- *
- * --------------------------------------------------*/
void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
{
// Start/EndAction
@@ -1845,16 +1772,12 @@ public:
return static_cast<SwUnoCrsr*>(
const_cast<SwModify*>(GetRegisteredIn()));
}
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
};
-/*-- 23.03.99 13:22:37---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
struct InvalidFrameDepend {
bool operator() (::boost::shared_ptr<SwDepend> const & rEntry)
{ return !rEntry->GetRegisteredIn(); }
@@ -1878,9 +1801,6 @@ void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
}
}
-/* -----------------23.03.99 13:38-------------------
- *
- * --------------------------------------------------*/
static sal_Bool
lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
uno::Reference<text::XTextContent> & o_rNextObject,
@@ -1895,9 +1815,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
// the format should be valid here, otherwise the client
// would have been removed in ::Modify
// check for a shape first
- SwClientIter aIter(*pFormat);
- SwDrawContact * const pContact =
- static_cast<SwDrawContact*>( aIter.First(TYPE(SwDrawContact)) );
+ SwDrawContact* const pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFormat );
if (pContact)
{
SdrObject * const pSdr = pContact->GetMaster();
@@ -1945,9 +1863,6 @@ lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr,
}
}
-/*-- 23.03.99 13:22:29---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::SwXParaFrameEnumeration(
const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode,
SwFrmFmt *const pFmt)
@@ -2005,16 +1920,11 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(
lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames);
}
}
-/*-- 23.03.99 13:22:30---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXParaFrameEnumeration::~SwXParaFrameEnumeration()
{
}
-/*-- 23.03.99 13:22:32---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SAL_CALL
SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
{
@@ -2028,9 +1938,7 @@ SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException)
: lcl_CreateNextObject(*m_pImpl->GetCursor(),
m_pImpl->m_xNextObject, m_pImpl->m_Frames);
}
-/*-- 23.03.99 13:22:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement()
throw (container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException)
@@ -2057,18 +1965,12 @@ throw (container::NoSuchElementException,
return aRet;
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
OUString SAL_CALL
SwXParaFrameEnumeration::getImplementationName() throw (uno::RuntimeException)
{
return C2U("SwXParaFrameEnumeration");
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
static char const*const g_ServicesParaFrameEnum[] =
{
"com.sun.star.util.ContentEnumeration",
@@ -2084,9 +1986,6 @@ throw (uno::RuntimeException)
g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName);
}
-/* -----------------------------06.04.00 16:39--------------------------------
-
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SAL_CALL
SwXParaFrameEnumeration::getSupportedServiceNames()
throw (uno::RuntimeException)
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 3b865d49bf09..8482dab122d3 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -151,7 +151,7 @@ public:
return static_cast<const SwTxtNode*>(GetRegisteredIn());
}
SwTxtNode * GetTxtNode() {
- return static_cast<SwTxtNode*>(pRegisteredIn);
+ return static_cast<SwTxtNode*>(GetRegisteredInNonConst());
}
SwTxtNode & GetTxtNodeOrThrow() {
@@ -183,7 +183,7 @@ public:
const uno::Sequence< ::rtl::OUString >& rPropertyNames,
bool bDirectValuesOnly)
throw (uno::RuntimeException);
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 5b0eca4a40fa..13014c512940 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -63,7 +63,7 @@ using ::rtl::OUString;
* SwXTextPortion
******************************************************************/
-static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
+void SwXTextPortion::init(const SwUnoCrsr* pPortionCursor)
{
SwUnoCrsr* pUnoCursor =
pPortionCursor->GetDoc()->CreateUnoCrsr(*pPortionCursor->GetPoint());
@@ -72,7 +72,7 @@ static void init(SwXTextPortion & rPortion, const SwUnoCrsr* pPortionCursor)
pUnoCursor->SetMark();
*pUnoCursor->GetMark() = *pPortionCursor->GetMark();
}
- pUnoCursor->Add(& rPortion);
+ pUnoCursor->Add(this);
}
/*-- 11.12.98 09:56:55---------------------------------------------------
@@ -97,7 +97,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType(eType)
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
}
/* -----------------24.03.99 16:30-------------------
@@ -119,7 +119,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType(PORTION_FRAME)
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
}
/* -----------------------------19.02.01 10:52--------------------------------
@@ -142,7 +142,7 @@ SwXTextPortion::SwXTextPortion(const SwUnoCrsr* pPortionCrsr,
, m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START )
, m_bIsCollapsed(false)
{
- init(*this, pPortionCrsr);
+ init( pPortionCrsr);
if (!bIsEnd)
{
@@ -1061,7 +1061,7 @@ throw( uno::RuntimeException )
/*-- 11.12.98 09:57:01---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextPortion::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextPortion::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if (!m_FrameDepend.GetRegisteredIn())
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index bb184fd9b879..0c633d3b8f0f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -755,7 +755,7 @@ lcl_ExportHints(
xRef = pPortion = new SwXTextPortion(
pUnoCrsr, xParent, PORTION_FIELD);
Reference<XTextField> xField =
- CreateSwXTextField(*pDoc, pAttr->GetFld());
+ SwXTextField::CreateSwXTextField(*pDoc, pAttr->GetFld());
pPortion->SetTextField(xField);
}
break;
@@ -1219,7 +1219,7 @@ lcl_CreatePortions(
/*-- 27.01.99 10:44:45---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXTextPortionEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextPortionEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 7f5efadada39..060d280eddc9 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -57,24 +57,18 @@ using ::rtl::OUString;
using ::rtl::OUStringBuffer;
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
SwXRedlineText::SwXRedlineText(SwDoc* _pDoc, SwNodeIndex aIndex) :
SwXText(_pDoc, CURSOR_REDLINE),
aNodeIndex(aIndex)
{
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
const SwStartNode* SwXRedlineText::GetStartNode() const
{
return aNodeIndex.GetNode().GetStartNode();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -97,9 +91,7 @@ uno::Any SwXRedlineText::queryInterface( const uno::Type& rType )
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedlineText::getTypes()
throw(uno::RuntimeException)
{
@@ -113,9 +105,7 @@ uno::Sequence<uno::Type> SwXRedlineText::getTypes()
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(uno::RuntimeException)
{
@@ -129,9 +119,7 @@ uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
}
return aId;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
throw( uno::RuntimeException )
{
@@ -174,9 +162,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
return static_cast<text::XWordCursor*>(pXCursor);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
const uno::Reference<text::XTextRange> & aTextRange)
throw( uno::RuntimeException )
@@ -186,9 +172,7 @@ uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursorByRange(
xCursor->gotoRange(aTextRange->getEnd(), sal_True);
return xCursor;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -199,23 +183,17 @@ uno::Reference<container::XEnumeration> SwXRedlineText::createEnumeration(void)
GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False));
return new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedlineText::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedlineText::hasElements( ) throw(uno::RuntimeException)
{
return sal_True; // we always have a content index
}
-/* -----------------------------19.12.00 11:36--------------------------------
- ---------------------------------------------------------------------------*/
SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
const SwUnoCrsr* pPortionCrsr,
uno::Reference< text::XText > xParent, BOOL bStart) :
@@ -226,15 +204,11 @@ SwXRedlinePortion::SwXRedlinePortion( const SwRedline* pRed,
{
SetCollapsed(!pRedline->HasMark());
}
-/*-- 19.12.00 11:37:24---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlinePortion::~SwXRedlinePortion()
{
}
-/* -----------------------------19.12.00 11:46--------------------------------
- ---------------------------------------------------------------------------*/
static util::DateTime lcl_DateTimeToUno(const DateTime& rDT)
{
util::DateTime aRetDT;
@@ -317,9 +291,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
}
return aRet;
}
-/* -----------------------------19.12.00 15:16--------------------------------
- ---------------------------------------------------------------------------*/
void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
{
SwUnoCrsr* pUnoCrsr = GetCursor();
@@ -334,9 +306,7 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
if(!bFound)
throw uno::RuntimeException();
}
-/* -----------------------------21.03.00 15:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -349,9 +319,7 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) th
}
return aId;
}
-/* -----------------------------11.01.01 16:39--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw()
{
uno::Any aRet;
@@ -391,9 +359,7 @@ uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, co
}
return aRet;
}
-/* -----------------------------11.01.01 11:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties(
const SwRedline& rRedline, sal_Bool bIsStart ) throw()
{
@@ -447,9 +413,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
aRet.realloc(nPropIdx);
return aRet;
}
-/*-- 11.01.01 17:06:07---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXRedline, SwClient);
SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
SwXText(&rDoc, CURSOR_REDLINE),
@@ -458,24 +422,18 @@ SwXRedline::SwXRedline(SwRedline& rRedline, SwDoc& rDoc) :
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedline::~SwXRedline()
{
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXRedline::getPropertySetInfo( ) throw(uno::RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > xRef =
aSwMapProvider.GetPropertySet(PROPERTY_MAP_REDLINE)->getPropertySetInfo();
return xRef;
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
@@ -545,9 +503,7 @@ void SwXRedline::setPropertyValue( const OUString& rPropertyName, const uno::Any
throw lang::IllegalArgumentException();
}
}
-/*-- 11.01.01 17:06:08---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -617,43 +573,33 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
aRet = SwXRedlinePortion::GetPropertyValue(rPropertyName, *pRedline);
return aRet;
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addPropertyChangeListener(
const OUString& /*aPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removePropertyChangeListener(
const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::addVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:09---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXRedline::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
}
-/*-- 11.01.01 17:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXRedline::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -662,9 +608,7 @@ void SwXRedline::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
pRedline = 0;
}
}
-/*-- 19.12.00 11:37:25---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -683,25 +627,19 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) t
}
return xRet;
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
uno::Type SwXRedline::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<text::XTextRange>*)0);
}
-/* -----------------------------19.12.00 12:34--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SwXRedline::hasElements( ) throw(uno::RuntimeException)
{
if(!pDoc)
throw uno::RuntimeException();
return 0 != pRedline->GetContentIdx();
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -737,18 +675,14 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u
}
return xRet;
}
-/* -----------------------------19.12.00 15:11--------------------------------
- ---------------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXRedline::createTextCursorByRange(
const uno::Reference< text::XTextRange > & /*aTextPosition*/)
throw( uno::RuntimeException )
{
throw uno::RuntimeException();
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SwXRedline::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
@@ -759,9 +693,7 @@ uno::Any SwXRedline::queryInterface( const uno::Type& rType )
}
return aRet;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<uno::Type> SwXRedline::getTypes()
throw(uno::RuntimeException)
{
@@ -775,9 +707,7 @@ uno::Sequence<uno::Type> SwXRedline::getTypes()
pTypes[nCurType++] = pBaseTypes[nType];
return aTypes;
}
-/* ---------------------------------------------------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(uno::RuntimeException)
{
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index 91fbcfa0f5f7..2cb95a75835d 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -42,27 +42,20 @@
#include <doc.hxx>
#include <docary.hxx>
#include <redline.hxx>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
-/*-- 11.01.01 15:28:54---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXRedlines::SwXRedlines(SwDoc* _pDoc) :
SwUnoCollection(_pDoc)
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlines::~SwXRedlines()
{
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -71,9 +64,7 @@ sal_Int32 SwXRedlines::getCount( ) throw(uno::RuntimeException)
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count();
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -91,9 +82,7 @@ uno::Any SwXRedlines::getByIndex(sal_Int32 nIndex)
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void)
throw( uno::RuntimeException )
{
@@ -102,16 +91,12 @@ uno::Reference< container::XEnumeration > SwXRedlines::createEnumeration(void)
throw uno::RuntimeException();
return uno::Reference< container::XEnumeration >(new SwXRedlineEnumeration(*GetDoc()));
}
-/*-- 11.01.01 15:28:55---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SwXRedlines::getElementType( ) throw(uno::RuntimeException)
{
return ::getCppuType((uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -120,76 +105,60 @@ sal_Bool SwXRedlines::hasElements( ) throw(uno::RuntimeException)
const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl();
return rRedTbl.Count() > 0;
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlines");
}
-/*-- 11.01.01 15:28:56---------------------------------------------------
- -----------------------------------------------------------------------*/
BOOL SwXRedlines::supportsService(const rtl::OUString& /*ServiceName*/)
throw( uno::RuntimeException )
{
DBG_ERROR("not implemented");
return FALSE;
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
throw( uno::RuntimeException )
{
DBG_ERROR("not implemented");
return uno::Sequence< OUString >();
}
-/*-- 11.01.01 15:28:57---------------------------------------------------
- -----------------------------------------------------------------------*/
beans::XPropertySet* SwXRedlines::GetObject( SwRedline& rRedline, SwDoc& rDoc )
{
SwPageDesc* pStdDesc = rDoc.GetPageDescFromPool(RES_POOLPAGE_STANDARD);
- SwClientIter aIter(*pStdDesc);
- SwXRedline* pxRedline = (SwXRedline*)aIter.First( TYPE( SwXRedline ));
+ SwIterator<SwXRedline,SwPageDesc> aIter(*pStdDesc);
+ SwXRedline* pxRedline = aIter.First();
while(pxRedline)
{
if(pxRedline->GetRedline() == &rRedline)
break;
- pxRedline = (SwXRedline*)aIter.Next();
+ pxRedline = aIter.Next();
}
if( !pxRedline )
pxRedline = new SwXRedline(rRedline, rDoc);
return pxRedline;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::SwXRedlineEnumeration(SwDoc& rDoc) :
pDoc(&rDoc),
nCurrentIndex(0)
{
pDoc->GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXRedlineEnumeration::~SwXRedlineEnumeration()
{
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
BOOL SwXRedlineEnumeration::hasMoreElements(void) throw( uno::RuntimeException )
{
if(!pDoc)
throw uno::RuntimeException();
return pDoc->GetRedlineTbl().Count() > nCurrentIndex;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXRedlineEnumeration::nextElement(void)
throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -203,31 +172,23 @@ uno::Any SwXRedlineEnumeration::nextElement(void)
aRet <<= xRet;
return aRet;
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
rtl::OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXRedlineEnumeration");
}
-/*-- 12.01.01 15:06:10---------------------------------------------------
- -----------------------------------------------------------------------*/
BOOL SwXRedlineEnumeration::supportsService(const rtl::OUString& /*ServiceName*/) throw( uno::RuntimeException )
{
return FALSE;
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
return uno::Sequence< OUString >();
}
-/*-- 12.01.01 15:06:11---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXRedlineEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXRedlineEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 25ce3ec6c441..ecc0c590d82f 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -82,9 +82,9 @@ public:
bool IsValid() const { return 0 != GetRegisteredIn(); }
void InsertRefMark( SwPaM & rPam, SwXTextCursor const*const pCursor );
void Invalidate();
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
@@ -105,7 +105,7 @@ void SwXReferenceMark::Impl::Invalidate()
/*-- 11.12.98 10:28:37---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXReferenceMark::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
@@ -119,7 +119,7 @@ void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew)
{
case RES_REFMARK_DELETED:
if (static_cast<const void*>(m_pMarkFmt) ==
- static_cast<SwPtrMsgPoolItem *>(pOld)->pObject)
+ static_cast<const SwPtrMsgPoolItem *>(pOld)->pObject)
{
Invalidate();
}
@@ -152,20 +152,6 @@ SwXReferenceMark::GetReferenceMark(
// #i105557#: do not iterate over the registered clients: race condition
// to do this properly requires the SwXReferenceMark to register at the
// SwFmtRefMark directly, not at the unocallback
-#if 0
- SwClientIter aIter( rUnoCB );
- SwXReferenceMark::Impl * pXMark =
- static_cast<SwXReferenceMark::Impl*>(
- aIter.First( TYPE( SwXReferenceMark::Impl ) ));
- while (pXMark)
- {
- if (pXMark->m_pMarkFmt == &rMarkFmt)
- {
- return &pXMark->m_rThis;
- }
- pXMark = static_cast<SwXReferenceMark::Impl*>(aIter.Next());
- }
-#endif
return 0;
}
@@ -773,9 +759,9 @@ public:
inline const ::sw::Meta * GetMeta() const;
// only for SwXMetaField!
inline const ::sw::MetaField * GetMetaField() const;
-
+protected:
// SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
};
@@ -785,7 +771,7 @@ inline const ::sw::Meta * SwXMeta::Impl::GetMeta() const
}
// SwModify
-void SwXMeta::Impl::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwXMeta::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
m_pTextPortions.reset(); // throw away cache (SwTxtNode changed)
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 2810b500ea4b..e4db4226619d 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -168,7 +168,7 @@ public:
const uno::Sequence< ::rtl::OUString >& rPropertyNames)
throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException);
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index ab486b71ed04..25f40e4900e5 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1087,7 +1087,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
String aString;
// return empty string if no char format is set
// otherwise it would be created here
- if(rInfo.GetRegisteredIn())
+ if(rInfo.HasCharFormat())
{
SwStyleNameMapper::FillProgName(
rInfo.GetCharFmt(*pDoc)->GetName(),
@@ -2445,7 +2445,7 @@ void SwXNumberingRules::setName(const OUString& /*rName*/) throw( RuntimeExcepti
/*-- 14.12.98 14:58:00---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXNumberingRules::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXNumberingRules::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 4309622c9545..209ad21f03de 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1477,7 +1477,7 @@ SwXStyle::~SwXStyle()
/*-- 17.12.98 08:26:51---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwXStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -2005,7 +2005,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName);
if(pPageDesc)
{
- pPageDesc->Add( pNewDesc );
+ pNewDesc->RegisterToPageDesc( *pPageDesc );
bPut = sal_True;
}
else
@@ -3891,7 +3891,7 @@ SwXAutoStyleFamily::~SwXAutoStyleFamily()
{
}
-void SwXAutoStyleFamily::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStyleFamily::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -4036,7 +4036,7 @@ SwXAutoStylesEnumerator::~SwXAutoStylesEnumerator()
delete pImpl;
}
-void SwXAutoStylesEnumerator::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStylesEnumerator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
@@ -4092,7 +4092,7 @@ SwXAutoStyle::~SwXAutoStyle()
{
}
-void SwXAutoStyle::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXAutoStyle::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index fdc382ad99d9..89ff738e4b81 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -100,7 +100,7 @@
#include <unochart.hxx>
#include <sortopt.hxx>
#include <rtl/math.hxx>
-
+#include <switerator.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -112,9 +112,6 @@ extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm );
#define UNO_TABLE_COLUMN_SUM 10000
-/* -----------------17.07.98 15:47-------------------
- *
- * --------------------------------------------------*/
table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
{
table::BorderLine aLine;
@@ -129,9 +126,7 @@ table::BorderLine lcl_SvxLineToLine(const SvxBorderLine* pLine)
aLine.Color = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance = 0;
return aLine;
}
-/* -----------------17.07.98 15:52-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine)
{
rSvxLine.SetColor( Color(rLine.Color));
@@ -141,9 +136,7 @@ sal_Bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLi
sal_Bool bRet = rLine.InnerLineWidth > 0 || rLine.OuterLineWidth > 0;
return bRet;
}
-/* -----------------11.12.98 14:22-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry, const uno::Any& aValue)
throw (lang::IllegalArgumentException)
{
@@ -225,9 +218,6 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
}
}
-/* -----------------27.04.98 08:50-------------------
- *
- * --------------------------------------------------*/
uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pEntry )
{
uno::Any aRet;
@@ -325,10 +315,6 @@ uno::Any lcl_GetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry
}
return aRet;
}
-/* -----------------19.10.05 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the position for the cell with the specified name
// (note that the indices rColumn and rRow are 0 based here)
@@ -464,10 +450,6 @@ int lcl_CompareCellRanges(
}
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
-
// returns the cell name for the cell at the specified position
// (note that the indices nColumn and nRow are 0 based here)
String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
@@ -529,9 +511,6 @@ const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const
return pBox;
}
-/* -----------------21.11.05 14:46-------------------
-
- --------------------------------------------------*/
// start cell should be in the upper-left corner of the range and
// end cell in the lower-right.
// I.e. from the four possible representation
@@ -569,9 +548,6 @@ void SwRangeDescriptor::Normalize()
}
-/* -----------------25.06.98 08:32-------------------
- *
- * --------------------------------------------------*/
SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
{
SwXCell* pXCell = 0;
@@ -584,9 +560,7 @@ SwXCell* lcl_CreateXCell(SwFrmFmt* pFmt, sal_Int32 nColumn, sal_Int32 nRow)
}
return pXCell;
}
-/* -----------------20.07.98 12:35-------------------
- *
- * --------------------------------------------------*/
+
void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
{
for( sal_uInt16 i = 0; i < rLines.Count(); i++ )
@@ -606,27 +580,23 @@ void lcl_InspectLines(SwTableLines& rLines, SvStrings& rAllNames)
}
}
}
-/* -----------------02.10.98 15:55-------------------
- *
- * --------------------------------------------------*/
+
void lcl_FormatTable(SwFrmFmt* pTblFmt)
{
- SwClientIter aIter( *pTblFmt );
- for( SwClient* pC = aIter.First( TYPE( SwFrm ));
- pC; pC = aIter.Next() )
+ SwIterator<SwFrm,SwFmt> aIter( *pTblFmt );
+ for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- if( ((SwFrm*)pC)->IsTabFrm() )
+ // mba: no TYPEINFO for SwTabFrm
+ if( pFrm->IsTabFrm() )
{
- if(((SwFrm*)pC)->IsValid())
- ((SwFrm*)pC)->InvalidatePos();
- ((SwTabFrm*)pC)->SetONECalcLowers();
- ((SwTabFrm*)pC)->Calc();
+ if(pFrm->IsValid())
+ pFrm->InvalidatePos();
+ ((SwTabFrm*)pFrm)->SetONECalcLowers();
+ ((SwTabFrm*)pFrm)->Calc();
}
}
}
-/* -----------------20.07.98 13:15-------------------
- *
- * --------------------------------------------------*/
+
void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
{
if(bExpand)
@@ -638,9 +608,7 @@ void lcl_CrsrSelect(SwPaM* pCrsr, sal_Bool bExpand)
pCrsr->DeleteMark();
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow)
{
SwTabCols aCols;
@@ -669,9 +637,7 @@ void lcl_GetTblSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* pBox, sal
rRet.setValue(&aColSeq, ::getCppuType((uno::Sequence< text::TableColumnSeparator>*)0));
}
-/* -----------------17.07.98 14:36-------------------
- *
- * --------------------------------------------------*/
+
void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBox, sal_Bool bRow, SwDoc* pDoc)
{
SwTabCols aOldCols;
@@ -715,17 +681,13 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo
}
}
}
-/* -----------------30.04.02 08:00-------------------
- *
- * --------------------------------------------------*/
+
inline rtl::OUString lcl_getString( SwXCell &rCell )
{
// getString is a member function of the base class...
return rCell.getString();
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to set string in SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to set string in SwXCell */
void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
BOOL bKeepNumberFmt )
{
@@ -741,9 +703,7 @@ void lcl_setString( SwXCell &rCell, const rtl::OUString &rTxt,
}
rCell.SwXText::setString(rTxt);
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to get value from SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to get value from SwXCell */
double lcl_getValue( SwXCell &rCell )
{
double fRet;
@@ -753,9 +713,7 @@ double lcl_getValue( SwXCell &rCell )
::rtl::math::setNan( &fRet );
return fRet;
}
-/* -----------------30.04.02 08:00-------------------
- * non UNO function call to set value in SwXCell
- * --------------------------------------------------*/
+/* non UNO function call to set value in SwXCell */
void lcl_setValue( SwXCell &rCell, double nVal )
{
if(rCell.IsValid())
@@ -793,9 +751,7 @@ void lcl_setValue( SwXCell &rCell, double nVal )
* SwXCell
******************************************************************/
TYPEINIT1(SwXCell, SwClient);
-/*-- 11.12.98 10:56:23---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -805,9 +761,7 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBx, sal_uInt16 nPos ) :
nFndPos(nPos)
{
}
-/* -----------------------------09.08.00 15:59--------------------------------
- ---------------------------------------------------------------------------*/
SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
SwXText(pTblFmt->GetDoc(), CURSOR_TBLTEXT),
SwClient(pTblFmt),
@@ -818,24 +772,17 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
{
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXCell::~SwXCell()
{
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -848,9 +795,7 @@ sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
else
return SwXText::getSomething(rId);
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeException)
{
static uno::Sequence< uno::Type > aRetTypes;
@@ -872,9 +817,7 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce
}
return aRetTypes;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -887,23 +830,17 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::R
}
return aId;
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::acquire( ) throw()
{
SwXCellBaseClass::acquire();
}
-/* -----------------------------18.05.00 10:18--------------------------------
- ---------------------------------------------------------------------------*/
void SAL_CALL SwXCell::release( ) throw()
{
SwXCellBaseClass::release();
}
-/* -----------------------------18.05.00 10:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
{
@@ -912,9 +849,7 @@ uno::Any SAL_CALL SwXCell::queryInterface( const uno::Type& aType )
aRet = SwXText::queryInterface(aType);
return aRet;
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
const SwStartNode *SwXCell::GetStartNode() const
{
const SwStartNode *pSttNd = 0;
@@ -930,9 +865,7 @@ SwXCell::CreateCursor() throw (uno::RuntimeException)
{
return createTextCursor();
}
-/*-- 11.12.98 10:56:24---------------------------------------------------
- -----------------------------------------------------------------------*/
bool SwXCell::IsValid() const
{
// FIXME: this is now a const method, to make SwXText::IsValid invisible
@@ -954,9 +887,7 @@ bool SwXCell::IsValid() const
}
return 0 != pBox;
}
-/*-- 11.12.98 10:56:25---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -970,9 +901,7 @@ OUString SwXCell::getFormula(void) throw( uno::RuntimeException )
}
return sRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1003,9 +932,7 @@ void SwXCell::setFormula(const OUString& rFormula) throw( uno::RuntimeException
pMyDoc->UpdateTblFlds( &aTblUpdate );
}
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
double SwXCell::getValue(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1014,17 +941,13 @@ double SwXCell::getValue(void) throw( uno::RuntimeException )
// #i112652# a table cell may contain NaN as a value, do not filter that
return fRet;
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setValue(double rValue) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
lcl_setValue( *this, rValue );
}
-/*-- 11.12.98 10:56:26---------------------------------------------------
- -----------------------------------------------------------------------*/
table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1042,27 +965,21 @@ table::CellContentType SwXCell::getType(void) throw( uno::RuntimeException )
}
return nRes;
}
-/* -----------------27.04.99 12:06-------------------
- *
- * --------------------------------------------------*/
+
void SwXCell::setString(const OUString& aString) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
lcl_setString( *this, aString );
}
-/*-- 11.12.98 10:56:27---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXCell::getError(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
OUString sContent = getString();
return sContent.equals(ViewShell::GetShellRes()->aCalc_Error);
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1086,9 +1003,7 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:28---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno::Reference< text::XTextRange > & xTextPosition)
throw( uno::RuntimeException )
{
@@ -1115,17 +1030,13 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno:
throw uno::RuntimeException();
return aRef;
}
-/*-- 11.12.98 10:56:33---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCell::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1155,9 +1066,7 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
}
}
}
-/*-- 11.12.98 10:56:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -1213,37 +1122,27 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1272,31 +1171,23 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro
}
return aRef;
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXCell::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<text::XTextRange>*)0);
}
-/*-- 11.12.98 10:56:38---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXCell::hasElements(void) throw( uno::RuntimeException )
{
return sal_True;
}
-/*-- 11.12.98 10:56:37---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXCell::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXCell::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------12.06.98 07:54-------------------
- *
- * --------------------------------------------------*/
+
SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTable )
{
SwXCell* pRet = 0;
@@ -1311,15 +1202,14 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab
//wenn es die Box gibt, dann wird auch eine Zelle zurueckgegeben
if(pFoundBox)
{
- SwClientIter aIter( *pTblFmt );
- SwXCell* pXCell = (SwXCell*)aIter.
- First( TYPE( SwXCell ));
+ SwIterator<SwXCell,SwFmt> aIter( *pTblFmt );
+ SwXCell* pXCell = aIter.First();
while( pXCell )
{
// gibt es eine passende Zelle bereits?
if(pXCell->GetTblBox() == pBox)
break;
- pXCell = (SwXCell*)aIter.Next();
+ pXCell = aIter.Next();
}
//sonst anlegen
if(!pXCell)
@@ -1329,9 +1219,7 @@ SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTab
}
return pRet;
}
-/* -----------------12.06.98 07:37-------------------
- * exitstiert die Box in der angegebenen Tabelle?
- * --------------------------------------------------*/
+/* does box exist in given table? */
SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
{
// check if nFndPos happens to point to the right table box
@@ -1347,24 +1235,18 @@ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2)
nFndPos = USHRT_MAX;
return 0;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCell::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCell");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXCell::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
return sServiceName.EqualsAscii("com.sun.star.text.CellProperties");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1376,23 +1258,17 @@ uno::Sequence< OUString > SwXCell::getSupportedServiceNames(void) throw( uno::Ru
/******************************************************************
* SwXTextTableRow
******************************************************************/
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextTableRow::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableRow");
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextTableRow::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableRow") == rServiceName;
}
-/* -----------------------------19.04.00 15:20--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1401,9 +1277,7 @@ uno::Sequence< OUString > SwXTextTableRow::getSupportedServiceNames(void) throw(
return aRet;
}
TYPEINIT1(SwXTextTableRow, SwClient);
-/*-- 11.12.98 12:04:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
SwClient(pFmt),
m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_ROW)),
@@ -1411,24 +1285,18 @@ SwXTextTableRow::SwXTextTableRow(SwFrmFmt* pFmt, SwTableLine* pLn) :
{
}
-/*-- 11.12.98 12:04:45---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableRow::~SwXTextTableRow()
{
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableRow::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:04:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
@@ -1489,9 +1357,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName,
}
}
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1538,44 +1404,32 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
}
return aRet;
}
-/*-- 11.12.98 12:04:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:04:49---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTableRow::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/*-- 11.12.98 12:04:50---------------------------------------------------
- -----------------------------------------------------------------------*/
SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
{
SwTableLine* pRet = 0;
@@ -1592,16 +1446,12 @@ SwTableLine* SwXTextTableRow::FindLine(SwTable* pTable, SwTableLine* pLine)
/******************************************************************
* SwXTextTableCursor
******************************************************************/
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTextTableCursor::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTableCursor");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTextTableCursor::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TextTableCursor") == rServiceName;
@@ -1614,9 +1464,7 @@ const SwDoc* SwXTextTableCursor::GetDoc() const { return GetFrmFmt()->Ge
SwDoc* SwXTextTableCursor::GetDoc() { return GetFrmFmt()->GetDoc(); }
const SwUnoCrsr* SwXTextTableCursor::GetCrsr() const { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
SwUnoCrsr* SwXTextTableCursor::GetCrsr() { return (SwUnoCrsr*)aCrsrDepend.GetRegisteredIn(); }
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -1625,9 +1473,6 @@ uno::Sequence< OUString > SwXTextTableCursor::getSupportedServiceNames(void) thr
return aRet;
}
-/*-- 11.12.98 12:16:13---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwClient(pFmt),
aCrsrDepend(this, 0),
@@ -1642,9 +1487,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt* pFmt, SwTableBox* pBox) :
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor* pTableSelection) :
SwClient(&rTableFmt),
aCrsrDepend(this, 0),
@@ -1665,9 +1508,7 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrmFmt& rTableFmt, const SwTableCursor*
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pTblCrsr->MakeBoxSels();
}
-/*-- 11.12.98 12:16:14---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTableCursor::~SwXTextTableCursor()
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1675,9 +1516,7 @@ SwXTextTableCursor::~SwXTextTableCursor()
if(pUnoCrsr)
delete pUnoCrsr;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1717,9 +1556,7 @@ OUString SwXTextTableCursor::getRangeName(void) throw( uno::RuntimeException )
}
return aRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool Expand)
throw( uno::RuntimeException )
{
@@ -1735,9 +1572,7 @@ sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& CellName, sal_Bool E
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1751,9 +1586,7 @@ sal_Bool SwXTextTableCursor::goLeft(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:15---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1767,9 +1600,7 @@ sal_Bool SwXTextTableCursor::goRight(sal_Int16 Count, sal_Bool Expand) throw( un
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1783,9 +1614,7 @@ sal_Bool SwXTextTableCursor::goUp(sal_Int16 Count, sal_Bool Expand) throw( uno::
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1799,9 +1628,7 @@ sal_Bool SwXTextTableCursor::goDown(sal_Int16 Count, sal_Bool Expand) throw( uno
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1813,9 +1640,7 @@ void SwXTextTableCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException
pTblCrsr->MoveTable(fnTableCurr, fnTableStart);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1827,9 +1652,7 @@ void SwXTextTableCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException )
pTblCrsr->MoveTable(fnTableCurr, fnTableEnd);
}
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1858,9 +1681,7 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException )
}
return bRet;
}
-/*-- 11.12.98 12:16:16---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -1884,17 +1705,13 @@ sal_Bool SwXTextTableCursor::splitRange(sal_Int16 Count, sal_Bool Horizontal) th
}
return bRet;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException,
@@ -1960,9 +1777,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 12:16:17---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -2022,38 +1837,28 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
}
return aRet;
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:18---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:16:19---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTableCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTableCursor::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
@@ -2077,36 +1882,25 @@ public:
void ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc);
};
-/* -----------------22.06.98 09:43-------------------
- *
- * --------------------------------------------------*/
+
SwTableProperties_Impl::SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
SwTableProperties_Impl::~SwTableProperties_Impl()
{
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::SetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any& rVal)
{
aAnyMap.SetValue( nWhichId, nMemberId, rVal );
}
-/* -----------------22.06.98 09:51-------------------
- *
- * --------------------------------------------------*/
sal_Bool SwTableProperties_Impl::GetProperty(USHORT nWhichId, USHORT nMemberId, const uno::Any*& rpAny )
{
return aAnyMap.FillValue( nWhichId, nMemberId, rpAny );
}
-/* -----------------13.01.99 15:42-------------------
- *
- * --------------------------------------------------*/
+
void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
{
SfxItemSet aSet(rDoc.GetAttrPool(),
@@ -2285,9 +2079,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() );
}
}
-/* -----------------------------11.07.00 12:14--------------------------------
- ---------------------------------------------------------------------------*/
SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef )
{
uno::Reference<lang::XUnoTunnel> xTunnel( xRef, uno::UNO_QUERY);
@@ -2296,17 +2088,13 @@ SwXTextTable* SwXTextTable::GetImplementation(uno::Reference< XInterface> xRef )
sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextTable::getUnoTunnelId()) ));
return 0;
}
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -2318,14 +2106,10 @@ sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/*-- 11.12.98 12:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
TYPEINIT1(SwXTextTable, SwClient)
-/*-- 11.12.98 12:42:43---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable() :
aLstnrCntnr( (text::XTextTable*)this),
aChartLstnrCntnr( (text::XTextTable*)this),
@@ -2337,11 +2121,8 @@ SwXTextTable::SwXTextTable() :
bFirstRowAsLabel(sal_False),
bFirstColumnAsLabel(sal_False)
{
-
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
SwClient( &rFrmFmt ),
aLstnrCntnr( (text::XTextTable*)this),
@@ -2354,18 +2135,13 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) :
bFirstRowAsLabel(sal_False),
bFirstColumnAsLabel(sal_False)
{
-
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextTable::~SwXTextTable()
{
delete pTableProps;
}
-/*-- 11.12.98 12:42:44---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeException )
{
if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX )
@@ -2376,17 +2152,14 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
nColumns = (sal_uInt16)nC;
}
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Reference< table::XTableRows > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
- SwXTableRows* pRows = (SwXTableRows*)SwClientIter(*pFmt).
- First(TYPE(SwXTableRows));
+ SwXTableRows* pRows = SwIterator<SwXTableRows,SwFmt>::FirstElement(*pFmt);
if (!pRows)
pRows = new SwXTableRows(*pFmt);
xRet = pRows;
@@ -2395,17 +2168,14 @@ uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::Run
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
uno::Reference< table::XTableColumns > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
- SwXTableColumns* pCols = (SwXTableColumns*)SwClientIter(*pFmt).
- First(TYPE(SwXTableColumns));
+ SwXTableColumns* pCols = SwIterator<SwXTableColumns,SwFmt>::FirstElement(*pFmt);
if (!pCols)
pCols = new SwXTableColumns(*pFmt);
xRet = pCols;
@@ -2414,9 +2184,7 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& CellName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2436,9 +2204,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& Cell
throw uno::RuntimeException();
return xRet;
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2463,9 +2229,7 @@ uno::Sequence< OUString > SwXTextTable::getCellNames(void) throw( uno::RuntimeEx
}
return uno::Sequence< OUString >();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(const OUString& CellName)
throw( uno::RuntimeException )
{
@@ -2486,9 +2250,7 @@ uno::Reference< text::XTextTableCursor > SwXTextTable::createCursorByCellName(c
throw uno::RuntimeException();
return xRet;
}
-/* -----------------18.02.99 13:36-------------------
- *
- * --------------------------------------------------*/
+
void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -2538,18 +2300,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
// hier muessen die Properties des Descriptors ausgewertet werden
pTableProps->ApplyTblAttr(*pTable, *pDoc);
SwFrmFmt* pTblFmt = pTable->GetFrmFmt();
- SwClientIter aIter( *pTblFmt );
- for( SwClient* pC = aIter.First( TYPE( SwFrm ));
- pC; pC = aIter.Next() )
- {
- if( ((SwFrm*)pC)->IsTabFrm() )
- {
- if(((SwFrm*)pC)->IsValid())
- ((SwFrm*)pC)->InvalidatePos();
- ((SwTabFrm*)pC)->SetONECalcLowers();
- ((SwTabFrm*)pC)->Calc();
- }
- }
+ lcl_FormatTable( pTblFmt );
pTblFmt->Add(this);
if(m_sTableName.Len())
@@ -2582,18 +2333,14 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex
else
throw lang::IllegalArgumentException();
}
-/*-- 11.12.98 12:42:45---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::attach(const uno::Reference< text::XTextRange > & xTextRange)
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
attachToRange( xTextRange );
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void)
throw( uno::RuntimeException )
{
@@ -2604,9 +2351,7 @@ uno::Reference< text::XTextRange > SwXTextTable::getAnchor(void)
uno::Reference< text::XTextRange > xRet = new SwXTextRange(*pFmt);
return xRet;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::dispose(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -2622,26 +2367,20 @@ void SwXTextTable::dispose(void) throw( uno::RuntimeException )
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aLstnrCntnr.AddListener(aListener);
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener))
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
@@ -2660,9 +2399,7 @@ uno::Reference< table::XCell > SwXTextTable::getCellByPosition(sal_Int32 nColum
return aRef;
}
-/* -----------------11.12.98 13:26-------------------
- *
- * --------------------------------------------------*/
+
uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt, SwTable* pTable,
const String& rTLName, const String& rBRName,
SwRangeDescriptor& rDesc)
@@ -2699,9 +2436,7 @@ uno::Reference< table::XCellRange > SwXTextTable::GetRangeByName(SwFrmFmt* pFmt
}
return aRef;
}
-/*-- 11.12.98 12:42:46---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop,
sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
@@ -2734,9 +2469,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByPosition(sal_In
throw lang::IndexOutOfBoundsException();
return aRef;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUString& aRange)
throw( uno::RuntimeException )
{
@@ -2771,9 +2504,7 @@ uno::Reference< table::XCellRange > SwXTextTable::getCellRangeByName(const OUSt
throw uno::RuntimeException();
return aRef;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw (uno::RuntimeException)
{
@@ -2833,9 +2564,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXTextTable::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
@@ -2903,9 +2632,7 @@ void SAL_CALL SwXTextTable::setDataArray(
}
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw( uno::RuntimeException )
{
@@ -2947,9 +2674,7 @@ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData(void)
throw uno::RuntimeException();
return aRowSeq;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
@@ -2997,9 +2722,7 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
aChartLstnrCntnr.ChartDataChanged();
}
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3039,9 +2762,7 @@ uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::Run
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3076,9 +2797,7 @@ void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
@@ -3119,9 +2838,7 @@ uno::Sequence< OUString > SwXTextTable::getColumnDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColumnDesc) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3158,9 +2875,7 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence< OUString >& rColum
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3169,9 +2884,7 @@ void SwXTextTable::addChartDataChangeEventListener(
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeChartDataChangeEventListener(
const uno::Reference< chart::XChartDataChangeEventListener > & aListener)
throw( uno::RuntimeException )
@@ -3179,27 +2892,21 @@ void SwXTextTable::removeChartDataChangeEventListener(
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:33-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXTextTable::isNotANumber(double nNumber) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return ( nNumber == DBL_MIN );
}
-/* -----------------08.03.99 15:34-------------------
- *
- * --------------------------------------------------*/
+
double SwXTextTable::getNotANumber(void) throw( uno::RuntimeException )
{
// We use DBL_MIN because starcalc does (which uses it because chart
// wants it that way!)
return DBL_MIN;
}
-/*-- 11.12.98 12:42:48---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void)
throw( uno::RuntimeException )
{
@@ -3207,9 +2914,7 @@ uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void)
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
@@ -3231,9 +2936,7 @@ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor
pFmt->GetDoc()->SortTbl(aBoxes, aSortOpt);
}
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumentException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3266,17 +2969,13 @@ void SwXTextTable::autoFormat(const OUString& aName) throw( lang::IllegalArgumen
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:49---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 12:42:50---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue)
throw( beans::UnknownPropertyException, beans::PropertyVetoException,
@@ -3338,9 +3037,9 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
&& pBorder)
{
SwDoc* pDoc = pFmt->GetDoc();
- SwClientIter aIter( *pFmt );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
//Tabellen ohne Layout (unsichtbare Header/Footer )
- if(0 != aIter.First( TYPE( SwFrm )))
+ if( pFrm )
{
lcl_FormatTable(pFmt);
SwTable* pTable = SwTable::FindTable( pFmt );
@@ -3486,9 +3185,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
else
throw uno::RuntimeException();
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3535,9 +3232,9 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
case FN_UNO_TABLE_BORDER:
{
SwDoc* pDoc = pFmt->GetDoc();
- SwClientIter aIter( *pFmt );
+ SwFrm* pFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
//Tabellen ohne Layout (unsichtbare Header/Footer )
- if(0 != aIter.First( TYPE( SwFrm )))
+ if( pFrm )
{
lcl_FormatTable(pFmt);
SwTable* pTable = SwTable::FindTable( pFmt );
@@ -3701,37 +3398,27 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 12:42:51---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:52---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 12:42:58---------------------------------------------------
- -----------------------------------------------------------------------*/
OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3747,9 +3434,7 @@ OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
sRet = m_sTableName;
return sRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3807,9 +3492,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
else
m_sTableName = sNewTblName;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getRowCount(void)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3825,9 +3508,7 @@ sal_uInt16 SwXTextTable::getRowCount(void)
}
return nRet;
}
-/*-----------------11.02.98 09:58-------------------
---------------------------------------------------*/
sal_uInt16 SwXTextTable::getColumnCount(void)
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -3845,10 +3526,8 @@ sal_uInt16 SwXTextTable::getColumnCount(void)
}
return nRet;
}
-/*-- 11.12.98 12:42:59---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTextTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT &&
(void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject )
@@ -3863,16 +3542,12 @@ void SwXTextTable::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
OUString SAL_CALL SwXTextTable::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTextTable");
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
String sServiceName(rServiceName);
@@ -3881,9 +3556,7 @@ sal_Bool SwXTextTable::supportsService(const OUString& rServiceName) throw( uno:
sServiceName.EqualsAscii("com.sun.star.text.TextContent") ||
sServiceName.EqualsAscii("com.sun.star.text.TextSortable"));
}
-/* -----------------25.10.99 15:12-------------------
- --------------------------------------------------*/
uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(4);
@@ -3898,17 +3571,13 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un
/******************************************************************
*
******************************************************************/
-/* -----------------------------10.03.00 18:02--------------------------------
- ---------------------------------------------------------------------------*/
const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
{
static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
return aSeq;
}
-/* -----------------------------10.03.00 18:04--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
throw(uno::RuntimeException)
{
@@ -3920,20 +3589,14 @@ sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >&
}
return 0;
}
-/* -----------------28.04.98 10:29-------------------
- *
- * --------------------------------------------------*/
+
TYPEINIT1(SwXCellRange, SwClient);
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXCellRange::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXCellRange");
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return
@@ -3945,9 +3608,7 @@ BOOL SwXCellRange::supportsService(const OUString& rServiceName) throw( uno::Run
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesAsian" ) ) ||
rServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.style.ParagraphPropertiesComplex" ) );
}
-/* -----------------------------19.04.00 15:21--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(7);
@@ -3962,9 +3623,7 @@ uno::Sequence< OUString > SwXCellRange::getSupportedServiceNames(void) throw( un
return aRet;
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
SwRangeDescriptor& rDesc)
:
@@ -3979,17 +3638,13 @@ SwXCellRange::SwXCellRange(SwUnoCrsr* pCrsr, SwFrmFmt& rFrmFmt,
{
aRgDesc.Normalize();
}
-/*-- 11.12.98 14:27:33---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXCellRange::~SwXCellRange()
{
vos::OGuard aGuard(Application::GetSolarMutex());
delete pTblCrsr;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
{
@@ -4011,9 +3666,7 @@ uno::Reference< table::XCell > SwXCellRange::getCellByPosition(sal_Int32 nColum
throw lang::IndexOutOfBoundsException();
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom)
throw( uno::RuntimeException, lang::IndexOutOfBoundsException )
@@ -4069,9 +3722,7 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByPosition(
return aRet;
}
-/*-- 11.12.98 14:27:34---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUString& rRange)
throw( uno::RuntimeException )
{
@@ -4089,17 +3740,13 @@ uno::Reference< table::XCellRange > SwXCellRange::getCellRangeByName(const OUSt
return getCellRangeByPosition(aDesc.nLeft - aRgDesc.nLeft, aDesc.nTop - aRgDesc.nTop,
aDesc.nRight - aRgDesc.nLeft, aDesc.nBottom - aRgDesc.nTop);
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Reference< beans::XPropertySetInfo > SwXCellRange::getPropertySetInfo(void) throw( uno::RuntimeException )
{
static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo();
return xRef;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
const uno::Any& aValue) throw( beans::UnknownPropertyException,
beans::PropertyVetoException, lang::IllegalArgumentException,
@@ -4218,9 +3865,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName,
throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
}
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -4302,39 +3947,27 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
}
return aRet;
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
DBG_WARNING("not implemented");
}
-/*-----------------------------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
void SwXCellRange::GetDataSequence(
uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used
uno::Sequence< OUString > *pTxtSeq, //-> as output sequence
@@ -4479,9 +4112,6 @@ void SwXCellRange::GetDataSequence(
pDblSeq->realloc( nDtaCnt );
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
throw (uno::RuntimeException)
{
@@ -4543,9 +4173,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXCellRange::getDataArray()
}
return aRowSeq;
}
-/*-- 29.04.02 11:42:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::setDataArray(
const uno::Sequence< uno::Sequence< uno::Any > >& rArray )
throw (uno::RuntimeException)
@@ -4611,9 +4239,7 @@ void SAL_CALL SwXCellRange::setDataArray(
}
}
}
-/*-- 11.12.98 14:27:36---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -4652,9 +4278,7 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
}
return aRowSeq;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData)
throw( uno::RuntimeException )
{
@@ -4697,9 +4321,7 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
throw( uno::RuntimeException )
{
@@ -4739,9 +4361,7 @@ uno::Sequence< OUString > SwXCellRange::getRowDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
throw( uno::RuntimeException )
{
@@ -4775,9 +4395,7 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
}
}
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
throw( uno::RuntimeException )
{
@@ -4817,9 +4435,7 @@ uno::Sequence< OUString > SwXCellRange::getColumnDescriptions(void)
throw uno::RuntimeException();
return aRet;
}
-/*-- 11.12.98 14:27:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& ColumnDesc)
throw( uno::RuntimeException )
{
@@ -4850,52 +4466,40 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence< OUString >& Column
}
}
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::addChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn())
throw uno::RuntimeException();
aChartLstnrCntnr.AddListener(aListener.get());
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< chart::XChartDataChangeEventListener > & aListener) throw( uno::RuntimeException )
{
if(!GetRegisteredIn() || !aChartLstnrCntnr.RemoveListener(aListener.get()))
throw uno::RuntimeException();
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return sal_False;
}
-/* -----------------08.03.99 15:36-------------------
- *
- * --------------------------------------------------*/
+
double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException )
{
DBG_WARNING("not implemented");
return 0.;
}
-/*-- 11.12.98 14:27:38---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Sequence< beans::PropertyValue > SwXCellRange::createSortDescriptor(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
return SwUnoCursorHelper::CreateSortDescriptor(true);
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor)
throw( uno::RuntimeException )
{
@@ -4911,23 +4515,17 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD
pFmt->GetDoc()->SortTbl(pTableCrsr->GetBoxes(), aSortOpt);
}
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getColumnCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nRight - aRgDesc.nLeft + 1);
}
-/* -----------------27.04.98 16:54-------------------
- *
- * --------------------------------------------------*/
+
sal_uInt16 SwXCellRange::getRowCount(void)
{
return static_cast< sal_uInt16 >(aRgDesc.nBottom - aRgDesc.nTop + 1);
}
-/* -----------------------------05.06.01 09:19--------------------------------
- ---------------------------------------------------------------------------*/
const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
{
const SwUnoCrsr* pRet = 0;
@@ -4937,10 +4535,8 @@ const SwUnoCrsr* SwXCellRange::GetTblCrsr() const
return pRet;
}
-/*-- 11.12.98 14:27:39---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXCellRange::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew );
if(!GetRegisteredIn() || !aCursorDepend.GetRegisteredIn())
@@ -4957,26 +4553,21 @@ void SwXCellRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
else
aChartLstnrCntnr.ChartDataChanged();
}
+
/******************************************************************
* SwXTableRows
******************************************************************/
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTableRows::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableRows");
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTableRows::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableRows") == rServiceName;
}
-/* -----------------------------19.04.00 15:22--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -4985,21 +4576,16 @@ uno::Sequence< OUString > SwXTableRows::getSupportedServiceNames(void) throw( un
return aRet;
}
TYPEINIT1(SwXTableRows, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableRows::SwXTableRows(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableRows::~SwXTableRows()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5014,9 +4600,7 @@ sal_Int32 SwXTableRows::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -5031,15 +4615,14 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
if(pTable->GetTabLines().Count() > nIndex)
{
SwTableLine* pLine = pTable->GetTabLines().GetObject((sal_uInt16)nIndex);
- SwClientIter aIter( *pFrmFmt );
- SwXTextTableRow* pXRow = (SwXTextTableRow*)aIter.
- First( TYPE( SwXTextTableRow ));
+ SwIterator<SwXTextTableRow,SwFmt> aIter( *pFrmFmt );
+ SwXTextTableRow* pXRow = aIter.First();
while( pXRow )
{
// gibt es eine passende Zelle bereits?
if(pXRow->GetTblRow() == pLine)
break;
- pXRow = (SwXTextTableRow*)aIter.Next();
+ pXRow = aIter.Next();
}
//sonst anlegen
if(!pXRow)
@@ -5053,16 +4636,12 @@ uno::Any SwXTableRows::getByIndex(sal_Int32 nIndex)
}
return aRet;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableRows::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((const uno::Reference<beans::XPropertySet>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5072,9 +4651,7 @@ sal_Bool SwXTableRows::hasElements(void) throw( uno::RuntimeException )
//es gibt keine Tabelle ohne Zeilen
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5128,9 +4705,7 @@ void SwXTableRows::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5190,10 +4765,8 @@ void SwXTableRows::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno:
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTableRows::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
@@ -5201,23 +4774,17 @@ void SwXTableRows::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
/******************************************************************
* SwXTableColumns
******************************************************************/
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
OUString SwXTableColumns::getImplementationName(void) throw( uno::RuntimeException )
{
return C2U("SwXTableColumns");
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
BOOL SwXTableColumns::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return C2U("com.sun.star.text.TableColumns") == rServiceName;
}
-/* -----------------------------19.04.00 15:23--------------------------------
- ---------------------------------------------------------------------------*/
uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
@@ -5226,21 +4793,16 @@ uno::Sequence< OUString > SwXTableColumns::getSupportedServiceNames(void) throw(
return aRet;
}
TYPEINIT1(SwXTableColumns, SwClient);
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
+
SwXTableColumns::SwXTableColumns(SwFrmFmt& rFrmFmt) :
SwClient(&rFrmFmt)
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTableColumns::~SwXTableColumns()
{
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5260,9 +4822,7 @@ sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException )
}
return nRet;
}
-/*-- 03.02.99 07:37:41---------------------------------------------------
- -----------------------------------------------------------------------*/
uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
{
@@ -5287,17 +4847,12 @@ uno::Any SwXTableColumns::getByIndex(sal_Int32 nIndex)
}
return uno::Any(&xRet, ::getCppuType((const uno::Reference<uno::XInterface>*)0));
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
uno::Type SAL_CALL SwXTableColumns::getElementType(void) throw( uno::RuntimeException )
{
return ::getCppuType((uno::Reference<uno::XInterface>*)0);
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5306,9 +4861,7 @@ sal_Bool SwXTableColumns::hasElements(void) throw( uno::RuntimeException )
throw uno::RuntimeException();
return sal_True;
}
-/*-- 03.02.99 07:37:42---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5361,9 +4914,7 @@ void SwXTableColumns::insertByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( uno::RuntimeException )
{
vos::OGuard aGuard(Application::GetSolarMutex());
@@ -5423,16 +4974,12 @@ void SwXTableColumns::removeByIndex(sal_Int32 nIndex, sal_Int32 nCount) throw( u
}
}
}
-/*-- 03.02.99 07:37:43---------------------------------------------------
- -----------------------------------------------------------------------*/
-void SwXTableColumns::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew)
+void SwXTableColumns::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
{
ClientModify(this, pOld, pNew);
}
-/* -----------------------------22.09.00 11:11--------------------------------
- ---------------------------------------------------------------------------*/
void SwChartEventListenerContainer::ChartDataChanged()
{
if(pListenerArr)
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 3ddcfc1d2ed7..6c35ac2a1392 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2687,7 +2687,7 @@ public:
}
return *pFmt;
}
-
+protected:
// SwClient
virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index a02085f261b6..0baada0c8df0 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -48,7 +48,9 @@ using namespace ::com::sun::star;
SwXTextMarkup::SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper::ConversionMap* pMap )
: mpTxtNode( &rTxtNode ), mpConversionMap( pMap )
{
- mpTxtNode->Add(this);
+ // FME 2007-07-16 #i79641# SwXTextMarkup is allowed to be removed ...
+ SetIsAllowedToBeRemovedInModifyCall(true);
+ mpTxtNode->Add(this);
}
SwXTextMarkup::~SwXTextMarkup()
@@ -421,12 +423,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
-void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ )
+void SwXTextMarkup::Modify( const SfxPoolItem* /*pOld*/, const SfxPoolItem* /*pNew*/ )
{
// FME 2007-07-16 #i79641# In my opinion this is perfectly legal,
// therefore I remove the assertion in SwModify::_Remove()
- if ( pRegisteredIn )
- pRegisteredIn->Remove( this );
+ if ( GetRegisteredIn() )
+ GetRegisteredInNonConst()->Remove( this );
// <--
vos::OGuard aGuard(Application::GetSolarMutex());
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 43662250ebd0..5377867e2a80 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2276,7 +2276,7 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
if( pFldType && pFldType->GetDepends() )
{
SwMsgPoolItem aHnt( RES_HIDDENPARA_PRINT );
- pFldType->Modify( &aHnt, 0);
+ pFldType->ModifyNotification( &aHnt, 0);
}
bReformat = TRUE;
}
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index a1b2805cbfa2..686b7a9a8f34 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -32,9 +32,7 @@
#include <sfx2/printer.hxx>
#include <rtl/logfile.hxx>
#include <doc.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <viewsh.hxx>
#include <rootfrm.hxx>
#include <viewimp.hxx>
@@ -48,14 +46,11 @@
#include <ndgrf.hxx>
#include <ndindex.hxx>
#include <accessibilityoptions.hxx>
-
+#include <switerator.hxx>
/*************************************************************************
|*
|* ViewShell::Init()
-|*
-|* Letzte Aenderung MA 14. Jun. 96
-|*
|*************************************************************************/
void ViewShell::Init( const SwViewOption *pNewOpt )
@@ -164,9 +159,6 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer die erste Shell.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
@@ -246,9 +238,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer weitere Shells auf ein Dokument.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
@@ -321,9 +310,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
|*
|* ViewShell::~ViewShell()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 10. May. 95
-|*
******************************************************************************/
ViewShell::~ViewShell()
@@ -349,9 +335,8 @@ ViewShell::~ViewShell()
{
if( pGNd->IsAnimated() )
{
- SwClientIter aIter( *pGNd );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm; pFrm = (SwFrm*)aIter.Next() )
+ SwIterator<SwFrm,SwGrfNode> aIter( *pGNd );
+ for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
ASSERT( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" );
((SwNoTxtFrm*)pFrm)->StopAnimation( pOut );
diff --git a/sw/source/filter/html/htmlvsh.hxx b/sw/source/filter/html/htmlvsh.hxx
index 18e0129fd0a3..67afddf699ee 100644
--- a/sw/source/filter/html/htmlvsh.hxx
+++ b/sw/source/filter/html/htmlvsh.hxx
@@ -34,7 +34,8 @@ class ViewShell;
class SwHTMLViewShellClient : public SwClient
{
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+protected:
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
public:
@@ -45,7 +46,7 @@ public:
void Register( ViewShell *pVsh );
void DeRegister();
- /*inline*/ ViewShell *GetViewShell(); // im swhtml.cxx
+ ViewShell *GetViewShell();
};
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index fba6a477757d..bb2cdd647bc3 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -925,15 +925,15 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() )
#endif
}
-void SwHTMLParser::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
+void SwHTMLParser::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 )
{
case RES_OBJECTDYING:
- if( ((SwPtrMsgPoolItem *)pOld)->pObject == pRegisteredIn )
+ if( ((SwPtrMsgPoolItem *)pOld)->pObject == GetRegisteredIn() )
{
// dann uns selbst beenden
- pRegisteredIn->Remove( this );
+ GetRegisteredInNonConst()->Remove( this );
ReleaseRef(); // ansonsten sind wir fertig!
}
break;
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index e7d684842beb..2a7bf5e0a917 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -924,7 +924,7 @@ protected:
virtual ~SwHTMLParser();
// wird das Dok geloescht, ist auch der Parser zu loeschen
- virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
virtual void AddMetaUserDefined( ::rtl::OUString const & i_rMetaName );
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index c511d4aab02a..f0b1259d2eda 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -166,7 +166,7 @@ class SwFltAnchorClient : public SwClient
public:
SwFltAnchorClient(SwFltAnchor * pFltAnchor);
- virtual void Modify (SfxPoolItem *pOld, SfxPoolItem *pNew);
+ virtual void Modify (const SfxPoolItem *pOld, const SfxPoolItem *pNew);
};
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index 507f35375ed6..d191a7424f61 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -724,7 +724,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule )
SwCharFmt* pCFmt = rNFmt.GetCharFmt();
if( pCFmt )
{
- pCFmt->Remove( &rNFmt );
+ rNFmt.ForgetCharFmt();
if( !pCFmt->GetDepends() )
pDoc->DelCharFmt( pCFmt );
}
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 2c182532079d..08b3af4fabbd 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -781,9 +781,9 @@ void SwRTFParser::ReadTable( int nToken )
{
SwTableBox* pBox = pNewLine->GetTabBoxes()[0];
pBoxFmt = (SwTableBoxFmt*)pBox->GetFrmFmt();
- pBoxFmt->Remove( pBox );
+ pBox->ForgetFrmFmt();
delete pBoxFmt;
- aBoxFmts[0]->Add( pBox );
+ pBox->RegisterToFormat( *aBoxFmts[0] );
SwTxtNode* pTNd = pDoc->GetNodes()[ pBox->GetSttIdx()+1 ]
->GetTxtNode();
ASSERT( pTNd, "wo ist der Textnode dieser Box?" );
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 43986e9cd599..7222b95fb229 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1057,7 +1057,7 @@ InsertedTableClient::InsertedTableClient(SwTableNode & rNode)
SwTableNode * InsertedTableClient::GetTableNode()
{
- return dynamic_cast<SwTableNode *> (pRegisteredIn);
+ return dynamic_cast<SwTableNode *> (GetRegisteredInNonConst());
}
InsertedTablesManager::InsertedTablesManager(const SwDoc &rDoc)
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 27295e9e7bce..57cb0ce8a650 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -777,11 +777,11 @@ SwFltAnchorClient::SwFltAnchorClient(SwFltAnchor * pFltAnchor)
{
}
-void SwFltAnchorClient::Modify(SfxPoolItem *, SfxPoolItem * pNew)
+void SwFltAnchorClient::Modify(const SfxPoolItem *, const SfxPoolItem * pNew)
{
if (pNew->Which() == RES_FMT_CHG)
{
- SwFmtChg * pFmtChg = dynamic_cast<SwFmtChg *> (pNew);
+ const SwFmtChg * pFmtChg = dynamic_cast<const SwFmtChg *> (pNew);
if (pFmtChg != NULL)
{
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7f1b6658800e..92745a7ec00d 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2120,7 +2120,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
const SwContact* pContact = _rFrmFmt.FindContactObj();
if ( pContact )
{
- std::vector<SwAnchoredObject*> aAnchoredObjs;
+ std::list<SwAnchoredObject*> aAnchoredObjs;
pContact->GetAnchoredObjs( aAnchoredObjs );
if ( !aAnchoredObjs.empty() )
{
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 6e6dcf813767..33350414f084 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1903,8 +1903,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if (pTextNodeInfoInner->isFirstInTable())
{
const SwTable * pTable = pTextNodeInfoInner->getTable();
- const SwTableFmt * pTabFmt =
- dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+
+ const SwTableFmt * pTabFmt = pTable->GetTableFmt();
if (pTabFmt != NULL)
{
if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE)
@@ -2118,7 +2118,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
// this has to be overruled.
const SwFmtPageDesc& rPageDescAtParaStyle =
ItemGet<SwFmtPageDesc>( rNode, RES_PAGEDESC );
- if( rPageDescAtParaStyle.GetRegisteredIn() )
+ if( rPageDescAtParaStyle.KnowsPageDesc() )
pTmpSet->ClearItem( RES_BREAK );
}
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index e22ca1c9b731..cfa1e6298421 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2115,7 +2115,7 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t
void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
const SwTable * pTable = pTableTextNodeInfoInner->getTable();
- const SwTableFmt * pTableFmt = dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+ const SwTableFmt * pTableFmt = pTable->GetTableFmt();
if (pTableFmt != NULL)
{
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 89aef162ec01..4688fe8fc6a1 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -325,21 +325,19 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
pISet = 0; // fuer Doppel-Attribute
}
}
-
+#include "switerator.hxx"
void MSWordExportBase::GatherChapterFields()
{
//If the header/footer contains a chapter field
- SwClientIter aIter(*pDoc->GetSysFldType(RES_CHAPTERFLD));
- const SwClient *pField = aIter.First(TYPE(SwFmtFld));
- while (pField)
+ SwFieldType* pType = pDoc->GetSysFldType( RES_CHAPTERFLD );
+ SwIterator<SwFmtFld,SwFieldType> aFmtFlds( *pType );
+ for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() )
{
- const SwFmtFld* pFld = (const SwFmtFld*)(pField);
if (const SwTxtFld *pTxtFld = pFld->GetTxtFld())
{
const SwTxtNode &rTxtNode = pTxtFld->GetTxtNode();
maChapterFieldLocs.push_back(rTxtNode.GetIndex());
}
- pField = aIter.Next();
}
}
@@ -441,7 +439,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
if ( pSet && pSet->Count() )
{
if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem )
- && ( (SwFmtPageDesc*)pItem )->GetRegisteredIn() )
+ && ( (SwFmtPageDesc*)pItem )->KnowsPageDesc() )
{
bBreakSet = true;
bNewPageDesc = true;
@@ -524,7 +522,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
// but a pagedesc item is an implicit page break before...
const SwFmtPageDesc &rPageDesc =
ItemGet<SwFmtPageDesc>( *pNd, RES_PAGEDESC );
- if ( rPageDesc.GetRegisteredIn() )
+ if ( rPageDesc.KnowsPageDesc() )
bHackInBreak = true;
}
}
@@ -862,10 +860,10 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
bool MSWordExportBase::HasRefToObject( USHORT nTyp, const String* pName, USHORT nSeqNo )
{
const SwTxtNode* pNd;
- SwClientIter aIter( *pDoc->GetSysFldType( RES_GETREFFLD ) );
- for ( SwFmtFld* pFld = static_cast< SwFmtFld* >( aIter.First( TYPE( SwFmtFld ) ) );
- pFld;
- pFld = static_cast< SwFmtFld* >( aIter.Next() ) )
+
+ SwFieldType* pType = pDoc->GetSysFldType( RES_GETREFFLD );
+ SwIterator<SwFmtFld, SwFieldType> aFmtFlds( *pType );
+ for ( SwFmtFld* pFld = aFmtFlds.First(); pFld; pFld = aFmtFlds.Next() )
{
if ( pFld->GetTxtFld() && nTyp == pFld->GetFld()->GetSubType() &&
0 != ( pNd = pFld->GetTxtFld()->GetpTxtNode() ) &&
@@ -3623,7 +3621,7 @@ void AttributeOutputBase::FormatPageDescription( const SwFmtPageDesc& rPageDesc
if ( GetExport().bStyDef && GetExport().pOutFmtNode && GetExport().pOutFmtNode->ISA( SwTxtFmtColl ) )
{
const SwTxtFmtColl* pC = (SwTxtFmtColl*)GetExport().pOutFmtNode;
- if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.GetRegisteredIn() )
+ if ( (SFX_ITEM_SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.KnowsPageDesc() )
FormatBreak( SvxFmtBreakItem( SVX_BREAK_PAGE_BEFORE, RES_BREAK ) );
}
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 93a39b1c390c..ae058529a5f1 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2672,7 +2672,7 @@ void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/,
if( STRING_NOTFOUND != n )
{
SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0);
- pType->Add( &rBase );
+ rBase.RegisterToTOXType( *pType );
rBase.SetCaptionDisplay( eCaptionType );
// Read Sequence Name and store in TOXBase
String sSeqName( rParam.GetResult() );
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 050f498c10c5..33f339fe60a3 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -700,7 +700,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
if( pFmtPageDesc )
{
- pPageDesc->Add( pFmtPageDesc );
+ pFmtPageDesc->RegisterToPageDesc( *pPageDesc );
pItemSet->Put( *pFmtPageDesc );
delete pFmtPageDesc;
}
@@ -1087,7 +1087,7 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
if( bSendModify )
{
SwCondCollCondChg aMsg( pColl );
- pColl->Modify( &aMsg, &aMsg );
+ pColl->ModifyNotification( &aMsg, &aMsg );
}
}
}
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index d5f298b5292c..6bdd02ef8c06 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -63,6 +63,7 @@
#include <ndole.hxx>
#include <docsh.hxx>
#include <sfx2/docfile.hxx>
+#include <switerator.hxx>
// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
@@ -320,9 +321,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
{
// check whether an object with this name already exists in the document
String aName;
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pExistingOLENd = pNd->GetOLENode();
if( pExistingOLENd )
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index bc7e1ec82888..c078f55a0ed9 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -92,11 +92,8 @@
#include <swcli.hxx>
#include <txtftn.hxx>
#include <ftnidx.hxx>
-
-// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption
#include <fldbas.hxx>
#include <docary.hxx>
-// <--
#include <swerror.h> // Fehlermeldungen
#include <helpid.h>
#include <cmdid.h>
@@ -122,7 +119,7 @@
#include <unomid.h>
#include <sfx2/Metadatable.hxx>
-
+#include <switerator.hxx>
using rtl::OUString;
using namespace ::com::sun::star;
@@ -944,32 +941,6 @@ Rectangle SwDocShell::GetVisArea( USHORT nAspect ) const
const SwRect aPageRect = pNd->FindPageFrmRect( FALSE, 0, FALSE );
return aPageRect.SVRect();
-
- // Why does this have to be that complicated? I replaced this by the
- // call of FindPageFrmRect():
- /*
- //PageDesc besorgen, vom ersten Absatz oder den default.
- const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc();
- const SwPageDesc* pDesc = rDesc.GetPageDesc();
- if( !pDesc )
- pDesc = &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
-
- //Das Format wird evtl. von der virtuellen Seitennummer bestimmt.
- const USHORT nPgNum = rDesc.GetNumOffset();
- const BOOL bOdd = nPgNum % 2 ? TRUE : FALSE;
- const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
- if ( !pFmt ) //#40568#
- pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt();
-
- if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX )
- //Jetzt wird es aber Zeit fuer die Initialisierung
- pDoc->getPrinter( true );
-
- const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize();
- const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() );
- const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER );
- const Rectangle aRect( aPt, aSz );
- return aRect;*/
}
return SfxObjectShell::GetVisArea( nAspect );
}
@@ -1014,17 +985,16 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
if ( GetWrtShell() )
{
SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pFirst = aIter.First();
while( pFirst )
{
- if( static_cast<SwFmtFld*>(pFirst)->GetTxtFld() &&
- static_cast<SwFmtFld*>(pFirst)->IsFldInDoc() )
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
nState |= HIDDENINFORMATION_NOTES;
break;
}
- pFirst = ++aIter;
+ pFirst = aIter.Next();
}
}
}
@@ -1048,16 +1018,6 @@ void SwDocShell::GetState(SfxItemSet& rSet)
{
switch (nWhich)
{
- // MT: MakroChosser immer enablen, weil Neu moeglich
- // case SID_BASICCHOOSER:
- // {
- // StarBASIC* pBasic = GetBasic();
- // StarBASIC* pAppBasic = SFX_APP()->GetBasic();
- // if ( !(pBasic->GetModules()->Count() ||
- // pAppBasic->GetModules()->Count()) )
- // rSet.DisableItem(nWhich);
- // }
- // break;
case SID_PRINTPREVIEW:
{
BOOL bDisable = IsInPlaceActive();
@@ -1261,9 +1221,8 @@ SwFEShell* SwDocShell::GetFEShell()
void SwDocShell::RemoveOLEObjects()
{
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
@@ -1290,9 +1249,8 @@ void SwDocShell::CalcLayoutForOLEObjects()
if( !pWrtShell )
return;
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && pOLENd->IsOLESizeInvalid() )
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index b0b81c5df6e4..1b439fca9e6d 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1187,14 +1187,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( rStyle.Len() &&
0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, TRUE )))
{
- pFindFmt->Add( &aCond );
+ aCond.RegisterToFormat( *pFindFmt );
((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond );
}
}
// Document auf die neue Bedingungen updaten
SwCondCollCondChg aMsg( pColl );
- pColl->Modify( &aMsg, &aMsg );
+ pColl->ModifyNotification( &aMsg, &aMsg );
}
else if( pCondItem && !pColl->GetDepends() )
{
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index c9e99979e66b..2b2ebc3ee7cd 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -102,7 +102,7 @@ struct SpellState
ESelection m_aESelection;
//iterating over draw text objects
- std::vector<SdrTextObj*> m_aTextObjects;
+ std::list<SdrTextObj*> m_aTextObjects;
bool m_bTextObjectsCollected;
SpellState() :
@@ -790,58 +790,24 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
if( pObj && pObj->ISA(SdrTextObj) )
pCurrentTextObj = static_cast<SdrTextObj*>(pObj);
}
- //at first fill the vector of drawing objects
+ //at first fill the list of drawing objects
if(!m_pSpellState->m_bTextObjectsCollected )
{
m_pSpellState->m_bTextObjectsCollected = true;
- sal_uInt16 n = 0;
- //iterate in the 'normal' array of objects
- while( n < pDoc->GetSpzFrmFmts()->Count() )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pDoc );
+ if(pCurrentTextObj)
{
- SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster();
- if ( pSdrO )
- {
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
- {
- SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS );
- //iterate inside of a grouped object
- while( aListIter.IsMore() )
- {
- SdrObject* pSdrOElement = aListIter.Next();
- if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrOElement)->HasText() &&
- pCurrentTextObj != pSdrOElement)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ m_pSpellState->m_aTextObjects.remove(pCurrentTextObj);
+ m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
}
}
- }
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrO )->HasText() &&
- pCurrentTextObj != pSdrO)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrO);
- }
- }
- }
- }
- ++n;
- }
- if(pCurrentTextObj)
- m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
- }
if(m_pSpellState->m_aTextObjects.size())
{
Reference< XSpellChecker1 > xSpell( GetSpellChecker() );
while(!bNextDoc && m_pSpellState->m_aTextObjects.size())
{
- std::vector<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
+ std::list<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
SdrTextObj* pTextObj = *aStart;
if(m_pSpellState->m_pStartDrawing == pTextObj)
m_pSpellState->m_bRestartDrawing = true;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 8220c7ee2c8d..0af9063d4c72 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -115,21 +115,11 @@
#include <dochdl.hrc>
#include <comcore.hrc> // #111827#
#include <sot/stg.hxx>
-
-// #108584#
#include <svx/svditer.hxx>
-
-// #108584#
#include <editeng/eeitem.hxx>
-
-// #108584#
#include <editeng/fhgtitem.hxx>
-
-// #108584#
#include <svx/svdpage.hxx>
#include <avmedia/mediawindow.hxx>
-
-// #109590#
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
#include <undobj.hxx>
@@ -137,6 +127,7 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swserv.hxx>
+#include <switerator.hxx>
extern BOOL bFrmDrag;
extern BOOL bDDINetAttr;
@@ -373,10 +364,8 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64&
uno::Reference < embed::XEmbeddedObject > xObj;
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
xObj = ((SwOLENode*)pNd)->GetOLEObj().GetOleRef();
@@ -393,10 +382,8 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const
{
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
return ((SwOLENode*)pNd)->GetGraphic();
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 645d4773626a..ee1eabf25611 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -87,6 +87,7 @@
#include <i18npool/lang.h>
#include "swevent.hxx"
+#include "switerator.hxx"
// distance between Anchor Y and initial note position
#define POSTIT_INITIAL_ANCHOR_DISTANCE 20
@@ -1187,17 +1188,16 @@ void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus)
{
bool bEmpty = mvPostItFlds.empty();
SwFieldType* pType = mpView->GetDocShell()->GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient * pFirst = aIter.GoStart();
- while(pFirst)
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while(pSwFmtFld)
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetTxtFld())
{
if ( pSwFmtFld->IsFldInDoc() )
InsertItem(pSwFmtFld,bCheckExistance,bFocus);
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
// if we just added the first one we have to update the view for centering
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 2088ce591bbe..4bec5c07e8a7 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1405,7 +1405,7 @@ BOOL SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
else if( bPageVar )
((SwRefPageGetFieldType*)pCurShell->GetFldType( 0, RES_REFPAGEGETFLD ))->UpdateFlds();
else if( TYP_GETREFFLD == rData.nTypeId )
- pFld->GetTyp()->Modify( 0, 0 );
+ pFld->GetTyp()->ModifyNotification( 0, 0 );
// temporaeres Feld loeschen
delete pFld;
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 265a53dc6646..fcfc0dbe22c4 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -53,6 +53,7 @@
#include <cmdid.h>
#include <globals.hrc>
#include <sfx2/bindings.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -249,14 +250,13 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
SwDBFieldType* pTyp = (SwDBFieldType*)pSh->InsertFldType(
SwDBFieldType(pSh->GetDoc(), sColumn, aData));
- SwClientIter aIter( *pOldTyp );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pOldTyp );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if( pFmtFld->GetFld() == m_pCurFld)
{
- pTyp->Add(pFmtFld); // Feld auf neuen Typ umhaengen
+ pFmtFld->RegisterToFieldType(*pTyp);
pTmpFld->ChgTyp(pTyp);
break;
}
@@ -411,9 +411,7 @@ IMPL_LINK( SwFldPage, NumFormatHdl, ListBox *, EMPTYARG )
return 0;
}
-/*-- 19.12.2005 14:05:47---------------------------------------------------
- -----------------------------------------------------------------------*/
void SwFldPage::SetWrtShell( SwWrtShell* pShell )
{
m_pWrtShell = pShell;
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index 32127f413e1a..3dd6f77e24ab 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -72,7 +72,6 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
pView( pVw ),
pTextObj( NULL ),
pOutlView( NULL ),
- pListIter( NULL ),
nOptions( nConvOptions ),
nDocIndex( 0 ),
nSourceLang( nSourceLanguage ),
@@ -146,51 +145,14 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
sal_uInt16 n = nDocIndex;
- while( !bNextDoc && ( pListIter ||
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() ) )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() );
+ for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ )
{
- while( !pTextObj && pListIter )
- {
- if( pListIter->IsMore() )
- {
- SdrObject* pSdrO = pListIter->Next();
- if( pSdrO && pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- else
- {
- delete pListIter;
- pListIter = NULL;
- }
- }
-
- if ( !pTextObj &&
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() )
- {
- SwFrmFmt* pFly = (*pView->GetDocShell()->GetDoc()->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster();
- if ( pSdrO )
- {
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
- pListIter = new SdrObjListIter( *pSdrO, IM_DEEPNOGROUPS );
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- }
- }
- ++n;
- }
+ pTextObj = (*aIt);
if ( pTextObj )
{
OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
-
if ( pParaObj )
{
SetPaperSize( pTextObj->GetLogicRect().GetSize() );
@@ -221,8 +183,11 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
else
SetUpdateMode(sal_False);
}
+
if ( !bNextDoc )
pTextObj = NULL;
+ else
+ break;
}
}
diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx
index 795e357e28c3..3cb59605d40e 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.hxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.hxx
@@ -43,7 +43,6 @@ class SdrHHCWrapper : public SdrOutliner
SwView* pView;
SdrTextObj* pTextObj;
OutlinerView* pOutlView;
- SdrObjListIter* pListIter;
sal_Int32 nOptions;
sal_uInt16 nDocIndex;
LanguageType nSourceLang;
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 3f26e47c8823..bc3842d3819a 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -81,6 +81,7 @@
#include <app.hrc>
#include <PostItMgr.hxx>
+#include <switerator.hxx>
using namespace nsSwDocInfoSubType;
@@ -377,17 +378,16 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if (pPostIt)
{
SwFieldType* pType = rSh.GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while( pSwFmtFld )
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetFld() == pPostIt )
{
pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) );
break;
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
}
}
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 012fd3510bd1..a1bb9d7543cd 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -81,7 +81,7 @@
#include <unocrsrhelper.hxx>
#include <unotextrange.hxx>
#include <sfx2/docfile.hxx>
-
+#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
@@ -575,9 +575,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt();
if (pFmt)
{
- SwXFrame* pxFrame = (SwXFrame*)SwClientIter((SwFrmFmt&)*pFmt).
- First(TYPE(SwXFrame));
-
+ SwXFrame* pxFrame = SwIterator<SwXFrame,SwFmt>::FirstElement(*pFmt);
if(pxFrame) //das einzige gemeinsame interface fuer alle Frames
{
aRef = uno::Reference< uno::XInterface >((cppu::OWeakObject*)pxFrame, uno::UNO_QUERY);
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 01f6c4e84d7a..b2fbce5ef2fd 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -544,7 +544,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
SwPageDesc* pDesc = ((SwWrtShell&)rShell).FindPageDescByName(
rDescName, TRUE );
if( pDesc )
- pDesc->Add( &aPgDesc );
+ aPgDesc.RegisterToPageDesc( *pDesc );
}
rSet.ClearItem( SID_ATTR_PARA_MODEL );
bChanged = TRUE;
@@ -557,7 +557,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
{
if( ((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
- ((SwFmtPageDesc*)pItem)->GetPageDesc()->Add(&aPgDesc);
+ aPgDesc.RegisterToPageDesc( *((SwFmtPageDesc*)pItem)->GetPageDesc() );
}
}
}