Teach symstore more duplicated DLLs
[LibreOffice.git] / sw / inc / node.hxx
blobd12e06d3e95071112e2b18475787502679e9595c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 #include "swdllapi.h"
26 #include "ndarr.hxx"
27 #include "ndtyp.hxx"
28 #include "index.hxx"
29 #include "fmtcol.hxx"
31 #include <memory>
32 #include <vector>
34 class SwContentFrame;
35 class SwContentNode;
36 class SwDoc;
37 class SwEndNode;
38 class SwFrame;
39 class SwFrameFormat;
40 class SwGrfNode;
41 class SwNoTextNode;
42 class SwNodeIndex;
43 class SwOLENode;
44 class SwRect;
45 class SwSection;
46 class SwSectionFormat;
47 class SwTOXBase;
48 class SwSectionNode;
49 class SwStartNode;
50 class SwTabFrame;
51 class SwRootFrame;
52 class SwTable;
53 class SwTableNode;
54 class SwTableBox;
55 class SwTextNode;
56 class SwPageDesc;
57 class SwViewShell;
58 struct SwPosition;
59 class IStyleAccess;
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;
69 class Point;
70 enum class SvxFrameDirection;
71 typedef std::vector<SwOLENode*> SwOLENodes; // docary.hxx
73 namespace drawinglayer { namespace 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
80 : private BigPtrEntry
82 friend class SwNodes;
84 SwNodeType const 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
90 public:
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; }
98 private:
99 Merge m_eMerge;
101 #ifdef DBG_UTIL
102 static long s_nSerial;
103 long const m_nSerial;
104 #endif
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;
111 protected:
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 );
119 public:
120 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
121 from subclasses */
122 virtual ~SwNode() override = 0;
124 #ifdef DBG_UTIL
125 long GetSerial() const { return m_nSerial; }
126 #endif
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
179 @retval false else
181 bool IsInRedlines() const;
183 /** Search table node, in which it is. If it is in no table
184 @return 0. */
185 SwTableNode *FindTableNode();
186 inline const SwTableNode *FindTableNode() const;
188 /** Search section node, in which it is. If it is in no section
189 @return 0. */
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;
210 inline SwDoc* GetDoc();
211 inline const SwDoc* GetDoc() const;
213 /** Provides access to the document setting interface
215 const IDocumentSettingAccess* getIDocumentSettingAccess() const;
217 /** Provides access to the document device interface
219 const IDocumentDeviceAccess& getIDocumentDeviceAccess() const;
221 /** Provides access to the document bookmark interface
223 const IDocumentMarkAccess* getIDocumentMarkAccess() const;
225 /** Provides access to the document redline interface
227 const IDocumentRedlineAccess& getIDocumentRedlineAccess() const;
229 /** Provides access to the document style pool interface
231 const IDocumentStylePoolAccess& getIDocumentStylePoolAccess() const;
233 /** Provides access to the document draw model interface
235 const IDocumentDrawModelAccess& getIDocumentDrawModelAccess() const;
237 /** Provides access to the document layout interface
239 const IDocumentLayoutAccess& getIDocumentLayoutAccess() const;
240 IDocumentLayoutAccess& getIDocumentLayoutAccess();
242 /** Provides access to the document links administration interface
244 const IDocumentLinksAdministration& getIDocumentLinksAdministration() const;
245 IDocumentLinksAdministration& getIDocumentLinksAdministration();
247 /** Provides access to the document fields administration interface
249 const IDocumentFieldsAccess& getIDocumentFieldsAccess() const;
250 IDocumentFieldsAccess& getIDocumentFieldsAccess();
252 /** Provides access to the document content operations interface
254 IDocumentContentOperations& getIDocumentContentOperations();
256 /** Provides access to the document automatic styles interface
258 IStyleAccess& getIDocumentStyleAccess();
260 /** Provides access to the document's numbered items interface */
261 IDocumentListItems& getIDocumentListItems();
263 /// Is node in the visible area of the Shell?
264 bool IsInVisibleArea( SwViewShell const * pSh ) const;
265 /// Is node in a protected area?
266 bool IsInProtectSect() const;
267 /** Is node in something that is protected (range, frame,
268 table cells ... including anchor in case of frames or footnotes)? */
269 bool IsProtect() const;
271 /** Search PageDesc with which this node is formatted. If layout is existent
272 search over layout, else only the hard way is left: search over the nodes
273 to the front!! */
274 const SwPageDesc* FindPageDesc( size_t* pPgDescNdIdx = nullptr ) const;
276 /// If node is in a fly return the respective format.
277 SwFrameFormat* GetFlyFormat() const;
279 /// If node is in a table return the respective table box.
280 SwTableBox* GetTableBox() const;
282 sal_uLong GetIndex() const { return GetPos(); }
284 const SwTextNode* FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const* pLayout = nullptr) const;
286 sal_uInt8 HasPrevNextLayNode() const;
288 std::vector<SwFrameFormat *> const* GetAnchoredFlys() const { return m_pAnchoredFlys.get(); }
289 void AddAnchoredFly(SwFrameFormat *);
290 void RemoveAnchoredFly(SwFrameFormat *);
293 * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
295 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
297 private:
298 SwNode( const SwNode & rNodes ) = delete;
299 SwNode & operator= ( const SwNode & rNodes ) = delete;
302 /// Starts a section of nodes in the document model.
303 class SAL_DLLPUBLIC_RTTI SwStartNode: public SwNode
305 friend class SwNode;
306 friend class SwNodes;
307 friend class SwEndNode; ///< to set the theEndOfSection !!
309 SwEndNode* m_pEndOfSection;
310 SwStartNodeType const m_eStartNodeType;
312 /// for the initial StartNode
313 SwStartNode( SwNodes& rNodes, sal_uLong nPos );
315 protected:
316 SwStartNode( const SwNodeIndex &rWhere,
317 const SwNodeType nNodeType = SwNodeType::Start,
318 SwStartNodeType = SwNormalStartNode );
319 public:
320 SwStartNodeType GetStartNodeType() const { return m_eStartNodeType; }
322 /// Call ChkCondcoll to all ContentNodes of section.
323 void CheckSectionCondColl() const;
325 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
327 private:
328 SwStartNode( const SwStartNode & rNode ) = delete;
329 SwStartNode & operator= ( const SwStartNode & rNode ) = delete;
332 /// Ends a section of nodes in the document model.
333 class SwEndNode : public SwNode
335 friend class SwNodes;
336 friend class SwTableNode; ///< To enable creation of its EndNote.
337 friend class SwSectionNode; ///< To enable creation of its EndNote.
339 /// for the initial StartNode
340 SwEndNode( SwNodes& rNodes, sal_uLong nPos, SwStartNode& rSttNd );
342 protected:
343 SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd );
345 private:
346 SwEndNode( const SwEndNode & rNode ) = delete;
347 SwEndNode & operator= ( const SwEndNode & rNode ) = delete;
350 // SwContentNode
352 class SW_DLLPUBLIC SwContentNode: public sw::BroadcastingModify, public SwNode, public SwIndexReg
355 sw::WriterMultiListener m_aCondCollListener;
356 SwFormatColl* m_pCondColl;
357 mutable bool mbSetModifyAtAttr;
359 protected:
360 SwContentNode( const SwNodeIndex &rWhere, const SwNodeType nNodeType,
361 SwFormatColl *pFormatColl );
362 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
363 from subclasses */
364 virtual ~SwContentNode() override = 0;
366 /** Attribute-set for all auto attributes of a ContentNode.
367 (e.g. TextNode or NoTextNode). */
368 std::shared_ptr<const SfxItemSet> mpAttrSet;
370 /// Make respective nodes create the specific AttrSets.
371 virtual void NewAttrSet( SwAttrPool& ) = 0;
373 /** There some functions that like to remove items from the internal
374 SwAttrSet (handle): */
375 sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
377 virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) override;
379 public:
381 /** MakeFrame will be called for a certain layout
382 pSib is another SwFrame of the same layout (e.g. the SwRootFrame itself, a sibling, the parent) */
383 virtual SwContentFrame *MakeFrame( SwFrame* pSib ) = 0;
385 virtual SwContentNode *JoinNext();
386 /** Is it possible to join two nodes?
387 In pIdx the second position can be returned. */
388 bool CanJoinNext( SwNodeIndex* pIdx =nullptr ) const;
389 bool CanJoinPrev( SwNodeIndex* pIdx =nullptr ) const;
391 void MakeStartIndex( SwIndex * pIdx ) { pIdx->Assign( this, 0 ); }
392 void MakeEndIndex( SwIndex * pIdx ) { pIdx->Assign( this, Len() ); }
394 bool GoNext(SwIndex *, sal_uInt16 nMode ) const;
395 bool GoPrevious(SwIndex *, sal_uInt16 nMode ) const;
397 /// @see GetFrameOfModify
398 SwContentFrame *getLayoutFrame( const SwRootFrame*,
399 const SwPosition *pPos = nullptr,
400 std::pair<Point, bool> const* pViewPosAndCalcFrame = nullptr) const;
401 /** @return the real size of the frame or an empty rectangle if
402 no layout exists. Needed for export filters. */
403 SwRect FindLayoutRect( const bool bPrtArea = false,
404 const Point* pPoint = nullptr ) const;
405 SwRect FindPageFrameRect() const;
407 /** Method creates all views of document for given node. The content
408 frames that are created are put in the respective layout. */
409 void MakeFramesForAdjacentContentNode(SwContentNode& rNode);
411 /** Method deletes all views of document for the node. The content-
412 frames are removed from the respective layout.
414 void DelFrames(SwRootFrame const* pLayout);
416 /** @return count of elements of node content. Default is 1.
417 There are differences between text node and formula node. */
418 virtual sal_Int32 Len() const;
420 virtual SwContentNode* MakeCopy(SwDoc*, const SwNodeIndex&, bool bNewFrames) const = 0;
422 /// Get information from Client.
423 virtual bool GetInfo( SfxPoolItem& ) const override;
425 /// SS for PoolItems: hard attributation.
427 /// If bInParent is FALSE search for attribute only in this node.
428 const SfxPoolItem& GetAttr( sal_uInt16 nWhich, bool bInParent=true ) const;
429 bool GetAttr( SfxItemSet& rSet ) const;
430 /// made virtual
431 virtual bool SetAttr( const SfxPoolItem& );
432 virtual bool SetAttr( const SfxItemSet& rSet );
433 virtual bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
434 virtual bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
435 virtual sal_uInt16 ResetAllAttr();
437 /// Obtains attribute that is not delivered via conditional style!
438 const SfxPoolItem* GetNoCondAttr( sal_uInt16 nWhich, bool bInParents ) const;
440 /** Does node has already its own auto-attributes?
441 Access to SwAttrSet. */
442 inline const SwAttrSet &GetSwAttrSet() const;
443 const SwAttrSet *GetpSwAttrSet() const { return static_cast<const SwAttrSet*>(mpAttrSet.get()); }
444 bool HasSwAttrSet() const { return mpAttrSet != nullptr; }
446 virtual SwFormatColl* ChgFormatColl( SwFormatColl* );
447 SwFormatColl* GetFormatColl() const { return const_cast<SwFormatColl*>(static_cast<const SwFormatColl*>(GetRegisteredIn())); }
449 //FEATURE::CONDCOLL
450 inline SwFormatColl& GetAnyFormatColl() const;
451 void SetCondFormatColl( SwFormatColl* );
452 inline SwFormatColl* GetCondFormatColl() const;
454 bool IsAnyCondition( SwCollCondition& rTmp ) const;
455 void ChkCondColl();
456 //FEATURE::CONDCOLL
458 /** Invalidates NumRule at the node. NumRule is updated
459 on EndAction of a Shell at the latest. */
460 bool InvalidateNumRule();
462 /** determines the text direction for a certain
463 position. @return -1, if text direction could *not* be determined. */
464 SvxFrameDirection GetTextDirection( const SwPosition& rPos,
465 const Point* pPt ) const;
467 void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
468 bool GetModifyAtAttr() const { return mbSetModifyAtAttr; }
470 static std::unique_ptr<SwOLENodes> CreateOLENodesArray( const SwFormatColl& rColl, bool bOnlyWithInvalidSize );
472 // Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
473 virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
475 virtual void ModifyNotification(const SfxPoolItem* pOld, const SfxPoolItem* pNew) override
477 SwClientNotify(*this, sw::LegacyModifyHint(pOld, pNew));
480 private:
481 SwContentNode( const SwContentNode & rNode ) = delete;
482 SwContentNode & operator= ( const SwContentNode & rNode ) = delete;
485 // SwTableNode
487 class SW_DLLPUBLIC SwTableNode : public SwStartNode, public sw::BroadcastingModify
489 friend class SwNodes;
490 std::unique_ptr<SwTable> m_pTable;
491 protected:
492 virtual ~SwTableNode() override;
494 public:
495 SwTableNode( const SwNodeIndex & );
497 const SwTable& GetTable() const { return *m_pTable; }
498 SwTable& GetTable() { return *m_pTable; }
499 SwTabFrame *MakeFrame( SwFrame* );
501 /// Creates the frms for the table node (i.e. the TabFrames).
502 void MakeOwnFrames(SwNodeIndex* pIdxBehind);
504 /** Method deletes all views of document for the node.
505 The content frames are removed from the respective layout. */
506 void DelFrames(SwRootFrame const* pLayout = nullptr);
508 /** Method creates all views of the document for the previous node.
509 The content frames that are created are put into the respective layout. */
510 void MakeFramesForAdjacentContentNode(const SwNodeIndex & rIdx);
512 SwTableNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
513 void SetNewTable( std::unique_ptr<SwTable> , bool bNewFrames=true );
515 // Removes redline objects that relate to this table from the 'Extra Redlines' table
516 void RemoveRedlines();
518 private:
519 SwTableNode( const SwTableNode & rNode ) = delete;
520 SwTableNode & operator= ( const SwTableNode & rNode ) = delete;
523 class SAL_DLLPUBLIC_RTTI SwSectionNode
524 : public SwStartNode
526 friend class SwNodes;
528 private:
529 SwSectionNode(const SwSectionNode&) = delete;
530 SwSectionNode& operator=(const SwSectionNode&) = delete;
532 std::unique_ptr<SwSection> const m_pSection;
534 protected:
535 virtual ~SwSectionNode() override;
537 public:
538 SwSectionNode(SwNodeIndex const&,
539 SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase);
541 const SwSection& GetSection() const { return *m_pSection; }
542 SwSection& GetSection() { return *m_pSection; }
544 SwFrame *MakeFrame( SwFrame* );
546 /** Creates the frms for the SectionNode (i.e. the SectionFrames).
547 On default the frames are created until the end of the range.
548 When another NodeIndex pEnd is passed a MakeFrames is called up to it.
549 Used by TableToText. */
550 void MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = nullptr);
552 /** Method deletes all views of document for the node. The
553 content frames are removed from the respective layout. */
554 void DelFrames(SwRootFrame const* pLayout = nullptr, bool bForce = false);
556 /** Method creates all views of document for the previous node.
557 The content frames created are put into the respective layout. */
558 void MakeFramesForAdjacentContentNode(const SwNodeIndex & rIdx);
560 SwSectionNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const;
562 /// Set pointer in format of section on itself.
563 void NodesArrChgd();
565 /** Check for not hidden areas whether there is content that is not in
566 a hidden sub-area. */
567 bool IsContentHidden() const;
571 /** This class is internal, used only during DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
573 Some of the nodes are then replaced with SwPlaceholderNode, and at the end of the operation, removed again.
574 FIXME find out if this is really necessary, and if we can avoid creation of the SwPlaceholderNodes in the first place.
576 class SwPlaceholderNode final : private SwNode
578 private:
579 friend class SwNodes;
580 SwPlaceholderNode(const SwNodeIndex &rWhere);
583 inline SwEndNode *SwNode::GetEndNode()
585 return SwNodeType::End == m_nNodeType ? static_cast<SwEndNode*>(this) : nullptr;
587 inline const SwEndNode *SwNode::GetEndNode() const
589 return SwNodeType::End == m_nNodeType ? static_cast<const SwEndNode*>(this) : nullptr;
591 inline SwStartNode *SwNode::GetStartNode()
593 return SwNodeType::Start & m_nNodeType ? static_cast<SwStartNode*>(this) : nullptr;
595 inline const SwStartNode *SwNode::GetStartNode() const
597 return SwNodeType::Start & m_nNodeType ? static_cast<const SwStartNode*>(this) : nullptr;
599 inline SwTableNode *SwNode::GetTableNode()
601 return SwNodeType::Table == m_nNodeType ? static_cast<SwTableNode*>(this) : nullptr;
603 inline const SwTableNode *SwNode::GetTableNode() const
605 return SwNodeType::Table == m_nNodeType ? static_cast<const SwTableNode*>(this) : nullptr;
607 inline SwSectionNode *SwNode::GetSectionNode()
609 return SwNodeType::Section == m_nNodeType ? static_cast<SwSectionNode*>(this) : nullptr;
611 inline const SwSectionNode *SwNode::GetSectionNode() const
613 return SwNodeType::Section == m_nNodeType ? static_cast<const SwSectionNode*>(this) : nullptr;
615 inline SwContentNode *SwNode::GetContentNode()
617 return SwNodeType::ContentMask & m_nNodeType ? static_cast<SwContentNode*>(this) : nullptr;
619 inline const SwContentNode *SwNode::GetContentNode() const
621 return SwNodeType::ContentMask & m_nNodeType ? static_cast<const SwContentNode*>(this) : nullptr;
624 inline bool SwNode::IsStartNode() const
626 return bool(SwNodeType::Start & m_nNodeType);
628 inline bool SwNode::IsContentNode() const
630 return bool(SwNodeType::ContentMask & m_nNodeType);
632 inline bool SwNode::IsEndNode() const
634 return SwNodeType::End == m_nNodeType;
636 inline bool SwNode::IsTextNode() const
638 return SwNodeType::Text == m_nNodeType;
640 inline bool SwNode::IsTableNode() const
642 return SwNodeType::Table == m_nNodeType;
644 inline bool SwNode::IsSectionNode() const
646 return SwNodeType::Section == m_nNodeType;
648 inline bool SwNode::IsNoTextNode() const
650 return bool(SwNodeType::NoTextMask & m_nNodeType);
652 inline bool SwNode::IsOLENode() const
654 return SwNodeType::Ole == m_nNodeType;
656 inline bool SwNode::IsGrfNode() const
658 return SwNodeType::Grf == m_nNodeType;
661 inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const
663 return const_cast<SwNode*>(this)->FindSttNodeByType( eTyp );
665 inline const SwTableNode* SwNode::FindTableNode() const
667 return const_cast<SwNode*>(this)->FindTableNode();
669 inline const SwSectionNode* SwNode::FindSectionNode() const
671 return const_cast<SwNode*>(this)->FindSectionNode();
673 inline sal_uLong SwNode::StartOfSectionIndex() const
675 return m_pStartOfSection->GetIndex();
677 inline sal_uLong SwNode::EndOfSectionIndex() const
679 const SwStartNode* pStNd = IsStartNode() ? static_cast<const SwStartNode*>(this) : m_pStartOfSection;
680 return pStNd->m_pEndOfSection->GetIndex();
682 inline const SwEndNode* SwNode::EndOfSectionNode() const
684 const SwStartNode* pStNd = IsStartNode() ? static_cast<const SwStartNode*>(this) : m_pStartOfSection;
685 return pStNd->m_pEndOfSection;
687 inline SwEndNode* SwNode::EndOfSectionNode()
689 const SwStartNode* pStNd = IsStartNode() ? static_cast<const SwStartNode*>(this) : m_pStartOfSection;
690 return pStNd->m_pEndOfSection;
693 inline SwNodes& SwNode::GetNodes()
695 return static_cast<SwNodes&>(GetArray());
697 inline const SwNodes& SwNode::GetNodes() const
699 return static_cast<SwNodes&>(GetArray());
702 inline SwDoc* SwNode::GetDoc()
704 return GetNodes().GetDoc();
706 inline const SwDoc* SwNode::GetDoc() const
708 return GetNodes().GetDoc();
711 inline SwFormatColl* SwContentNode::GetCondFormatColl() const
713 return m_pCondColl;
716 inline SwFormatColl& SwContentNode::GetAnyFormatColl() const
718 return m_pCondColl
719 ? *m_pCondColl
720 : *const_cast<SwFormatColl*>(static_cast<const SwFormatColl*>(GetRegisteredIn()));
723 inline const SwAttrSet& SwContentNode::GetSwAttrSet() const
725 return mpAttrSet ? *GetpSwAttrSet() : GetAnyFormatColl().GetAttrSet();
728 //FEATURE::CONDCOLL
730 inline const SfxPoolItem& SwContentNode::GetAttr( sal_uInt16 nWhich,
731 bool bInParents ) const
733 return GetSwAttrSet().Get( nWhich, bInParents );
736 inline SwPlaceholderNode::SwPlaceholderNode(const SwNodeIndex &rWhere)
737 : SwNode(rWhere, SwNodeType::PlaceHolder)
741 inline SwNodePtr SwNodes::operator[]( sal_uLong n ) const
743 return static_cast<SwNodePtr>(BigPtrArray::operator[] ( n ));
746 #endif
748 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */