[Libreoffice-commits] core.git: starmath/inc starmath/source

Takeshi Abe tabe at fixedpoint.jp
Tue Sep 29 06:41:37 PDT 2015


 starmath/inc/node.hxx    |   15 +++++----------
 starmath/source/node.cxx |    4 ++++
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 4672445c1ab501550d554db7519e44516001fea3
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Sep 29 20:30:20 2015 +0900

    starmath: ClaimPaternity() is only for SmStructureNode
    
    rather than SmNode.
    
    Change-Id: I2c4765500f077007979417b90f47cc22c6362491
    Reviewed-on: https://gerrit.libreoffice.org/18917
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 1ca0db7..0f4eb1b 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 31ee52a..74e5137 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


More information about the Libreoffice-commits mailing list