[PATCH] Fix Greek characters, stacks and subs/sups for operators.

Luke Dixon 6b8b4567 at gmail.com
Tue Nov 23 02:36:18 PST 2010


---
 starmath/source/visitors.cxx |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 6ca86fd..ab2ac87 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -2174,7 +2174,7 @@ void SmNodeToTextVisitor::Visit( SmTableNode* pNode )
             LineToText( it.Current( ) );
             if( it.Next( ) ) {
                 Separate( );
-                Append( "## " );
+                Append( "# " );
             }else
                 break;
         }
@@ -2242,33 +2242,39 @@ void SmNodeToTextVisitor::Visit( SmOperNode* pNode )
         SmNode* pChild;
         if( ( pChild = pSubSup->GetSubSup( LSUP ) ) ) {
             Separate( );
-            Append( "lsup " );
+            Append( "lsup { " );
             LineToText( pChild );
+            Append( "} ");
         }
         if( ( pChild = pSubSup->GetSubSup( LSUB ) ) ) {
             Separate( );
-            Append( "lsub " );
+            Append( "lsub { " );
             LineToText( pChild );
+            Append( "} ");
         }
         if( ( pChild = pSubSup->GetSubSup( RSUP ) ) ) {
             Separate( );
-            Append( "rsup " );
+            Append( "rsup { " );
             LineToText( pChild );
+            Append( "} ");
         }
         if( ( pChild = pSubSup->GetSubSup( RSUB ) ) ) {
             Separate( );
-            Append( "rsub " );
+            Append( "rsub { " );
             LineToText( pChild );
+            Append( "} ");
         }
         if( ( pChild = pSubSup->GetSubSup( CSUP ) ) ) {
             Separate( );
-            Append( "csup " );
+            Append( "csup { " );
             LineToText( pChild );
+            Append( "} ");
         }
         if( ( pChild = pSubSup->GetSubSup( CSUB ) ) ) {
             Separate( );
-            Append( "csub " );
+            Append( "csub { " );
             LineToText( pChild );
+            Append( "} ");
         }
     }
     LineToText( pNode->GetSubNode( 1 ) );
@@ -2490,7 +2496,6 @@ void SmNodeToTextVisitor::Visit( SmTextNode* pNode )
 
 void SmNodeToTextVisitor::Visit( SmSpecialNode* pNode )
 {
-    Append( "%" );
     Append( pNode->GetToken( ).aText );
 }
 
@@ -2528,13 +2533,18 @@ void SmNodeToTextVisitor::Visit( SmLineNode* pNode )
 
 void SmNodeToTextVisitor::Visit( SmExpressionNode* pNode )
 {
-    Append( "{ " );
+    USHORT nSize = pNode->GetNumSubNodes();
+    if (nSize > 1) {
+        Append( "{ " );
+    }
     SmNodeIterator it( pNode );
     while( it.Next( ) ) {
         it->Accept( this );
         Separate( );
     }
-    Append( "}" );
+    if (nSize > 1) {
+        Append( "} " );
+    }
 }
 
 void SmNodeToTextVisitor::Visit( SmPolyLineNode* )
-- 
1.7.3.2


--=-2YfWaiRb/ZXYxDWyu/lZ
Content-Disposition: attachment; filename*0=0001-Clear-2-things-from-the-visual-formula-editor-todo-l.pat; filename*1=ch
Content-Type: text/x-patch; name="0001-Clear-2-things-from-the-visual-formula-editor-todo-l.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the LibreOffice mailing list