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 .
20 #ifndef INCLUDED_SW_INC_NODE_HXX
21 #define INCLUDED_SW_INC_NODE_HXX
23 #include <sal/types.h>
46 class SwSectionFormat
;
60 class IDocumentSettingAccess
;
61 class IDocumentDeviceAccess
;
62 class IDocumentMarkAccess
;
63 class IDocumentRedlineAccess
;
64 class IDocumentStylePoolAccess
;
65 class IDocumentLinksAdministration
;
66 class IDocumentFieldsAccess
;
67 class IDocumentContentOperations
;
68 class IDocumentListItems
;
70 enum class SvxFrameDirection
;
71 typedef std::vector
<SwOLENode
*> SwOLENodes
; // docary.hxx
73 namespace drawinglayer::attribute
{
74 class SdrAllFillAttributesHelper
;
75 typedef std::shared_ptr
< SdrAllFillAttributesHelper
> SdrAllFillAttributesHelperPtr
;
78 /// Base class of the Writer document model elements.
79 class SW_DLLPUBLIC SwNode
84 SwNodeType m_nNodeType
;
86 /// For text nodes: level of auto format. Was put here because we had still free bits.
87 sal_uInt8 m_nAFormatNumLvl
: 3;
88 bool m_bIgnoreDontExpand
: 1; ///< for Text Attributes - ignore the flag
91 /// sw_redlinehide: redline node merge state
92 enum class Merge
{ None
, First
, NonFirst
, Hidden
};
93 bool IsCreateFrameWhenHidingRedlines() const {
94 return m_eMerge
== Merge::None
|| m_eMerge
== Merge::First
;
96 void SetRedlineMergeFlag(Merge
const eMerge
) { m_eMerge
= eMerge
; }
97 Merge
GetRedlineMergeFlag() const { return m_eMerge
; }
102 static tools::Long s_nSerial
;
103 tools::Long m_nSerial
;
106 /// all SwFrameFormat that are anchored at the node
107 /// invariant: SwFrameFormat is in the list iff
108 /// SwFrameFormat::GetAnchor().GetContentAnchor() points to this node
109 std::unique_ptr
<std::vector
<SwFrameFormat
*>> m_pAnchoredFlys
;
112 SwStartNode
* m_pStartOfSection
;
114 SwNode( const SwNodeIndex
&rWhere
, const SwNodeType nNodeId
);
116 /// for the initial StartNode
117 SwNode( SwNodes
& rNodes
, sal_uLong nPos
, const SwNodeType nNodeId
);
120 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
122 virtual ~SwNode() override
= 0;
125 tools::Long
GetSerial() const { return m_nSerial
; }
128 sal_uInt16
GetSectionLevel() const;
130 inline sal_uLong
StartOfSectionIndex() const;
131 const SwStartNode
* StartOfSectionNode() const { return m_pStartOfSection
; }
132 SwStartNode
* StartOfSectionNode() { return m_pStartOfSection
; }
134 inline sal_uLong
EndOfSectionIndex() const;
135 inline const SwEndNode
* EndOfSectionNode() const;
136 inline SwEndNode
* EndOfSectionNode();
138 sal_uInt8
GetAutoFormatLvl() const { return m_nAFormatNumLvl
; }
139 void SetAutoFormatLvl( sal_uInt8 nVal
) { m_nAFormatNumLvl
= nVal
; }
141 bool IsIgnoreDontExpand() const { return m_bIgnoreDontExpand
; }
142 void SetIgnoreDontExpand( bool bNew
) { m_bIgnoreDontExpand
= bNew
; }
144 SwNodeType
GetNodeType() const { return m_nNodeType
; }
146 inline SwStartNode
*GetStartNode();
147 inline const SwStartNode
*GetStartNode() const;
148 inline SwContentNode
*GetContentNode();
149 inline const SwContentNode
*GetContentNode() const;
150 inline SwEndNode
*GetEndNode();
151 inline const SwEndNode
*GetEndNode() const;
152 inline SwTextNode
*GetTextNode();
153 inline const SwTextNode
*GetTextNode() const;
154 inline SwOLENode
*GetOLENode();
155 inline const SwOLENode
*GetOLENode() const;
156 inline SwNoTextNode
*GetNoTextNode();
157 inline const SwNoTextNode
*GetNoTextNode() const;
158 inline SwGrfNode
*GetGrfNode();
159 inline const SwGrfNode
*GetGrfNode() const;
160 inline SwTableNode
*GetTableNode();
161 inline const SwTableNode
*GetTableNode() const;
162 inline SwSectionNode
*GetSectionNode();
163 inline const SwSectionNode
*GetSectionNode() const;
165 inline bool IsStartNode() const;
166 inline bool IsContentNode() const;
167 inline bool IsEndNode() const;
168 inline bool IsTextNode() const;
169 inline bool IsTableNode() const;
170 inline bool IsSectionNode() const;
171 inline bool IsOLENode() const;
172 inline bool IsNoTextNode() const;
173 inline bool IsGrfNode() const;
176 Checks if this node is in redlines.
178 @retval true this node is in redlines
181 bool IsInRedlines() const;
183 /** Search table node, in which it is. If it is in no table
185 SwTableNode
*FindTableNode();
186 inline const SwTableNode
*FindTableNode() const;
188 /** Search section node, in which it is. If it is in no section
190 SwSectionNode
*FindSectionNode();
191 inline const SwSectionNode
*FindSectionNode() const;
193 SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
);
194 inline const SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
) const;
196 const SwStartNode
* FindTableBoxStartNode() const
197 { return FindSttNodeByType( SwTableBoxStartNode
); }
198 const SwStartNode
* FindFlyStartNode() const
199 { return FindSttNodeByType( SwFlyStartNode
); }
200 const SwStartNode
* FindFootnoteStartNode() const
201 { return FindSttNodeByType( SwFootnoteStartNode
); }
202 const SwStartNode
* FindHeaderStartNode() const
203 { return FindSttNodeByType( SwHeaderStartNode
); }
204 const SwStartNode
* FindFooterStartNode() const
205 { return FindSttNodeByType( SwFooterStartNode
); }
207 /// Node is in which nodes-array/doc?
208 inline SwNodes
& GetNodes();
209 inline const SwNodes
& GetNodes() const;
213 return GetNodes().GetDoc();
216 const SwDoc
& GetDoc() const
218 return GetNodes().GetDoc();
221 /** Provides access to the document setting interface
223 const IDocumentSettingAccess
* getIDocumentSettingAccess() const;
225 /** Provides access to the document device interface
227 const IDocumentDeviceAccess
& getIDocumentDeviceAccess() const;
229 /** Provides access to the document bookmark interface
231 const IDocumentMarkAccess
* getIDocumentMarkAccess() const;
233 /** Provides access to the document redline interface
235 const IDocumentRedlineAccess
& getIDocumentRedlineAccess() const;
237 /** Provides access to the document style pool interface
239 const IDocumentStylePoolAccess
& getIDocumentStylePoolAccess() const;
241 /** Provides access to the document draw model interface
243 const IDocumentDrawModelAccess
& getIDocumentDrawModelAccess() const;
245 /** Provides access to the document layout interface
247 const IDocumentLayoutAccess
& getIDocumentLayoutAccess() const;
248 IDocumentLayoutAccess
& getIDocumentLayoutAccess();
250 /** Provides access to the document links administration interface
252 const IDocumentLinksAdministration
& getIDocumentLinksAdministration() const;
253 IDocumentLinksAdministration
& getIDocumentLinksAdministration();
255 /** Provides access to the document fields administration interface
257 const IDocumentFieldsAccess
& getIDocumentFieldsAccess() const;
258 IDocumentFieldsAccess
& getIDocumentFieldsAccess();
260 /** Provides access to the document content operations interface
262 IDocumentContentOperations
& getIDocumentContentOperations();
264 /** Provides access to the document automatic styles interface
266 IStyleAccess
& getIDocumentStyleAccess();
268 /** Provides access to the document's numbered items interface */
269 IDocumentListItems
& getIDocumentListItems();
271 /// Is node in the visible area of the Shell?
272 bool IsInVisibleArea( SwViewShell
const * pSh
) const;
273 /// Is node in a protected area?
274 bool IsInProtectSect() const;
275 /** Is node in something that is protected (range, frame,
276 table cells ... including anchor in case of frames or footnotes)? */
277 bool IsProtect() const;
279 /** Search PageDesc with which this node is formatted. If layout is existent
280 search over layout, else only the hard way is left: search over the nodes
282 const SwPageDesc
* FindPageDesc( size_t* pPgDescNdIdx
= nullptr ) const;
284 /// If node is in a fly return the respective format.
285 SwFrameFormat
* GetFlyFormat() const;
287 /// If node is in a table return the respective table box.
288 SwTableBox
* GetTableBox() const;
290 sal_uLong
GetIndex() const { return GetPos(); }
292 const SwTextNode
* FindOutlineNodeOfLevel(sal_uInt8 nLvl
, SwRootFrame
const* pLayout
= nullptr) const;
294 sal_uInt8
HasPrevNextLayNode() const;
296 std::vector
<SwFrameFormat
*> const* GetAnchoredFlys() const { return m_pAnchoredFlys
.get(); }
297 void AddAnchoredFly(SwFrameFormat
*);
298 void RemoveAnchoredFly(SwFrameFormat
*);
301 * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
303 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const;
306 SwNode( const SwNode
& rNodes
) = delete;
307 SwNode
& operator= ( const SwNode
& rNodes
) = delete;
310 /// Starts a section of nodes in the document model.
311 class SAL_DLLPUBLIC_RTTI SwStartNode
: public SwNode
314 friend class SwNodes
;
315 friend class SwEndNode
; ///< to set the theEndOfSection !!
317 SwEndNode
* m_pEndOfSection
;
318 SwStartNodeType m_eStartNodeType
;
320 /// for the initial StartNode
321 SwStartNode( SwNodes
& rNodes
, sal_uLong nPos
);
324 SwStartNode( const SwNodeIndex
&rWhere
,
325 const SwNodeType nNodeType
= SwNodeType::Start
,
326 SwStartNodeType
= SwNormalStartNode
);
328 SwStartNodeType
GetStartNodeType() const { return m_eStartNodeType
; }
330 /// Call ChkCondcoll to all ContentNodes of section.
331 void CheckSectionCondColl() const;
333 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
336 SwStartNode( const SwStartNode
& rNode
) = delete;
337 SwStartNode
& operator= ( const SwStartNode
& rNode
) = delete;
340 /// Ends a section of nodes in the document model.
341 class SwEndNode
: public SwNode
343 friend class SwNodes
;
344 friend class SwTableNode
; ///< To enable creation of its EndNote.
345 friend class SwSectionNode
; ///< To enable creation of its EndNote.
347 /// for the initial StartNode
348 SwEndNode( SwNodes
& rNodes
, sal_uLong nPos
, SwStartNode
& rSttNd
);
351 SwEndNode( const SwNodeIndex
&rWhere
, SwStartNode
& rSttNd
);
354 SwEndNode( const SwEndNode
& rNode
) = delete;
355 SwEndNode
& operator= ( const SwEndNode
& rNode
) = delete;
360 class SW_DLLPUBLIC SwContentNode
: public sw::BroadcastingModify
, public SwNode
, public SwIndexReg
363 sw::WriterMultiListener m_aCondCollListener
;
364 SwFormatColl
* m_pCondColl
;
365 mutable bool mbSetModifyAtAttr
;
368 SwContentNode( const SwNodeIndex
&rWhere
, const SwNodeType nNodeType
,
369 SwFormatColl
*pFormatColl
);
370 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
372 virtual ~SwContentNode() override
= 0;
374 /** Attribute-set for all auto attributes of a ContentNode.
375 (e.g. TextNode or NoTextNode). */
376 std::shared_ptr
<const SfxItemSet
> mpAttrSet
;
378 /// Make respective nodes create the specific AttrSets.
379 virtual void NewAttrSet( SwAttrPool
& ) = 0;
381 /** There some functions that like to remove items from the internal
382 SwAttrSet (handle): */
383 sal_uInt16
ClearItemsFromAttrSet( const std::vector
<sal_uInt16
>& rWhichIds
);
385 virtual void SwClientNotify( const SwModify
&, const SfxHint
& rHint
) override
;
389 /** MakeFrame will be called for a certain layout
390 pSib is another SwFrame of the same layout (e.g. the SwRootFrame itself, a sibling, the parent) */
391 virtual SwContentFrame
*MakeFrame( SwFrame
* pSib
) = 0;
393 virtual SwContentNode
*JoinNext();
394 /** Is it possible to join two nodes?
395 In pIdx the second position can be returned. */
396 bool CanJoinNext( SwNodeIndex
* pIdx
=nullptr ) const;
397 bool CanJoinPrev( SwNodeIndex
* pIdx
=nullptr ) const;
399 void MakeStartIndex( SwIndex
* pIdx
) { pIdx
->Assign( this, 0 ); }
400 void MakeEndIndex( SwIndex
* pIdx
) { pIdx
->Assign( this, Len() ); }
402 bool GoNext(SwIndex
*, sal_uInt16 nMode
) const;
403 bool GoPrevious(SwIndex
*, sal_uInt16 nMode
) const;
405 /// @see GetFrameOfModify
406 SwContentFrame
*getLayoutFrame( const SwRootFrame
*,
407 const SwPosition
*pPos
= nullptr,
408 std::pair
<Point
, bool> const* pViewPosAndCalcFrame
= nullptr) const;
409 /** @return the real size of the frame or an empty rectangle if
410 no layout exists. Needed for export filters. */
411 SwRect
FindLayoutRect( const bool bPrtArea
= false,
412 const Point
* pPoint
= nullptr ) const;
413 SwRect
FindPageFrameRect() const;
415 /** Method creates all views of document for given node. The content
416 frames that are created are put in the respective layout. */
417 void MakeFramesForAdjacentContentNode(SwContentNode
& rNode
);
419 /** Method deletes all views of document for the node. The content-
420 frames are removed from the respective layout.
422 void DelFrames(SwRootFrame
const* pLayout
);
424 /** @return count of elements of node content. Default is 1.
425 There are differences between text node and formula node. */
426 virtual sal_Int32
Len() const;
428 virtual SwContentNode
* MakeCopy(SwDoc
&, const SwNodeIndex
&, bool bNewFrames
) const = 0;
430 /// Get information from Client.
431 virtual bool GetInfo( SfxPoolItem
& ) const override
;
433 /// SS for PoolItems: hard attributation.
435 /// If bInParent is FALSE search for attribute only in this node.
436 const SfxPoolItem
& GetAttr( sal_uInt16 nWhich
, bool bInParent
=true ) const;
437 bool GetAttr( SfxItemSet
& rSet
) const;
439 virtual bool SetAttr( const SfxPoolItem
& );
440 virtual bool SetAttr( const SfxItemSet
& rSet
);
441 virtual bool ResetAttr( sal_uInt16 nWhich1
, sal_uInt16 nWhich2
= 0 );
442 virtual bool ResetAttr( const std::vector
<sal_uInt16
>& rWhichArr
);
443 virtual sal_uInt16
ResetAllAttr();
445 /// Obtains attribute that is not delivered via conditional style!
446 const SfxPoolItem
* GetNoCondAttr( sal_uInt16 nWhich
, bool bInParents
) const;
448 /** Does node has already its own auto-attributes?
449 Access to SwAttrSet. */
450 inline const SwAttrSet
&GetSwAttrSet() const;
451 const SwAttrSet
*GetpSwAttrSet() const { return static_cast<const SwAttrSet
*>(mpAttrSet
.get()); }
452 bool HasSwAttrSet() const { return mpAttrSet
!= nullptr; }
454 virtual SwFormatColl
* ChgFormatColl( SwFormatColl
* );
455 SwFormatColl
* GetFormatColl() const { return const_cast<SwFormatColl
*>(static_cast<const SwFormatColl
*>(GetRegisteredIn())); }
457 inline SwFormatColl
& GetAnyFormatColl() const;
458 void SetCondFormatColl( SwFormatColl
* );
459 inline SwFormatColl
* GetCondFormatColl() const;
461 bool IsAnyCondition( SwCollCondition
& rTmp
) const;
462 void ChkCondColl(const SwTextFormatColl
* pColl
= nullptr);
464 /** Invalidates NumRule at the node. NumRule is updated
465 on EndAction of a Shell at the latest. */
466 bool InvalidateNumRule();
468 /** determines the text direction for a certain
469 position. @return -1, if text direction could *not* be determined. */
470 SvxFrameDirection
GetTextDirection( const SwPosition
& rPos
,
471 const Point
* pPt
) const;
473 void SetModifyAtAttr( bool bSetModifyAtAttr
) const { mbSetModifyAtAttr
= bSetModifyAtAttr
; }
474 bool GetModifyAtAttr() const { return mbSetModifyAtAttr
; }
476 static std::unique_ptr
<SwOLENodes
> CreateOLENodesArray( const SwFormatColl
& rColl
, bool bOnlyWithInvalidSize
);
478 // Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
479 virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr
getSdrAllFillAttributesHelper() const;
481 void UpdateAttr(const SwUpdateAttr
&);
484 SwContentNode( const SwContentNode
& rNode
) = delete;
485 SwContentNode
& operator= ( const SwContentNode
& rNode
) = delete;
490 class SW_DLLPUBLIC SwTableNode
: public SwStartNode
, public sw::BroadcastingModify
492 friend class SwNodes
;
493 std::unique_ptr
<SwTable
> m_pTable
;
495 virtual ~SwTableNode() override
;
498 SwTableNode( const SwNodeIndex
& );
500 const SwTable
& GetTable() const { return *m_pTable
; }
501 SwTable
& GetTable() { return *m_pTable
; }
502 SwTabFrame
*MakeFrame( SwFrame
* );
504 /// Creates the frms for the table node (i.e. the TabFrames).
505 void MakeOwnFrames(SwNodeIndex
* pIdxBehind
);
507 /** Method deletes all views of document for the node.
508 The content frames are removed from the respective layout. */
509 void DelFrames(SwRootFrame
const* pLayout
= nullptr);
511 /** Method creates all views of the document for the previous node.
512 The content frames that are created are put into the respective layout. */
513 void MakeFramesForAdjacentContentNode(const SwNodeIndex
& rIdx
);
515 SwTableNode
* MakeCopy( SwDoc
&, const SwNodeIndex
& ) const;
516 void SetNewTable( std::unique_ptr
<SwTable
> , bool bNewFrames
=true );
518 // Removes redline objects that relate to this table from the 'Extra Redlines' table
519 void RemoveRedlines();
522 SwTableNode( const SwTableNode
& rNode
) = delete;
523 SwTableNode
& operator= ( const SwTableNode
& rNode
) = delete;
526 class SAL_DLLPUBLIC_RTTI SwSectionNode
529 friend class SwNodes
;
532 SwSectionNode(const SwSectionNode
&) = delete;
533 SwSectionNode
& operator=(const SwSectionNode
&) = delete;
535 std::unique_ptr
<SwSection
> const m_pSection
;
538 virtual ~SwSectionNode() override
;
541 SwSectionNode(SwNodeIndex
const&,
542 SwSectionFormat
& rFormat
, SwTOXBase
const*const pTOXBase
);
544 const SwSection
& GetSection() const { return *m_pSection
; }
545 SwSection
& GetSection() { return *m_pSection
; }
547 SwFrame
*MakeFrame( SwFrame
* );
549 /** Creates the frms for the SectionNode (i.e. the SectionFrames).
550 On default the frames are created until the end of the range.
551 When another NodeIndex pEnd is passed a MakeFrames is called up to it.
552 Used by TableToText. */
553 void MakeOwnFrames(SwNodeIndex
* pIdxBehind
, SwNodeIndex
* pEnd
= nullptr);
555 /** Method deletes all views of document for the node. The
556 content frames are removed from the respective layout. */
557 void DelFrames(SwRootFrame
const* pLayout
= nullptr, bool bForce
= false);
559 /** Method creates all views of document for the previous node.
560 The content frames created are put into the respective layout. */
561 void MakeFramesForAdjacentContentNode(const SwNodeIndex
& rIdx
);
563 SwSectionNode
* MakeCopy( SwDoc
&, const SwNodeIndex
& ) const;
565 /// Set pointer in format of section on itself.
568 /** Check for not hidden areas whether there is content that is not in
569 a hidden sub-area. */
570 bool IsContentHidden() const;
574 /** This class is internal, used only during DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
576 Some of the nodes are then replaced with SwPlaceholderNode, and at the end of the operation, removed again.
577 FIXME find out if this is really necessary, and if we can avoid creation of the SwPlaceholderNodes in the first place.
579 class SwPlaceholderNode final
: private SwNode
582 friend class SwNodes
;
583 SwPlaceholderNode(const SwNodeIndex
&rWhere
);
586 inline SwEndNode
*SwNode::GetEndNode()
588 return SwNodeType::End
== m_nNodeType
? static_cast<SwEndNode
*>(this) : nullptr;
590 inline const SwEndNode
*SwNode::GetEndNode() const
592 return SwNodeType::End
== m_nNodeType
? static_cast<const SwEndNode
*>(this) : nullptr;
594 inline SwStartNode
*SwNode::GetStartNode()
596 return SwNodeType::Start
& m_nNodeType
? static_cast<SwStartNode
*>(this) : nullptr;
598 inline const SwStartNode
*SwNode::GetStartNode() const
600 return SwNodeType::Start
& m_nNodeType
? static_cast<const SwStartNode
*>(this) : nullptr;
602 inline SwTableNode
*SwNode::GetTableNode()
604 return SwNodeType::Table
== m_nNodeType
? static_cast<SwTableNode
*>(this) : nullptr;
606 inline const SwTableNode
*SwNode::GetTableNode() const
608 return SwNodeType::Table
== m_nNodeType
? static_cast<const SwTableNode
*>(this) : nullptr;
610 inline SwSectionNode
*SwNode::GetSectionNode()
612 return SwNodeType::Section
== m_nNodeType
? static_cast<SwSectionNode
*>(this) : nullptr;
614 inline const SwSectionNode
*SwNode::GetSectionNode() const
616 return SwNodeType::Section
== m_nNodeType
? static_cast<const SwSectionNode
*>(this) : nullptr;
618 inline SwContentNode
*SwNode::GetContentNode()
620 return SwNodeType::ContentMask
& m_nNodeType
? static_cast<SwContentNode
*>(this) : nullptr;
622 inline const SwContentNode
*SwNode::GetContentNode() const
624 return SwNodeType::ContentMask
& m_nNodeType
? static_cast<const SwContentNode
*>(this) : nullptr;
627 inline bool SwNode::IsStartNode() const
629 return bool(SwNodeType::Start
& m_nNodeType
);
631 inline bool SwNode::IsContentNode() const
633 return bool(SwNodeType::ContentMask
& m_nNodeType
);
635 inline bool SwNode::IsEndNode() const
637 return SwNodeType::End
== m_nNodeType
;
639 inline bool SwNode::IsTextNode() const
641 return SwNodeType::Text
== m_nNodeType
;
643 inline bool SwNode::IsTableNode() const
645 return SwNodeType::Table
== m_nNodeType
;
647 inline bool SwNode::IsSectionNode() const
649 return SwNodeType::Section
== m_nNodeType
;
651 inline bool SwNode::IsNoTextNode() const
653 return bool(SwNodeType::NoTextMask
& m_nNodeType
);
655 inline bool SwNode::IsOLENode() const
657 return SwNodeType::Ole
== m_nNodeType
;
659 inline bool SwNode::IsGrfNode() const
661 return SwNodeType::Grf
== m_nNodeType
;
664 inline const SwStartNode
* SwNode::FindSttNodeByType( SwStartNodeType eTyp
) const
666 return const_cast<SwNode
*>(this)->FindSttNodeByType( eTyp
);
668 inline const SwTableNode
* SwNode::FindTableNode() const
670 return const_cast<SwNode
*>(this)->FindTableNode();
672 inline const SwSectionNode
* SwNode::FindSectionNode() const
674 return const_cast<SwNode
*>(this)->FindSectionNode();
676 inline sal_uLong
SwNode::StartOfSectionIndex() const
678 return m_pStartOfSection
->GetIndex();
680 inline sal_uLong
SwNode::EndOfSectionIndex() const
682 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
683 return pStNd
->m_pEndOfSection
->GetIndex();
685 inline const SwEndNode
* SwNode::EndOfSectionNode() const
687 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
688 return pStNd
->m_pEndOfSection
;
690 inline SwEndNode
* SwNode::EndOfSectionNode()
692 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
693 return pStNd
->m_pEndOfSection
;
696 inline SwNodes
& SwNode::GetNodes()
698 return static_cast<SwNodes
&>(GetArray());
700 inline const SwNodes
& SwNode::GetNodes() const
702 return static_cast<SwNodes
&>(GetArray());
705 inline SwFormatColl
* SwContentNode::GetCondFormatColl() const
710 inline SwFormatColl
& SwContentNode::GetAnyFormatColl() const
714 : *const_cast<SwFormatColl
*>(static_cast<const SwFormatColl
*>(GetRegisteredIn()));
717 inline const SwAttrSet
& SwContentNode::GetSwAttrSet() const
719 return mpAttrSet
? *GetpSwAttrSet() : GetAnyFormatColl().GetAttrSet();
724 inline const SfxPoolItem
& SwContentNode::GetAttr( sal_uInt16 nWhich
,
725 bool bInParents
) const
727 return GetSwAttrSet().Get( nWhich
, bInParents
);
730 inline SwPlaceholderNode::SwPlaceholderNode(const SwNodeIndex
&rWhere
)
731 : SwNode(rWhere
, SwNodeType::PlaceHolder
)
735 inline SwNodePtr
SwNodes::operator[]( sal_uLong n
) const
737 return static_cast<SwNodePtr
>(BigPtrArray::operator[] ( n
));
742 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */