starmath: SmBinHorNode's symbol is not always an SmMathSymbolNode
E.g. it is an SmGlyphSpecialNode in the "boper" case. Change-Id: I6311e0dca8e71c617d2c4c681b0b049217ec9867
This commit is contained in:
@@ -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
|
||||
|
@@ -824,9 +824,9 @@ void SmDynIntegralNode::CreateTextFromNode(OUString &rText)
|
||||
|
||||
void SmBinHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
|
||||
{
|
||||
SmNode *pLeft = GetSubNode(0),
|
||||
*pOper = GetSubNode(1),
|
||||
*pRight = GetSubNode(2);
|
||||
SmNode *pLeft = LeftOperand(),
|
||||
*pOper = Symbol(),
|
||||
*pRight = RightOperand();
|
||||
assert(pLeft);
|
||||
assert(pOper);
|
||||
assert(pRight);
|
||||
|
@@ -2185,9 +2185,9 @@ void SmNodeToTextVisitor::Visit( SmUnHorNode* pNode )
|
||||
|
||||
void SmNodeToTextVisitor::Visit( SmBinHorNode* pNode )
|
||||
{
|
||||
SmNode *pLeft = pNode->GetSubNode( 0 ),
|
||||
*pOper = pNode->GetSubNode( 1 ),
|
||||
*pRight = pNode->GetSubNode( 2 );
|
||||
SmNode *pLeft = pNode->LeftOperand(),
|
||||
*pOper = pNode->Symbol(),
|
||||
*pRight = pNode->RightOperand();
|
||||
Separate( );
|
||||
pLeft->Accept( this );
|
||||
Separate( );
|
||||
|
Reference in New Issue
Block a user