summaryrefslogtreecommitdiff
path: root/starmath/source/visitors.cxx
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2020-11-03 15:12:08 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-05 09:07:46 +0100
commitd3abe0a1fb2f2b546b164280c5562443dc1f4300 (patch)
treeabf3a1d495698dbfbe04c6c5425b21f1caf7f382 /starmath/source/visitors.cxx
parent03ef620caff59bf624b931646b21b239171511bd (diff)
Added frac command. Sould solve tdf#137234.
Change-Id: I78dcd06a30b93c441dd5983711603f184d20c63b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105255 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/visitors.cxx')
-rw-r--r--starmath/source/visitors.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index f6e030b298d7..9b8ac0d855aa 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -2280,13 +2280,23 @@ void SmNodeToTextVisitor::Visit( SmBinHorNode* pNode )
void SmNodeToTextVisitor::Visit( SmBinVerNode* pNode )
{
- SmNode *pNum = pNode->GetSubNode( 0 ),
- *pDenom = pNode->GetSubNode( 2 );
- Append( "{ " );
- LineToText( pNum );
- Append( "over" );
- LineToText( pDenom );
- Append( "} " );
+ if( pNode->GetToken().eType == TOVER ){
+ SmNode *pNum = pNode->GetSubNode( 0 ),
+ *pDenom = pNode->GetSubNode( 2 );
+ Append( "{ " );
+ LineToText( pNum );
+ Append( "over" );
+ LineToText( pDenom );
+ Append( "} " );
+ } else{
+ SmNode *pNum = pNode->GetSubNode( 0 ),
+ *pDenom = pNode->GetSubNode( 2 );
+ Append( "frac {" );
+ LineToText( pNum );
+ Append( "} {" );
+ LineToText( pDenom );
+ Append( "}" );
+ }
}
void SmNodeToTextVisitor::Visit( SmBinDiagonalNode* pNode )