xref: /AOO41X/main/sw/inc/node.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SW_NODE_HXX
25cdf0e10cSrcweir #define SW_NODE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vector>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <boost/utility.hpp>
30cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <tools/mempool.hxx>
33cdf0e10cSrcweir #include <tools/gen.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "swdllapi.h"
36cdf0e10cSrcweir #include <ndarr.hxx>
37cdf0e10cSrcweir #include <ndtyp.hxx>
38cdf0e10cSrcweir #include <index.hxx>
39cdf0e10cSrcweir #include <fmtcol.hxx>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // ---------------------
42cdf0e10cSrcweir // forward Deklarationen
43cdf0e10cSrcweir // ---------------------
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class SvUShorts;
46cdf0e10cSrcweir class SwCntntFrm;
47cdf0e10cSrcweir class SwCntntNode;
48cdf0e10cSrcweir class SwDoc;
49cdf0e10cSrcweir class SwEndNode;
50cdf0e10cSrcweir class SwFrm;
51cdf0e10cSrcweir class SwFrmFmt;
52cdf0e10cSrcweir class SwGrfNode;
53cdf0e10cSrcweir class SwNoTxtNode;
54cdf0e10cSrcweir class SwNodeIndex;
55cdf0e10cSrcweir class SwOLENode;
56cdf0e10cSrcweir class SwRect;
57cdf0e10cSrcweir class SwSection;
58cdf0e10cSrcweir class SwSectionFmt;
59cdf0e10cSrcweir class SwTOXBase;
60cdf0e10cSrcweir class SwSectionNode;
61cdf0e10cSrcweir class SwStartNode;
62cdf0e10cSrcweir class SwTabFrm;
63cdf0e10cSrcweir class SwRootFrm;
64cdf0e10cSrcweir class SwTable;
65cdf0e10cSrcweir class SwTableNode;
66cdf0e10cSrcweir class SwTableBox;
67cdf0e10cSrcweir class SwTxtNode;
68cdf0e10cSrcweir class SwPageDesc;
69cdf0e10cSrcweir class ViewShell;
70cdf0e10cSrcweir struct SwPosition;
71cdf0e10cSrcweir class IStyleAccess;
72cdf0e10cSrcweir class IDocumentSettingAccess;
73cdf0e10cSrcweir class IDocumentDeviceAccess;
74cdf0e10cSrcweir class IDocumentMarkAccess;
75cdf0e10cSrcweir class IDocumentRedlineAccess;
76cdf0e10cSrcweir class IDocumentStylePoolAccess;
77cdf0e10cSrcweir class IDocumentLineNumberAccess;
78cdf0e10cSrcweir class IDocumentLinksAdministration;
79cdf0e10cSrcweir class IDocumentFieldsAccess;
80cdf0e10cSrcweir class IDocumentContentOperations;
81cdf0e10cSrcweir class IDocumentListItems;
82cdf0e10cSrcweir class SwOLENodes;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir // --------------------
85cdf0e10cSrcweir // class SwNode
86cdf0e10cSrcweir // --------------------
87cdf0e10cSrcweir class SW_DLLPUBLIC SwNode : private /* public*/ BigPtrEntry
88cdf0e10cSrcweir {
89cdf0e10cSrcweir 	friend class SwNodes;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #ifdef DBG_UTIL
92cdf0e10cSrcweir     static long nSerial;
93cdf0e10cSrcweir     long nMySerial;
94cdf0e10cSrcweir #endif
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	sal_uInt8 nNodeType;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	// JP 28.03.96
99cdf0e10cSrcweir 	// fuer Textnodes: Stufungslevel der Autoformatierung. Ist erstmal hier
100cdf0e10cSrcweir 	//					gelandet, weil noch Bits frei sind
101cdf0e10cSrcweir 	sal_uInt8 nAFmtNumLvl : 3;
102cdf0e10cSrcweir 	sal_Bool bSetNumLSpace : 1;			// fuer Numerierung: sal_True Einzug setzen
103cdf0e10cSrcweir 	sal_Bool bIgnoreDontExpand : 1;		// for Text Attributes - ignore the flag
104cdf0e10cSrcweir 
105cdf0e10cSrcweir protected:
106cdf0e10cSrcweir 	SwStartNode* pStartOfSection;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeId );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	// fuer den initialen StartNode
111cdf0e10cSrcweir 	SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNodeId );
112cdf0e10cSrcweir 
113cdf0e10cSrcweir public:
114cdf0e10cSrcweir 	virtual ~SwNode();
115cdf0e10cSrcweir 
116cdf0e10cSrcweir #ifdef DBG_UTIL
117cdf0e10cSrcweir     long int GetSerial() const { return nMySerial; }
118cdf0e10cSrcweir #endif
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	sal_uInt16 GetSectionLevel() const;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     inline sal_uLong StartOfSectionIndex() const;
123cdf0e10cSrcweir     inline const SwStartNode* StartOfSectionNode() const { return pStartOfSection; }
124cdf0e10cSrcweir     inline       SwStartNode* StartOfSectionNode() { return pStartOfSection; }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     inline sal_uLong EndOfSectionIndex() const;
127cdf0e10cSrcweir     inline const SwEndNode* EndOfSectionNode() const;
128cdf0e10cSrcweir     inline         SwEndNode* EndOfSectionNode();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     inline sal_uInt8 GetAutoFmtLvl() const     { return nAFmtNumLvl; }
131cdf0e10cSrcweir     inline void SetAutoFmtLvl( sal_uInt8 nVal )      { nAFmtNumLvl = nVal; }
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     inline sal_Bool IsSetNumLSpace() const  { return bSetNumLSpace; }
134cdf0e10cSrcweir     inline void SetNumLSpace( sal_Bool bFlag )        { bSetNumLSpace = bFlag; }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     inline sal_Bool IsIgnoreDontExpand() const  { return bIgnoreDontExpand; }
137cdf0e10cSrcweir     inline void SetIgnoreDontExpand( sal_Bool bNew )  { bIgnoreDontExpand = bNew; }
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 	sal_uInt8 	GetNodeType() const { return nNodeType; }
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     inline       SwStartNode *GetStartNode();
142cdf0e10cSrcweir     inline const SwStartNode *GetStartNode() const;
143cdf0e10cSrcweir     inline       SwCntntNode *GetCntntNode();
144cdf0e10cSrcweir     inline const SwCntntNode *GetCntntNode() const;
145cdf0e10cSrcweir     inline       SwEndNode   *GetEndNode();
146cdf0e10cSrcweir     inline const SwEndNode   *GetEndNode() const;
147cdf0e10cSrcweir #ifndef	 ICC
148cdf0e10cSrcweir   inline
149cdf0e10cSrcweir #endif
150cdf0e10cSrcweir 	SwTxtNode   *GetTxtNode();
151cdf0e10cSrcweir 
152cdf0e10cSrcweir #ifndef	 ICC
153cdf0e10cSrcweir   inline
154cdf0e10cSrcweir #endif
155cdf0e10cSrcweir 	const SwTxtNode   *GetTxtNode() const;
156cdf0e10cSrcweir     inline        SwOLENode   *GetOLENode();
157cdf0e10cSrcweir     inline  const SwOLENode   *GetOLENode() const;
158cdf0e10cSrcweir     inline        SwNoTxtNode *GetNoTxtNode();
159cdf0e10cSrcweir     inline  const SwNoTxtNode *GetNoTxtNode() const;
160cdf0e10cSrcweir     inline        SwGrfNode   *GetGrfNode();
161cdf0e10cSrcweir     inline  const SwGrfNode   *GetGrfNode() const;
162cdf0e10cSrcweir     inline       SwTableNode *GetTableNode();
163cdf0e10cSrcweir     inline const SwTableNode *GetTableNode() const;
164cdf0e10cSrcweir     inline       SwSectionNode *GetSectionNode();
165cdf0e10cSrcweir     inline const SwSectionNode *GetSectionNode() const;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     inline sal_Bool IsStartNode() const;
168cdf0e10cSrcweir     inline sal_Bool IsCntntNode() const;
169cdf0e10cSrcweir     inline sal_Bool IsEndNode() const;
170cdf0e10cSrcweir     inline sal_Bool IsTxtNode() const;
171cdf0e10cSrcweir     inline sal_Bool IsTableNode() const;
172cdf0e10cSrcweir     inline sal_Bool IsSectionNode() const;
173cdf0e10cSrcweir     inline sal_Bool IsOLENode() const;
174cdf0e10cSrcweir     inline sal_Bool IsNoTxtNode() const;
175cdf0e10cSrcweir     inline sal_Bool IsGrfNode() const;
176cdf0e10cSrcweir 
177cdf0e10cSrcweir     /**
178cdf0e10cSrcweir        Checks if this node is in redlines.
179cdf0e10cSrcweir 
180cdf0e10cSrcweir        @retval sal_True       this node is in redlines
181cdf0e10cSrcweir        @retval sal_False      else
182cdf0e10cSrcweir      */
183cdf0e10cSrcweir     sal_Bool IsInRedlines() const;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	// suche den TabellenNode, in dem dieser steht. Wenn in keiner
186cdf0e10cSrcweir 	// Tabelle wird 0 returnt.
187cdf0e10cSrcweir 					SwTableNode *FindTableNode();
188cdf0e10cSrcweir     inline const  SwTableNode *FindTableNode() const;
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	// suche den SectionNode, in dem dieser steht. Wenn es in keiner
191cdf0e10cSrcweir 	// Section steht wird 0 returnt.
192cdf0e10cSrcweir 					SwSectionNode *FindSectionNode();
193cdf0e10cSrcweir     inline    const   SwSectionNode *FindSectionNode() const;
194cdf0e10cSrcweir 
195cdf0e10cSrcweir     SwStartNode* FindSttNodeByType( SwStartNodeType eTyp );
196cdf0e10cSrcweir     inline const SwStartNode* FindSttNodeByType( SwStartNodeType eTyp ) const;
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 	const SwStartNode* FindTableBoxStartNode() const
199cdf0e10cSrcweir 						{ return FindSttNodeByType( SwTableBoxStartNode ); }
200cdf0e10cSrcweir 	const SwStartNode* FindFlyStartNode() const
201cdf0e10cSrcweir 						{ return FindSttNodeByType( SwFlyStartNode ); }
202cdf0e10cSrcweir 	const SwStartNode* FindFootnoteStartNode() const
203cdf0e10cSrcweir 						{ return FindSttNodeByType( SwFootnoteStartNode ); }
204cdf0e10cSrcweir 	const SwStartNode* FindHeaderStartNode() const
205cdf0e10cSrcweir 						{ return FindSttNodeByType( SwHeaderStartNode ); }
206cdf0e10cSrcweir 	const SwStartNode* FindFooterStartNode() const
207cdf0e10cSrcweir 						{ return FindSttNodeByType( SwFooterStartNode ); }
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 		// in welchem Nodes-Array/Doc steht der Node ?
210cdf0e10cSrcweir     inline          SwNodes& GetNodes();
211cdf0e10cSrcweir     inline const  SwNodes& GetNodes() const;
212cdf0e10cSrcweir     inline            SwDoc* GetDoc();
213cdf0e10cSrcweir     inline const  SwDoc* GetDoc() const;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     /** Provides access to the document setting interface
216cdf0e10cSrcweir      */
217cdf0e10cSrcweir     const IDocumentSettingAccess* getIDocumentSettingAccess() const;
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     /** Provides access to the document device interface
220cdf0e10cSrcweir      */
221cdf0e10cSrcweir     const IDocumentDeviceAccess* getIDocumentDeviceAccess() const;
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     /** Provides access to the document bookmark interface
224cdf0e10cSrcweir      */
225cdf0e10cSrcweir     const IDocumentMarkAccess* getIDocumentMarkAccess() const;
226cdf0e10cSrcweir 
227cdf0e10cSrcweir     /** Provides access to the document redline interface
228cdf0e10cSrcweir      */
229cdf0e10cSrcweir     const IDocumentRedlineAccess* getIDocumentRedlineAccess() const;
230cdf0e10cSrcweir 
231cdf0e10cSrcweir     /** Provides access to the document style pool interface
232cdf0e10cSrcweir      */
233cdf0e10cSrcweir     const IDocumentStylePoolAccess* getIDocumentStylePoolAccess() const;
234cdf0e10cSrcweir 
235cdf0e10cSrcweir     /** Provides access to the document line number information interface
236cdf0e10cSrcweir      */
237cdf0e10cSrcweir     const IDocumentLineNumberAccess* getIDocumentLineNumberAccess() const;
238cdf0e10cSrcweir 
239cdf0e10cSrcweir     /** Provides access to the document draw model interface
240cdf0e10cSrcweir      */
241cdf0e10cSrcweir     const IDocumentDrawModelAccess* getIDocumentDrawModelAccess() const;
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     /** Provides access to the document layout interface
244cdf0e10cSrcweir      */
245cdf0e10cSrcweir     const IDocumentLayoutAccess* getIDocumentLayoutAccess() const;
246cdf0e10cSrcweir           IDocumentLayoutAccess* getIDocumentLayoutAccess();
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     /** Provides access to the document links administration interface
249cdf0e10cSrcweir      */
250cdf0e10cSrcweir     const IDocumentLinksAdministration* getIDocumentLinksAdministration() const;
251cdf0e10cSrcweir           IDocumentLinksAdministration* getIDocumentLinksAdministration();
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     /** Provides access to the document fields administration interface
254cdf0e10cSrcweir      */
255cdf0e10cSrcweir     const IDocumentFieldsAccess* getIDocumentFieldsAccess() const;
256cdf0e10cSrcweir           IDocumentFieldsAccess* getIDocumentFieldsAccess();
257cdf0e10cSrcweir 
258cdf0e10cSrcweir     /** Provides access to the document content operations interface
259cdf0e10cSrcweir      */
260cdf0e10cSrcweir           IDocumentContentOperations* getIDocumentContentOperations();
261cdf0e10cSrcweir 
262cdf0e10cSrcweir     /** Provides access to the document automatic styles interface
263cdf0e10cSrcweir      */
264cdf0e10cSrcweir           IStyleAccess& getIDocumentStyleAccess();
265cdf0e10cSrcweir 
266cdf0e10cSrcweir     /** Provides access to the document's numbered items interface
267cdf0e10cSrcweir 
268cdf0e10cSrcweir         OD 2007-10-31 #i83479#
269cdf0e10cSrcweir 
270cdf0e10cSrcweir         @author OD
271cdf0e10cSrcweir     */
272cdf0e10cSrcweir     IDocumentListItems& getIDocumentListItems();
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	// liegt der Node im Sichtbarenbereich der Shell ?
275cdf0e10cSrcweir     sal_Bool IsInVisibleArea( ViewShell* pSh = 0 ) const;
276cdf0e10cSrcweir 	// befindet sich der Node in einem geschuetzten Bereich?
277cdf0e10cSrcweir 	sal_Bool IsInProtectSect() const;
278cdf0e10cSrcweir 	// befindet sich der Node in irgendetwas geschuetzten ?
279cdf0e10cSrcweir 	// (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei
280cdf0e10cSrcweir 	//	Rahmen/Fussnoten/..)
281cdf0e10cSrcweir 	sal_Bool IsProtect() const;
282cdf0e10cSrcweir 	// suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das
283cdf0e10cSrcweir 	// Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur
284cdf0e10cSrcweir 	// die harte Tour ueber die Nodes nach vorne suchen!!
285cdf0e10cSrcweir     // OD 18.03.2003 #106326#
286cdf0e10cSrcweir     const SwPageDesc* FindPageDesc( sal_Bool bCalcLay, sal_uInt32* pPgDescNdIdx = 0 ) const;
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 	// falls der Node in einem Fly steht, dann wird das entsprechende Format
289cdf0e10cSrcweir 	// returnt
290cdf0e10cSrcweir 	SwFrmFmt* GetFlyFmt() const;
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	// falls der Node in einer Tabelle steht, dann wird die entsprechende
293cdf0e10cSrcweir 	// TabellenBox returnt
294cdf0e10cSrcweir 	SwTableBox* GetTblBox() const;
295cdf0e10cSrcweir 
296cdf0e10cSrcweir     inline sal_uLong GetIndex() const { return GetPos(); }
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	const SwTxtNode* FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const;
299cdf0e10cSrcweir 
300cdf0e10cSrcweir 	sal_uInt8 HasPrevNextLayNode() const;
301cdf0e10cSrcweir 
302cdf0e10cSrcweir private:
303cdf0e10cSrcweir 	// privater Constructor, weil nie kopiert werden darf !!
304cdf0e10cSrcweir 	SwNode( const SwNode & rNodes );
305cdf0e10cSrcweir 	SwNode & operator= ( const SwNode & rNodes );
306cdf0e10cSrcweir };
307cdf0e10cSrcweir 
308cdf0e10cSrcweir // --------------------
309cdf0e10cSrcweir // class SwStartNode
310cdf0e10cSrcweir // --------------------
311cdf0e10cSrcweir class SwStartNode: public SwNode
312cdf0e10cSrcweir {
313cdf0e10cSrcweir 	friend class SwNode;
314cdf0e10cSrcweir 	friend class SwNodes;
315cdf0e10cSrcweir 	friend class SwEndNode;		// um theEndOfSection zu setzen !!
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 	SwEndNode* pEndOfSection;
318cdf0e10cSrcweir 	SwStartNodeType eSttNdTyp;
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 	// fuer den initialen StartNode
321cdf0e10cSrcweir 	SwStartNode( SwNodes& rNodes, sal_uLong nPos );
322cdf0e10cSrcweir 
323cdf0e10cSrcweir protected:
324cdf0e10cSrcweir 	SwStartNode( const SwNodeIndex &rWhere,
325cdf0e10cSrcweir 				 const sal_uInt8 nNodeType = ND_STARTNODE,
326cdf0e10cSrcweir 				 SwStartNodeType = SwNormalStartNode );
327cdf0e10cSrcweir public:
328cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwStartNode)
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 	SwStartNodeType GetStartNodeType() const 		{ return eSttNdTyp; }
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	// an alle ContentNodes der Section das ChkCondColl rufen
333cdf0e10cSrcweir 	void CheckSectionCondColl() const;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir private:
336cdf0e10cSrcweir 	// privater Constructor, weil nie kopiert werden darf !!
337cdf0e10cSrcweir 	SwStartNode( const SwStartNode & rNode );
338cdf0e10cSrcweir 	SwStartNode & operator= ( const SwStartNode & rNode );
339cdf0e10cSrcweir };
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 
342cdf0e10cSrcweir // --------------------
343cdf0e10cSrcweir // class SwEndNode
344cdf0e10cSrcweir // --------------------
345cdf0e10cSrcweir class SwEndNode : public SwNode
346cdf0e10cSrcweir {
347cdf0e10cSrcweir 	friend class SwNodes;
348cdf0e10cSrcweir 	friend class SwTableNode;		// um seinen EndNode anlegen zukoennen
349cdf0e10cSrcweir 	friend class SwSectionNode;		// um seinen EndNode anlegen zukoennen
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	// fuer den initialen StartNode
352cdf0e10cSrcweir 	SwEndNode( SwNodes& rNodes, sal_uLong nPos, SwStartNode& rSttNd );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir protected:
355cdf0e10cSrcweir 	SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd );
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwEndNode)
358cdf0e10cSrcweir 
359cdf0e10cSrcweir private:
360cdf0e10cSrcweir 	// privater Constructor, weil nie kopiert werden darf !!
361cdf0e10cSrcweir 	SwEndNode( const SwEndNode & rNode );
362cdf0e10cSrcweir 	SwEndNode & operator= ( const SwEndNode & rNode );
363cdf0e10cSrcweir };
364cdf0e10cSrcweir 
365cdf0e10cSrcweir 
366cdf0e10cSrcweir // --------------------
367cdf0e10cSrcweir // SwCntntNode
368cdf0e10cSrcweir // --------------------
369cdf0e10cSrcweir class SW_DLLPUBLIC SwCntntNode: public SwModify, public SwNode, public SwIndexReg
370cdf0e10cSrcweir {
371cdf0e10cSrcweir 	// Der Reader darf NewAttrSet() aufrufen!
372cdf0e10cSrcweir //  friend class SwSwgReader;
373cdf0e10cSrcweir //  friend class Sw3IoImp;
374cdf0e10cSrcweir 
375cdf0e10cSrcweir //FEATURE::CONDCOLL
376cdf0e10cSrcweir 	SwDepend* pCondColl;
377cdf0e10cSrcweir //FEATURE::CONDCOLL
378cdf0e10cSrcweir     mutable bool mbSetModifyAtAttr;
379cdf0e10cSrcweir 
380cdf0e10cSrcweir protected:
381cdf0e10cSrcweir 	SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeType,
382cdf0e10cSrcweir 				SwFmtColl *pFmtColl );
383cdf0e10cSrcweir 	virtual ~SwCntntNode();
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 	// Attribut-Set fuer alle AUTO-Attribute eines CntntNodes
386cdf0e10cSrcweir 	//	( z.B: TxtNode oder NoTxtNode
387cdf0e10cSrcweir     boost::shared_ptr<const SfxItemSet> mpAttrSet;
388cdf0e10cSrcweir 
389cdf0e10cSrcweir 	// lasse von den entsprechenden Nodes die spz. AttrSets anlegen
390cdf0e10cSrcweir 	virtual void NewAttrSet( SwAttrPool& ) = 0;
391cdf0e10cSrcweir 
392cdf0e10cSrcweir     // There some functions that like to remove items from the internal
393cdf0e10cSrcweir     // SwAttrSet (handle):
394cdf0e10cSrcweir     sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
395cdf0e10cSrcweir 
396cdf0e10cSrcweir    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
397cdf0e10cSrcweir 
398cdf0e10cSrcweir public:
399cdf0e10cSrcweir 	TYPEINFO();		//Bereits in Basisklasse Client drin.
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     // MakeFrm will be called for a certain layout
402cdf0e10cSrcweir     // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent)
403cdf0e10cSrcweir 	virtual SwCntntFrm *MakeFrm( SwFrm* pSib ) = 0;
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     virtual SwCntntNode *SplitCntntNode(const SwPosition & ) = 0;
406cdf0e10cSrcweir 
407cdf0e10cSrcweir 	virtual SwCntntNode *JoinNext();
408cdf0e10cSrcweir 	virtual SwCntntNode *JoinPrev();
409cdf0e10cSrcweir 	// koennen 2 Nodes zusammengefasst werden ?
410cdf0e10cSrcweir 	// in pIdx kann die 2. Position returnt werden.
411cdf0e10cSrcweir 	int CanJoinNext( SwNodeIndex* pIdx =0 ) const;
412cdf0e10cSrcweir 	int CanJoinPrev( SwNodeIndex* pIdx =0 ) const;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 	void MakeStartIndex( SwIndex * pIdx )	{ pIdx->Assign( this, 0 ); }
415cdf0e10cSrcweir 	void MakeEndIndex( SwIndex * pIdx )		{ pIdx->Assign( this, Len() ); }
416cdf0e10cSrcweir 
417cdf0e10cSrcweir 	sal_Bool GoNext(SwIndex *, sal_uInt16 nMode ) const;
418cdf0e10cSrcweir 	sal_Bool GoPrevious(SwIndex *, sal_uInt16 nMode ) const;
419cdf0e10cSrcweir 
420cdf0e10cSrcweir     // Replacement for good old GetFrm(..):
421cdf0e10cSrcweir 	SwCntntFrm *getLayoutFrm( const SwRootFrm*,
422cdf0e10cSrcweir                         const Point* pDocPos = 0,
423cdf0e10cSrcweir 						const SwPosition *pPos = 0,
424cdf0e10cSrcweir 						const sal_Bool bCalcFrm = sal_True ) const;
425cdf0e10cSrcweir 	// Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres
426cdf0e10cSrcweir 	// Rechteck, wenn kein Layout existiert.
427cdf0e10cSrcweir 	// Wird fuer die Export Filter benoetigt.
428cdf0e10cSrcweir 	SwRect FindLayoutRect( const sal_Bool bPrtArea = sal_False,
429cdf0e10cSrcweir 							const Point* pPoint = 0,
430cdf0e10cSrcweir 							const sal_Bool bCalcFrm = sal_False  ) const;
431cdf0e10cSrcweir 	SwRect FindPageFrmRect( const sal_Bool bPrtArea = sal_False,
432cdf0e10cSrcweir 							const Point* pPoint = 0,
433cdf0e10cSrcweir 							const sal_Bool bCalcFrm = sal_False  ) const;
434cdf0e10cSrcweir 	/*
435cdf0e10cSrcweir 	 * Methode erzeugt fuer den angegebenen Node alle Ansichten vom
436cdf0e10cSrcweir 	 * Dokument. Die erzeugten Contentframes werden in das entsprechende
437cdf0e10cSrcweir 	 * Layout gehaengt.
438cdf0e10cSrcweir 	 */
439cdf0e10cSrcweir 	void MakeFrms( SwCntntNode& rNode );
440cdf0e10cSrcweir 	/*
441cdf0e10cSrcweir 	 * Methode loescht fuer den Node alle Ansichten vom
442cdf0e10cSrcweir 	 * Dokument. Die Contentframes werden aus dem entsprechenden
443cdf0e10cSrcweir 	 * Layout ausgehaengt.
444cdf0e10cSrcweir 	 */
445cdf0e10cSrcweir 	void DelFrms();
446cdf0e10cSrcweir 
447cdf0e10cSrcweir 	/*
448cdf0e10cSrcweir 	 * liefert die Anzahl der Elemente des Inhalts des Nodes;
449cdf0e10cSrcweir 	 * Default ist 1, Unterschiede gibt es beim TextNode und beim
450cdf0e10cSrcweir 	 * Formelnode.
451cdf0e10cSrcweir 	 */
452cdf0e10cSrcweir 	virtual xub_StrLen Len() const;
453cdf0e10cSrcweir 
454cdf0e10cSrcweir 	virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const = 0;
455cdf0e10cSrcweir 		// erfrage vom Client Informationen
456cdf0e10cSrcweir 	virtual sal_Bool GetInfo( SfxPoolItem& ) const;
457cdf0e10cSrcweir 
458cdf0e10cSrcweir 	// SS fuer die PoolItems: (Harte-(Fmt)Attrbutierung)
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 	// Ist bInParent sal_False, wird nur in diesem Node nach dem Attribut gesucht.
461cdf0e10cSrcweir 	const SfxPoolItem& GetAttr( sal_uInt16 nWhich, sal_Bool bInParent=sal_True ) const;
462cdf0e10cSrcweir 	sal_Bool GetAttr( SfxItemSet& rSet, sal_Bool bInParent=sal_True ) const;
463cdf0e10cSrcweir     // --> OD 2008-03-13 #refactorlists#
464cdf0e10cSrcweir     // made virtual
465cdf0e10cSrcweir     virtual sal_Bool SetAttr( const SfxPoolItem& );
466cdf0e10cSrcweir     virtual sal_Bool SetAttr( const SfxItemSet& rSet );
467cdf0e10cSrcweir     virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
468cdf0e10cSrcweir     virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
469cdf0e10cSrcweir     virtual sal_uInt16 ResetAllAttr();
470cdf0e10cSrcweir     // <--
471cdf0e10cSrcweir 
472cdf0e10cSrcweir     // liefert das Attribut, das nicht ueber die bedingte Vorlage kommt!
473cdf0e10cSrcweir 	const SfxPoolItem* GetNoCondAttr( sal_uInt16 nWhich, sal_Bool bInParents ) const;
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 	// hat der Node schon eigene Auto-Attribute ?
476cdf0e10cSrcweir 	// Zugriff auf SwAttrSet
477cdf0e10cSrcweir     inline const SwAttrSet &GetSwAttrSet() const;
478cdf0e10cSrcweir     inline const SwAttrSet *GetpSwAttrSet() const { return static_cast<const SwAttrSet*>(mpAttrSet.get()); }
479cdf0e10cSrcweir     inline sal_Bool  HasSwAttrSet() const { return mpAttrSet ? sal_True : sal_False; }
480cdf0e10cSrcweir 
481cdf0e10cSrcweir 	virtual SwFmtColl* ChgFmtColl( SwFmtColl* );
482cdf0e10cSrcweir 	SwFmtColl* GetFmtColl() const { return (SwFmtColl*)GetRegisteredIn(); }
483cdf0e10cSrcweir 
484cdf0e10cSrcweir //FEATURE::CONDCOLL
485cdf0e10cSrcweir     inline SwFmtColl& GetAnyFmtColl() const;
486cdf0e10cSrcweir 	void SetCondFmtColl( SwFmtColl* );
487cdf0e10cSrcweir     inline SwFmtColl* GetCondFmtColl() const;
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 	sal_Bool IsAnyCondition( SwCollCondition& rTmp ) const;
490cdf0e10cSrcweir 	void ChkCondColl();
491cdf0e10cSrcweir //FEATURE::CONDCOLL
492cdf0e10cSrcweir 
493cdf0e10cSrcweir 	// invalidiert die am Node gesetzte NumRule. Diese wird
494cdf0e10cSrcweir 	// spaetestend in EndAction einer Shell geupdatet
495cdf0e10cSrcweir 	sal_Bool InvalidateNumRule();
496cdf0e10cSrcweir 
497cdf0e10cSrcweir     // --> OD 2005-02-21 #i42921# - determines the text direction for a certain
498cdf0e10cSrcweir     // position. Return -1, if text direction could *not* be determined.
499cdf0e10cSrcweir     short GetTextDirection( const SwPosition& rPos,
500cdf0e10cSrcweir                             const Point* pPt ) const;
501cdf0e10cSrcweir     // <--
502cdf0e10cSrcweir 
503cdf0e10cSrcweir     inline void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
504cdf0e10cSrcweir     inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr; }
505cdf0e10cSrcweir 
506cdf0e10cSrcweir     static SwOLENodes* CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize );
507cdf0e10cSrcweir 
508cdf0e10cSrcweir private:
509cdf0e10cSrcweir 	// privater Constructor, weil nie kopiert werden darf !!
510cdf0e10cSrcweir 	SwCntntNode( const SwCntntNode & rNode );
511cdf0e10cSrcweir 	SwCntntNode & operator= ( const SwCntntNode & rNode );
512cdf0e10cSrcweir };
513cdf0e10cSrcweir 
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 
516cdf0e10cSrcweir //---------
517cdf0e10cSrcweir // SwTableNode
518cdf0e10cSrcweir //---------
519cdf0e10cSrcweir class SW_DLLPUBLIC SwTableNode : public SwStartNode, public SwModify
520cdf0e10cSrcweir {
521cdf0e10cSrcweir 	friend class SwNodes;
522cdf0e10cSrcweir 	SwTable* pTable;
523cdf0e10cSrcweir protected:
524cdf0e10cSrcweir 	virtual ~SwTableNode();
525cdf0e10cSrcweir 
526cdf0e10cSrcweir public:
527cdf0e10cSrcweir 	SwTableNode( const SwNodeIndex & );
528cdf0e10cSrcweir 
529cdf0e10cSrcweir 	const SwTable& GetTable() const { return *pTable; }
530cdf0e10cSrcweir 	SwTable& GetTable() { return *pTable; }
531cdf0e10cSrcweir 	SwTabFrm *MakeFrm( SwFrm* );
532cdf0e10cSrcweir 
533cdf0e10cSrcweir 	//Legt die Frms fuer den TableNode (also die TabFrms) an.
534cdf0e10cSrcweir 	void MakeFrms( SwNodeIndex* pIdxBehind );
535cdf0e10cSrcweir 
536cdf0e10cSrcweir 	//Methode loescht fuer den Node alle Ansichten vom
537cdf0e10cSrcweir 	//Dokument. Die Contentframes werden aus dem entsprechenden
538cdf0e10cSrcweir 	//Layout ausgehaengt.
539cdf0e10cSrcweir 	void DelFrms();
540cdf0e10cSrcweir 
541cdf0e10cSrcweir 	//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
542cdf0e10cSrcweir 	//Dokument. Die erzeugten Contentframes werden in das entsprechende
543cdf0e10cSrcweir 	//Layout gehaengt.
544cdf0e10cSrcweir 	void MakeFrms( const SwNodeIndex & rIdx );
545cdf0e10cSrcweir 
546cdf0e10cSrcweir 	SwTableNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
547cdf0e10cSrcweir 	void SetNewTable( SwTable* , sal_Bool bNewFrames=sal_True );
548cdf0e10cSrcweir 
549cdf0e10cSrcweir private:
550cdf0e10cSrcweir 	// privater Constructor, weil nie kopiert werden darf !!
551cdf0e10cSrcweir 	SwTableNode( const SwTableNode & rNode );
552cdf0e10cSrcweir 	SwTableNode & operator= ( const SwTableNode & rNode );
553cdf0e10cSrcweir };
554cdf0e10cSrcweir 
555cdf0e10cSrcweir 
556cdf0e10cSrcweir //---------
557cdf0e10cSrcweir // SwSectionNode
558cdf0e10cSrcweir //---------
559cdf0e10cSrcweir class SwSectionNode
560cdf0e10cSrcweir     : public SwStartNode
561cdf0e10cSrcweir     , private ::boost::noncopyable
562cdf0e10cSrcweir {
563cdf0e10cSrcweir 	friend class SwNodes;
564cdf0e10cSrcweir 
565cdf0e10cSrcweir private:
566cdf0e10cSrcweir     ::std::auto_ptr<SwSection> const m_pSection;
567cdf0e10cSrcweir 
568cdf0e10cSrcweir protected:
569cdf0e10cSrcweir 	virtual ~SwSectionNode();
570cdf0e10cSrcweir 
571cdf0e10cSrcweir public:
572cdf0e10cSrcweir     SwSectionNode(SwNodeIndex const&,
573cdf0e10cSrcweir         SwSectionFmt & rFmt, SwTOXBase const*const pTOXBase);
574cdf0e10cSrcweir 
575cdf0e10cSrcweir     const SwSection& GetSection() const { return *m_pSection; }
576cdf0e10cSrcweir           SwSection& GetSection()       { return *m_pSection; }
577cdf0e10cSrcweir 
578cdf0e10cSrcweir 	SwFrm *MakeFrm( SwFrm* );
579cdf0e10cSrcweir 
580cdf0e10cSrcweir 	//Legt die Frms fuer den SectionNode (also die SectionFrms) an.
581cdf0e10cSrcweir 	//Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt,
582cdf0e10cSrcweir 	//uebergibt man einen weiteren NodeIndex pEnd, so wird bis zu diesem
583cdf0e10cSrcweir 	//ein MakeFrms gerufen, genutzt wird dies von TableToText
584cdf0e10cSrcweir 	void MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = NULL );
585cdf0e10cSrcweir 
586cdf0e10cSrcweir 	//Methode loescht fuer den Node alle Ansichten vom
587cdf0e10cSrcweir 	//Dokument. Die Contentframes werden aus dem entsprechenden
588cdf0e10cSrcweir 	//Layout ausgehaengt.
589cdf0e10cSrcweir 	void DelFrms();
590cdf0e10cSrcweir 
591cdf0e10cSrcweir 	//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
592cdf0e10cSrcweir 	//Dokument. Die erzeugten Contentframes werden in das entsprechende
593cdf0e10cSrcweir 	//Layout gehaengt.
594cdf0e10cSrcweir 	void MakeFrms( const SwNodeIndex & rIdx );
595cdf0e10cSrcweir 
596cdf0e10cSrcweir 	SwSectionNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
597cdf0e10cSrcweir 
598cdf0e10cSrcweir 	// setze den Verweis im Format der Section auf sich selbst
599cdf0e10cSrcweir 	void NodesArrChgd();
600cdf0e10cSrcweir 
601cdf0e10cSrcweir 	// ueberprueft bei _nicht_ versteckten Bereichen, ob es Inhalt gibt, der
602cdf0e10cSrcweir 	// _nicht_ in einem versteckten (Unter-)Bereich liegt
603cdf0e10cSrcweir 	sal_Bool IsCntntHidden() const;
604cdf0e10cSrcweir 
605cdf0e10cSrcweir };
606cdf0e10cSrcweir 
607cdf0e10cSrcweir 
608cdf0e10cSrcweir 
609cdf0e10cSrcweir // ---------------------- einige inline Methoden ----------------------
610cdf0e10cSrcweir inline       SwEndNode   *SwNode::GetEndNode()
611cdf0e10cSrcweir {
612cdf0e10cSrcweir 	 return ND_ENDNODE == nNodeType ? (SwEndNode*)this : 0;
613cdf0e10cSrcweir }
614cdf0e10cSrcweir inline const SwEndNode   *SwNode::GetEndNode() const
615cdf0e10cSrcweir {
616cdf0e10cSrcweir 	 return ND_ENDNODE == nNodeType ? (const SwEndNode*)this : 0;
617cdf0e10cSrcweir }
618cdf0e10cSrcweir inline       SwStartNode *SwNode::GetStartNode()
619cdf0e10cSrcweir {
620cdf0e10cSrcweir 	 return ND_STARTNODE & nNodeType ? (SwStartNode*)this : 0;
621cdf0e10cSrcweir }
622cdf0e10cSrcweir inline const SwStartNode *SwNode::GetStartNode() const
623cdf0e10cSrcweir {
624cdf0e10cSrcweir 	 return ND_STARTNODE & nNodeType ? (const SwStartNode*)this : 0;
625cdf0e10cSrcweir }
626cdf0e10cSrcweir inline       SwTableNode *SwNode::GetTableNode()
627cdf0e10cSrcweir {
628cdf0e10cSrcweir 	 return ND_TABLENODE == nNodeType ? (SwTableNode*)this : 0;
629cdf0e10cSrcweir }
630cdf0e10cSrcweir inline const SwTableNode *SwNode::GetTableNode() const
631cdf0e10cSrcweir {
632cdf0e10cSrcweir 	 return ND_TABLENODE == nNodeType ? (const SwTableNode*)this : 0;
633cdf0e10cSrcweir }
634cdf0e10cSrcweir inline       SwSectionNode *SwNode::GetSectionNode()
635cdf0e10cSrcweir {
636cdf0e10cSrcweir 	 return ND_SECTIONNODE == nNodeType ? (SwSectionNode*)this : 0;
637cdf0e10cSrcweir }
638cdf0e10cSrcweir inline const SwSectionNode *SwNode::GetSectionNode() const
639cdf0e10cSrcweir {
640cdf0e10cSrcweir 	 return ND_SECTIONNODE == nNodeType ? (const SwSectionNode*)this : 0;
641cdf0e10cSrcweir }
642cdf0e10cSrcweir inline       SwCntntNode *SwNode::GetCntntNode()
643cdf0e10cSrcweir {
644cdf0e10cSrcweir 	 return ND_CONTENTNODE & nNodeType ? (SwCntntNode*)this : 0;
645cdf0e10cSrcweir }
646cdf0e10cSrcweir inline const SwCntntNode *SwNode::GetCntntNode() const
647cdf0e10cSrcweir {
648cdf0e10cSrcweir 	 return ND_CONTENTNODE & nNodeType ? (const SwCntntNode*)this : 0;
649cdf0e10cSrcweir }
650cdf0e10cSrcweir 
651cdf0e10cSrcweir 
652cdf0e10cSrcweir inline sal_Bool SwNode::IsStartNode() const
653cdf0e10cSrcweir {
654cdf0e10cSrcweir 	return ND_STARTNODE & nNodeType  ? sal_True : sal_False;
655cdf0e10cSrcweir }
656cdf0e10cSrcweir inline sal_Bool SwNode::IsCntntNode() const
657cdf0e10cSrcweir {
658cdf0e10cSrcweir 	return ND_CONTENTNODE & nNodeType  ? sal_True : sal_False;
659cdf0e10cSrcweir }
660cdf0e10cSrcweir inline sal_Bool SwNode::IsEndNode() const
661cdf0e10cSrcweir {
662cdf0e10cSrcweir 	return ND_ENDNODE == nNodeType  ? sal_True : sal_False;
663cdf0e10cSrcweir }
664cdf0e10cSrcweir inline sal_Bool SwNode::IsTxtNode() const
665cdf0e10cSrcweir {
666cdf0e10cSrcweir 	return ND_TEXTNODE == nNodeType  ? sal_True : sal_False;
667cdf0e10cSrcweir }
668cdf0e10cSrcweir inline sal_Bool SwNode::IsTableNode() const
669cdf0e10cSrcweir {
670cdf0e10cSrcweir 	return ND_TABLENODE == nNodeType  ? sal_True : sal_False;
671cdf0e10cSrcweir }
672cdf0e10cSrcweir inline sal_Bool SwNode::IsSectionNode() const
673cdf0e10cSrcweir {
674cdf0e10cSrcweir 	return ND_SECTIONNODE == nNodeType  ? sal_True : sal_False;
675cdf0e10cSrcweir }
676cdf0e10cSrcweir inline sal_Bool SwNode::IsNoTxtNode() const
677cdf0e10cSrcweir {
678cdf0e10cSrcweir 	return ND_NOTXTNODE & nNodeType  ? sal_True : sal_False;
679cdf0e10cSrcweir }
680cdf0e10cSrcweir inline sal_Bool SwNode::IsOLENode() const
681cdf0e10cSrcweir {
682cdf0e10cSrcweir 	return ND_OLENODE == nNodeType  ? sal_True : sal_False;
683cdf0e10cSrcweir }
684cdf0e10cSrcweir inline sal_Bool SwNode::IsGrfNode() const
685cdf0e10cSrcweir {
686cdf0e10cSrcweir 	return ND_GRFNODE == nNodeType  ? sal_True : sal_False;
687cdf0e10cSrcweir }
688cdf0e10cSrcweir 
689cdf0e10cSrcweir inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const
690cdf0e10cSrcweir {
691cdf0e10cSrcweir 	return ((SwNode*)this)->FindSttNodeByType( eTyp );
692cdf0e10cSrcweir }
693cdf0e10cSrcweir inline const SwTableNode* SwNode::FindTableNode() const
694cdf0e10cSrcweir {
695cdf0e10cSrcweir 	return ((SwNode*)this)->FindTableNode();
696cdf0e10cSrcweir }
697cdf0e10cSrcweir inline const SwSectionNode* SwNode::FindSectionNode() const
698cdf0e10cSrcweir {
699cdf0e10cSrcweir 	return ((SwNode*)this)->FindSectionNode();
700cdf0e10cSrcweir }
701cdf0e10cSrcweir inline sal_uLong SwNode::StartOfSectionIndex() const
702cdf0e10cSrcweir {
703cdf0e10cSrcweir     return pStartOfSection->GetIndex();
704cdf0e10cSrcweir }
705cdf0e10cSrcweir inline sal_uLong SwNode::EndOfSectionIndex() const
706cdf0e10cSrcweir {
707cdf0e10cSrcweir 	const SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection;
708cdf0e10cSrcweir 	return pStNd->pEndOfSection->GetIndex();
709cdf0e10cSrcweir }
710cdf0e10cSrcweir inline const SwEndNode* SwNode::EndOfSectionNode() const
711cdf0e10cSrcweir {
712cdf0e10cSrcweir 	const SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection;
713cdf0e10cSrcweir 	return pStNd->pEndOfSection;
714cdf0e10cSrcweir }
715cdf0e10cSrcweir inline SwEndNode* SwNode::EndOfSectionNode()
716cdf0e10cSrcweir {
717cdf0e10cSrcweir 	SwStartNode* pStNd = IsStartNode() ? (SwStartNode*)this : pStartOfSection;
718cdf0e10cSrcweir 	return pStNd->pEndOfSection;
719cdf0e10cSrcweir }
720cdf0e10cSrcweir 
721cdf0e10cSrcweir inline SwNodes& SwNode::GetNodes()
722cdf0e10cSrcweir {
723cdf0e10cSrcweir 	return (SwNodes&)GetArray();
724cdf0e10cSrcweir }
725cdf0e10cSrcweir inline const SwNodes& SwNode::GetNodes() const
726cdf0e10cSrcweir {
727cdf0e10cSrcweir 	return (SwNodes&)GetArray();
728cdf0e10cSrcweir }
729cdf0e10cSrcweir 
730cdf0e10cSrcweir inline SwDoc* SwNode::GetDoc()
731cdf0e10cSrcweir {
732cdf0e10cSrcweir 	return GetNodes().GetDoc();
733cdf0e10cSrcweir }
734cdf0e10cSrcweir inline const SwDoc* SwNode::GetDoc() const
735cdf0e10cSrcweir {
736cdf0e10cSrcweir 	return GetNodes().GetDoc();
737cdf0e10cSrcweir }
738cdf0e10cSrcweir 
739cdf0e10cSrcweir inline SwFmtColl* SwCntntNode::GetCondFmtColl() const
740cdf0e10cSrcweir {
741cdf0e10cSrcweir 	return pCondColl ? (SwFmtColl*)pCondColl->GetRegisteredIn() : 0;
742cdf0e10cSrcweir }
743cdf0e10cSrcweir 
744cdf0e10cSrcweir 
745cdf0e10cSrcweir inline SwFmtColl& SwCntntNode::GetAnyFmtColl() const
746cdf0e10cSrcweir {
747cdf0e10cSrcweir 	return pCondColl && pCondColl->GetRegisteredIn()
748cdf0e10cSrcweir 				? *(SwFmtColl*)pCondColl->GetRegisteredIn()
749cdf0e10cSrcweir 				: *(SwFmtColl*)GetRegisteredIn();
750cdf0e10cSrcweir }
751cdf0e10cSrcweir 
752cdf0e10cSrcweir inline const SwAttrSet& SwCntntNode::GetSwAttrSet() const
753cdf0e10cSrcweir {
754cdf0e10cSrcweir     return mpAttrSet ? *GetpSwAttrSet() : GetAnyFmtColl().GetAttrSet();
755cdf0e10cSrcweir }
756cdf0e10cSrcweir 
757cdf0e10cSrcweir //FEATURE::CONDCOLL
758cdf0e10cSrcweir 
759cdf0e10cSrcweir inline const SfxPoolItem& SwCntntNode::GetAttr( sal_uInt16 nWhich,
760cdf0e10cSrcweir 												sal_Bool bInParents ) const
761cdf0e10cSrcweir {
762cdf0e10cSrcweir 	return GetSwAttrSet().Get( nWhich, bInParents );
763cdf0e10cSrcweir }
764cdf0e10cSrcweir #endif
765