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