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