LibreOffice Module sw (master) 1
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
SwNumberTreeNode Class Referenceabstract

A tree of numbered nodes. More...

#include <SwNumberTree.hxx>

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

Public Member Functions

 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...
 

Protected Types

typedef std::set< SwNumberTreeNode *, compSwNumberTreeNodeLessThantSwNumberTreeChildren
 

Protected Member Functions

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

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

A tree of numbered nodes.

Simple example:

1. kshdkjfs
  1.1. lskjf
2. sdfjlksaf
3. fkaoslk
  3.1. lfjlaskf
  3.2. jaslkjflsf
    3.2.1. hkljhkjhk

+ R
  + 1 kshdkjfs
  | + 1 lskjf
  + 2 sdfjlksaf
  + 3 fkaoslk
    + 1 lfjlaskf
    + 2 jaslkjflsf
      + 1 hkljhkjhk

The root contains the nodes of the first level. Each node A of the first level contains those nodes of the second level that have the same first level number as A and so on for the subsidiary levels.

The numbering label of a node A is resolved by concatenating the numbers of the nodes on the path from the root to A.


Phantoms

A phantom is an auxiliary node that is used to emulate numberings starting with nodes not at top level. The phantom contains the number for the level but is not considered part of the numbering.

Constraint 1: A phantom is always the first child node. Constraint 2: At each node there is at most one child that is a phantom. Constraint 3: A phantom is the smallest of all numbering nodes.

Uncounted Phantoms

0.1. dljflskjlasf

  1. abcdagaha 5.1.

Counted Phantoms

5.1. lgkjjgklg

  1. lkjfalskjflsaf 6.1. ljdflaksjflkjasflkjsf

The phantom gets numbered with the start value.

Definition at line 113 of file SwNumberTree.hxx.

Member Typedef Documentation

◆ tSwNumberTreeChildren

Definition at line 116 of file SwNumberTree.hxx.

Constructor & Destructor Documentation

◆ SwNumberTreeNode() [1/2]

SwNumberTreeNode::SwNumberTreeNode ( )

Definition at line 30 of file SwNumberTree.cxx.

References mChildren, mItLastValid, and mpParent.

◆ ~SwNumberTreeNode()

SwNumberTreeNode::~SwNumberTreeNode ( )
virtual

◆ SwNumberTreeNode() [2/2]

SwNumberTreeNode::SwNumberTreeNode ( const SwNumberTreeNode )
protected

Member Function Documentation

◆ AddChild()

void SwNumberTreeNode::AddChild ( SwNumberTreeNode pChild,
const int  nDepth,
const SwDoc rDoc 
)

◆ ClearObsoletePhantoms()

void SwNumberTreeNode::ClearObsoletePhantoms ( )
protected

Removes recursively phantoms that have no children.

The resulting tree has no phantoms that either have no children or whose descendancy consist entirely of phantoms.

Definition at line 104 of file SwNumberTree.cxx.

References mChildren, and SetLastValid().

Referenced by AddChild(), and RemoveMe().

◆ Create()

virtual SwNumberTreeNode * SwNumberTreeNode::Create ( ) const
protectedpure virtual

Creates a new node of the same class.

Returns
the new node

Implemented in SwNodeNum.

Referenced by CreatePhantom().

◆ CreatePhantom()

SwNumberTreeNode * SwNumberTreeNode::CreatePhantom ( )
protected

Creates a phantom.

Returns
the created phantom

Definition at line 63 of file SwNumberTree.cxx.

References Create(), mbPhantom, mChildren, and mpParent.

Referenced by AddChild(), MoveChildren(), and RemoveChild().

◆ GetChildCount()

SwNumberTreeNode::tSwNumberTreeChildren::size_type SwNumberTreeNode::GetChildCount ( ) const

Returns how many children this node has got.

Returns
number of children

Definition at line 829 of file SwNumberTree.cxx.

References mChildren.

Referenced by AddChild(), GetPrecedingNodeOf(), HasOnlyPhantoms(), SwNodeNum::UnregisterMeAndChildrenDueToRootDelete(), ValidateHierarchical(), and ~SwNumberTreeNode().

◆ GetFirstNonPhantomChild()

SwNumberTreeNode * SwNumberTreeNode::GetFirstNonPhantomChild ( )
protected

HB, OD : return node, if it isn't a phantom, otherwise return first non-phantom descendant.

Returns the first child of this node that is NOT a phantom.

Returns
the first non phantom child

Definition at line 307 of file SwNumberTree.cxx.

References GetFirstNonPhantomChild(), IsPhantom(), and mChildren.

Referenced by GetFirstNonPhantomChild().

◆ GetIterator()

SwNumberTreeNode::tSwNumberTreeChildren::const_iterator SwNumberTreeNode::GetIterator ( const SwNumberTreeNode pChild) const
protected

◆ GetLastDescendant()

SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant ( ) const
protected

Returns the last descendant of a node, if it has children.

Returns
last descendant of the node

Definition at line 914 of file SwNumberTree.cxx.

References GetLastDescendant(), and mChildren.

Referenced by GetLastDescendant(), and GetPred().

◆ GetLevelInListTree()

int SwNumberTreeNode::GetLevelInListTree ( ) const

Return level of this node.

The level of this node is the length of the path from the root to this node.

Returns
the level of this node

Definition at line 820 of file SwNumberTree.cxx.

References GetLevelInListTree(), and mpParent.

Referenced by SwTextNode::GetActualListLevel(), GetLevelInListTree(), SwNodeNum::GetStartValue(), SwNumRule::MakeRefNumString(), and SetLevelInListTree().

◆ GetNumber()

SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::GetNumber ( bool  bValidate = true) const

Returns number of this node.

Parameters
bValidatevalidate the number?
Returns
number of this node

Definition at line 666 of file SwNumberTree.cxx.

References mnNumber, mpParent, and Validate().

Referenced by GetNumberVector_(), SwEditShell::SetNumberingRestart(), and ValidateContinuous().

◆ GetNumberVector()

SwNumberTree::tNumberVector SwNumberTreeNode::GetNumberVector ( ) const

Returns level numbers of this node.

Returns
level numbers of this node

Definition at line 676 of file SwNumberTree.cxx.

References GetNumberVector_().

Referenced by lcl_FindOutlineNum(), SwNumRule::MakeNumString(), MakeRefNumStr(), and SwNumRule::MakeRefNumString().

◆ GetNumberVector_()

void SwNumberTreeNode::GetNumberVector_ ( SwNumberTree::tNumberVector rVector,
bool  bValidate = true 
) const
protected

Calls GetNumberVector_ on parent and adds number of this node at the end.

Parameters
rVectorreturn value
bValidatevalidate the number?

Definition at line 297 of file SwNumberTree.cxx.

References GetNumber(), GetNumberVector_(), and mpParent.

Referenced by GetNumberVector(), and GetNumberVector_().

◆ GetParent()

SwNumberTreeNode * SwNumberTreeNode::GetParent ( ) const
inline

◆ GetPrecedingNodeOf()

const SwNumberTreeNode * SwNumberTreeNode::GetPrecedingNodeOf ( const SwNumberTreeNode rNode) const

determines the node, which is preceding the node

#i81002# The search for the preceding node is performed for the tree below the <this> node. To search the complete tree, the method has been called for the root of the tree.

Definition at line 1119 of file SwNumberTree.cxx.

References GetChildCount(), GetPrecedingNodeOf(), GetRoot(), LessThan(), and mChildren.

Referenced by SwNodeNum::GetPrecedingNodeNumOf(), and GetPrecedingNodeOf().

◆ GetPred()

SwNumberTreeNode * SwNumberTreeNode::GetPred ( bool  bSibling = false) const

Returns the greatest descendant of the root that is smaller than this node, aka the predecessor of this node.

Returns
the predecessor

Definition at line 935 of file SwNumberTree.cxx.

References GetIterator(), GetLastDescendant(), GetParent(), mChildren, and mpParent.

Referenced by SwTaggedPDFHelper::BeginNumberedListStructureElements(), and ValidateContinuous().

◆ GetRoot()

SwNumberTreeNode * SwNumberTreeNode::GetRoot ( ) const
protected

Returns the root node of the tree this node is part of.

Important note: method call <GetRoot()->GetRoot()> returns NULL.

Returns
the root

Definition at line 93 of file SwNumberTree.cxx.

References mpParent.

Referenced by SwNodeNum::GetPrecedingNodeNumOf(), GetPrecedingNodeOf(), SwNodeNum::HandleNumberTreeRootNodeDelete(), HasPhantomCountedParent(), NotifyNodesOnListLevel(), and SetLevelInListTree().

◆ GetStartValue()

virtual SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::GetStartValue ( ) const
pure virtual

Return start value.

Returns
start value

Implemented in SwNodeNum.

Referenced by ValidateContinuous().

◆ HasCountedChildren()

virtual bool SwNumberTreeNode::HasCountedChildren ( ) const
protectedpure virtual

Implemented in SwNodeNum.

Referenced by IsCounted().

◆ HasOnlyPhantoms()

bool SwNumberTreeNode::HasOnlyPhantoms ( ) const
protected

Return if all descendants of this node are phantoms.

Definition at line 701 of file SwNumberTree.cxx.

References GetChildCount(), and mChildren.

Referenced by RemoveMe(), and ~SwNumberTreeNode().

◆ HasPhantomCountedParent()

bool SwNumberTreeNode::HasPhantomCountedParent ( ) const
protected

◆ Invalidate()

void SwNumberTreeNode::Invalidate ( SwNumberTreeNode const *  pChild)
protected

Invalidates a child.

Calls SetLastValid for the preceding sibling of the child and notifies all invalid children.

Parameters
pChildthe child to invalidate

Definition at line 1033 of file SwNumberTree.cxx.

References GetIterator(), IsValid(), mChildren, and SetLastValid().

Referenced by InvalidateMe().

◆ InvalidateAndNotifyTree()

void SwNumberTreeNode::InvalidateAndNotifyTree ( const SwDoc rDoc)
inline

Invalidation and notification of complete numbering tree.

#i64010# Usage: on <IsCounted()> state change it's needed to invalidate the complete numbering tree due to wide influence of this change.

Definition at line 293 of file SwNumberTree.hxx.

◆ InvalidateChildren()

void SwNumberTreeNode::InvalidateChildren ( )
inlineprotected

Invalidation of all children.

Usage: on <IsCounted()> state change the children have to be invalidated

Definition at line 433 of file SwNumberTree.hxx.

Referenced by SetLastValid().

◆ InvalidateMe()

void SwNumberTreeNode::InvalidateMe ( )

Notifies the node.

Calls Invalidate(this) on parent.

Definition at line 1049 of file SwNumberTree.cxx.

References Invalidate(), and mpParent.

Referenced by AddChild().

◆ InvalidateTree()

void SwNumberTreeNode::InvalidateTree ( ) const

Invalidate this node and all its descendants.

All iterators holding the last valid node in the according list of children are set to the end of this list, thereby stating all children in the list are invalid. #i83479# - made public

Definition at line 1024 of file SwNumberTree.cxx.

References mChildren, and mItLastValid.

◆ IsContinueingPreviousSubTree()

bool SwNumberTreeNode::IsContinueingPreviousSubTree ( ) const
inline

Definition at line 159 of file SwNumberTree.hxx.

Referenced by SwUnoCursorHelper::getCursorPropertyValue().

◆ IsContinuous()

virtual bool SwNumberTreeNode::IsContinuous ( ) const
pure virtual

Return if this node is counted continuous.

Return values
trueThis node is counted continuous.
falseelse

Implemented in SwNodeNum.

Referenced by SwNodeNum::IsContinuous(), NotifyInvalidChildren(), SetLastValid(), and Validate().

◆ IsCounted()

bool SwNumberTreeNode::IsCounted ( ) const
virtual

Return if this node is counted.

Return values
truethis node is counted
falsethis node is NOT counted

Reimplemented in SwNodeNum.

Definition at line 717 of file SwNumberTree.cxx.

References HasCountedChildren(), IsCountPhantoms(), and IsPhantom().

Referenced by AddChild(), SwTaggedPDFHelper::BeginNumberedListStructureElements(), HasPhantomCountedParent(), SwNodeNum::IsCounted(), NotifyInvalidChildren(), SetLastValid(), and ValidateHierarchical().

◆ IsCountedForNumbering()

virtual bool SwNumberTreeNode::IsCountedForNumbering ( ) const
protectedpure virtual

Implemented in SwNodeNum.

◆ IsCountPhantoms()

virtual bool SwNumberTreeNode::IsCountPhantoms ( ) const
protectedpure virtual

Return if phantoms are counted.

Implemented in SwNodeNum.

Referenced by IsCounted().

◆ IsFirst() [1/2]

bool SwNumberTreeNode::IsFirst ( ) const

Return if this node if the first non-phantom node in the tree.

Return values
truethis node is the first non-phantom node in the tree
falseelse

Definition at line 758 of file SwNumberTree.cxx.

References GetParent(), IsFirst(), IsPhantom(), and mChildren.

Referenced by IsFirst().

◆ IsFirst() [2/2]

bool SwNumberTreeNode::IsFirst ( const SwNumberTreeNode pNode) const

Return if a node is first non-phantom child of this node.

Parameters
pNodethe node to check
Return values
truepNode is first child of this node
falseelse

Definition at line 748 of file SwNumberTree.cxx.

References mChildren.

Referenced by SwTaggedPDFHelper::BeginNumberedListStructureElements(), and SwTextNode::IsFirstOfNumRule().

◆ IsNotifiable()

virtual bool SwNumberTreeNode::IsNotifiable ( const SwDoc rDoc) const
protectedpure virtual

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

Implemented in SwNodeNum.

Referenced by Notify(), and NotifyInvalidChildren().

◆ IsNotificationEnabled()

virtual bool SwNumberTreeNode::IsNotificationEnabled ( const SwDoc rDoc) const
protectedpure virtual

Return if the notification is not disabled on global conditions.

Return values
trueNotification enabled in general.
falseelse

Implemented in SwNodeNum.

Referenced by AddChild().

◆ IsPhantom()

bool SwNumberTreeNode::IsPhantom ( ) const
inline

◆ IsRestart()

virtual bool SwNumberTreeNode::IsRestart ( ) const
pure virtual

Return if numbering is restarted at this node.

Implemented in SwNodeNum.

◆ IsSane() [1/2]

void SwNumberTreeNode::IsSane ( bool  bRecursive) const

Sanity check.

Parameters
bRecursivedescend to children
Return values
truethe structure of this node is sane
falseelse

Definition at line 835 of file SwNumberTree.cxx.

References IsSane().

Referenced by AddChild(), IsSane(), MoveChildren(), MoveGreaterChildren(), and RemoveMe().

◆ IsSane() [2/2]

void SwNumberTreeNode::IsSane ( bool  bRecursive,
std::vector< const SwNumberTreeNode * >  rParents 
) const
protected

Sanity check with loop detection.

Parameters
bRecursivedescend to children
rParentsvector for recording path

◆ IsValid() [1/2]

bool SwNumberTreeNode::IsValid ( ) const
protected

Returns if this node is valid.

Return values
truethis node is valid
falseelse

Definition at line 661 of file SwNumberTree.cxx.

References IsValid(), and mpParent.

Referenced by Validate().

◆ IsValid() [2/2]

bool SwNumberTreeNode::IsValid ( const SwNumberTreeNode pChild) const
protected

Returns if a child A this node is valid.

A is valid if aItLastValid in parent refers to a node greater than of equal to A.

Parameters
pChildchild to be tested
Return values
truethis node is valid
falsethis node is NOT valid

Definition at line 685 of file SwNumberTree.cxx.

References mChildren, mItLastValid, and mpParent.

Referenced by Invalidate(), and IsValid().

◆ LessThan()

bool SwNumberTreeNode::LessThan ( const SwNumberTreeNode rTreeNode) const
virtual

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 in SwNodeNum.

Definition at line 930 of file SwNumberTree.cxx.

Referenced by GetPrecedingNodeOf(), MoveGreaterChildren(), and SwNumberTreeNodeLessThan().

◆ MoveChildren()

void SwNumberTreeNode::MoveChildren ( SwNumberTreeNode pDest)
protected

Moves all children to a given destination node.

Parameters
pDestthe destination node

Definition at line 366 of file SwNumberTree.cxx.

References CreatePhantom(), IsPhantom(), IsSane(), mChildren, mItLastValid, MoveChildren(), and SetLastValid().

Referenced by MoveChildren(), and RemoveChild().

◆ MoveGreaterChildren()

void SwNumberTreeNode::MoveGreaterChildren ( SwNumberTreeNode _rCompareNode,
SwNumberTreeNode _rDestNode 
)
protected

Moves all children of this node that are greater than a given node to the destination node.

distinguish between node for comparing, whose children are greater, and the destination node.

Parameters
_rCompareNodeinput parameter - reference to the node, which is used to determine the greater children
_rDestNodeinput parameter - reference to the node, which is the destination for the greater children

Definition at line 318 of file SwNumberTree.cxx.

References IsSane(), LessThan(), mChildren, and SetLastValid().

Referenced by AddChild().

◆ Notify()

void SwNumberTreeNode::Notify ( const SwDoc rDoc)
protected

Notifies this node (NotifyNode) and all descendants.

Definition at line 1061 of file SwNumberTree.cxx.

References IsNotifiable(), IsPhantom(), mChildren, and NotifyNode().

◆ NotifyChildrenOnDepth()

void SwNumberTreeNode::NotifyChildrenOnDepth ( const int  nDepth)
protected

notification of children nodes on certain depth

Definition at line 1163 of file SwNumberTree.cxx.

References mChildren.

Referenced by NotifyNodesOnListLevel().

◆ NotifyInvalidChildren()

void SwNumberTreeNode::NotifyInvalidChildren ( const SwDoc rDoc)

Notifies all invalid children of this node.

#i83479# - made public

Definition at line 1073 of file SwNumberTree.cxx.

References GetIterator(), GetParent(), IsContinuous(), IsCounted(), IsNotifiable(), mChildren, mItLastValid, mpParent, and NotifyInvalidChildren().

Referenced by AddChild(), NotifyInvalidChildren(), NotifyInvalidSiblings(), and RemoveChild().

◆ NotifyInvalidSiblings()

void SwNumberTreeNode::NotifyInvalidSiblings ( const SwDoc rDoc)

Notifies all invalid siblings of this node.

Definition at line 1112 of file SwNumberTree.cxx.

References mpParent, and NotifyInvalidChildren().

Referenced by AddChild().

◆ NotifyNode()

virtual void SwNumberTreeNode::NotifyNode ( )
protectedpure virtual

Notifies the node.

Called when the number of the node got invalid.

Implemented in SwNodeNum.

References Validate.

Referenced by Notify().

◆ NotifyNodesOnListLevel()

void SwNumberTreeNode::NotifyNodesOnListLevel ( const int  nListLevel)

notification of all nodes in the list tree on certain list level

Definition at line 1150 of file SwNumberTree.cxx.

References GetParent(), GetRoot(), and NotifyChildrenOnDepth().

◆ operator=()

SwNumberTreeNode & SwNumberTreeNode::operator= ( const SwNumberTreeNode )
protected

◆ PostRemove()

virtual void SwNumberTreeNode::PostRemove ( )
protectedpure virtual

Implemented in SwNodeNum.

Referenced by RemoveChild().

◆ PreAdd()

virtual void SwNumberTreeNode::PreAdd ( )
protectedpure virtual

Implemented in SwNodeNum.

Referenced by AddChild().

◆ RemoveChild()

void SwNumberTreeNode::RemoveChild ( SwNumberTreeNode pChild,
const SwDoc rDoc 
)

Remove a child.

Parameters
pChildchild to be removed

Definition at line 567 of file SwNumberTree.cxx.

References CreatePhantom(), GetIterator(), IsPhantom(), mChildren, MoveChildren(), mpParent, NotifyInvalidChildren(), PostRemove(), and SetLastValid().

Referenced by RemoveMe().

◆ RemoveMe()

void SwNumberTreeNode::RemoveMe ( const SwDoc rDoc)

Remove this child from the tree.

Definition at line 640 of file SwNumberTree.cxx.

References ClearObsoletePhantoms(), GetParent(), HasOnlyPhantoms(), IsPhantom(), IsSane(), mpParent, and RemoveChild().

Referenced by SwList::RemoveListItem(), and SetLevelInListTree().

◆ SetLastValid()

void SwNumberTreeNode::SetLastValid ( const tSwNumberTreeChildren::const_iterator &  aItLastValid,
bool  bValidating = false 
) const
protected

Set the last valid child of this node.

Parameters
aItLastValiditerator pointing to the new last valid child
bValidating- true always set the last valid node to aItLastValid
  • false only set if aItLastValid is preceding the current last valid node

Definition at line 967 of file SwNumberTree.cxx.

References GetIterator(), GetParent(), InvalidateChildren(), IsContinuous(), IsCounted(), mChildren, mItLastValid, mpParent, and SetLastValid().

Referenced by AddChild(), ClearObsoletePhantoms(), Invalidate(), MoveChildren(), MoveGreaterChildren(), RemoveChild(), SetLastValid(), ValidateContinuous(), and ValidateHierarchical().

◆ SetLevelInListTree()

void SwNumberTreeNode::SetLevelInListTree ( const int  nLevel,
const SwDoc rDoc 
)

set level of this node

precondition: node is already member of a list tree

Definition at line 796 of file SwNumberTree.cxx.

References AddChild(), GetLevelInListTree(), GetParent(), GetRoot(), and RemoveMe().

◆ Validate()

void SwNumberTreeNode::Validate ( const SwNumberTreeNode pNode) const
protected

Validates a child.

Parameters
pNodechild to be validated
Attention: \n All invalid children preceding pNode are validated, too.

Definition at line 286 of file SwNumberTree.cxx.

References IsContinuous(), IsValid(), ValidateContinuous(), and ValidateHierarchical().

Referenced by GetNumber(), and ValidateMe().

◆ ValidateContinuous()

void SwNumberTreeNode::ValidateContinuous ( const SwNumberTreeNode pNode) const
protected

Validates a child using continuous numbering.

Parameters
pNodechild to be validated
Attention: \n All invalid children preceding pNode are validated, too.

Definition at line 229 of file SwNumberTree.cxx.

References GetNumber(), GetParent(), GetPred(), GetStartValue(), mChildren, mItLastValid, and SetLastValid().

Referenced by Validate().

◆ ValidateHierarchical()

void SwNumberTreeNode::ValidateHierarchical ( const SwNumberTreeNode pNode) const
protected

Validates a child using hierarchical numbering.

Parameters
pNodechild to be validated
Attention: \n All invalid children preceding pNode are validated, too.

Definition at line 126 of file SwNumberTree.cxx.

References GetChildCount(), GetIterator(), GetParent(), HasPhantomCountedParent(), IsCounted(), IsPhantom(), mChildren, mItLastValid, and SetLastValid().

Referenced by Validate().

◆ ValidateMe()

void SwNumberTreeNode::ValidateMe ( )

Validates this node.

Calls Validate(this) on parent.

Definition at line 1055 of file SwNumberTree.cxx.

References mpParent, and Validate().

Referenced by SwNodeNum::NotifyNode().

Member Data Documentation

◆ mbContinueingPreviousSubTree

bool SwNumberTreeNode::mbContinueingPreviousSubTree
mutableprotected

Definition at line 392 of file SwNumberTree.hxx.

◆ mbPhantom

bool SwNumberTreeNode::mbPhantom
protected

true this node is a phantom false this node is NOT a phantom

Definition at line 398 of file SwNumberTree.hxx.

Referenced by CreatePhantom().

◆ mChildren

tSwNumberTreeChildren SwNumberTreeNode::mChildren
protected

◆ mItLastValid

tSwNumberTreeChildren::const_iterator SwNumberTreeNode::mItLastValid
mutableprotected

Iterator to the last valid element.

All children that are less than or equal to the referenced child are valid. All children greater than the referenced child are invalid.

Definition at line 405 of file SwNumberTree.hxx.

Referenced by InvalidateTree(), IsValid(), MoveChildren(), NotifyInvalidChildren(), SetLastValid(), SwNumberTreeNode(), ValidateContinuous(), ValidateHierarchical(), and ~SwNumberTreeNode().

◆ mnNumber

SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::mnNumber
mutableprotected

the number of the node

Definition at line 383 of file SwNumberTree.hxx.

Referenced by GetNumber().

◆ mpParent

SwNumberTreeNode* SwNumberTreeNode::mpParent
protected

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