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

#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 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)
 Add a child. More...
 
void RemoveChild (SwNumberTreeNode *pChild)
 Remove a child. More...
 
void RemoveMe ()
 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...
 
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)
 set level of this node More...
 
int GetLevelInListTree () const
 Return level of this node. More...
 
void InvalidateTree () const
 Invalidate this node and all its descendants. More...
 
void NotifyInvalidChildren ()
 Notifies all invalid children of this node. More...
 
void InvalidateMe ()
 Notifies the node. More...
 
void ValidateMe ()
 Validates this node. More...
 
void NotifyInvalidSiblings ()
 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 ()
 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...
 

Static Public Member Functions

static void HandleNumberTreeRootNodeDelete (SwNodeNum &rNodeNum)
 

Protected 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
 
- Protected Member Functions inherited from SwNumberTreeNode
SwNumberTreeNodeGetRoot () const
 Returns the root node of the tree this node is part of. More...
 
tSwNumberTreeChildren::size_type GetChildCount () const
 Returns how many children this node has got. More...
 
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...
 
void Notify ()
 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...
 
SwNumberTreeNodeCreatePhantom ()
 Creates a phantom. 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...
 

Private Member Functions

 SwNodeNum (const SwNodeNum &)=delete
 
SwNodeNumoperator= (const SwNodeNum &)=delete
 
virtual bool IsCountPhantoms () const override
 Return if phantoms are counted. More...
 
virtual bool IsNotifiable () 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 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::SwNodeNum ( SwTextNode pTextNode,
bool  isHiddenRedlines 
)
explicit

Definition at line 31 of file SwNodeNum.cxx.

Referenced by Create().

SwNodeNum::SwNodeNum ( SwNumRule pNumRule)
explicit

Definition at line 38 of file SwNodeNum.cxx.

SwNodeNum::~SwNodeNum ( )
overridevirtual

Definition at line 45 of file SwNodeNum.cxx.

SwNodeNum::SwNodeNum ( const SwNodeNum )
privatedelete

Member Function Documentation

void SwNodeNum::ChangeNumRule ( SwNumRule rNumRule)
SwNumberTreeNode * SwNodeNum::Create ( ) const
overrideprotectedvirtual

Creates a new node of the same class.

Returns
the new node

Implements SwNumberTreeNode.

Definition at line 74 of file SwNodeNum.cxx.

References GetNumRule(), and SwNodeNum().

SwNumRule* SwNodeNum::GetNumRule ( ) const
inline
SwPosition SwNodeNum::GetPosition ( ) const

Definition at line 67 of file SwNodeNum.cxx.

References GetTextNode(), and mpTextNode.

Referenced by SwListImpl::InsertListItem().

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

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

#i81002#

Definition at line 356 of file SwNodeNum.cxx.

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

Referenced by MakeRefNumStr().

SwNumberTree::tSwNumTreeNumber SwNodeNum::GetStartValue ( ) const
overridevirtual
SwTextNode* SwNodeNum::GetTextNode ( ) const
inline
void SwNodeNum::HandleNumberTreeRootNodeDelete ( SwNodeNum rNodeNum)
static
bool SwNodeNum::HasCountedChildren ( ) const
overrideprotectedvirtual
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 148 of file SwNodeNum.cxx.

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

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 169 of file SwNodeNum.cxx.

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

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

bool SwNodeNum::IsCountedForNumbering ( ) const
overrideprotectedvirtual
bool SwNodeNum::IsCountPhantoms ( ) const
overrideprivatevirtual

Return if phantoms are counted.

Implements SwNumberTreeNode.

Definition at line 244 of file SwNodeNum.cxx.

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

bool SwNodeNum::IsNotifiable ( ) const
overrideprivatevirtual

Return if this node is notifiable.

Attention:
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 128 of file SwNodeNum.cxx.

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

bool SwNodeNum::IsNotificationEnabled ( ) const
overridevirtual

Return if the notification is not disabled on global conditions.

Return values
trueNotification enabled in general.
falseelse

Implements SwNumberTreeNode.

Definition at line 138 of file SwNodeNum.cxx.

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

bool SwNodeNum::IsRestart ( ) const
overridevirtual

Return if numbering is restarted at this node.

Implements SwNumberTreeNode.

Definition at line 232 of file SwNodeNum.cxx.

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

Referenced by GetStartValue().

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

Returns if this node is less than another node.

Parameters
rTreeNodenode to compare with
Attention:
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 215 of file SwNodeNum.cxx.

References SwNode::GetIndex(), and mpTextNode.

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

void SwNodeNum::NotifyNode ( )
overrideprivatevirtual

Notifies the node.

Called when the number of the node got invalid.

Implements SwNumberTreeNode.

Definition at line 205 of file SwNodeNum.cxx.

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

SwNodeNum& SwNodeNum::operator= ( const SwNodeNum )
privatedelete
void SwNodeNum::PostRemove ( )
overrideprotectedvirtual
void SwNodeNum::PreAdd ( )
overrideprotectedvirtual
void SwNodeNum::UnregisterMeAndChildrenDueToRootDelete ( SwNodeNum rNodeNum)
staticprivate

Member Data Documentation

bool SwNodeNum::m_isHiddenRedlines
private

Definition at line 86 of file SwNodeNum.hxx.

Referenced by PostRemove(), and PreAdd().

SwNumRule* SwNodeNum::mpNumRule
private

Definition at line 85 of file SwNodeNum.hxx.

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

SwTextNode* const SwNodeNum::mpTextNode
private

Definition at line 84 of file SwNodeNum.hxx.

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


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