LibreOffice Module sw (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwNodeNum Class Referencefinal

#include <SwNodeNum.hxx>

Inheritance diagram for SwNodeNum:
[legend]
Collaboration diagram for SwNodeNum:
[legend]

Public Member Functions

 SwNodeNum (SwTextNode *pTextNode, bool isHiddenRedlines)
 
 SwNodeNum (SwNumRule *pNumRule)
 
virtual ~SwNodeNum () override
 
SwNumRuleGetNumRule () const
 
void ChangeNumRule (SwNumRule &rNumRule)
 
SwTextNodeGetTextNode () const
 
virtual bool IsNotificationEnabled (const SwDoc &rDoc) const override
 Return if the notification is not disabled on global conditions. More...
 
virtual bool IsContinuous () const override
 Return if this node is counted continuous. More...
 
virtual bool IsCounted () const override
 Return if this node is counted. More...
 
virtual bool LessThan (const SwNumberTreeNode &rNode) const override
 Returns if this node is less than another node. More...
 
virtual bool IsRestart () const override
 Return if numbering is restarted at this node. More...
 
virtual SwNumberTree::tSwNumTreeNumber GetStartValue () const override
 Return start value. More...
 
SwPosition GetPosition () const
 
const SwNodeNumGetPrecedingNodeNumOf (const SwTextNode &rTextNode) const
 determines the <SwNodeNum> instance, which is preceding the given text node More...
 
- Public Member Functions inherited from SwNumberTreeNode
 SwNumberTreeNode ()
 
virtual ~SwNumberTreeNode ()
 
void AddChild (SwNumberTreeNode *pChild, const int nDepth, const SwDoc &rDoc)
 Add a child. More...
 
void RemoveChild (SwNumberTreeNode *pChild, const SwDoc &rDoc)
 Remove a child. More...
 
void RemoveMe (const SwDoc &rDoc)
 Remove this child from the tree. More...
 
SwNumberTreeNodeGetParent () const
 Returns the parent of this node. More...
 
SwNumberTree::tSwNumTreeNumber GetNumber (bool bValidate=true) const
 Returns number of this node. More...
 
bool IsContinueingPreviousSubTree () const
 
SwNumberTree::tNumberVector GetNumberVector () const
 Returns level numbers of this node. More...
 
virtual bool IsRestart () const =0
 Return if numbering is restarted at this node. More...
 
virtual SwNumberTree::tSwNumTreeNumber GetStartValue () const =0
 Return start value. More...
 
virtual bool IsCounted () const
 Return if this node is counted. More...
 
virtual bool IsContinuous () const =0
 Return if this node is counted continuous. More...
 
bool IsFirst (const SwNumberTreeNode *pNode) const
 Return if a node is first non-phantom child of this node. More...
 
bool IsFirst () const
 Return if this node if the first non-phantom node in the tree. More...
 
bool IsPhantom () const
 Return if this node is a phantom. More...
 
void SetLevelInListTree (const int nLevel, const SwDoc &rDoc)
 set level of this node More...
 
int GetLevelInListTree () const
 Return level of this node. More...
 
virtual bool LessThan (const SwNumberTreeNode &rTreeNode) const
 Returns if this node is less than another node. More...
 
void InvalidateTree () const
 Invalidate this node and all its descendants. More...
 
void NotifyInvalidChildren (const SwDoc &rDoc)
 Notifies all invalid children of this node. More...
 
void InvalidateMe ()
 Notifies the node. More...
 
void ValidateMe ()
 Validates this node. More...
 
void NotifyInvalidSiblings (const SwDoc &rDoc)
 Notifies all invalid siblings of this node. More...
 
void NotifyNodesOnListLevel (const int nListLevel)
 notification of all nodes in the list tree on certain list level More...
 
void InvalidateAndNotifyTree (const SwDoc &rDoc)
 Invalidation and notification of complete numbering tree. More...
 
SwNumberTreeNodeGetPred (bool bSibling=false) const
 Returns the greatest descendant of the root that is smaller than this node, aka the predecessor of this node. More...
 
const SwNumberTreeNodeGetPrecedingNodeOf (const SwNumberTreeNode &rNode) const
 determines the node, which is preceding the node More...
 
void IsSane (bool bRecursive) const
 Sanity check. More...
 
tSwNumberTreeChildren::size_type GetChildCount () const
 Returns how many children this node has got. More...
 

Static Public Member Functions

static void HandleNumberTreeRootNodeDelete (SwNodeNum &rNodeNum)
 

Private Member Functions

virtual SwNumberTreeNodeCreate () const override
 Creates a new node of the same class. More...
 
virtual bool HasCountedChildren () const override
 
virtual bool IsCountedForNumbering () const override
 
virtual void PreAdd () override
 
virtual void PostRemove () override
 
 SwNodeNum (const SwNodeNum &)=delete
 
SwNodeNumoperator= (const SwNodeNum &)=delete
 
virtual bool IsCountPhantoms () const override
 Return if phantoms are counted. More...
 
virtual bool IsNotifiable (const SwDoc &rDoc) const override
 Return if this node is notifiable. More...
 
virtual void NotifyNode () override
 Notifies the node. More...
 

Static Private Member Functions

static void UnregisterMeAndChildrenDueToRootDelete (SwNodeNum &rNodeNum)
 

Private Attributes

SwTextNode *const mpTextNode
 
SwNumRulempNumRule
 
bool m_isHiddenRedlines
 

Additional Inherited Members

- Protected Types inherited from SwNumberTreeNode
typedef std::set< SwNumberTreeNode *, compSwNumberTreeNodeLessThantSwNumberTreeChildren
 
- Protected Member Functions inherited from SwNumberTreeNode
SwNumberTreeNodeGetRoot () const
 Returns the root node of the tree this node is part of. More...
 
virtual bool IsNotificationEnabled (const SwDoc &rDoc) const =0
 Return if the notification is not disabled on global conditions. More...
 
virtual bool HasCountedChildren () const =0
 
virtual bool IsCountedForNumbering () const =0
 
virtual void PreAdd ()=0
 
virtual void PostRemove ()=0
 
void IsSane (bool bRecursive, std::vector< const SwNumberTreeNode * > rParents) const
 Sanity check with loop detection. More...
 
 SwNumberTreeNode (const SwNumberTreeNode &)
 
SwNumberTreeNodeoperator= (const SwNumberTreeNode &)
 
void GetNumberVector_ (SwNumberTree::tNumberVector &rVector, bool bValidate=true) const
 Calls GetNumberVector_ on parent and adds number of this node at the end. More...
 
void Invalidate (SwNumberTreeNode const *pChild)
 Invalidates a child. More...
 
void InvalidateChildren ()
 Invalidation of all children. More...
 
void SetLastValid (const tSwNumberTreeChildren::const_iterator &aItLastValid, bool bValidating=false) const
 Set the last valid child of this node. More...
 
virtual bool IsNotifiable (const SwDoc &rDoc) const =0
 Return if this node is notifiable. More...
 
virtual void NotifyNode ()=0
 Notifies the node. More...
 
void Notify (const SwDoc &rDoc)
 Notifies this node (NotifyNode) and all descendants. More...
 
void NotifyChildrenOnDepth (const int nDepth)
 notification of children nodes on certain depth More...
 
bool IsValid (const SwNumberTreeNode *pChild) const
 Returns if a child A this node is valid. More...
 
bool IsValid () const
 Returns if this node is valid. More...
 
void Validate (const SwNumberTreeNode *pNode) const
 Validates a child. More...
 
void ValidateHierarchical (const SwNumberTreeNode *pNode) const
 Validates a child using hierarchical numbering. More...
 
void ValidateContinuous (const SwNumberTreeNode *pNode) const
 Validates a child using continuous numbering. More...
 
virtual SwNumberTreeNodeCreate () const =0
 Creates a new node of the same class. More...
 
SwNumberTreeNodeCreatePhantom ()
 Creates a phantom. More...
 
virtual bool IsCountPhantoms () const =0
 Return if phantoms are counted. More...
 
bool HasOnlyPhantoms () const
 Return if all descendants of this node are phantoms. More...
 
bool HasPhantomCountedParent () const
 
SwNumberTreeNodeGetFirstNonPhantomChild ()
 HB, OD : return node, if it isn't a phantom, otherwise return first non-phantom descendant. More...
 
void ClearObsoletePhantoms ()
 Removes recursively phantoms that have no children. More...
 
tSwNumberTreeChildren::const_iterator GetIterator (const SwNumberTreeNode *pChild) const
 
void MoveChildren (SwNumberTreeNode *pDest)
 Moves all children to a given destination node. More...
 
void MoveGreaterChildren (SwNumberTreeNode &_rCompareNode, SwNumberTreeNode &_rDestNode)
 Moves all children of this node that are greater than a given node to the destination node. More...
 
SwNumberTreeNodeGetLastDescendant () const
 Returns the last descendant of a node, if it has children. More...
 
- Protected Attributes inherited from SwNumberTreeNode
tSwNumberTreeChildren mChildren
 the children More...
 
SwNumberTreeNodempParent
 he parent node More...
 
SwNumberTree::tSwNumTreeNumber mnNumber
 the number of the node More...
 
bool mbContinueingPreviousSubTree
 
bool mbPhantom
 true this node is a phantom false this node is NOT a phantom More...
 
tSwNumberTreeChildren::const_iterator mItLastValid
 Iterator to the last valid element. More...
 

Detailed Description

Definition at line 29 of file SwNodeNum.hxx.

Constructor & Destructor Documentation

◆ SwNodeNum() [1/3]

SwNodeNum::SwNodeNum ( SwTextNode pTextNode,
bool  isHiddenRedlines 
)
explicit

Definition at line 28 of file SwNodeNum.cxx.

Referenced by Create().

◆ SwNodeNum() [2/3]

SwNodeNum::SwNodeNum ( SwNumRule pNumRule)
explicit

Definition at line 35 of file SwNodeNum.cxx.

◆ ~SwNodeNum()

SwNodeNum::~SwNodeNum ( )
overridevirtual

Definition at line 42 of file SwNodeNum.cxx.

◆ SwNodeNum() [3/3]

SwNodeNum::SwNodeNum ( const SwNodeNum )
privatedelete

Member Function Documentation

◆ ChangeNumRule()

void SwNodeNum::ChangeNumRule ( SwNumRule rNumRule)

◆ Create()

SwNumberTreeNode * SwNodeNum::Create ( ) const
overrideprivatevirtual

Creates a new node of the same class.

Returns
the new node

Implements SwNumberTreeNode.

Definition at line 71 of file SwNodeNum.cxx.

References GetNumRule(), and SwNodeNum().

◆ GetNumRule()

SwNumRule * SwNodeNum::GetNumRule ( ) const
inline

◆ GetPosition()

SwPosition SwNodeNum::GetPosition ( ) const

Definition at line 64 of file SwNodeNum.cxx.

References GetTextNode(), and mpTextNode.

Referenced by SwList::InsertListItem().

◆ GetPrecedingNodeNumOf()

const SwNodeNum * SwNodeNum::GetPrecedingNodeNumOf ( const SwTextNode rTextNode) const

determines the <SwNodeNum> instance, which is preceding the given text node

#i81002#

Definition at line 354 of file SwNodeNum.cxx.

References SwNumberTreeNode::GetPrecedingNodeOf(), and SwNumberTreeNode::GetRoot().

Referenced by MakeRefNumStr().

◆ GetStartValue()

SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStartValue ( ) const
overridevirtual

◆ GetTextNode()

SwTextNode * SwNodeNum::GetTextNode ( ) const
inline

◆ HandleNumberTreeRootNodeDelete()

void SwNodeNum::HandleNumberTreeRootNodeDelete ( SwNodeNum rNodeNum)
static

◆ HasCountedChildren()

bool SwNodeNum::HasCountedChildren ( ) const
overrideprivatevirtual

Implements SwNumberTreeNode.

Definition at line 187 of file SwNodeNum.cxx.

References SwNumberTreeNode::mChildren.

◆ IsContinuous()

bool SwNodeNum::IsContinuous ( ) const
overridevirtual

Return if this node is counted continuous.

Return values
trueThis node is counted continuous.
falseelse

Implements SwNumberTreeNode.

Definition at line 149 of file SwNodeNum.cxx.

References GetNumRule(), SwNumberTreeNode::GetParent(), SwNumberTreeNode::IsContinuous(), SwNumRule::IsContinusNum(), and mpNumRule.

◆ IsCounted()

bool SwNodeNum::IsCounted ( ) const
overridevirtual

Return if this node is counted.

Return values
truethis node is counted
falsethis node is NOT counted

Reimplemented from SwNumberTreeNode.

Definition at line 170 of file SwNodeNum.cxx.

References GetTextNode(), SwNumberTreeNode::IsCounted(), and SwTextNode::IsCountedInList().

Referenced by IsCountedForNumbering(), and SwNumRule::MakeNumString().

◆ IsCountedForNumbering()

bool SwNodeNum::IsCountedForNumbering ( ) const
overrideprivatevirtual

◆ IsCountPhantoms()

bool SwNodeNum::IsCountPhantoms ( ) const
overrideprivatevirtual

Return if phantoms are counted.

Implements SwNumberTreeNode.

Definition at line 245 of file SwNodeNum.cxx.

References SwNumRule::IsContinusNum(), SwNumRule::IsCountPhantoms(), and mpNumRule.

◆ IsNotifiable()

bool SwNodeNum::IsNotifiable ( const SwDoc rDoc) const
overrideprivatevirtual

Return if this node is notifiable.

Attention: \n If a not is not notifiable a notify request is not
forwarded to its descendants.
Return values
trueThis node is notifiable.
falseelse

Implements SwNumberTreeNode.

Definition at line 125 of file SwNodeNum.cxx.

References GetTextNode(), and IsNotificationEnabled().

◆ IsNotificationEnabled()

bool SwNodeNum::IsNotificationEnabled ( const SwDoc rDoc) const
overridevirtual

Return if the notification is not disabled on global conditions.

Return values
trueNotification enabled in general.
falseelse

Implements SwNumberTreeNode.

Definition at line 137 of file SwNodeNum.cxx.

References GetTextNode(), SwDoc::IsInDtor(), and SwDoc::IsInReading().

Referenced by IsNotifiable().

◆ IsRestart()

bool SwNodeNum::IsRestart ( ) const
overridevirtual

Return if numbering is restarted at this node.

Implements SwNumberTreeNode.

Definition at line 233 of file SwNodeNum.cxx.

References GetTextNode(), and SwTextNode::IsListRestart().

Referenced by GetStartValue().

◆ LessThan()

bool SwNodeNum::LessThan ( const SwNumberTreeNode rTreeNode) const
overridevirtual

Returns if this node is less than another node.

Parameters
rTreeNodenode to compare with
Attention: \n A phantom node is considered the least element with
respect to lessThan.
Return values
truethis node is less than rTreeNode
falseelse

Reimplemented from SwNumberTreeNode.

Definition at line 216 of file SwNodeNum.cxx.

References SwNode::GetIndex(), and mpTextNode.

Referenced by sw::DocumentListItemsManager::lessThanNodeNum::operator()().

◆ NotifyNode()

void SwNodeNum::NotifyNode ( )
overrideprivatevirtual

Notifies the node.

Called when the number of the node got invalid.

Implements SwNumberTreeNode.

Definition at line 206 of file SwNodeNum.cxx.

References mpTextNode, SwTextNode::NumRuleChgd(), and SwNumberTreeNode::ValidateMe().

◆ operator=()

SwNodeNum & SwNodeNum::operator= ( const SwNodeNum )
privatedelete

◆ PostRemove()

void SwNodeNum::PostRemove ( )
overrideprivatevirtual

◆ PreAdd()

void SwNodeNum::PreAdd ( )
overrideprivatevirtual

◆ UnregisterMeAndChildrenDueToRootDelete()

void SwNodeNum::UnregisterMeAndChildrenDueToRootDelete ( SwNodeNum rNodeNum)
staticprivate

Member Data Documentation

◆ m_isHiddenRedlines

bool SwNodeNum::m_isHiddenRedlines
private

Definition at line 85 of file SwNodeNum.hxx.

Referenced by PostRemove(), and PreAdd().

◆ mpNumRule

SwNumRule* SwNodeNum::mpNumRule
private

Definition at line 84 of file SwNodeNum.hxx.

Referenced by ChangeNumRule(), IsContinuous(), IsCountPhantoms(), PostRemove(), and PreAdd().

◆ mpTextNode

SwTextNode* const SwNodeNum::mpTextNode
private

Definition at line 83 of file SwNodeNum.hxx.

Referenced by GetPosition(), LessThan(), and NotifyNode().


The documentation for this class was generated from the following files: