diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-03-01 16:26:23 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-03-07 03:37:07 +0000 |
commit | b89feb8018bf3610faf01e73995d576f6566e20b (patch) | |
tree | 57d7e3a035b85903f08364be8c4a07ab8a358e20 /starmath/source | |
parent | ed51d4293dd919a03edca11ec48c607bbfa31076 (diff) |
starmath: Make SmNode abstract and noncopyable
... and remove unused SmStructureNode's copy ctor/assignment operator.
This seems desirable according to the old comment in SmNode::Accept().
Change-Id: Ifb51c64ca784f1295374d31cc210cbe3e45aa2f8
Reviewed-on: https://gerrit.libreoffice.org/22801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/node.cxx | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 6a9c07d6889b..8dadb752dde6 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -378,11 +378,6 @@ const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const return pResult; } -void SmNode::GetAccessibleText( OUStringBuffer &/*rText*/ ) const -{ - SAL_WARN("starmath", "SmNode: GetAccessibleText not overridden"); -} - const SmNode * SmNode::FindNodeWithAccessibleIndex(sal_Int32 nAccIdx) const { const SmNode *pResult = nullptr; @@ -420,54 +415,12 @@ long SmNode::GetFormulaBaseline() const } -SmStructureNode::SmStructureNode( const SmStructureNode &rNode ) : - SmNode( rNode.GetType(), rNode.GetToken() ) -{ - size_t i; - for (i = 0; i < aSubNodes.size(); i++) - delete aSubNodes[i]; - aSubNodes.resize(0); - - auto nSize = rNode.aSubNodes.size(); - aSubNodes.resize( nSize ); - for (i = 0; i < nSize; ++i) - { - SmNode *pNode = rNode.aSubNodes[i]; - aSubNodes[i] = pNode ? new SmNode( *pNode ) : nullptr; - } - ClaimPaternity(); -} - - SmStructureNode::~SmStructureNode() { ForEachNonNull(this, boost::checked_deleter<SmNode>()); } -SmStructureNode & SmStructureNode::operator = ( const SmStructureNode &rNode ) -{ - SmNode::operator = ( rNode ); - - size_t i; - for (i = 0; i < aSubNodes.size(); i++) - delete aSubNodes[i]; - aSubNodes.resize(0); - - auto nSize = rNode.aSubNodes.size(); - aSubNodes.resize( nSize ); - for (i = 0; i < nSize; ++i) - { - SmNode *pNode = rNode.aSubNodes[i]; - aSubNodes[i] = pNode ? new SmNode( *pNode ) : nullptr; - } - - ClaimPaternity(); - - return *this; -} - - void SmStructureNode::SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird) { size_t nSize = pThird ? 3 : (pSecond ? 2 : (pFirst ? 1 : 0)); @@ -2929,14 +2882,6 @@ void SmBlankNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) /**************************************************************************/ //Implementation of all accept methods for SmVisitor -void SmNode::Accept(SmVisitor*){ - //This method is only implemented to avoid making SmNode abstract because an - //obscure copy constructor is used... I can't find it's implementation, and - //don't want to figure out how to fix it... If you want to, just delete this - //method, making SmNode abstract, and see where you can an problem with that. - SAL_WARN("starmath", "SmNode should not be visitable!"); -} - void SmTableNode::Accept(SmVisitor* pVisitor) { pVisitor->Visit(this); } |