20#include <osl/diagnose.h>
29 : mpTextNode( pTextNode )
30 , mpNumRule( nullptr )
31 , m_isHiddenRedlines(isHiddenRedlines)
36 : mpTextNode( nullptr )
37 , mpNumRule( pNumRule )
38 , m_isHiddenRedlines(false)
50 "<SwNodeNum::ChangeNumRule(..)> - missing list style and/or text node. Serious defect -> please inform OD." );
67 "<SwNodeNum::GetPosition()> - no text node set at <SwNodeNum> instance" );
81 "<SwNodeNum::PreAdd()> - no text node set at <SwNodeNum> instance" );
87 "<SwNodeNum::PreAdd()> - no list style set at <SwNodeNum> instance" );
106 "<SwNodeNum::PostRemove()> - no text node set at <SwNodeNum> instance" );
108 "<SwNodeNum::PostRemove()> - no list style set at <SwNodeNum> instance" );
130 aResult = pTextNode->IsNotifiable();
142 aResult = pTextNode->IsNotificationEnabled();
151 bool aResult =
false;
164 OSL_FAIL(
"<SwNodeNum::IsContinuous()> - OD debug" );
172 bool aResult =
false;
191 SwNodeNum* pChild( dynamic_cast<SwNodeNum*>(pNode) );
192 OSL_ENSURE( pChild,
"<SwNodeNum::HasCountedChildren()> - unexpected type of child" );
193 return pChild && (pChild->IsCountedForNumbering() || pChild->HasCountedChildren());
218 bool bResult =
false;
235 bool bIsRestart =
false;
256 OSL_FAIL(
"<SwNodeNum::IsCountPhantoms(): missing numbering rule" );
278 if (nLevel >= 0 && nLevel <
MAXLEVEL)
309 const bool bIsPhantom( rNodeNum.
IsPhantom() );
310 tSwNumberTreeChildren::size_type nAllowedChildCount( 0 );
318 OSL_FAIL(
"<SwNodeNum::UnregisterMeAndChildrenDueToRootDelete(..)> - unknown number tree node child" );
319 ++nAllowedChildCount;
347 SwPaM aPam( *pTextNode );
356 const SwNodeNum* pPrecedingNodeNum(
nullptr );
361 pPrecedingNodeNum =
dynamic_cast<const SwNodeNum*
>(
366 return pPrecedingNodeNum;
virtual void removeListItem(const SwNodeNum &rNodeNum)=0
virtual void addListItem(const SwNodeNum &rNodeNum)=0
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
virtual bool HasCountedChildren() const override
virtual SwNumberTreeNode * Create() const override
Creates a new node of the same class.
const SwNodeNum * GetPrecedingNodeNumOf(const SwTextNode &rTextNode) const
determines the <SwNodeNum> instance, which is preceding the given text node
SwNumRule * GetNumRule() const
virtual bool IsCountedForNumbering() const override
void ChangeNumRule(SwNumRule &rNumRule)
virtual void NotifyNode() override
Notifies the node.
virtual void PreAdd() override
SwTextNode *const mpTextNode
virtual bool IsContinuous() const override
Return if this node is counted continuous.
virtual bool IsCountPhantoms() const override
Return if phantoms are counted.
SwPosition GetPosition() const
SwNodeNum(SwTextNode *pTextNode, bool isHiddenRedlines)
static void HandleNumberTreeRootNodeDelete(SwNodeNum &rNodeNum)
virtual bool IsNotificationEnabled(const SwDoc &rDoc) const override
Return if the notification is not disabled on global conditions.
virtual bool LessThan(const SwNumberTreeNode &rNode) const override
Returns if this node is less than another node.
static void UnregisterMeAndChildrenDueToRootDelete(SwNodeNum &rNodeNum)
virtual SwNumberTree::tSwNumTreeNumber GetStartValue() const override
Return start value.
virtual void PostRemove() override
virtual bool IsRestart() const override
Return if numbering is restarted at this node.
virtual bool IsNotifiable(const SwDoc &rDoc) const override
Return if this node is notifiable.
virtual ~SwNodeNum() override
SwTextNode * GetTextNode() const
virtual bool IsCounted() const override
Return if this node is counted.
SwNodeOffset GetIndex() const
IDocumentListItems & getIDocumentListItems()
Provides access to the document's numbered items interface.
bool IsCountPhantoms() const
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
bool IsContinusNum() const
void RemoveTextNode(SwTextNode &rTextNode)
void AddTextNode(SwTextNode &rTextNode)
A tree of numbered nodes.
bool IsPhantom() const
Return if this node is a phantom.
int GetLevelInListTree() const
Return level of this node.
virtual bool IsContinuous() const =0
Return if this node is counted continuous.
virtual bool IsCounted() const
Return if this node is counted.
SwNumberTreeNode * GetRoot() const
Returns the root node of the tree this node is part of.
tSwNumberTreeChildren mChildren
the children
tSwNumberTreeChildren::size_type GetChildCount() const
Returns how many children this node has got.
const SwNumberTreeNode * GetPrecedingNodeOf(const SwNumberTreeNode &rNode) const
determines the node, which is preceding the node
void ValidateMe()
Validates this node.
SwNumberTreeNode * GetParent() const
Returns the parent of this node.
PaM is Point and Mark: a selection of the document model.
SwTextNode is a paragraph in the document model.
bool HasBullet() const
Returns if this text node has a bullet.
SwNumberTree::tSwNumTreeNumber GetActualListStartValue() const
bool IsCountedInList() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
bool HasNumber(SwRootFrame const *pLayout=nullptr) const
Returns if this text node has a number.
bool IsListRestart() const
void NumRuleChgd()
Notify this textnode that its numbering rule has changed.
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
tools::Long tSwNumTreeNumber
Marks a position in the document model.
constexpr sal_uInt8 MAXLEVEL