Remove unused SmStructureNode::SetSubNodesBinMo with plain pointers (starmath)
and keep the remaining one which uses unique_ptr
Change-Id: I0e4e4aff5c202897a27dfef97750c14c3c5736bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152581
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
diff --git a/compilerplugins/clang/unusedmethods.results b/compilerplugins/clang/unusedmethods.results
index b7a3444..8c0beae 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -3034,8 +3034,6 @@ starmath/inc/node.hxx:508
SmNode * SmStructureNode::GetSubNodeBinMo(unsigned long) const
starmath/inc/node.hxx:533
void SmStructureNode::SetSubNodes(SmNode *,SmNode *,SmNode *)
starmath/inc/node.hxx:554
void SmStructureNode::SetSubNodesBinMo(SmNode *,SmNode *,SmNode *)
starmath/inc/nodetype.hxx:59
_Bool starmathdatabase::isStructuralNode(enum SmNodeType)
starmath/inc/nodetype.hxx:71
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index f162b83..e0b5973 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -544,16 +544,6 @@ public:
std::unique_ptr<SmNode> pThird = nullptr);
/**
* Sets subnodes, used for operators.
* The data is reordered so the items are correctly ordered.
* @param pFirst
* @param pSecond
* @param pThird
* @return
*/
void SetSubNodesBinMo(SmNode* pFirst, SmNode* pSecond, SmNode* pThird);
/**
* Sets subnodes.
* @param rNodeArray
* @return
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 5beab34..7a9d42bd 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -416,33 +416,6 @@ void SmStructureNode::SetSubNodesBinMo(std::unique_ptr<SmNode> pFirst, std::uniq
ClaimPaternity();
}
void SmStructureNode::SetSubNodesBinMo(SmNode* pFirst, SmNode* pSecond, SmNode* pThird)
{
if(GetType()==SmNodeType::BinDiagonal)
{
size_t nSize = pSecond ? 3 : (pThird ? 2 : (pFirst ? 1 : 0));
maSubNodes.resize( nSize );
if (pFirst)
maSubNodes[0] = pFirst;
if (pSecond)
maSubNodes[2] = pSecond;
if (pThird)
maSubNodes[1] = pThird;
}
else
{
size_t nSize = pThird ? 3 : (pSecond ? 2 : (pFirst ? 1 : 0));
maSubNodes.resize( nSize );
if (pFirst)
maSubNodes[0] = pFirst;
if (pSecond)
maSubNodes[1] = pSecond;
if (pThird)
maSubNodes[2] = pThird;
}
ClaimPaternity();
}
void SmStructureNode::SetSubNodes(SmNodeArray&& rNodeArray)
{
maSubNodes = std::move(rNodeArray);