diff options
-rw-r--r-- | starmath/inc/node.hxx | 15 | ||||
-rw-r--r-- | starmath/source/node.cxx | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 1ca0db792986..0f4eb1b2fcb5 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -222,9 +222,7 @@ public: void SetToken(SmToken& token){ aNodeToken = token; } -protected: - /** Sets parent on children of this node */ - inline void ClaimPaternity(); + private: SmStructureNode* aParentNode; }; @@ -336,15 +334,12 @@ public: aSubNodes[nIndex] = pNode; ClaimPaternity(); } + +private: + /** Sets parent on children of this node */ + void ClaimPaternity(); }; -inline void SmNode::ClaimPaternity() { - SmNode* pNode; - sal_uInt16 nSize = GetNumSubNodes(); - for (sal_uInt16 i = 0; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) - pNode->SetParent(static_cast<SmStructureNode*>(this)); //Cast is valid if we have children -} /** Abstract base class for all visible node * diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 31ee52a6b050..74e5137aaaba 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -624,6 +624,10 @@ void SmStructureNode::GetAccessibleText( OUStringBuffer &rText ) const } +void SmStructureNode::ClaimPaternity() +{ + ForEachNonNull(this, [this](SmNode *pNode){pNode->SetParent(this);}); +} bool SmVisibleNode::IsVisible() const |