starmath: ClaimPaternity() is only for SmStructureNode

rather than SmNode.

Change-Id: I2c4765500f077007979417b90f47cc22c6362491
Reviewed-on: https://gerrit.libreoffice.org/18917
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Takeshi Abe
2015-09-29 20:30:20 +09:00
committed by Caolán McNamara
parent 64a3c4d9e2
commit 4672445c1a
2 changed files with 9 additions and 10 deletions

View File

@@ -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
*

View File

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