1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
25 #include <boost/utility.hpp>
26 #include <boost/shared_ptr.hpp>
28 #include <sal/types.h>
29 #include <tools/mempool.hxx>
37 // ---------------------
38 // forward declarations
39 // ---------------------
67 class IDocumentSettingAccess
;
68 class IDocumentDeviceAccess
;
69 class IDocumentMarkAccess
;
70 class IDocumentRedlineAccess
;
71 class IDocumentStylePoolAccess
;
72 class IDocumentLineNumberAccess
;
73 class IDocumentLinksAdministration
;
74 class IDocumentFieldsAccess
;
75 class IDocumentContentOperations
;
76 class IDocumentListItems
;
80 /// Base class of the Writer document model elements.
81 class SW_DLLPUBLIC SwNode
88 /// For text nodes: level of auto format. Was put here because we had still free bits.
89 sal_uInt8 nAFmtNumLvl
: 3;
90 bool bSetNumLSpace
: 1; ///< For numbering: TRUE: set indent.
91 bool bIgnoreDontExpand
: 1; ///< for Text Attributes - ignore the flag
94 static long s_nSerial
;
99 SwStartNode
* pStartOfSection
;
101 SwNode( const SwNodeIndex
&rWhere
, const sal_uInt8 nNodeId
);
103 /// for the initial StartNode
104 SwNode( SwNodes
& rNodes
, sal_uLong nPos
, const sal_uInt8 nNodeId
);
107 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
109 virtual ~SwNode() = 0;
112 long GetSerial() const { return m_nSerial
; }
115 sal_uInt16
GetSectionLevel() const;
117 inline sal_uLong
StartOfSectionIndex() const;
118 inline const SwStartNode
* StartOfSectionNode() const { return pStartOfSection
; }
119 inline SwStartNode
* StartOfSectionNode() { return pStartOfSection
; }
121 inline sal_uLong
EndOfSectionIndex() const;
122 inline const SwEndNode
* EndOfSectionNode() const;
123 inline SwEndNode
* EndOfSectionNode();
125 inline sal_uInt8
GetAutoFmtLvl() const { return nAFmtNumLvl
; }
126 inline void SetAutoFmtLvl( sal_uInt8 nVal
) { nAFmtNumLvl
= nVal
; }
128 inline bool IsSetNumLSpace() const { return bSetNumLSpace
; }
129 inline void SetNumLSpace( bool bFlag
) { bSetNumLSpace
= bFlag
; }
131 inline bool IsIgnoreDontExpand() const { return bIgnoreDontExpand
; }
132 inline void SetIgnoreDontExpand( bool bNew
) { bIgnoreDontExpand
= bNew
; }
134 sal_uInt8
GetNodeType() const { return nNodeType
; }
136 inline SwStartNode
*GetStartNode();
137 inline const SwStartNode
*GetStartNode() const;
138 inline SwCntntNode
*GetCntntNode();
139 inline const SwCntntNode
*GetCntntNode() const;
140 inline SwEndNode
*GetEndNode();
141 inline const SwEndNode
*GetEndNode() const;
142 inline SwTxtNode
*GetTxtNode();
143 inline const SwTxtNode
*GetTxtNode() const;
144 inline SwOLENode
*GetOLENode();
145 inline const SwOLENode
*GetOLENode() const;
146 inline SwNoTxtNode
*GetNoTxtNode();
147 inline const SwNoTxtNode
*GetNoTxtNode() const;
148 inline SwGrfNode
*GetGrfNode();
149 inline const SwGrfNode
*GetGrfNode() const;
150 inline SwTableNode
*GetTableNode();
151 inline const SwTableNode
*GetTableNode() const;
152 inline SwSectionNode
*GetSectionNode();
153 inline const SwSectionNode
*GetSectionNode() const;
155 inline sal_Bool
IsStartNode() const;
156 inline sal_Bool
IsCntntNode() const;
157 inline sal_Bool
IsEndNode() const;
158 inline sal_Bool
IsTxtNode() const;
159 inline sal_Bool
IsTableNode() const;
160 inline sal_Bool
IsSectionNode() const;
161 inline sal_Bool
IsOLENode() const;
162 inline sal_Bool
IsNoTxtNode() const;
163 inline sal_Bool
IsGrfNode() const;
166 Checks if this node is in redlines.
168 @retval sal_True this node is in redlines
169 @retval sal_False else
171 sal_Bool
IsInRedlines() const;
173 /** Search table node, in which it is. If it is in no table
175 SwTableNode
*FindTableNode();
176 inline const SwTableNode
*FindTableNode() const;
178 /** Search section node, in which it is. If it is in no section
180 SwSectionNode
*FindSectionNode();
181 inline const SwSectionNode
*FindSectionNode() const;
183 SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
);
184 inline const SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
) const;
186 const SwStartNode
* FindTableBoxStartNode() const
187 { return FindSttNodeByType( SwTableBoxStartNode
); }
188 const SwStartNode
* FindFlyStartNode() const
189 { return FindSttNodeByType( SwFlyStartNode
); }
190 const SwStartNode
* FindFootnoteStartNode() const
191 { return FindSttNodeByType( SwFootnoteStartNode
); }
192 const SwStartNode
* FindHeaderStartNode() const
193 { return FindSttNodeByType( SwHeaderStartNode
); }
194 const SwStartNode
* FindFooterStartNode() const
195 { return FindSttNodeByType( SwFooterStartNode
); }
197 /// Node is in which nodes-array/doc?
198 inline SwNodes
& GetNodes();
199 inline const SwNodes
& GetNodes() const;
200 inline SwDoc
* GetDoc();
201 inline const SwDoc
* GetDoc() const;
203 /** Provides access to the document setting interface
205 const IDocumentSettingAccess
* getIDocumentSettingAccess() const;
207 /** Provides access to the document device interface
209 const IDocumentDeviceAccess
* getIDocumentDeviceAccess() const;
211 /** Provides access to the document bookmark interface
213 const IDocumentMarkAccess
* getIDocumentMarkAccess() const;
215 /** Provides access to the document redline interface
217 const IDocumentRedlineAccess
* getIDocumentRedlineAccess() const;
219 /** Provides access to the document style pool interface
221 const IDocumentStylePoolAccess
* getIDocumentStylePoolAccess() const;
223 /** Provides access to the document line number information interface
225 const IDocumentLineNumberAccess
* getIDocumentLineNumberAccess() const;
227 /** Provides access to the document draw model interface
229 const IDocumentDrawModelAccess
* getIDocumentDrawModelAccess() const;
231 /** Provides access to the document layout interface
233 const IDocumentLayoutAccess
* getIDocumentLayoutAccess() const;
234 IDocumentLayoutAccess
* getIDocumentLayoutAccess();
236 /** Provides access to the document links administration interface
238 const IDocumentLinksAdministration
* getIDocumentLinksAdministration() const;
239 IDocumentLinksAdministration
* getIDocumentLinksAdministration();
241 /** Provides access to the document fields administration interface
243 const IDocumentFieldsAccess
* getIDocumentFieldsAccess() const;
244 IDocumentFieldsAccess
* getIDocumentFieldsAccess();
246 /** Provides access to the document content operations interface
248 IDocumentContentOperations
* getIDocumentContentOperations();
250 /** Provides access to the document automatic styles interface
252 IStyleAccess
& getIDocumentStyleAccess();
254 /** Provides access to the document's numbered items interface
258 IDocumentListItems
& getIDocumentListItems();
260 /// Is node in the visible area of the Shell?
261 sal_Bool
IsInVisibleArea( ViewShell
* pSh
= 0 ) const;
262 /// Is node in an protected area?
263 bool IsInProtectSect() const;
264 /** Is node in something that is protected (range, frame,
265 table cells ... including anchor in case of frames or footnotes)? */
266 sal_Bool
IsProtect() const;
268 /** Search PageDesc with which this node is formated. If layout is existent
269 search over layout, else only the hard way is left: search over the nodes
271 const SwPageDesc
* FindPageDesc( sal_Bool bCalcLay
, sal_uInt32
* pPgDescNdIdx
= 0 ) const;
273 /// If node is in a fly return the respective format.
274 SwFrmFmt
* GetFlyFmt() const;
276 /// If node is in a table return the respective table box.
277 SwTableBox
* GetTblBox() const;
279 inline sal_uLong
GetIndex() const { return GetPos(); }
281 const SwTxtNode
* FindOutlineNodeOfLevel( sal_uInt8 nLvl
) const;
283 sal_uInt8
HasPrevNextLayNode() const;
286 * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
289 virtual void dumpAsXml( xmlTextWriterPtr writer
= NULL
);
292 /// Private constructor because copying is never allowed!!
293 SwNode( const SwNode
& rNodes
);
294 SwNode
& operator= ( const SwNode
& rNodes
);
297 /// Starts a section of nodes in the document model.
298 class SwStartNode
: public SwNode
301 friend class SwNodes
;
302 friend class SwEndNode
; ///< to set the theEndOfSection !!
304 SwEndNode
* pEndOfSection
;
305 SwStartNodeType eSttNdTyp
;
307 /// for the initial StartNode
308 SwStartNode( SwNodes
& rNodes
, sal_uLong nPos
);
311 SwStartNode( const SwNodeIndex
&rWhere
,
312 const sal_uInt8 nNodeType
= ND_STARTNODE
,
313 SwStartNodeType
= SwNormalStartNode
);
315 DECL_FIXEDMEMPOOL_NEWDEL(SwStartNode
)
317 SwStartNodeType
GetStartNodeType() const { return eSttNdTyp
; }
319 /// Call ChkCondcoll to all ContentNodes of section.
320 void CheckSectionCondColl() const;
322 virtual void dumpAsXml( xmlTextWriterPtr writer
= NULL
);
325 /// Private constructor because copying is never allowed!!
326 SwStartNode( const SwStartNode
& rNode
);
327 SwStartNode
& operator= ( const SwStartNode
& rNode
);
331 /// Ends a section of nodes in the document model.
332 class SwEndNode
: public SwNode
334 friend class SwNodes
;
335 friend class SwTableNode
; ///< To enable creation of its EndNote.
336 friend class SwSectionNode
; ///< To enable creation of its EndNote.
338 /// for the initial StartNode
339 SwEndNode( SwNodes
& rNodes
, sal_uLong nPos
, SwStartNode
& rSttNd
);
342 SwEndNode( const SwNodeIndex
&rWhere
, SwStartNode
& rSttNd
);
344 DECL_FIXEDMEMPOOL_NEWDEL(SwEndNode
)
347 /// Private constructor because copying is never allowed!!
348 SwEndNode( const SwEndNode
& rNode
);
349 SwEndNode
& operator= ( const SwEndNode
& rNode
);
353 // --------------------
355 // --------------------
356 class SW_DLLPUBLIC SwCntntNode
: public SwModify
, public SwNode
, public SwIndexReg
362 mutable bool mbSetModifyAtAttr
;
365 SwCntntNode( const SwNodeIndex
&rWhere
, const sal_uInt8 nNodeType
,
366 SwFmtColl
*pFmtColl
);
367 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
369 virtual ~SwCntntNode() = 0;
371 /** Attribute-set for all auto attributes of a CntntNode.
372 (e.g. TxtNode or NoTxtNode). */
373 boost::shared_ptr
<const SfxItemSet
> mpAttrSet
;
375 /// Make respective nodes create the specific AttrSets.
376 virtual void NewAttrSet( SwAttrPool
& ) = 0;
378 /** There some functions that like to remove items from the internal
379 SwAttrSet (handle): */
380 sal_uInt16
ClearItemsFromAttrSet( const std::vector
<sal_uInt16
>& rWhichIds
);
382 virtual void Modify( const SfxPoolItem
* pOld
, const SfxPoolItem
*pNew
);
385 TYPEINFO(); /// Already contained in base class Client.
387 /** MakeFrm will be called for a certain layout
388 pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent) */
389 virtual SwCntntFrm
*MakeFrm( SwFrm
* pSib
) = 0;
391 virtual SwCntntNode
*SplitCntntNode(const SwPosition
& ) = 0;
393 virtual SwCntntNode
*JoinNext();
394 virtual SwCntntNode
*JoinPrev();
395 /** Is it possible to join two nodes?
396 In pIdx the second position can be returned. */
397 int CanJoinNext( SwNodeIndex
* pIdx
=0 ) const;
398 int CanJoinPrev( SwNodeIndex
* pIdx
=0 ) const;
400 void MakeStartIndex( SwIndex
* pIdx
) { pIdx
->Assign( this, 0 ); }
401 void MakeEndIndex( SwIndex
* pIdx
) { pIdx
->Assign( this, Len() ); }
403 sal_Bool
GoNext(SwIndex
*, sal_uInt16 nMode
) const;
404 sal_Bool
GoPrevious(SwIndex
*, sal_uInt16 nMode
) const;
406 /// Replacement for good old GetFrm(..):
407 SwCntntFrm
*getLayoutFrm( const SwRootFrm
*,
408 const Point
* pDocPos
= 0,
409 const SwPosition
*pPos
= 0,
410 const sal_Bool bCalcFrm
= sal_True
) const;
411 /** @return the real size of the frame or an empty rectangle if
412 no layout exists. Needed for export filters. */
413 SwRect
FindLayoutRect( const sal_Bool bPrtArea
= sal_False
,
414 const Point
* pPoint
= 0,
415 const sal_Bool bCalcFrm
= sal_False
) const;
416 SwRect
FindPageFrmRect( const sal_Bool bPrtArea
= sal_False
,
417 const Point
* pPoint
= 0,
418 const sal_Bool bCalcFrm
= sal_False
) const;
420 /** Method creates all views of document for given node. The content
421 frames that are created are put in the respective layout. */
422 void MakeFrms( SwCntntNode
& rNode
);
424 /** Method deletes all views of document for the node. The content-
425 frames are removed from the respective layout. */
428 /** @return count of elements of node content. Default is 1.
429 There are differences between text node and formula node. */
430 virtual xub_StrLen
Len() const;
432 virtual SwCntntNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const = 0;
434 /// Get information from Client.
435 virtual bool GetInfo( SfxPoolItem
& ) const;
437 /// SS for PoolItems: hard attributation.
439 /// If bInParent is FALSE search for attribute only in this node.
440 const SfxPoolItem
& GetAttr( sal_uInt16 nWhich
, sal_Bool bInParent
=sal_True
) const;
441 sal_Bool
GetAttr( SfxItemSet
& rSet
, sal_Bool bInParent
=sal_True
) const;
443 virtual sal_Bool
SetAttr( const SfxPoolItem
& );
444 virtual sal_Bool
SetAttr( const SfxItemSet
& rSet
);
445 virtual sal_Bool
ResetAttr( sal_uInt16 nWhich1
, sal_uInt16 nWhich2
= 0 );
446 virtual sal_Bool
ResetAttr( const std::vector
<sal_uInt16
>& rWhichArr
);
447 virtual sal_uInt16
ResetAllAttr();
449 /// Obtains attribute that is not delivered via conditional style!
450 const SfxPoolItem
* GetNoCondAttr( sal_uInt16 nWhich
, sal_Bool bInParents
) const;
452 /** Does node has already its own auto-attributes?
453 Access to SwAttrSet. */
454 inline const SwAttrSet
&GetSwAttrSet() const;
455 inline const SwAttrSet
*GetpSwAttrSet() const { return static_cast<const SwAttrSet
*>(mpAttrSet
.get()); }
456 inline sal_Bool
HasSwAttrSet() const { return mpAttrSet
? sal_True
: sal_False
; }
458 virtual SwFmtColl
* ChgFmtColl( SwFmtColl
* );
459 SwFmtColl
* GetFmtColl() const { return (SwFmtColl
*)GetRegisteredIn(); }
462 inline SwFmtColl
& GetAnyFmtColl() const;
463 void SetCondFmtColl( SwFmtColl
* );
464 inline SwFmtColl
* GetCondFmtColl() const;
466 sal_Bool
IsAnyCondition( SwCollCondition
& rTmp
) const;
470 /** Invalidates NumRule at the node. NumRule is updated
471 on EndAction of a Shell at the latest. */
472 sal_Bool
InvalidateNumRule();
474 /** determines the text direction for a certain
475 position. @return -1, if text direction could *not* be determined. */
476 short GetTextDirection( const SwPosition
& rPos
,
477 const Point
* pPt
) const;
479 inline void SetModifyAtAttr( bool bSetModifyAtAttr
) const { mbSetModifyAtAttr
= bSetModifyAtAttr
; }
480 inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr
; }
482 static SwOLENodes
* CreateOLENodesArray( const SwFmtColl
& rColl
, bool bOnlyWithInvalidSize
);
485 /// Private constructor because copying is never allowed!!
486 SwCntntNode( const SwCntntNode
& rNode
);
487 SwCntntNode
& operator= ( const SwCntntNode
& rNode
);
495 class SW_DLLPUBLIC SwTableNode
: public SwStartNode
, public SwModify
497 friend class SwNodes
;
500 virtual ~SwTableNode();
503 SwTableNode( const SwNodeIndex
& );
505 const SwTable
& GetTable() const { return *pTable
; }
506 SwTable
& GetTable() { return *pTable
; }
507 SwTabFrm
*MakeFrm( SwFrm
* );
509 /// Creates the frms for the table node (i.e. the TabFrms).
510 void MakeFrms( SwNodeIndex
* pIdxBehind
);
512 /** Method deletes all views of document for the node.
513 The content frames are removed from the respective layout. */
516 /** Method creates all views of the document for the previous node.
517 The content frames that are created are put into the respective layout. */
518 void MakeFrms( const SwNodeIndex
& rIdx
);
520 SwTableNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const;
521 void SetNewTable( SwTable
* , sal_Bool bNewFrames
=sal_True
);
524 /// Private constructor because copying is never allowed!!
525 SwTableNode( const SwTableNode
& rNode
);
526 SwTableNode
& operator= ( const SwTableNode
& rNode
);
535 , private ::boost::noncopyable
537 friend class SwNodes
;
540 ::std::auto_ptr
<SwSection
> const m_pSection
;
543 virtual ~SwSectionNode();
546 SwSectionNode(SwNodeIndex
const&,
547 SwSectionFmt
& rFmt
, SwTOXBase
const*const pTOXBase
);
549 const SwSection
& GetSection() const { return *m_pSection
; }
550 SwSection
& GetSection() { return *m_pSection
; }
552 SwFrm
*MakeFrm( SwFrm
* );
554 /** Creates the frms for the SectionNode (i.e. the SectionFrms).
555 On default the frames are created until the end of the range.
556 When another NodeIndex pEnd is passed a MakeFrms is called up to it.
557 Used by TableToText. */
558 void MakeFrms( SwNodeIndex
* pIdxBehind
, SwNodeIndex
* pEnd
= NULL
);
560 /** Method deletes all views of document for the node. The
561 content frames are removed from the respective layout. */
564 /** Method creates all views of document for the previous node.
565 The content frames created are put into the respective layout. */
566 void MakeFrms( const SwNodeIndex
& rIdx
);
568 SwSectionNode
* MakeCopy( SwDoc
*, const SwNodeIndex
& ) const;
570 /// Set pointer in format of section on itself.
573 /** Check for not hidden areas whether there is content that is not in
574 a hidden sub-area. */
575 sal_Bool
IsCntntHidden() const;
582 // SwDummySectionNode
585 /** This class is internal. And quite frankly I don't know what ND_SECTIONDUMMY is for,
586 the class has been merely created to replace "SwNode( ND_SECTIONDUMMY )", the only case
587 of instantiating SwNode directly. Now SwNode can be an abstract base class. */
588 class SwDummySectionNode
592 friend class SwNodes
;
593 SwDummySectionNode( const SwNodeIndex
&rWhere
);
597 inline SwEndNode
*SwNode::GetEndNode()
599 return ND_ENDNODE
== nNodeType
? (SwEndNode
*)this : 0;
601 inline const SwEndNode
*SwNode::GetEndNode() const
603 return ND_ENDNODE
== nNodeType
? (const SwEndNode
*)this : 0;
605 inline SwStartNode
*SwNode::GetStartNode()
607 return ND_STARTNODE
& nNodeType
? (SwStartNode
*)this : 0;
609 inline const SwStartNode
*SwNode::GetStartNode() const
611 return ND_STARTNODE
& nNodeType
? (const SwStartNode
*)this : 0;
613 inline SwTableNode
*SwNode::GetTableNode()
615 return ND_TABLENODE
== nNodeType
? (SwTableNode
*)this : 0;
617 inline const SwTableNode
*SwNode::GetTableNode() const
619 return ND_TABLENODE
== nNodeType
? (const SwTableNode
*)this : 0;
621 inline SwSectionNode
*SwNode::GetSectionNode()
623 return ND_SECTIONNODE
== nNodeType
? (SwSectionNode
*)this : 0;
625 inline const SwSectionNode
*SwNode::GetSectionNode() const
627 return ND_SECTIONNODE
== nNodeType
? (const SwSectionNode
*)this : 0;
629 inline SwCntntNode
*SwNode::GetCntntNode()
631 return ND_CONTENTNODE
& nNodeType
? (SwCntntNode
*)this : 0;
633 inline const SwCntntNode
*SwNode::GetCntntNode() const
635 return ND_CONTENTNODE
& nNodeType
? (const SwCntntNode
*)this : 0;
639 inline sal_Bool
SwNode::IsStartNode() const
641 return ND_STARTNODE
& nNodeType
? sal_True
: sal_False
;
643 inline sal_Bool
SwNode::IsCntntNode() const
645 return ND_CONTENTNODE
& nNodeType
? sal_True
: sal_False
;
647 inline sal_Bool
SwNode::IsEndNode() const
649 return ND_ENDNODE
== nNodeType
? sal_True
: sal_False
;
651 inline sal_Bool
SwNode::IsTxtNode() const
653 return ND_TEXTNODE
== nNodeType
? sal_True
: sal_False
;
655 inline sal_Bool
SwNode::IsTableNode() const
657 return ND_TABLENODE
== nNodeType
? sal_True
: sal_False
;
659 inline sal_Bool
SwNode::IsSectionNode() const
661 return ND_SECTIONNODE
== nNodeType
? sal_True
: sal_False
;
663 inline sal_Bool
SwNode::IsNoTxtNode() const
665 return ND_NOTXTNODE
& nNodeType
? sal_True
: sal_False
;
667 inline sal_Bool
SwNode::IsOLENode() const
669 return ND_OLENODE
== nNodeType
? sal_True
: sal_False
;
671 inline sal_Bool
SwNode::IsGrfNode() const
673 return ND_GRFNODE
== nNodeType
? sal_True
: sal_False
;
676 inline const SwStartNode
* SwNode::FindSttNodeByType( SwStartNodeType eTyp
) const
678 return ((SwNode
*)this)->FindSttNodeByType( eTyp
);
680 inline const SwTableNode
* SwNode::FindTableNode() const
682 return ((SwNode
*)this)->FindTableNode();
684 inline const SwSectionNode
* SwNode::FindSectionNode() const
686 return ((SwNode
*)this)->FindSectionNode();
688 inline sal_uLong
SwNode::StartOfSectionIndex() const
690 return pStartOfSection
->GetIndex();
692 inline sal_uLong
SwNode::EndOfSectionIndex() const
694 const SwStartNode
* pStNd
= IsStartNode() ? (SwStartNode
*)this : pStartOfSection
;
695 return pStNd
->pEndOfSection
->GetIndex();
697 inline const SwEndNode
* SwNode::EndOfSectionNode() const
699 const SwStartNode
* pStNd
= IsStartNode() ? (SwStartNode
*)this : pStartOfSection
;
700 return pStNd
->pEndOfSection
;
702 inline SwEndNode
* SwNode::EndOfSectionNode()
704 SwStartNode
* pStNd
= IsStartNode() ? (SwStartNode
*)this : pStartOfSection
;
705 return pStNd
->pEndOfSection
;
708 inline SwNodes
& SwNode::GetNodes()
710 return (SwNodes
&)GetArray();
712 inline const SwNodes
& SwNode::GetNodes() const
714 return (SwNodes
&)GetArray();
717 inline SwDoc
* SwNode::GetDoc()
719 return GetNodes().GetDoc();
721 inline const SwDoc
* SwNode::GetDoc() const
723 return GetNodes().GetDoc();
726 inline SwFmtColl
* SwCntntNode::GetCondFmtColl() const
728 return pCondColl
? (SwFmtColl
*)pCondColl
->GetRegisteredIn() : 0;
732 inline SwFmtColl
& SwCntntNode::GetAnyFmtColl() const
734 return pCondColl
&& pCondColl
->GetRegisteredIn()
735 ? *(SwFmtColl
*)pCondColl
->GetRegisteredIn()
736 : *(SwFmtColl
*)GetRegisteredIn();
739 inline const SwAttrSet
& SwCntntNode::GetSwAttrSet() const
741 return mpAttrSet
? *GetpSwAttrSet() : GetAnyFmtColl().GetAttrSet();
746 inline const SfxPoolItem
& SwCntntNode::GetAttr( sal_uInt16 nWhich
,
747 sal_Bool bInParents
) const
749 return GetSwAttrSet().Get( nWhich
, bInParents
);
752 inline SwDummySectionNode::SwDummySectionNode( const SwNodeIndex
&rWhere
)
753 : SwNode( rWhere
, ND_SECTIONDUMMY
)
759 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */