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

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 =0
 Return if the notification is not disabled on global conditions. More...
 
tSwNumberTreeChildren::size_type GetChildCount () const
 Returns how many children this node has got. 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 =0
 Return if this node is notifiable. More...
 
virtual void NotifyNode ()=0
 Notifies the 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...
 
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.

Definition at line 114 of file SwNumberTree.hxx.

Member Typedef Documentation

Definition at line 118 of file SwNumberTree.hxx.

Constructor & Destructor Documentation

SwNumberTreeNode::SwNumberTreeNode ( )

Definition at line 31 of file SwNumberTree.cxx.

References mChildren, and mItLastValid.

SwNumberTreeNode::~SwNumberTreeNode ( )
virtual
SwNumberTreeNode::SwNumberTreeNode ( const SwNumberTreeNode )
protected

Member Function Documentation

void SwNumberTreeNode::AddChild ( SwNumberTreeNode pChild,
const int  nDepth 
)
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 107 of file SwNumberTree.cxx.

References mChildren, and SetLastValid().

Referenced by AddChild(), and RemoveMe().

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

SwNumberTreeNode * SwNumberTreeNode::CreatePhantom ( )
protected

Creates a phantom.

Returns
the created phantom

Definition at line 66 of file SwNumberTree.cxx.

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

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

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

Returns how many children this node has got.

Returns
number of children

Definition at line 831 of file SwNumberTree.cxx.

References mChildren.

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

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 310 of file SwNumberTree.cxx.

References IsPhantom(), and mChildren.

Referenced by MoveGreaterChildren().

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

Definition at line 892 of file SwNumberTree.cxx.

References mChildren.

Referenced by GetPred(), Invalidate(), NotifyInvalidChildren(), RemoveChild(), and ValidateHierarchical().

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 916 of file SwNumberTree.cxx.

References GetLastDescendant(), and mChildren.

Referenced by GetLastDescendant(), and GetPred().

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 822 of file SwNumberTree.cxx.

References GetLevelInListTree(), and mpParent.

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

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 668 of file SwNumberTree.cxx.

References mnNumber, mpParent, and Validate().

Referenced by GetNumberVector_(), and ValidateContinuous().

SwNumberTree::tNumberVector SwNumberTreeNode::GetNumberVector ( ) const

Returns level numbers of this node.

Returns
level numbers of this node

Definition at line 678 of file SwNumberTree.cxx.

References GetNumberVector_().

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

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 300 of file SwNumberTree.cxx.

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

Referenced by GetNumberVector(), and GetNumberVector_().

SwNumberTreeNode* SwNumberTreeNode::GetParent ( ) const
inline
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 1121 of file SwNumberTree.cxx.

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

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

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 937 of file SwNumberTree.cxx.

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

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

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 96 of file SwNumberTree.cxx.

References mpParent.

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

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

Return start value.

Returns
start value

Implemented in SwNodeNum.

Referenced by ValidateContinuous().

virtual bool SwNumberTreeNode::HasCountedChildren ( ) const
protectedpure virtual

Implemented in SwNodeNum.

Referenced by IsCounted().

bool SwNumberTreeNode::HasOnlyPhantoms ( ) const
protected

Return if all descendants of this node are phantoms.

Definition at line 703 of file SwNumberTree.cxx.

References GetChildCount(), and mChildren.

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

bool SwNumberTreeNode::HasPhantomCountedParent ( ) const
protected
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 1035 of file SwNumberTree.cxx.

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

Referenced by InvalidateMe().

void SwNumberTreeNode::InvalidateAndNotifyTree ( )
inline

Invalidation and notification of complete numbering tree.

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

Definition at line 299 of file SwNumberTree.hxx.

void SwNumberTreeNode::InvalidateChildren ( )
inlineprotected

Invalidation of all children.

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

Definition at line 440 of file SwNumberTree.hxx.

Referenced by SetLastValid().

void SwNumberTreeNode::InvalidateMe ( )

Notifies the node.

Calls Invalidate(this) on parent.

Definition at line 1051 of file SwNumberTree.cxx.

References Invalidate(), and mpParent.

Referenced by AddChild().

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 1026 of file SwNumberTree.cxx.

References mChildren, and mItLastValid.

bool SwNumberTreeNode::IsContinueingPreviousSubTree ( ) const
inline

Definition at line 165 of file SwNumberTree.hxx.

Referenced by SwUnoCursorHelper::getCursorPropertyValue().

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(), and Validate().

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 719 of file SwNumberTree.cxx.

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

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

virtual bool SwNumberTreeNode::IsCountedForNumbering ( ) const
protectedpure virtual

Implemented in SwNodeNum.

virtual bool SwNumberTreeNode::IsCountPhantoms ( ) const
protectedpure virtual

Return if phantoms are counted.

Implemented in SwNodeNum.

Referenced by IsCounted().

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 750 of file SwNumberTree.cxx.

References mChildren.

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

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 760 of file SwNumberTree.cxx.

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

virtual bool SwNumberTreeNode::IsNotifiable ( ) const
protectedpure virtual

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

Implemented in SwNodeNum.

Referenced by Notify(), and NotifyInvalidChildren().

virtual bool SwNumberTreeNode::IsNotificationEnabled ( ) 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().

bool SwNumberTreeNode::IsPhantom ( ) const
inline
virtual bool SwNumberTreeNode::IsRestart ( ) const
pure virtual

Return if numbering is restarted at this node.

Implemented in SwNodeNum.

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 837 of file SwNumberTree.cxx.

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

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

Definition at line 844 of file SwNumberTree.cxx.

References find(), mChildren, mpParent, and SAL_WARN_IF.

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 687 of file SwNumberTree.cxx.

References mChildren, mItLastValid, and mpParent.

Referenced by Invalidate(), and IsValid().

bool SwNumberTreeNode::IsValid ( ) const
protected

Returns if this node is valid.

Return values
truethis node is valid
falseelse

Definition at line 663 of file SwNumberTree.cxx.

References IsValid(), and mpParent.

Referenced by Validate().

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

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

Definition at line 932 of file SwNumberTree.cxx.

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

void SwNumberTreeNode::MoveChildren ( SwNumberTreeNode pDest)
protected

Moves all children to a given destination node.

Parameters
pDestthe destination node

Definition at line 369 of file SwNumberTree.cxx.

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

Referenced by MoveChildren(), and RemoveChild().

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 321 of file SwNumberTree.cxx.

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

Referenced by AddChild().

void SwNumberTreeNode::Notify ( )
protected

Notifies this node (NotifyNode) and all descendants.

Definition at line 1063 of file SwNumberTree.cxx.

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

void SwNumberTreeNode::NotifyChildrenOnDepth ( const int  nDepth)
protected

notification of children nodes on certain depth

Definition at line 1165 of file SwNumberTree.cxx.

References mChildren.

Referenced by NotifyNodesOnListLevel().

void SwNumberTreeNode::NotifyInvalidChildren ( )

Notifies all invalid children of this node.

#i83479# - made public

Definition at line 1075 of file SwNumberTree.cxx.

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

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

void SwNumberTreeNode::NotifyInvalidSiblings ( )

Notifies all invalid siblings of this node.

Definition at line 1114 of file SwNumberTree.cxx.

References mpParent, and NotifyInvalidChildren().

Referenced by AddChild().

virtual void SwNumberTreeNode::NotifyNode ( )
protectedpure virtual

Notifies the node.

Called when the number of the node got invalid.

Implemented in SwNodeNum.

Referenced by Notify().

void SwNumberTreeNode::NotifyNodesOnListLevel ( const int  nListLevel)

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

Definition at line 1152 of file SwNumberTree.cxx.

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

SwNumberTreeNode& SwNumberTreeNode::operator= ( const SwNumberTreeNode )
protected
virtual void SwNumberTreeNode::PostRemove ( )
protectedpure virtual

Implemented in SwNodeNum.

Referenced by RemoveChild().

virtual void SwNumberTreeNode::PreAdd ( )
protectedpure virtual

Implemented in SwNodeNum.

Referenced by AddChild().

void SwNumberTreeNode::RemoveChild ( SwNumberTreeNode pChild)

Remove a child.

Parameters
pChildchild to be removed

Definition at line 569 of file SwNumberTree.cxx.

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

Referenced by RemoveMe().

void SwNumberTreeNode::RemoveMe ( )

Remove this child from the tree.

Definition at line 642 of file SwNumberTree.cxx.

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

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

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 970 of file SwNumberTree.cxx.

References InvalidateChildren(), and IsCounted().

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

void SwNumberTreeNode::SetLevelInListTree ( const int  nLevel)

set level of this node

precondition: node is already member of a list tree

Definition at line 798 of file SwNumberTree.cxx.

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

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

Validates a child.

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

Definition at line 289 of file SwNumberTree.cxx.

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

Referenced by GetNumber(), and ValidateMe().

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

Validates a child using continuous numbering.

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

Definition at line 232 of file SwNumberTree.cxx.

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

Referenced by Validate().

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

Validates a child using hierarchical numbering.

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

Definition at line 129 of file SwNumberTree.cxx.

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

Referenced by Validate().

void SwNumberTreeNode::ValidateMe ( )

Validates this node.

Calls Validate(this) on parent.

Definition at line 1057 of file SwNumberTree.cxx.

References mpParent, and Validate().

Referenced by SwNodeNum::NotifyNode().

Member Data Documentation

bool SwNumberTreeNode::mbContinueingPreviousSubTree
mutableprotected

Definition at line 398 of file SwNumberTree.hxx.

bool SwNumberTreeNode::mbPhantom
protected

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

Definition at line 404 of file SwNumberTree.hxx.

Referenced by CreatePhantom().

tSwNumberTreeChildren SwNumberTreeNode::mChildren
protected
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 411 of file SwNumberTree.hxx.

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

SwNumberTree::tSwNumTreeNumber SwNumberTreeNode::mnNumber
mutableprotected

the number of the node

Definition at line 389 of file SwNumberTree.hxx.

Referenced by GetNumber().

SwNumberTreeNode* SwNumberTreeNode::mpParent
protected

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