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>
26 #include "BorderCacheOwner.hxx"
29 #include "contentindex.hxx"
31 #include "nodeoffset.hxx"
33 #include <sfx2/AccessibilityIssue.hxx>
50 class SwSectionFormat
;
64 class IDocumentSettingAccess
;
65 class IDocumentDeviceAccess
;
66 class IDocumentMarkAccess
;
67 class IDocumentRedlineAccess
;
68 class IDocumentStylePoolAccess
;
69 class IDocumentLinksAdministration
;
70 class IDocumentFieldsAccess
;
71 class IDocumentContentOperations
;
72 class IDocumentListItems
;
74 enum class SvxFrameDirection
;
75 typedef std::vector
<SwOLENode
*> SwOLENodes
; // docary.hxx
76 enum class SwCursorSkipMode
;
78 namespace drawinglayer::attribute
{
79 class SdrAllFillAttributesHelper
;
80 typedef std::shared_ptr
< SdrAllFillAttributesHelper
> SdrAllFillAttributesHelperPtr
;
83 // Accessibility check
87 struct AccessibilityCheckStatus
89 std::unique_ptr
<sfx::AccessibilityIssueCollection
> pCollection
;
95 /// Base class of the Writer document model elements.
96 class SW_DLLPUBLIC SwNode
97 : public sw::BorderCacheOwner
, private BigPtrEntry
101 SwNodeType m_nNodeType
;
103 /// For text nodes: level of auto format. Was put here because we had still free bits.
104 sal_uInt8 m_nAFormatNumLvl
: 3;
105 bool m_bIgnoreDontExpand
: 1; ///< for Text Attributes - ignore the flag
107 mutable sw::AccessibilityCheckStatus m_aAccessibilityCheckStatus
;
110 /// sw_redlinehide: redline node merge state
111 enum class Merge
{ None
, First
, NonFirst
, Hidden
};
112 bool IsCreateFrameWhenHidingRedlines() const {
113 return m_eMerge
== Merge::None
|| m_eMerge
== Merge::First
;
115 void SetRedlineMergeFlag(Merge
const eMerge
) { m_eMerge
= eMerge
; }
116 Merge
GetRedlineMergeFlag() const { return m_eMerge
; }
121 static tools::Long s_nSerial
;
122 tools::Long m_nSerial
;
125 /// all SwFrameFormat that are anchored at the node
126 /// invariant: SwFrameFormat is in the list iff
127 /// SwFrameFormat::GetAnchor().GetContentAnchor() points to this node
128 std::vector
<SwFrameFormat
*> m_aAnchoredFlys
;
131 SwStartNode
* m_pStartOfSection
;
133 /// only used by SwContentNodeTmp in SwTextNode::Update
136 SwNode( const SwNode
& rWhere
, const SwNodeType nNodeId
);
138 /// for the initial StartNode
139 SwNode( SwNodes
& rNodes
, SwNodeOffset nPos
, const SwNodeType nNodeId
);
142 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
144 virtual ~SwNode() override
= 0;
147 tools::Long
GetSerial() const { return m_nSerial
; }
150 sal_uInt16
GetSectionLevel() const;
152 inline SwNodeOffset
StartOfSectionIndex() const;
153 const SwStartNode
* StartOfSectionNode() const { return m_pStartOfSection
; }
154 SwStartNode
* StartOfSectionNode() { return m_pStartOfSection
; }
156 inline SwNodeOffset
EndOfSectionIndex() const;
157 inline const SwEndNode
* EndOfSectionNode() const;
158 inline SwEndNode
* EndOfSectionNode();
160 sal_uInt8
GetAutoFormatLvl() const { return m_nAFormatNumLvl
; }
161 void SetAutoFormatLvl( sal_uInt8 nVal
) { m_nAFormatNumLvl
= nVal
; }
163 bool IsIgnoreDontExpand() const { return m_bIgnoreDontExpand
; }
164 void SetIgnoreDontExpand( bool bNew
) { m_bIgnoreDontExpand
= bNew
; }
166 SwNodeType
GetNodeType() const { return m_nNodeType
; }
168 inline SwStartNode
*GetStartNode();
169 inline const SwStartNode
*GetStartNode() const;
170 inline SwContentNode
*GetContentNode();
171 inline const SwContentNode
*GetContentNode() const;
172 inline SwEndNode
*GetEndNode();
173 inline const SwEndNode
*GetEndNode() const;
174 inline SwTextNode
*GetTextNode();
175 inline const SwTextNode
*GetTextNode() const;
176 inline SwOLENode
*GetOLENode();
177 inline const SwOLENode
*GetOLENode() const;
178 inline SwNoTextNode
*GetNoTextNode();
179 inline const SwNoTextNode
*GetNoTextNode() const;
180 inline SwGrfNode
*GetGrfNode();
181 inline const SwGrfNode
*GetGrfNode() const;
182 inline SwTableNode
*GetTableNode();
183 inline const SwTableNode
*GetTableNode() const;
184 inline SwSectionNode
*GetSectionNode();
185 inline const SwSectionNode
*GetSectionNode() const;
187 inline bool IsStartNode() const;
188 inline bool IsContentNode() const;
189 inline bool IsEndNode() const;
190 inline bool IsTextNode() const;
191 inline bool IsTableNode() const;
192 inline bool IsSectionNode() const;
193 inline bool IsOLENode() const;
194 inline bool IsNoTextNode() const;
195 inline bool IsGrfNode() const;
198 Checks if this node is in redlines.
200 @retval true this node is in redlines
203 bool IsInRedlines() const;
205 /** Search table node, in which it is. If it is in no table
207 SwTableNode
*FindTableNode();
208 inline const SwTableNode
*FindTableNode() const;
210 /** Search section node, in which it is. If it is in no section
212 SwSectionNode
*FindSectionNode();
213 inline const SwSectionNode
*FindSectionNode() const;
215 SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
);
216 inline const SwStartNode
* FindSttNodeByType( SwStartNodeType eTyp
) const;
218 const SwStartNode
* FindTableBoxStartNode() const
219 { return FindSttNodeByType( SwTableBoxStartNode
); }
220 const SwStartNode
* FindFlyStartNode() const
221 { return FindSttNodeByType( SwFlyStartNode
); }
222 const SwStartNode
* FindFootnoteStartNode() const
223 { return FindSttNodeByType( SwFootnoteStartNode
); }
224 const SwStartNode
* FindHeaderStartNode() const
225 { return FindSttNodeByType( SwHeaderStartNode
); }
226 const SwStartNode
* FindFooterStartNode() const
227 { return FindSttNodeByType( SwFooterStartNode
); }
229 /// Node is in which nodes-array/doc?
230 inline SwNodes
& GetNodes();
231 inline const SwNodes
& GetNodes() const;
235 return GetNodes().GetDoc();
238 const SwDoc
& GetDoc() const
240 return GetNodes().GetDoc();
243 /** Provides access to the document setting interface
245 const IDocumentSettingAccess
* getIDocumentSettingAccess() const;
247 /** Provides access to the document device interface
249 const IDocumentDeviceAccess
& getIDocumentDeviceAccess() const;
251 /** Provides access to the document bookmark interface
253 const IDocumentMarkAccess
* getIDocumentMarkAccess() const;
255 /** Provides access to the document redline interface
257 const IDocumentRedlineAccess
& getIDocumentRedlineAccess() const;
259 /** Provides access to the document style pool interface
261 const IDocumentStylePoolAccess
& getIDocumentStylePoolAccess() const;
263 /** Provides access to the document draw model interface
265 const IDocumentDrawModelAccess
& getIDocumentDrawModelAccess() const;
267 /** Provides access to the document layout interface
269 const IDocumentLayoutAccess
& getIDocumentLayoutAccess() const;
270 IDocumentLayoutAccess
& getIDocumentLayoutAccess();
272 /** Provides access to the document links administration interface
274 const IDocumentLinksAdministration
& getIDocumentLinksAdministration() const;
275 IDocumentLinksAdministration
& getIDocumentLinksAdministration();
277 /** Provides access to the document fields administration interface
279 const IDocumentFieldsAccess
& getIDocumentFieldsAccess() const;
280 IDocumentFieldsAccess
& getIDocumentFieldsAccess();
282 /** Provides access to the document content operations interface
284 IDocumentContentOperations
& getIDocumentContentOperations();
286 /** Provides access to the document automatic styles interface
288 IStyleAccess
& getIDocumentStyleAccess();
290 /** Provides access to the document's numbered items interface */
291 IDocumentListItems
& getIDocumentListItems();
293 /// Is node in the visible area of the Shell?
294 bool IsInVisibleArea( SwViewShell
const * pSh
) const;
295 /// Is node in a protected area?
296 bool IsInProtectSect() const;
297 /** Is node in something that is protected (range, frame,
298 table cells ... including anchor in case of frames or footnotes)? */
299 bool IsProtect() const;
301 /** Search PageDesc with which this node is formatted. If layout is existent
302 search over layout, else only the hard way is left: search over the nodes
304 const SwPageDesc
* FindPageDesc( SwNodeOffset
* pPgDescNdIdx
= nullptr ) const;
306 /// If node is in a fly return the respective format.
307 SwFrameFormat
* GetFlyFormat() const;
309 /// If node is in a table return the respective table box.
310 SwTableBox
* GetTableBox() const;
312 SwNodeOffset
GetIndex() const { return SwNodeOffset(GetPos()); }
314 const SwTextNode
* FindOutlineNodeOfLevel(sal_uInt8 nLvl
, SwRootFrame
const* pLayout
= nullptr) const;
316 sal_uInt8
HasPrevNextLayNode() const;
318 std::vector
<SwFrameFormat
*> const & GetAnchoredFlys() const { return m_aAnchoredFlys
; }
319 void AddAnchoredFly(SwFrameFormat
*);
320 void RemoveAnchoredFly(SwFrameFormat
*);
323 * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
325 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const;
327 bool operator==(const SwNode
& rOther
) const { return this == &rOther
; }
328 bool operator!=(const SwNode
& rOther
) const { return this != &rOther
; }
329 bool operator<(const SwNode
& rOther
) const { assert(&GetNodes() == &rOther
.GetNodes()); return GetIndex() < rOther
.GetIndex(); }
330 bool operator<=(const SwNode
& rOther
) const { assert(&GetNodes() == &rOther
.GetNodes()); return GetIndex() <= rOther
.GetIndex(); }
331 bool operator>(const SwNode
& rOther
) const { assert(&GetNodes() == &rOther
.GetNodes()); return GetIndex() > rOther
.GetIndex(); }
332 bool operator>=(const SwNode
& rOther
) const { assert(&GetNodes() == &rOther
.GetNodes()); return GetIndex() >= rOther
.GetIndex(); }
334 sw::AccessibilityCheckStatus
& getAccessibilityCheckStatus()
336 return m_aAccessibilityCheckStatus
;
339 void resetAndQueueAccessibilityCheck(bool bIssueObjectNameChanged
= false);
342 SwNode( const SwNode
& rNodes
) = delete;
343 SwNode
& operator= ( const SwNode
& rNodes
) = delete;
346 /// Starts a section of nodes in the document model.
347 class SAL_DLLPUBLIC_RTTI SwStartNode
: public SwNode
350 friend class SwNodes
;
351 friend class SwEndNode
; ///< to set the theEndOfSection !!
353 SwEndNode
* m_pEndOfSection
;
354 SwStartNodeType m_eStartNodeType
;
356 /// for the initial StartNode
357 SwStartNode( SwNodes
& rNodes
, SwNodeOffset nPos
);
360 SwStartNode( const SwNode
& rWhere
,
361 const SwNodeType nNodeType
= SwNodeType::Start
,
362 SwStartNodeType
= SwNormalStartNode
);
364 SwStartNodeType
GetStartNodeType() const { return m_eStartNodeType
; }
366 /// Call ChkCondcoll to all ContentNodes of section.
367 void CheckSectionCondColl() const;
369 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
372 SwStartNode( const SwStartNode
& rNode
) = delete;
373 SwStartNode
& operator= ( const SwStartNode
& rNode
) = delete;
376 /// Ends a section of nodes in the document model.
377 class SwEndNode final
: public SwNode
379 friend class SwNodes
;
380 friend class SwTableNode
; ///< To enable creation of its EndNote.
381 friend class SwSectionNode
; ///< To enable creation of its EndNote.
383 /// for the initial StartNode
384 SwEndNode( SwNodes
& rNodes
, SwNodeOffset nPos
, SwStartNode
& rSttNd
);
386 SwEndNode( const SwNode
& rWhere
, SwStartNode
& rSttNd
);
388 SwEndNode( const SwEndNode
& rNode
) = delete;
389 SwEndNode
& operator= ( const SwEndNode
& rNode
) = delete;
394 class SW_DLLPUBLIC SwContentNode
: public sw::BroadcastingModify
, public SwNode
, public SwContentIndexReg
397 sw::WriterMultiListener m_aCondCollListener
;
398 SwFormatColl
* m_pCondColl
;
399 mutable bool mbSetModifyAtAttr
;
402 /// only used by SwContentNodeTmp in SwTextNode::Update
405 SwContentNode( const SwNode
& rWhere
, const SwNodeType nNodeType
,
406 SwFormatColl
*pFormatColl
);
407 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
409 virtual ~SwContentNode() override
= 0;
411 /** Attribute-set for all auto attributes of a ContentNode.
412 (e.g. TextNode or NoTextNode). */
413 std::shared_ptr
<const SfxItemSet
> mpAttrSet
;
415 /// Make respective nodes create the specific AttrSets.
416 virtual void NewAttrSet( SwAttrPool
& ) = 0;
418 /** There some functions that like to remove items from the internal
419 SwAttrSet (handle): */
420 sal_uInt16
ClearItemsFromAttrSet( const std::vector
<sal_uInt16
>& rWhichIds
);
422 virtual void SwClientNotify( const SwModify
&, const SfxHint
& rHint
) override
;
426 /** MakeFrame will be called for a certain layout
427 pSib is another SwFrame of the same layout (e.g. the SwRootFrame itself, a sibling, the parent) */
428 virtual SwContentFrame
*MakeFrame( SwFrame
* pSib
) = 0;
430 virtual SwContentNode
*JoinNext();
431 /** Is it possible to join two nodes?
432 In pIdx the second position can be returned. */
433 bool CanJoinNext( SwNodeIndex
* pIdx
= nullptr ) const;
434 bool CanJoinNext( SwPosition
* pIdx
) const;
435 bool CanJoinPrev( SwNodeIndex
* pIdx
=nullptr ) const;
437 bool GoNext(SwContentIndex
*, SwCursorSkipMode nMode
) const;
438 bool GoNext(SwPosition
*, SwCursorSkipMode nMode
) const;
439 bool GoPrevious(SwContentIndex
*, SwCursorSkipMode nMode
) const;
441 /// @see GetFrameOfModify
442 SwContentFrame
*getLayoutFrame( const SwRootFrame
*,
443 const SwPosition
*pPos
= nullptr,
444 std::pair
<Point
, bool> const* pViewPosAndCalcFrame
= nullptr) const;
445 /** @return the real size of the frame or an empty rectangle if
446 no layout exists. Needed for export filters. */
447 SwRect
FindLayoutRect( const bool bPrtArea
= false,
448 const Point
* pPoint
= nullptr ) const;
449 SwRect
FindPageFrameRect() const;
451 /** Method creates all views of document for given node. The content
452 frames that are created are put in the respective layout. */
453 void MakeFramesForAdjacentContentNode(SwContentNode
& rNode
);
455 /** Method deletes all views of document for the node. The content-
456 frames are removed from the respective layout.
458 void DelFrames(SwRootFrame
const* pLayout
);
460 /** @return count of elements of node content. Default is 1.
461 There are differences between text node and formula node. */
462 virtual sal_Int32
Len() const;
464 virtual SwContentNode
* MakeCopy(SwDoc
&, SwNode
& rWhere
, bool bNewFrames
) const = 0;
466 /// Get information from Client.
467 virtual bool GetInfo( SfxPoolItem
& ) const override
;
469 /// SS for PoolItems: hard attributation.
471 /// If bInParent is FALSE search for attribute only in this node.
472 const SfxPoolItem
& GetAttr( sal_uInt16 nWhich
, bool bInParent
=true ) const;
474 const T
& GetAttr( TypedWhichId
<T
> nWhich
, bool bInParent
=true ) const
475 { return static_cast<const T
&>(GetAttr(sal_uInt16(nWhich
), bInParent
)); }
476 bool GetAttr( SfxItemSet
& rSet
) const;
478 virtual bool SetAttr( const SfxPoolItem
& );
479 virtual bool SetAttr( const SfxItemSet
& rSet
);
480 virtual bool ResetAttr( sal_uInt16 nWhich1
, sal_uInt16 nWhich2
= 0 );
481 virtual bool ResetAttr( const std::vector
<sal_uInt16
>& rWhichArr
);
482 virtual sal_uInt16
ResetAllAttr();
484 /// Obtains attribute that is not delivered via conditional style!
485 const SfxPoolItem
* GetNoCondAttr( sal_uInt16 nWhich
, bool bInParents
) const;
487 const T
* GetNoCondAttr( TypedWhichId
<T
> nWhich
, bool bInParents
) const
488 { return static_cast<const T
*>(GetNoCondAttr(sal_uInt16(nWhich
), bInParents
)); }
490 /** Does node has already its own auto-attributes?
491 Access to SwAttrSet. */
492 inline const SwAttrSet
&GetSwAttrSet() const;
493 const SwAttrSet
*GetpSwAttrSet() const { return static_cast<const SwAttrSet
*>(mpAttrSet
.get()); }
494 bool HasSwAttrSet() const { return mpAttrSet
!= nullptr; }
496 virtual SwFormatColl
* ChgFormatColl( SwFormatColl
* );
497 SwFormatColl
* GetFormatColl() const { return const_cast<SwFormatColl
*>(static_cast<const SwFormatColl
*>(GetRegisteredIn())); }
499 inline SwFormatColl
& GetAnyFormatColl() const;
500 void SetCondFormatColl( SwFormatColl
* );
501 inline SwFormatColl
* GetCondFormatColl() const;
503 bool IsAnyCondition( SwCollCondition
& rTmp
) const;
504 void ChkCondColl(const SwTextFormatColl
* pColl
= nullptr);
506 /** Invalidates NumRule at the node. NumRule is updated
507 on EndAction of a Shell at the latest. */
508 bool InvalidateNumRule();
510 /** determines the text direction for a certain
511 position. @return -1, if text direction could *not* be determined. */
512 SvxFrameDirection
GetTextDirection( const SwPosition
& rPos
,
513 const Point
* pPt
) const;
515 void SetModifyAtAttr( bool bSetModifyAtAttr
) const { mbSetModifyAtAttr
= bSetModifyAtAttr
; }
516 bool GetModifyAtAttr() const { return mbSetModifyAtAttr
; }
518 static std::unique_ptr
<SwOLENodes
> CreateOLENodesArray( const SwFormatColl
& rColl
, bool bOnlyWithInvalidSize
);
520 // Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
521 virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr
getSdrAllFillAttributesHelper() const;
523 void UpdateAttr(const SwUpdateAttr
&);
526 SwContentNode( const SwContentNode
& rNode
) = delete;
527 SwContentNode
& operator= ( const SwContentNode
& rNode
) = delete;
532 class SW_DLLPUBLIC SwTableNode final
: public SwStartNode
, public sw::BroadcastingModify
534 friend class SwNodes
;
535 std::unique_ptr
<SwTable
> m_pTable
;
537 virtual ~SwTableNode() override
;
540 SwTableNode( const SwNode
& );
542 const SwTable
& GetTable() const { return *m_pTable
; }
543 SwTable
& GetTable() { return *m_pTable
; }
544 SwTabFrame
*MakeFrame( SwFrame
* );
546 /// Creates the frms for the table node (i.e. the TabFrames).
547 /// pIdxBehind is optional parameter.
548 void MakeOwnFrames(SwPosition
* pIdxBehind
= nullptr);
550 /** Method deletes all views of document for the node.
551 The content frames are removed from the respective layout. */
552 void DelFrames(SwRootFrame
const* pLayout
= nullptr);
554 /** Method creates all views of the document for the previous node.
555 The content frames that are created are put into the respective layout. */
556 void MakeFramesForAdjacentContentNode(const SwNodeIndex
& rIdx
);
558 SwTableNode
* MakeCopy( SwDoc
&, const SwNodeIndex
& ) const;
559 void SetNewTable( std::unique_ptr
<SwTable
> , bool bNewFrames
=true );
561 // Removes redline objects that relate to this table from the 'Extra Redlines' table
562 void RemoveRedlines();
564 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
567 SwTableNode( const SwTableNode
& rNode
) = delete;
568 SwTableNode
& operator= ( const SwTableNode
& rNode
) = delete;
571 /// A section node represents the start of a section on the UI, i.e. the container created using
572 /// Insert -> Section menu item.
573 class SAL_DLLPUBLIC_RTTI SwSectionNode final
576 friend class SwNodes
;
579 SwSectionNode(const SwSectionNode
&) = delete;
580 SwSectionNode
& operator=(const SwSectionNode
&) = delete;
582 std::unique_ptr
<SwSection
> const m_pSection
;
584 virtual ~SwSectionNode() override
;
587 SwSectionNode(const SwNode
& rWhere
,
588 SwSectionFormat
& rFormat
, SwTOXBase
const*const pTOXBase
);
590 const SwSection
& GetSection() const { return *m_pSection
; }
591 SwSection
& GetSection() { return *m_pSection
; }
593 SwFrame
*MakeFrame( SwFrame
* );
595 /** Creates the frms for the SectionNode (i.e. the SectionFrames).
596 On default the frames are created until the end of the range.
597 When another NodeIndex pEnd is passed a MakeFrames is called up to it.
598 Used by TableToText. */
599 void MakeOwnFrames(SwNodeIndex
* pIdxBehind
, SwNodeIndex
* pEnd
= nullptr);
601 /** Method deletes all views of document for the node. The
602 content frames are removed from the respective layout. */
603 void DelFrames(SwRootFrame
const* pLayout
= nullptr, bool bForce
= false);
605 /** Method creates all views of document for the previous node.
606 The content frames created are put into the respective layout. */
607 void MakeFramesForAdjacentContentNode(const SwNodeIndex
& rIdx
);
609 SwSectionNode
* MakeCopy( SwDoc
&, const SwNodeIndex
& ) const;
611 /// Set pointer in format of section on itself.
614 /** Check for not hidden areas whether there is content that is not in
615 a hidden sub-area. */
616 bool IsContentHidden() const;
618 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
622 /** This class is internal, used only during DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
624 Some of the nodes are then replaced with SwPlaceholderNode, and at the end of the operation, removed again.
625 FIXME find out if this is really necessary, and if we can avoid creation of the SwPlaceholderNodes in the first place.
627 class SwPlaceholderNode final
: private SwNode
630 friend class SwNodes
;
631 SwPlaceholderNode(const SwNode
& rWhere
);
634 inline SwEndNode
*SwNode::GetEndNode()
636 return SwNodeType::End
== m_nNodeType
? static_cast<SwEndNode
*>(this) : nullptr;
638 inline const SwEndNode
*SwNode::GetEndNode() const
640 return SwNodeType::End
== m_nNodeType
? static_cast<const SwEndNode
*>(this) : nullptr;
642 inline SwStartNode
*SwNode::GetStartNode()
644 return SwNodeType::Start
& m_nNodeType
? static_cast<SwStartNode
*>(this) : nullptr;
646 inline const SwStartNode
*SwNode::GetStartNode() const
648 return SwNodeType::Start
& m_nNodeType
? static_cast<const SwStartNode
*>(this) : nullptr;
650 inline SwTableNode
*SwNode::GetTableNode()
652 return SwNodeType::Table
== m_nNodeType
? static_cast<SwTableNode
*>(this) : nullptr;
654 inline const SwTableNode
*SwNode::GetTableNode() const
656 return SwNodeType::Table
== m_nNodeType
? static_cast<const SwTableNode
*>(this) : nullptr;
658 inline SwSectionNode
*SwNode::GetSectionNode()
660 return SwNodeType::Section
== m_nNodeType
? static_cast<SwSectionNode
*>(this) : nullptr;
662 inline const SwSectionNode
*SwNode::GetSectionNode() const
664 return SwNodeType::Section
== m_nNodeType
? static_cast<const SwSectionNode
*>(this) : nullptr;
666 inline SwContentNode
*SwNode::GetContentNode()
668 return SwNodeType::ContentMask
& m_nNodeType
? static_cast<SwContentNode
*>(this) : nullptr;
670 inline const SwContentNode
*SwNode::GetContentNode() const
672 return SwNodeType::ContentMask
& m_nNodeType
? static_cast<const SwContentNode
*>(this) : nullptr;
675 inline bool SwNode::IsStartNode() const
677 return bool(SwNodeType::Start
& m_nNodeType
);
679 inline bool SwNode::IsContentNode() const
681 return bool(SwNodeType::ContentMask
& m_nNodeType
);
683 inline bool SwNode::IsEndNode() const
685 return SwNodeType::End
== m_nNodeType
;
687 inline bool SwNode::IsTextNode() const
689 return SwNodeType::Text
== m_nNodeType
;
691 inline bool SwNode::IsTableNode() const
693 return SwNodeType::Table
== m_nNodeType
;
695 inline bool SwNode::IsSectionNode() const
697 return SwNodeType::Section
== m_nNodeType
;
699 inline bool SwNode::IsNoTextNode() const
701 return bool(SwNodeType::NoTextMask
& m_nNodeType
);
703 inline bool SwNode::IsOLENode() const
705 return SwNodeType::Ole
== m_nNodeType
;
707 inline bool SwNode::IsGrfNode() const
709 return SwNodeType::Grf
== m_nNodeType
;
712 inline const SwStartNode
* SwNode::FindSttNodeByType( SwStartNodeType eTyp
) const
714 return const_cast<SwNode
*>(this)->FindSttNodeByType( eTyp
);
716 inline const SwTableNode
* SwNode::FindTableNode() const
718 return const_cast<SwNode
*>(this)->FindTableNode();
720 inline const SwSectionNode
* SwNode::FindSectionNode() const
722 return const_cast<SwNode
*>(this)->FindSectionNode();
724 inline SwNodeOffset
SwNode::StartOfSectionIndex() const
726 return m_pStartOfSection
->GetIndex();
728 inline SwNodeOffset
SwNode::EndOfSectionIndex() const
730 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
731 return pStNd
->m_pEndOfSection
->GetIndex();
733 inline const SwEndNode
* SwNode::EndOfSectionNode() const
735 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
736 return pStNd
->m_pEndOfSection
;
738 inline SwEndNode
* SwNode::EndOfSectionNode()
740 const SwStartNode
* pStNd
= IsStartNode() ? static_cast<const SwStartNode
*>(this) : m_pStartOfSection
;
741 return pStNd
->m_pEndOfSection
;
744 inline SwNodes
& SwNode::GetNodes()
746 return static_cast<SwNodes
&>(GetArray());
748 inline const SwNodes
& SwNode::GetNodes() const
750 return static_cast<SwNodes
&>(GetArray());
753 inline SwFormatColl
* SwContentNode::GetCondFormatColl() const
758 inline SwFormatColl
& SwContentNode::GetAnyFormatColl() const
762 : *const_cast<SwFormatColl
*>(static_cast<const SwFormatColl
*>(GetRegisteredIn()));
765 inline const SwAttrSet
& SwContentNode::GetSwAttrSet() const
767 return mpAttrSet
? *GetpSwAttrSet() : GetAnyFormatColl().GetAttrSet();
770 inline const SfxPoolItem
& SwContentNode::GetAttr( sal_uInt16 nWhich
,
771 bool bInParents
) const
773 return GetSwAttrSet().Get( nWhich
, bInParents
);
776 inline SwPlaceholderNode::SwPlaceholderNode(const SwNode
& rWhere
)
777 : SwNode(rWhere
, SwNodeType::PlaceHolder
)
781 inline SwNode
* SwNodes::operator[]( SwNodeOffset n
) const
783 return static_cast<SwNode
*>(BigPtrArray::operator[] ( sal_Int32(n
) ));
788 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */