summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-09-29 20:30:20 +0900
committerCaolán McNamara <caolanm@redhat.com>2015-09-29 13:41:10 +0000
commit4672445c1ab501550d554db7519e44516001fea3 (patch)
tree7637a4d5a5a2486f974a45c10ad399337f023e37
parent64a3c4d9e272ba6eefe8bcd6a3e0ca4462b7aca1 (diff)
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>
-rw-r--r--starmath/inc/node.hxx15
-rw-r--r--starmath/source/node.cxx4
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