diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-08-04 18:22:51 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-08-05 13:36:45 +0900 |
commit | ce97110f37825f9666bff8ff2df0d2092620ae17 (patch) | |
tree | e76271f546a5b798026e1bb266b21b48707d09ea /starmath/inc | |
parent | 39e300612c97b7742c8d8417d4dc6c0022cfa040 (diff) |
starmath: SmBinHorNode's symbol is not always an SmMathSymbolNode
E.g. it is an SmGlyphSpecialNode in the "boper" case.
Change-Id: I6311e0dca8e71c617d2c4c681b0b049217ec9867
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/node.hxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index c22e9a79deec..e0b2019d433a 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -842,8 +842,8 @@ public: virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override; void Accept(SmVisitor* pVisitor) override; - SmMathSymbolNode* Symbol(); - const SmMathSymbolNode* Symbol() const; + SmNode* Symbol(); + const SmNode* Symbol() const; SmNode* LeftOperand(); const SmNode* LeftOperand() const; SmNode* RightOperand(); @@ -1293,18 +1293,18 @@ inline const SmNode* SmDynIntegralNode::Body() const } -inline SmMathSymbolNode* SmBinHorNode::Symbol() +inline SmNode* SmBinHorNode::Symbol() { - OSL_ASSERT( GetNumSubNodes() > 1 && GetSubNode( 1 )->GetType() == NMATH ); - return static_cast< SmMathSymbolNode* >( GetSubNode( 1 )); + assert( GetNumSubNodes() == 3 ); + return GetSubNode( 1 ); } -inline const SmMathSymbolNode* SmBinHorNode::Symbol() const +inline const SmNode* SmBinHorNode::Symbol() const { return const_cast< SmBinHorNode* >( this )->Symbol(); } inline SmNode* SmBinHorNode::LeftOperand() { - OSL_ASSERT( GetNumSubNodes() > 0 ); + assert( GetNumSubNodes() == 3 ); return GetSubNode( 0 ); } inline const SmNode* SmBinHorNode::LeftOperand() const @@ -1313,7 +1313,7 @@ inline const SmNode* SmBinHorNode::LeftOperand() const } inline SmNode* SmBinHorNode::RightOperand() { - OSL_ASSERT( GetNumSubNodes() > 2 ); + assert( GetNumSubNodes() == 3 ); return GetSubNode( 2 ); } inline const SmNode* SmBinHorNode::RightOperand() const |