[Libreoffice-commits] core.git: starmath/inc starmath/qa starmath/source

Takeshi Abe tabe at fixedpoint.jp
Tue Apr 18 10:47:51 UTC 2017


 starmath/inc/caret.hxx               |    2 
 starmath/inc/node.hxx                |   74 +++++++++++------------
 starmath/qa/cppunit/mock-visitor.hxx |  108 +++++++++++++++++------------------
 starmath/qa/cppunit/test_node.cxx    |    4 -
 starmath/qa/cppunit/test_parse.cxx   |   16 ++---
 starmath/source/cursor.cxx           |   80 ++++++++++++-------------
 starmath/source/mathmlexport.cxx     |   82 +++++++++++++-------------
 starmath/source/mathmlimport.cxx     |   10 +--
 starmath/source/mathtype.cxx         |   34 +++++------
 starmath/source/node.cxx             |   24 +++----
 starmath/source/ooxmlexport.cxx      |   10 +--
 starmath/source/rtfexport.cxx        |   10 +--
 starmath/source/visitors.cxx         |   30 ++++-----
 starmath/source/wordexportbase.cxx   |   40 ++++++------
 14 files changed, 262 insertions(+), 262 deletions(-)

New commits:
commit d52d230fc204b7b2b0d9b27445b496b0113a8dd5
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon Apr 17 18:38:38 2017 +0900

    starmath: Convert SmNodeType to scoped enum
    
    Change-Id: I30921f9426e0e50ab8c6dfb1e86400847176b707
    Reviewed-on: https://gerrit.libreoffice.org/36613
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index a1d12cd4c7c2..e21c0b40e1f6 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -54,7 +54,7 @@ struct SmCaretPos{
      * Unless pNode is an instance of SmTextNode, then the index is the text length.
      */
     static SmCaretPos GetPosAfter(SmNode* pNode) {
-        if(pNode && pNode->GetType() == NTEXT)
+        if(pNode && pNode->GetType() == SmNodeType::Text)
             return SmCaretPos(pNode, static_cast<SmTextNode*>(pNode)->GetText().getLength());
         return SmCaretPos(pNode, 1);
     }
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 7c9fbcec892b..52487fcef0ae 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -79,14 +79,14 @@ typedef std::vector< SmNode * > SmNodeArray;
 
 enum SmScaleMode    { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT };
 
-enum SmNodeType
-{
-/* 0*/ NTABLE,         NBRACE,         NBRACEBODY,     NOPER,          NALIGN,
-/* 5*/ NATTRIBUT,      NFONT,          NUNHOR,         NBINHOR,        NBINVER,
-/*10*/ NBINDIAGONAL,   NSUBSUP,        NMATRIX,        NPLACE,         NTEXT,
-/*15*/ NSPECIAL,       NGLYPH_SPECIAL, NMATH,          NBLANK,         NERROR,
-/*20*/ NLINE,          NEXPRESSION,    NPOLYLINE,      NROOT,          NROOTSYMBOL,
-/*25*/ NRECTANGLE,  NVERTICAL_BRACE, NMATHIDENT
+enum class SmNodeType
+{
+/* 0*/ Table,       Brace,         Bracebody,     Oper,        Align,
+/* 5*/ Attribut,    Font,          UnHor,         BinHor,      BinVer,
+/*10*/ BinDiagonal, SubSup,        Matrix,        Place,       Text,
+/*15*/ Special,     GlyphSpecial,  Math,          Blank,       Error,
+/*20*/ Line,        Expression,    PolyLine,      Root,        RootSymbol,
+/*25*/ Rectangle,   VerticalBrace, MathIdent
 };
 
 
@@ -320,7 +320,7 @@ class SmRectangleNode : public SmGraphicNode
 
 public:
     explicit SmRectangleNode(const SmToken &rNodeToken)
-    :   SmGraphicNode(NRECTANGLE, rNodeToken)
+        : SmGraphicNode(SmNodeType::Rectangle, rNodeToken)
     {}
 
     virtual void AdaptToX(OutputDevice &rDev, sal_uLong nWidth) override;
@@ -458,7 +458,7 @@ class SmGlyphSpecialNode : public SmSpecialNode
 {
 public:
     explicit SmGlyphSpecialNode(const SmToken &rNodeToken)
-    :   SmSpecialNode(NGLYPH_SPECIAL, rNodeToken, FNT_MATH)
+        : SmSpecialNode(SmNodeType::GlyphSpecial, rNodeToken, FNT_MATH)
     {}
 
     virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
@@ -504,7 +504,7 @@ class SmMathIdentifierNode : public SmMathSymbolNode
 {
 public:
     explicit SmMathIdentifierNode(const SmToken &rNodeToken)
-    :   SmMathSymbolNode(NMATHIDENT, rNodeToken) {}
+        : SmMathSymbolNode(SmNodeType::MathIdent, rNodeToken) {}
 };
 
 
@@ -520,7 +520,7 @@ class SmRootSymbolNode : public SmMathSymbolNode
 
 public:
     explicit SmRootSymbolNode(const SmToken &rNodeToken)
-        : SmMathSymbolNode(NROOTSYMBOL, rNodeToken)
+        : SmMathSymbolNode(SmNodeType::RootSymbol, rNodeToken)
         , mnBodyWidth(0)
     {
     }
@@ -543,10 +543,10 @@ class SmPlaceNode : public SmMathSymbolNode
 {
 public:
     explicit SmPlaceNode(const SmToken &rNodeToken)
-    :   SmMathSymbolNode(NPLACE, rNodeToken)
+        : SmMathSymbolNode(SmNodeType::Place, rNodeToken)
     {
     }
-    SmPlaceNode() : SmMathSymbolNode(NPLACE, SmToken(TPLACE, MS_PLACE, "<?>")) {};
+    SmPlaceNode() : SmMathSymbolNode(SmNodeType::Place, SmToken(TPLACE, MS_PLACE, "<?>")) {};
 
     virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) override;
     virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
@@ -563,7 +563,7 @@ class SmErrorNode : public SmMathSymbolNode
 {
 public:
     explicit SmErrorNode(const SmToken &rNodeToken)
-    :   SmMathSymbolNode(NERROR, rNodeToken)
+        : SmMathSymbolNode(SmNodeType::Error, rNodeToken)
     {
         SetText(OUString(MS_ERROR));
     }
@@ -586,7 +586,7 @@ class SmTableNode : public SmStructureNode
     long mnFormulaBaseline;
 public:
     explicit SmTableNode(const SmToken &rNodeToken)
-        :   SmStructureNode(NTABLE, rNodeToken)
+        : SmStructureNode(SmNodeType::Table, rNodeToken)
         , mnFormulaBaseline(0)
     {
     }
@@ -618,7 +618,7 @@ protected:
 
 public:
     explicit SmLineNode(const SmToken &rNodeToken)
-        : SmStructureNode(NLINE, rNodeToken)
+        : SmStructureNode(SmNodeType::Line, rNodeToken)
         , mbUseExtraSpaces(true)
     {
     }
@@ -642,7 +642,7 @@ class SmExpressionNode : public SmLineNode
 {
 public:
     explicit SmExpressionNode(const SmToken &rNodeToken)
-    :   SmLineNode(NEXPRESSION, rNodeToken)
+        : SmLineNode(SmNodeType::Expression, rNodeToken)
     {}
 
     virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
@@ -659,7 +659,7 @@ class SmUnHorNode : public SmStructureNode
 {
 public:
     explicit SmUnHorNode(const SmToken &rNodeToken)
-        : SmStructureNode(NUNHOR, rNodeToken, 2)
+        : SmStructureNode(SmNodeType::UnHor, rNodeToken, 2)
     {
     }
 
@@ -683,7 +683,7 @@ class SmRootNode : public SmStructureNode
 {
 public:
     explicit SmRootNode(const SmToken &rNodeToken)
-        : SmStructureNode(NROOT, rNodeToken, 3)
+        : SmStructureNode(SmNodeType::Root, rNodeToken, 3)
     {
     }
 
@@ -715,7 +715,7 @@ class SmBinHorNode : public SmStructureNode
 {
 public:
     explicit SmBinHorNode(const SmToken &rNodeToken)
-        : SmStructureNode(NBINHOR, rNodeToken, 3)
+        : SmStructureNode(SmNodeType::BinHor, rNodeToken, 3)
     {
     }
 
@@ -747,7 +747,7 @@ class SmBinVerNode : public SmStructureNode
 {
 public:
     explicit SmBinVerNode(const SmToken &rNodeToken)
-        : SmStructureNode(NBINVER, rNodeToken, 3)
+        : SmStructureNode(SmNodeType::BinVer, rNodeToken, 3)
     {
     }
 
@@ -778,7 +778,7 @@ class SmBinDiagonalNode : public SmStructureNode
 
 public:
     explicit SmBinDiagonalNode(const SmToken &rNodeToken)
-        : SmStructureNode(NBINDIAGONAL, rNodeToken, 3)
+        : SmStructureNode(SmNodeType::BinDiagonal, rNodeToken, 3)
         , mbAscending(false)
     {
     }
@@ -837,7 +837,7 @@ class SmSubSupNode : public SmStructureNode
 
 public:
     explicit SmSubSupNode(const SmToken &rNodeToken)
-        : SmStructureNode(NSUBSUP, rNodeToken, 1 + SUBSUP_NUM_ENTRIES)
+        : SmStructureNode(SmNodeType::SubSup, rNodeToken, 1 + SUBSUP_NUM_ENTRIES)
         , mbUseLimits(false)
     {
     }
@@ -887,7 +887,7 @@ class SmBraceNode : public SmStructureNode
 {
 public:
     explicit SmBraceNode(const SmToken &rNodeToken)
-        : SmStructureNode(NBRACE, rNodeToken, 3)
+        : SmStructureNode(SmNodeType::Brace, rNodeToken, 3)
     {
     }
 
@@ -919,7 +919,7 @@ class SmBracebodyNode : public SmStructureNode
 
 public:
     explicit SmBracebodyNode(const SmToken &rNodeToken)
-        : SmStructureNode(NBRACEBODY, rNodeToken)
+        : SmStructureNode(SmNodeType::Bracebody, rNodeToken)
         , mnBodyHeight(0)
     {
     }
@@ -960,7 +960,7 @@ public:
 
 
 inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken)
-    : SmStructureNode(NVERTICAL_BRACE, rNodeToken, 3)
+    : SmStructureNode(SmNodeType::VerticalBrace, rNodeToken, 3)
 {
 }
 
@@ -979,7 +979,7 @@ class SmOperNode : public SmStructureNode
 {
 public:
     explicit SmOperNode(const SmToken &rNodeToken)
-        : SmStructureNode(NOPER, rNodeToken, 2)
+        : SmStructureNode(SmNodeType::Oper, rNodeToken, 2)
     {
     }
 
@@ -1004,7 +1004,7 @@ class SmAlignNode : public SmStructureNode
 {
 public:
     explicit SmAlignNode(const SmToken &rNodeToken)
-    :   SmStructureNode(NALIGN, rNodeToken)
+        : SmStructureNode(SmNodeType::Align, rNodeToken)
     {}
 
     virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
@@ -1026,7 +1026,7 @@ class SmAttributNode : public SmStructureNode
 {
 public:
     explicit SmAttributNode(const SmToken &rNodeToken)
-    :   SmStructureNode(NATTRIBUT, rNodeToken, 2)
+        : SmStructureNode(SmNodeType::Attribut, rNodeToken, 2)
     {}
 
     virtual void Arrange(OutputDevice &rDev, const SmFormat &rFormat) override;
@@ -1051,7 +1051,7 @@ class SmFontNode : public SmStructureNode
 
 public:
     explicit SmFontNode(const SmToken &rNodeToken)
-        : SmStructureNode(NFONT, rNodeToken)
+        : SmStructureNode(SmNodeType::Font, rNodeToken)
         , meSizeType(FontSizeType::MULTIPLY)
         , maFontSize(1)
     {
@@ -1080,7 +1080,7 @@ class SmMatrixNode : public SmStructureNode
 
 public:
     explicit SmMatrixNode(const SmToken &rNodeToken)
-        : SmStructureNode(NMATRIX, rNodeToken)
+        : SmStructureNode(SmNodeType::Matrix, rNodeToken)
         , mnNumRows(0)
         , mnNumCols(0)
     {
@@ -1108,7 +1108,7 @@ class SmBlankNode : public SmGraphicNode
 
 public:
     explicit SmBlankNode(const SmToken &rNodeToken)
-        : SmGraphicNode(NBLANK, rNodeToken)
+        : SmGraphicNode(SmNodeType::Blank, rNodeToken)
         , mnNum(0)
     {
     }
@@ -1137,7 +1137,7 @@ inline const SmNode* SmRootNode::Argument() const
 inline SmRootSymbolNode* SmRootNode::Symbol()
 {
     assert( GetNumSubNodes() == 3 );
-    assert( GetSubNode( 1 )->GetType() == NROOTSYMBOL );
+    assert( GetSubNode( 1 )->GetType() == SmNodeType::RootSymbol );
     return static_cast< SmRootSymbolNode* >( GetSubNode( 1 ));
 }
 inline const SmRootSymbolNode* SmRootNode::Symbol() const
@@ -1205,7 +1205,7 @@ inline const SmNode* SmAttributNode::Body() const
 inline SmMathSymbolNode* SmBraceNode::OpeningBrace()
 {
     assert( GetNumSubNodes() == 3 );
-    assert( GetSubNode( 0 )->GetType() == NMATH );
+    assert( GetSubNode( 0 )->GetType() == SmNodeType::Math );
     return static_cast< SmMathSymbolNode* >( GetSubNode( 0 ));
 }
 inline const SmMathSymbolNode* SmBraceNode::OpeningBrace() const
@@ -1224,7 +1224,7 @@ inline const SmNode* SmBraceNode::Body() const
 inline SmMathSymbolNode* SmBraceNode::ClosingBrace()
 {
     assert( GetNumSubNodes() == 3 );
-    assert( GetSubNode( 2 )->GetType() == NMATH );
+    assert( GetSubNode( 2 )->GetType() == SmNodeType::Math );
     return static_cast< SmMathSymbolNode* >( GetSubNode( 2 ));
 }
 inline const SmMathSymbolNode* SmBraceNode::ClosingBrace() const
@@ -1244,7 +1244,7 @@ inline const SmNode* SmVerticalBraceNode::Body() const
 inline SmMathSymbolNode* SmVerticalBraceNode::Brace()
 {
     assert( GetNumSubNodes() == 3 );
-    assert( GetSubNode( 1 )->GetType() == NMATH );
+    assert( GetSubNode( 1 )->GetType() == SmNodeType::Math );
     return static_cast< SmMathSymbolNode* >( GetSubNode( 1 ));
 }
 inline const SmMathSymbolNode* SmVerticalBraceNode::Brace() const
diff --git a/starmath/qa/cppunit/mock-visitor.hxx b/starmath/qa/cppunit/mock-visitor.hxx
index b3ed74803cbe..ca13e16e569c 100644
--- a/starmath/qa/cppunit/mock-visitor.hxx
+++ b/starmath/qa/cppunit/mock-visitor.hxx
@@ -20,8 +20,8 @@ public:
     virtual ~MockVisitor() {}
 
     void Visit( SmTableNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmTableNode should have type NTABLE",
-                                     NTABLE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmTableNode should have type SmNodeType::Table",
+                                     SmNodeType::Table, pNode->GetType());
         auto eTT = pNode->GetToken().eType;
         CPPUNIT_ASSERT_MESSAGE("The type of SmTableNode's token should be either TEND, TBINOM, or TSTACK",
                                eTT == TEND || eTT == TBINOM || eTT == TSTACK);
@@ -29,150 +29,150 @@ public:
     }
 
     void Visit( SmBraceNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBraceNode should have type NBRACE",
-                                     NBRACE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBraceNode should have type SmNodeType::Brace",
+                                     SmNodeType::Brace, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmBracebodyNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBracebodyNode should have type NBRACEBODY",
-                                     NBRACEBODY, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBracebodyNode should have type SmNodeType::Bracebody",
+                                     SmNodeType::Bracebody, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmOperNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmOperNode should have type NOPER",
-                                     NOPER, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmOperNode should have type SmNodeType::Oper",
+                                     SmNodeType::Oper, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmAlignNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmAlignNode should have type NALIGN",
-                                     NALIGN, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmAlignNode should have type SmNodeType::Align",
+                                     SmNodeType::Align, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmAttributNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmAttributNode should have type NATTRIBUT",
-                                     NATTRIBUT, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmAttributNode should have type SmNodeType::Attribut",
+                                     SmNodeType::Attribut, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmFontNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmFontNode should have type NFONT",
-                                     NFONT, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmFontNode should have type SmNodeType::Font",
+                                     SmNodeType::Font, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmUnHorNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmUnHorNode should have type NUNHOR",
-                                     NUNHOR, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmUnHorNode should have type SmNodeType::UnHor",
+                                     SmNodeType::UnHor, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmBinHorNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinHorNode should have type NBINHOR",
-                                     NBINHOR, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinHorNode should have type SmNodeType::BinHor",
+                                     SmNodeType::BinHor, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmBinVerNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinVerNode should have type NBINVER",
-                                     NBINVER, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinVerNode should have type SmNodeType::BinVer",
+                                     SmNodeType::BinVer, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmBinDiagonalNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinDiagonalNode should have type NBINDIAGONAL",
-                                     NBINDIAGONAL, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBinDiagonalNode should have type SmNodeType::BinDiagonal",
+                                     SmNodeType::BinDiagonal, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmSubSupNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmSubSupNode should have type NSUBSUP",
-                                     NSUBSUP, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmSubSupNode should have type SmNodeType::SubSup",
+                                     SmNodeType::SubSup, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmMatrixNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmMatrixNode should have type NMATRIX",
-                                     NMATRIX, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmMatrixNode should have type SmNodeType::Matrix",
+                                     SmNodeType::Matrix, pNode->GetType());
         CPPUNIT_ASSERT_EQUAL_MESSAGE("SmMatrixNode's token should be of type TMATRIX",
                                      TMATRIX, pNode->GetToken().eType);
         VisitChildren( pNode );
     }
 
     void Visit( SmPlaceNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmPlaceNode should have type NPLACE",
-                                     NPLACE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmPlaceNode should have type SmNodeType::Place",
+                                     SmNodeType::Place, pNode->GetType());
     }
 
     void Visit( SmTextNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmTextNode should have type NTEXT",
-                                     NTEXT, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmTextNode should have type SmNodeType::Text",
+                                     SmNodeType::Text, pNode->GetType());
     }
 
     void Visit( SmSpecialNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmSpecialNode should have type NSPECIAL",
-                                     NSPECIAL, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmSpecialNode should have type SmNodeType::Special",
+                                     SmNodeType::Special, pNode->GetType());
     }
 
     void Visit( SmGlyphSpecialNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmGlyphSpecialNode should have type NGLYPH_SPECIAL",
-                                     NGLYPH_SPECIAL, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmGlyphSpecialNode should have type SmNodeType::GlyphSpecial",
+                                     SmNodeType::GlyphSpecial, pNode->GetType());
     }
 
     void Visit( SmMathSymbolNode* pNode ) override {
-        CPPUNIT_ASSERT_MESSAGE("SmMathSymbolNode should have type NMATH or NMATHIDENT",
-                               pNode->GetType() == NMATH || pNode->GetType() == NMATHIDENT);
+        CPPUNIT_ASSERT_MESSAGE("SmMathSymbolNode should have type SmNodeType::Math or SmNodeType::MathIdent",
+                               pNode->GetType() == SmNodeType::Math || pNode->GetType() == SmNodeType::MathIdent);
     }
 
     void Visit( SmBlankNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBlankNode should have type NBLANK",
-                                     NBLANK, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmBlankNode should have type SmNodeType::Blank",
+                                     SmNodeType::Blank, pNode->GetType());
     }
 
     void Visit( SmErrorNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmErrorNode should have type NERROR",
-                                     NERROR, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmErrorNode should have type SmNodeType::Error",
+                                     SmNodeType::Error, pNode->GetType());
     }
 
     void Visit( SmLineNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmLineNode should have type NLINE",
-                                     NLINE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmLineNode should have type SmNodeType::Line",
+                                     SmNodeType::Line, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmExpressionNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmExpressionNode should have type NEXPRESSION",
-                                     NEXPRESSION, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmExpressionNode should have type SmNodeType::Expression",
+                                     SmNodeType::Expression, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmPolyLineNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmPolyLineNode should have type NPOLYLINE",
-                                     NPOLYLINE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmPolyLineNode should have type SmNodeType::PolyLine",
+                                     SmNodeType::PolyLine, pNode->GetType());
     }
 
     void Visit( SmRootNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRootNode should have type NROOT",
-                                     NROOT, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRootNode should have type SmNodeType::Root",
+                                     SmNodeType::Root, pNode->GetType());
         VisitChildren( pNode );
     }
 
     void Visit( SmRootSymbolNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRootSymbolNode should have type NROOTSYMBOL",
-                                     NROOTSYMBOL, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRootSymbolNode should have type SmNodeType::RootSymbol",
+                                     SmNodeType::RootSymbol, pNode->GetType());
     }
 
     void Visit( SmRectangleNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRectangleNode should have type NRECTANGLE",
-                                     NRECTANGLE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmRectangleNode should have type SmNodeType::Rectangle",
+                                     SmNodeType::Rectangle, pNode->GetType());
     }
 
     void Visit( SmVerticalBraceNode* pNode ) override {
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmVerticalBraceNode should have type NVERTICAL_BRACE",
-                                     NVERTICAL_BRACE, pNode->GetType());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("SmVerticalBraceNode should have type SmNodeType::VerticalBrace",
+                                     SmNodeType::VerticalBrace, pNode->GetType());
         VisitChildren( pNode );
     }
 
diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx
index e36b8100f682..017089acc628 100644
--- a/starmath/qa/cppunit/test_node.cxx
+++ b/starmath/qa/cppunit/test_node.cxx
@@ -92,11 +92,11 @@ void NodeTest::testTdf52225()
         CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pTree->GetNumSubNodes());   \
         const SmNode *pLine = pTree->GetSubNode(0);                     \
         CPPUNIT_ASSERT(pLine);                                          \
-        CPPUNIT_ASSERT_EQUAL(NLINE, pLine->GetType());                  \
+        CPPUNIT_ASSERT_EQUAL(SmNodeType::Line, pLine->GetType());       \
         CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pLine->GetNumSubNodes());   \
         const SmNode *pNode = pLine->GetSubNode(0);                     \
         CPPUNIT_ASSERT(pNode);                                          \
-        CPPUNIT_ASSERT_EQUAL(NSPECIAL, pNode->GetType());               \
+        CPPUNIT_ASSERT_EQUAL(SmNodeType::Special, pNode->GetType());    \
         const SmSpecialNode *pSn = static_cast<const SmSpecialNode *>(pNode); \
         CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pSn->GetText().getLength()); \
         CPPUNIT_ASSERT_EQUAL(sal_Unicode(code), pSn->GetText()[0]);     \
diff --git a/starmath/qa/cppunit/test_parse.cxx b/starmath/qa/cppunit/test_parse.cxx
index 12d21c240e0f..cd014ab3ad72 100644
--- a/starmath/qa/cppunit/test_parse.cxx
+++ b/starmath/qa/cppunit/test_parse.cxx
@@ -69,15 +69,15 @@ void ParseTest::testMinus()
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pNode->GetNumSubNodes());
     const SmNode *pNode0 = pNode->GetSubNode(0);
     CPPUNIT_ASSERT(pNode0);
-    CPPUNIT_ASSERT_EQUAL(NLINE, pNode0->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Line, pNode0->GetType());
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pNode0->GetNumSubNodes());
     const SmNode *pNode00 = pNode0->GetSubNode(0);
     CPPUNIT_ASSERT(pNode00);
-    CPPUNIT_ASSERT_EQUAL(NUNHOR, pNode00->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::UnHor, pNode00->GetType());
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pNode00->GetNumSubNodes());
     const SmNode *pNode000 = pNode00->GetSubNode(0);
     CPPUNIT_ASSERT(pNode000);
-    CPPUNIT_ASSERT_EQUAL(NMATH, pNode000->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Math, pNode000->GetType());
     // GetText() vs GetToken().aText
     CPPUNIT_ASSERT_EQUAL(OUString(MS_MINUS),
                          static_cast<const SmMathSymbolNode *>(pNode000)->GetText());
@@ -85,7 +85,7 @@ void ParseTest::testMinus()
                          static_cast<const SmMathSymbolNode *>(pNode000)->GetToken().aText);
     const SmNode *pNode001 = pNode00->GetSubNode(1);
     CPPUNIT_ASSERT(pNode001);
-    CPPUNIT_ASSERT_EQUAL(NTEXT, pNode001->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Text, pNode001->GetType());
     // GetText() vs GetToken().aText
     CPPUNIT_ASSERT(static_cast<const SmTextNode *>(pNode001)->GetText().isEmpty());
     CPPUNIT_ASSERT_EQUAL(OUString("1.2"),
@@ -102,21 +102,21 @@ void ParseTest::testNospace()
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pNode->GetNumSubNodes());
     const SmNode *pNode0 = pNode->GetSubNode(0);
     CPPUNIT_ASSERT(pNode0);
-    CPPUNIT_ASSERT_EQUAL(NLINE, pNode0->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Line, pNode0->GetType());
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pNode0->GetNumSubNodes());
     const SmNode *pNode00 = pNode0->GetSubNode(0);
     CPPUNIT_ASSERT(pNode00);
-    CPPUNIT_ASSERT_EQUAL(NEXPRESSION, pNode00->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Expression, pNode00->GetType());
     CPPUNIT_ASSERT(!static_cast<const SmExpressionNode *>(pNode00)->IsUseExtraSpaces());
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pNode00->GetNumSubNodes());
     const SmNode *pNode000 = pNode00->GetSubNode(0);
     CPPUNIT_ASSERT(pNode000);
-    CPPUNIT_ASSERT_EQUAL(NFONT, pNode000->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Font, pNode000->GetType());
     CPPUNIT_ASSERT_EQUAL(OUString("nitalic"),
                          static_cast<const SmFontNode *>(pNode000)->GetToken().aText);
     const SmNode *pNode001 = pNode00->GetSubNode(1);
     CPPUNIT_ASSERT(pNode001);
-    CPPUNIT_ASSERT_EQUAL(NEXPRESSION, pNode001->GetType());
+    CPPUNIT_ASSERT_EQUAL(SmNodeType::Expression, pNode001->GetType());
     CPPUNIT_ASSERT(static_cast<const SmExpressionNode *>(pNode001)->IsUseExtraSpaces());
     CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pNode00->GetNumSubNodes());
 }
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index b077f5980133..7c6ad9f4118e 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -184,7 +184,7 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
     assert(nLineOffset >= 0);
 
     //If we're in front of a node who's parent is a TABLE
-    if(pLineParent->GetType() == NTABLE && mpPosition->CaretPos.nIndex == 0 && nLineOffset > 0){
+    if(pLineParent->GetType() == SmNodeType::Table && mpPosition->CaretPos.nIndex == 0 && nLineOffset > 0){
         //Now we can merge with nLineOffset - 1
         BeginEdit();
         //Line to merge things into, so we can delete pLine
@@ -228,12 +228,12 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
         EndEdit();
 
     //TODO: If we're in an empty (sub/super/*) script
-    /*}else if(pLineParent->GetType() == NSUBSUP &&
+    /*}else if(pLineParent->GetType() == SmNodeType::SubSup &&
              nLineOffset != 0 &&
-             pLine->GetType() == NEXPRESSION &&
+             pLine->GetType() == SmNodeType::Expression &&
              pLine->GetNumSubNodes() == 0){
         //There's a (sub/super) script we can delete
-    //Consider selecting the entire script if GetNumSubNodes() != 0 or pLine->GetType() != NEXPRESSION
+    //Consider selecting the entire script if GetNumSubNodes() != 0 or pLine->GetType() != SmNodeType::Expression
     //TODO: Handle case where we delete a limit
     */
 
@@ -339,7 +339,7 @@ SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList,
     for(it = pLineList->begin(); it != pLineList->end(); ++it){
         if(*it == rCaretPos.pSelectedNode)
         {
-            if((*it)->GetType() == NTEXT)
+            if((*it)->GetType() == SmNodeType::Text)
             {
                 //Split textnode if needed
                 if(rCaretPos.nIndex > 0)
@@ -383,8 +383,8 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
     //Check if there's textnodes to merge
     if( prev &&
         next &&
-        prev->GetType() == NTEXT &&
-        next->GetType() == NTEXT &&
+        prev->GetType() == SmNodeType::Text &&
+        next->GetType() == SmNodeType::Text &&
         ( prev->GetToken().eType != TNUMBER ||
           next->GetToken().eType == TNUMBER) ){
         SmTextNode *pText = static_cast<SmTextNode*>(prev),
@@ -400,7 +400,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
     }
 
     //Check if there's a SmPlaceNode to remove:
-    if(prev && next && prev->GetType() == NPLACE && !SmNodeListParser::IsOperator(next->GetToken())){
+    if(prev && next && prev->GetType() == SmNodeType::Place && !SmNodeListParser::IsOperator(next->GetToken())){
         --aIter;
         aIter = pLineList->erase(aIter);
         delete prev;
@@ -411,7 +411,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
             return SmCaretPos();
         return SmCaretPos::GetPosAfter(*aIter);
     }
-    if(prev && next && next->GetType() == NPLACE && !SmNodeListParser::IsOperator(prev->GetToken())){
+    if(prev && next && next->GetType() == SmNodeType::Place && !SmNodeListParser::IsOperator(prev->GetToken())){
         aIter = pLineList->erase(aIter);
         delete next;
         return SmCaretPos::GetPosAfter(prev);
@@ -430,7 +430,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
     while(it != pLineList->end()){
         if((*it)->IsSelected()){
             //Split text nodes
-            if((*it)->GetType() == NTEXT) {
+            if((*it)->GetType() == SmNodeType::Text) {
                 SmTextNode* pText = static_cast<SmTextNode*>(*it);
                 OUString aText = pText->GetText();
                 //Start and lengths of the segments, 2 is the selected segment
@@ -533,7 +533,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
 
     //Wrap the subject in a SmSubSupNode
     SmSubSupNode* pSubSup;
-    if(pSubject->GetType() != NSUBSUP){
+    if(pSubject->GetType() != SmNodeType::SubSup){
         SmToken token;
         token.nGroup = TG::Power;
         pSubSup = new SmSubSupNode(token);
@@ -588,12 +588,12 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup) {
     //Find a subject to set limits on
     SmOperNode *pSubject = nullptr;
     //Check if pSelectedNode might be a subject
-    if(mpPosition->CaretPos.pSelectedNode->GetType() == NOPER)
+    if(mpPosition->CaretPos.pSelectedNode->GetType() == SmNodeType::Oper)
         pSubject = static_cast<SmOperNode*>(mpPosition->CaretPos.pSelectedNode);
     else {
         //If not, check if parent of the current line is a SmOperNode
         SmNode *pLineNode = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode);
-        if(pLineNode->GetParent() && pLineNode->GetParent()->GetType() == NOPER)
+        if(pLineNode->GetParent() && pLineNode->GetParent()->GetType() == SmNodeType::Oper)
             pSubject = static_cast<SmOperNode*>(pLineNode->GetParent());
     }
 
@@ -606,7 +606,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup) {
     //Find the sub sup node
     SmSubSupNode *pSubSup = nullptr;
     //Check if there's already one there...
-    if(pSubject->GetSubNode(0)->GetType() == NSUBSUP)
+    if(pSubject->GetSubNode(0)->GetType() == SmNodeType::SubSup)
         pSubSup = static_cast<SmSubSupNode*>(pSubject->GetSubNode(0));
     else { //if not create a new SmSubSupNode
         SmToken token;
@@ -765,18 +765,18 @@ bool SmCursor::InsertRow() {
     SmTableNode  *pTable  = nullptr;
     SmMatrixNode *pMatrix = nullptr;
     int nTableIndex = nParentIndex;
-    if(pLineParent->GetType() == NTABLE)
+    if(pLineParent->GetType() == SmNodeType::Table)
         pTable = static_cast<SmTableNode*>(pLineParent);
     //If it's wrapped in a SmLineNode, we can still insert a newline
-    else if(pLineParent->GetType() == NLINE &&
+    else if(pLineParent->GetType() == SmNodeType::Line &&
             pLineParent->GetParent() &&
-            pLineParent->GetParent()->GetType() == NTABLE) {
+            pLineParent->GetParent()->GetType() == SmNodeType::Table) {
         //NOTE: This hack might give problems if we stop ignoring SmAlignNode
         pTable = static_cast<SmTableNode*>(pLineParent->GetParent());
         nTableIndex = pTable->IndexOfSubNode(pLineParent);
         assert(nTableIndex >= 0);
     }
-    if(pLineParent->GetType() == NMATRIX)
+    if(pLineParent->GetType() == SmNodeType::Matrix)
         pMatrix = static_cast<SmMatrixNode*>(pLineParent);
 
     //If we're not in a context that supports InsertRow, return sal_False
@@ -815,7 +815,7 @@ bool SmCursor::InsertRow() {
         SmNode *pNewLine = SmNodeListParser().Parse(pNewLineList);
         delete pNewLineList;
         //Wrap pNewLine in SmLineNode if needed
-        if(pLineParent->GetType() == NLINE) {
+        if(pLineParent->GetType() == SmNodeType::Line) {
             SmLineNode *pNewLineNode = new SmLineNode(SmToken(TNEWLINE, '\0', "newline"));
             pNewLineNode->SetSubNodes(pNewLine, nullptr);
             pNewLine = pNewLineNode;
@@ -1132,7 +1132,7 @@ void SmCursor::Copy(){
         CloneLineToClipboard(static_cast<SmStructureNode*>(pLine), &aClipboard);
     else{
         //Special care to only clone selected text
-        if(pLine->GetType() == NTEXT) {
+        if(pLine->GetType() == SmNodeType::Text) {
             SmTextNode *pText = static_cast<SmTextNode*>(pLine);
             std::unique_ptr<SmTextNode> pClone(new SmTextNode( pText->GetToken(), pText->GetFontDesc() ));
             int start  = pText->GetSelectionStart(),
@@ -1214,15 +1214,15 @@ SmNodeList* SmCursor::LineToList(SmStructureNode* pLine, SmNodeList* list){
         if (!pChild)
             continue;
         switch(pChild->GetType()){
-            case NLINE:
-            case NUNHOR:
-            case NEXPRESSION:
-            case NBINHOR:
-            case NALIGN:
-            case NFONT:
+            case SmNodeType::Line:
+            case SmNodeType::UnHor:
+            case SmNodeType::Expression:
+            case SmNodeType::BinHor:
+            case SmNodeType::Align:
+            case SmNodeType::Font:
                 LineToList(static_cast<SmStructureNode*>(pChild), list);
                 break;
-            case NERROR:
+            case SmNodeType::Error:
                 delete pChild;
                 break;
             default:
@@ -1243,9 +1243,9 @@ void SmCursor::CloneLineToClipboard(SmStructureNode* pLine, SmClipboard* pClipbo
             continue;
         if( IsLineCompositionNode( pChild ) )
             CloneLineToClipboard( static_cast<SmStructureNode*>(pChild), pClipboard );
-        else if( pChild->IsSelected() && pChild->GetType() != NERROR ) {
+        else if( pChild->IsSelected() && pChild->GetType() != SmNodeType::Error ) {
             //Only clone selected text from SmTextNode
-            if(pChild->GetType() == NTEXT) {
+            if(pChild->GetType() == SmNodeType::Text) {
                 SmTextNode *pText = static_cast<SmTextNode*>(pChild);
                 std::unique_ptr<SmTextNode> pClone(new SmTextNode( pChild->GetToken(), pText->GetFontDesc() ));
                 int start = pText->GetSelectionStart(),
@@ -1261,12 +1261,12 @@ void SmCursor::CloneLineToClipboard(SmStructureNode* pLine, SmClipboard* pClipbo
 
 bool SmCursor::IsLineCompositionNode(SmNode* pNode){
     switch(pNode->GetType()){
-        case NLINE:
-        case NUNHOR:
-        case NEXPRESSION:
-        case NBINHOR:
-        case NALIGN:
-        case NFONT:
+        case SmNodeType::Line:
+        case SmNodeType::UnHor:
+        case SmNodeType::Expression:
+        case SmNodeType::BinHor:
+        case SmNodeType::Align:
+        case SmNodeType::Font:
             return true;
         default:
             return false;
@@ -1310,7 +1310,7 @@ void SmCursor::FinishEdit(SmNodeList* pLineList,
     delete pLineList;
 
     //Check if we're making the body of a subsup node bigger than one
-    if(pParent->GetType() == NSUBSUP &&
+    if(pParent->GetType() == SmNodeType::SubSup &&
        nParentIndex == 0 &&
        entries > 1) {
         //Wrap pLine in scalable round brackets
@@ -1418,7 +1418,7 @@ bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBra
 
     SmNode* pNode = pos.pSelectedNode;
 
-    if (pNode->GetType() == NTEXT) {
+    if (pNode->GetType() == SmNodeType::Text) {
         SmTextNode* pTextNode = static_cast<SmTextNode*>(pNode);
         if (pos.nIndex < pTextNode->GetText().getLength()) {
             // The cursor is on a text node and at the middle of it.
@@ -1445,14 +1445,14 @@ bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBra
         }
 
         pNode = pParentNode;
-        if (pNode->GetType() == NBRACEBODY) {
+        if (pNode->GetType() == SmNodeType::Bracebody) {
             // Found the brace body node.
             break;
         }
     }
 
     SmStructureNode* pBraceNodeTmp = pNode->GetParent();
-    if (!pBraceNodeTmp || pBraceNodeTmp->GetType() != NBRACE) {
+    if (!pBraceNodeTmp || pBraceNodeTmp->GetType() != SmNodeType::Brace) {
         // Brace node is invalid.
         return false;
     }
@@ -1498,7 +1498,7 @@ SmNode* SmNodeListParser::Parse(SmNodeList* list){
     //Delete error nodes
     SmNodeList::iterator it = pList->begin();
     while(it != pList->end()) {
-        if((*it)->GetType() == NERROR){
+        if((*it)->GetType() == SmNodeType::Error){
             //Delete and erase
             delete *it;
             it = pList->erase(it);
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 8aaa96dbecba..9bc174abe026 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -628,7 +628,7 @@ void SmXMLExport::ExportBinaryHorizontal(const SmNode *pNode, int nLevel)
     {
         const SmNode *node = s.top();
         s.pop();
-        if (node->GetType() != NBINHOR || node->GetToken().nGroup != nGroup)
+        if (node->GetType() != SmNodeType::BinHor || node->GetToken().nGroup != nGroup)
         {
             ExportNodes(node, nLevel+1);
             continue;
@@ -653,7 +653,7 @@ void SmXMLExport::ExportExpression(const SmNode *pNode, int nLevel,
 
     // #i115443: nodes of type expression always need to be grouped with mrow statement
     if (!bNoMrowContainer &&
-        (nSize > 1 || pNode->GetType() == NEXPRESSION))
+        (nSize > 1 || pNode->GetType() == SmNodeType::Expression))
         pRow = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MROW, true, true);
 
     for (sal_uInt16 i = 0; i < nSize; i++)
@@ -668,14 +668,14 @@ void SmXMLExport::ExportBinaryVertical(const SmNode *pNode, int nLevel)
     assert(pNode->GetNumSubNodes() == 3);
     const SmNode *pNum = pNode->GetSubNode(0);
     const SmNode *pDenom = pNode->GetSubNode(2);
-    if (pNum->GetType() == NALIGN && pNum->GetToken().eType != TALIGNC)
+    if (pNum->GetType() == SmNodeType::Align && pNum->GetToken().eType != TALIGNC)
     {
         // A left or right alignment is specified on the numerator:
         // attach the corresponding numalign attribute.
         AddAttribute(XML_NAMESPACE_MATH, XML_NUMALIGN,
             pNum->GetToken().eType == TALIGNL ? XML_LEFT : XML_RIGHT);
     }
-    if (pDenom->GetType() == NALIGN && pDenom->GetToken().eType != TALIGNC)
+    if (pDenom->GetType() == SmNodeType::Align && pDenom->GetToken().eType != TALIGNC)
     {
         // A left or right alignment is specified on the denominator:
         // attach the corresponding denomalign attribute.
@@ -734,7 +734,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
     if (nSize >= 1)
     {
         const SmNode *pLine = pNode->GetSubNode(nSize-1);
-        if (pLine->GetType() == NLINE && pLine->GetNumSubNodes() == 1 &&
+        if (pLine->GetType() == SmNodeType::Line && pLine->GetNumSubNodes() == 1 &&
             pLine->GetSubNode(0) != nullptr &&
             pLine->GetSubNode(0)->GetToken().eType == TNEWLINE)
             --nSize;
@@ -754,21 +754,21 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
             {
                 pRow  = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTR, true, true);
                 SmTokenType eAlign = TALIGNC;
-                if (pTemp->GetType() == NALIGN)
+                if (pTemp->GetType() == SmNodeType::Align)
                 {
-                    // For Binom() and Stack() constructions, the NALIGN nodes
+                    // For Binom() and Stack() constructions, the SmNodeType::Align nodes
                     // are direct children.
                     // binom{alignl ...}{alignr ...} and
                     // stack{alignl ... ## alignr ... ## ...}
                     eAlign = pTemp->GetToken().eType;
                 }
-                else if (pTemp->GetType() == NLINE &&
+                else if (pTemp->GetType() == SmNodeType::Line &&
                          pTemp->GetNumSubNodes() == 1 &&
                          pTemp->GetSubNode(0) &&
-                         pTemp->GetSubNode(0)->GetType() == NALIGN)
+                         pTemp->GetSubNode(0)->GetType() == SmNodeType::Align)
                 {
-                    // For the Table() construction, the NALIGN node is a child
-                    // of an NLINE node.
+                    // For the Table() construction, the SmNodeType::Align node is a child
+                    // of an SmNodeType::Line node.
                     // alignl ... newline alignr ... newline ...
                     eAlign = pTemp->GetSubNode(0)->GetToken().eType;
                 }
@@ -794,12 +794,12 @@ void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/)
     const SmTextNode *pTemp = static_cast<const SmTextNode *>(pNode);
     SvXMLElementExport *pMath = nullptr;
 
-    if (pNode->GetType() == NMATH || pNode->GetType() == NGLYPH_SPECIAL)
+    if (pNode->GetType() == SmNodeType::Math || pNode->GetType() == SmNodeType::GlyphSpecial)
     {
-        // Export NMATH and NGLYPH_SPECIAL symbols as <mo> elements
+        // Export SmNodeType::Math and SmNodeType::GlyphSpecial symbols as <mo> elements
         pMath = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MO, true, false);
     }
-    else if (pNode->GetType() == NSPECIAL)
+    else if (pNode->GetType() == SmNodeType::Special)
     {
         bool bIsItalic = IsItalic(pNode->GetFont());
         if (!bIsItalic)
@@ -808,14 +808,14 @@ void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/)
     }
     else
     {
-        // Export NMATHIDENT and NPLACE symbols as <mi> elements:
+        // Export SmNodeType::MathIdent and SmNodeType::Place symbols as <mi> elements:
         // - These math symbols should not be drawn slanted. Hence we should
         // attach a mathvariant="normal" attribute to single-char <mi> elements
         // that are not mathematical alphanumeric symbol. For simplicity and to
         // work around browser limitations, we always attach such an attribute.
         // - The MathML specification suggests to use empty <mi> elements as
         // placeholders but they won't be visible in most MathML rendering
-        // engines so let's use an empty square for NPLACE instead.
+        // engines so let's use an empty square for SmNodeType::Place instead.
         AddAttribute(XML_NAMESPACE_MATH, XML_MATHVARIANT, XML_NORMAL);
         pMath = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MI, true, false);
     }
@@ -1436,7 +1436,7 @@ void SmXMLExport::ExportMatrix(const SmNode *pNode, int nLevel)
         for (sal_uInt16 x = 0; x < pMatrix->GetNumCols(); x++)
             if (const SmNode *pTemp = pNode->GetSubNode(i++))
             {
-                if (pTemp->GetType() == NALIGN &&
+                if (pTemp->GetType() == SmNodeType::Align &&
                     pTemp->GetToken().eType != TALIGNC)
                 {
                     // A left or right alignment is specified on this cell,
@@ -1457,22 +1457,22 @@ void SmXMLExport::ExportNodes(const SmNode *pNode, int nLevel)
         return;
     switch(pNode->GetType())
     {
-        case NTABLE:
+        case SmNodeType::Table:
             ExportTable(pNode, nLevel);
             break;
-        case NALIGN:
-        case NBRACEBODY:
-        case NEXPRESSION:
+        case SmNodeType::Align:
+        case SmNodeType::Bracebody:
+        case SmNodeType::Expression:
             ExportExpression(pNode, nLevel);
             break;
-        case NLINE:
+        case SmNodeType::Line:
             ExportLine(pNode, nLevel);
             break;
-        case NTEXT:
+        case SmNodeType::Text:
             ExportText(pNode, nLevel);
             break;
-        case NGLYPH_SPECIAL:
-        case NMATH:
+        case SmNodeType::GlyphSpecial:
+        case SmNodeType::Math:
             {
                 sal_Unicode cTmp = 0;
                 const SmTextNode *pTemp = static_cast< const SmTextNode * >(pNode);
@@ -1520,48 +1520,48 @@ void SmXMLExport::ExportNodes(const SmNode *pNode, int nLevel)
                 }
             }
             break;
-        case NSPECIAL: //NSPECIAL requires some sort of Entity preservation in the XML engine.
-        case NMATHIDENT :
-        case NPLACE:
+        case SmNodeType::Special: //SmNodeType::Special requires some sort of Entity preservation in the XML engine.
+        case SmNodeType::MathIdent:
+        case SmNodeType::Place:
             ExportMath(pNode, nLevel);
             break;
-        case NBINHOR:
+        case SmNodeType::BinHor:
             ExportBinaryHorizontal(pNode, nLevel);
             break;
-        case NUNHOR:
+        case SmNodeType::UnHor:
             ExportUnaryHorizontal(pNode, nLevel);
             break;
-        case NBRACE:
+        case SmNodeType::Brace:
             ExportBrace(pNode, nLevel);
             break;
-        case NBINVER:
+        case SmNodeType::BinVer:
             ExportBinaryVertical(pNode, nLevel);
             break;
-        case NBINDIAGONAL:
+        case SmNodeType::BinDiagonal:
             ExportBinaryDiagonal(pNode, nLevel);
             break;
-        case NSUBSUP:
+        case SmNodeType::SubSup:
             ExportSubSupScript(pNode, nLevel);
             break;
-        case NROOT:
+        case SmNodeType::Root:
             ExportRoot(pNode, nLevel);
             break;
-        case NOPER:
+        case SmNodeType::Oper:
             ExportOperator(pNode, nLevel);
             break;
-        case NATTRIBUT:
+        case SmNodeType::Attribut:
             ExportAttributes(pNode, nLevel);
             break;
-        case NFONT:
+        case SmNodeType::Font:
             ExportFont(pNode, nLevel);
             break;
-        case NVERTICAL_BRACE:
+        case SmNodeType::VerticalBrace:
             ExportVerticalBrace(static_cast<const SmVerticalBraceNode *>(pNode), nLevel);
             break;
-        case NMATRIX:
+        case SmNodeType::Matrix:
             ExportMatrix(pNode, nLevel);
             break;
-        case NBLANK:
+        case SmNodeType::Blank:
             ExportBlank(pNode, nLevel);
             break;
        default:
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 13cf4d62a01e..96c2aa05ae70 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -495,7 +495,7 @@ void SmXMLImport::endDocument()
 {
     //Set the resulted tree into the SmDocShell where it belongs
     SmNode *pTree = popOrZero(aNodeStack);
-    if (pTree && pTree->GetType() == NTABLE)
+    if (pTree && pTree->GetType() == SmNodeType::Table)
     {
         uno::Reference <frame::XModel> xModel = GetModel();
         uno::Reference <lang::XUnoTunnel> xTunnel(xModel,uno::UNO_QUERY);
@@ -2411,9 +2411,9 @@ void SmXMLRowContext_Impl::EndElement()
         //ourselves, and creating the appropriate dummy StarMath none bracket
         //to balance the arrangement
         if (((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
-            && (aRelationArray[0]->GetType() == NMATH))
+            && (aRelationArray[0]->GetType() == SmNodeType::Math))
         || ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
-            && (aRelationArray[nSize-1]->GetType() == NMATH)))
+            && (aRelationArray[nSize-1]->GetType() == SmNodeType::Math)))
         {
             SmToken aToken;
             aToken.cMathChar = '\0';
@@ -2421,7 +2421,7 @@ void SmXMLRowContext_Impl::EndElement()
 
             int nLeft=0,nRight=0;
             if ((aRelationArray[0]->GetScaleMode() == SCALE_HEIGHT)
-                && (aRelationArray[0]->GetType() == NMATH))
+                && (aRelationArray[0]->GetType() == SmNodeType::Math))
             {
                 aToken = aRelationArray[0]->GetToken();
                 nLeft=1;
@@ -2433,7 +2433,7 @@ void SmXMLRowContext_Impl::EndElement()
             SmNode *pLeft = new SmMathSymbolNode(aToken);
 
             if ((aRelationArray[nSize-1]->GetScaleMode() == SCALE_HEIGHT)
-                && (aRelationArray[nSize-1]->GetType() == NMATH))
+                && (aRelationArray[nSize-1]->GetType() == SmNodeType::Math))
             {
                 aToken = aRelationArray[nSize-1]->GetToken();
                 nRight=1;
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index e9fe0cee8a87..058b836c4f59 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -1952,28 +1952,28 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
 {
     switch(pNode->GetType())
     {
-        case NATTRIBUT:
+        case SmNodeType::Attribut:
             HandleAttributes(pNode,nLevel);
             break;
-        case NTEXT:
+        case SmNodeType::Text:
             HandleText(pNode,nLevel);
             break;
-        case NVERTICAL_BRACE:
+        case SmNodeType::VerticalBrace:
             HandleVerticalBrace(pNode,nLevel);
             break;
-        case NBRACE:
+        case SmNodeType::Brace:
             HandleBrace(pNode,nLevel);
             break;
-        case NOPER:
+        case SmNodeType::Oper:
             HandleOperator(pNode,nLevel);
             break;
-        case NBINVER:
+        case SmNodeType::BinVer:
             HandleFractions(pNode,nLevel);
             break;
-        case NROOT:
+        case SmNodeType::Root:
             HandleRoot(pNode,nLevel);
             break;
-        case NSPECIAL:
+        case SmNodeType::Special:
             {
             SmTextNode *pText = static_cast<SmTextNode *>(pNode);
             //if the token str and the result text are the same then this
@@ -1984,14 +1984,14 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
                 HandleMath(pText,nLevel);
             }
             break;
-        case NMATH:
-        case NMATHIDENT:
+        case SmNodeType::Math:
+        case SmNodeType::MathIdent:
             HandleMath(pNode,nLevel);
             break;
-        case NSUBSUP:
+        case SmNodeType::SubSup:
             HandleSubSupScript(pNode,nLevel);
             break;
-        case NEXPRESSION:
+        case SmNodeType::Expression:
             {
             sal_uInt16  nSize = pNode->GetNumSubNodes();
             for (sal_uInt16 i = 0; i < nSize; i++)
@@ -1999,14 +1999,14 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
                     HandleNodes(pTemp,nLevel+1);
             }
             break;
-        case NTABLE:
+        case SmNodeType::Table:
             //Root Node, PILE equivalent, i.e. vertical stack
             HandleTable(pNode,nLevel);
             break;
-        case NMATRIX:
+        case SmNodeType::Matrix:
             HandleSmMatrix(static_cast<SmMatrixNode *>(pNode),nLevel);
             break;
-        case NLINE:
+        case SmNodeType::Line:
             {
             pS->WriteUChar( 0x0a );
             pS->WriteUChar( LINE );
@@ -2017,10 +2017,10 @@ void MathType::HandleNodes(SmNode *pNode,int nLevel)
             pS->WriteUChar( END );
             }
             break;
-        case NALIGN:
+        case SmNodeType::Align:
             HandleMAlign(pNode,nLevel);
             break;
-        case NBLANK:
+        case SmNodeType::Blank:
             pS->WriteUChar( CHAR );
             pS->WriteUChar( 0x98 );
             if (pNode->GetToken().eType == TSBLANK)
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 7cf4b7384839..8cf71b772232 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -469,7 +469,7 @@ void SmExpressionNode::CreateTextFromNode(OUString &rText)
         {
             pNode->CreateTextFromNode(rText);
             //Just a bit of foo to make unary +asd -asd +-asd -+asd look nice
-            if (pNode->GetType() == NMATH)
+            if (pNode->GetType() == SmNodeType::Math)
                 if ((nSize != 2) ||
                     ( !rText.endsWith("+") && !rText.endsWith("-") ))
                     rText += " ";
@@ -1080,7 +1080,7 @@ void SmBinDiagonalNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
            *pLine  = GetSubNode(2);
     assert(pLeft);
     assert(pRight);
-    assert(pLine && pLine->GetType() == NPOLYLINE);
+    assert(pLine && pLine->GetType() == SmNodeType::PolyLine);
 
     SmPolyLineNode *pOper = static_cast<SmPolyLineNode *>(pLine);
     assert(pOper);
@@ -1373,7 +1373,7 @@ void SmBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
     long  nBraceHeight;
     if (bScale)
     {
-        nBraceHeight = pBody->GetType() == NBRACEBODY ?
+        nBraceHeight = pBody->GetType() == SmNodeType::Bracebody ?
                               static_cast<SmBracebodyNode *>(pBody)->GetBodyHeight()
                             : pBody->GetHeight();
         nBraceHeight += 2 * (nBraceHeight * nPerc / 100L);
@@ -1566,7 +1566,7 @@ SmNode * SmOperNode::GetSymbol()
     SmNode *pNode = GetSubNode(0);
     assert(pNode);
 
-    if (pNode->GetType() == NSUBSUP)
+    if (pNode->GetType() == SmNodeType::SubSup)
         pNode = static_cast<SmSubSupNode *>(pNode)->GetBody();
 
     OSL_ENSURE(pNode, "Sm: NULL pointer!");
@@ -1697,7 +1697,7 @@ void SmAttributNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
             break;
         default :
             eVerAlign = RectVerAlign::AttributeHi;
-            if (pBody->GetType() == NATTRIBUT)
+            if (pBody->GetType() == SmNodeType::Attribut)
                 nDist = GetFont().GetFontSize().Height()
                         * rFormat.GetDistance(DIS_ORNAMENTSPACE) / 100L;
     }
@@ -1917,7 +1917,7 @@ void SmFontNode::SetSizeParameter(const Fraction& rValue, FontSizeType eType)
 
 
 SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken)
-    : SmGraphicNode(NPOLYLINE, rNodeToken)
+    : SmGraphicNode(SmNodeType::PolyLine, rNodeToken)
     , maPoly(2)
     , maToSize()
     , mnWidth(0)
@@ -2044,7 +2044,7 @@ SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, sal_uIn
 }
 
 SmTextNode::SmTextNode( const SmToken &rNodeToken, sal_uInt16 nFontDescP )
-    : SmVisibleNode(NTEXT, rNodeToken)
+    : SmVisibleNode(SmNodeType::Text, rNodeToken)
     , mnFontDesc(nFontDescP)
     , mnSelectionStart(0)
     , mnSelectionEnd(0)
@@ -2103,16 +2103,16 @@ void SmTextNode::CreateTextFromNode(OUString &rText)
     {
         SmParser aParseTest;
         std::unique_ptr<SmTableNode> pTable(aParseTest.Parse(GetToken().aText));
-        assert(pTable->GetType() == NTABLE);
+        assert(pTable->GetType() == SmNodeType::Table);
         bQuoted=true;
         if (pTable->GetNumSubNodes() == 1)
         {
             SmNode *pResult = pTable->GetSubNode(0);
-            if ( (pResult->GetType() == NLINE) &&
+            if ( (pResult->GetType() == SmNodeType::Line) &&
                 (pResult->GetNumSubNodes() == 1) )
             {
                 pResult = pResult->GetSubNode(0);
-                if (pResult->GetType() == NTEXT)
+                if (pResult->GetType() == SmNodeType::Text)
                     bQuoted=false;
             }
         }
@@ -2345,7 +2345,7 @@ const SmNode * SmMatrixNode::GetLeftMost() const
 
 
 SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken)
-:   SmSpecialNode(NMATH, rNodeToken, FNT_MATH)
+:   SmSpecialNode(SmNodeType::Math, rNodeToken, FNT_MATH)
 {
     sal_Unicode cChar = GetToken().cMathChar;
     if (sal_Unicode('\0') != cChar)
@@ -2590,7 +2590,7 @@ SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sa
 
 
 SmSpecialNode::SmSpecialNode(const SmToken &rNodeToken)
-    : SmTextNode(NSPECIAL, rNodeToken, FNT_MATH)  // default Font isn't always correct!
+    : SmTextNode(SmNodeType::Special, rNodeToken, FNT_MATH)  // default Font isn't always correct!
     , mbIsFromGreekSymbolSet(lcl_IsFromGreekSymbolSet( rNodeToken.aText ))
 {
 }
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx
index 0aeabe8c6ac5..39b47a6d990b 100644
--- a/starmath/source/ooxmlexport.cxx
+++ b/starmath/source/ooxmlexport.cxx
@@ -238,7 +238,7 @@ void SmOoxmlExport::HandleRoot( const SmRootNode* pNode, int nLevel )
 
 static OString mathSymbolToString( const SmNode* node )
 {
-    assert( node->GetType() == NMATH || node->GetType() == NMATHIDENT );
+    assert( node->GetType() == SmNodeType::Math || node->GetType() == SmNodeType::MathIdent );
     const SmTextNode* txtnode = static_cast< const SmTextNode* >( node );
     assert( txtnode->GetText().getLength() == 1 );
     sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode( txtnode->GetText()[0] );
@@ -261,7 +261,7 @@ void SmOoxmlExport::HandleOperator( const SmOperNode* pNode, int nLevel )
         case TCOPROD:
         case TSUM:
         {
-            const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == NSUBSUP
+            const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == SmNodeType::SubSup
                 ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : nullptr;
             const SmNode* operation = subsup != nullptr ? subsup->GetBody() : pNode->GetSubNode( 0 );
             m_pSerializer->startElementNS( XML_m, XML_nary, FSEND );
@@ -303,7 +303,7 @@ void SmOoxmlExport::HandleOperator( const SmOperNode* pNode, int nLevel )
             HandleNode( pNode->GetSymbol(), nLevel + 1 );
             m_pSerializer->endElementNS( XML_m, XML_e );
             m_pSerializer->startElementNS( XML_m, XML_lim, FSEND );
-            if( const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == NSUBSUP
+            if( const SmSubSupNode* subsup = pNode->GetSubNode( 0 )->GetType() == SmNodeType::SubSup
                 ? static_cast< const SmSubSupNode* >( pNode->GetSubNode( 0 )) : nullptr )
             {
                 if( subsup->GetSubSup( CSUB ) != nullptr )
@@ -466,14 +466,14 @@ void SmOoxmlExport::HandleBrace( const SmBraceNode* pNode, int nLevel )
             FSNS( XML_m, XML_val ), mathSymbolToString( pNode->OpeningBrace()).getStr(), FSEND );
 
     std::vector< const SmNode* > subnodes;
-    if( pNode->Body()->GetType() == NBRACEBODY )
+    if( pNode->Body()->GetType() == SmNodeType::Bracebody )
     {
         const SmBracebodyNode* body = static_cast< const SmBracebodyNode* >( pNode->Body());
         bool separatorWritten = false; // assume all separators are the same
         for( int i = 0; i < body->GetNumSubNodes(); ++i )
         {
             const SmNode* subnode = body->GetSubNode( i );
-            if (subnode->GetType() == NMATH || subnode->GetType() == NMATHIDENT)
+            if (subnode->GetType() == SmNodeType::Math || subnode->GetType() == SmNodeType::MathIdent)
             { // do not write, but write what separator it is
                 const SmMathSymbolNode* math = static_cast< const SmMathSymbolNode* >( subnode );
                 if( !separatorWritten )
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 9acd9d494a1d..1022505b89e0 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -179,7 +179,7 @@ namespace
 {
 OString mathSymbolToString(const SmNode* node, rtl_TextEncoding nEncoding)
 {
-    assert(node->GetType() == NMATH || node->GetType() == NMATHIDENT);
+    assert(node->GetType() == SmNodeType::Math || node->GetType() == SmNodeType::MathIdent);
     auto txtnode = static_cast<const SmTextNode*>(node);
     if (txtnode->GetText().isEmpty())
         return OString();
@@ -206,7 +206,7 @@ void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel)
     case TCOPROD:
     case TSUM:
     {
-        const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr;
+        const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == SmNodeType::SubSup ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr;
         const SmNode* operation = subsup ? subsup->GetBody() : pNode->GetSubNode(0);
         m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MNARY " ");
         m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MNARYPR " ");
@@ -248,7 +248,7 @@ void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel)
         HandleNode(pNode->GetSymbol(), nLevel + 1);
         m_pBuffer->append("}"); // me
         m_pBuffer->append("{" LO_STRING_SVTOOLS_RTF_MLIM " ");
-        if (const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == NSUBSUP ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr)
+        if (const SmSubSupNode* subsup = pNode->GetSubNode(0)->GetType() == SmNodeType::SubSup ? static_cast<const SmSubSupNode*>(pNode->GetSubNode(0)) : nullptr)
             if (subsup->GetSubSup(CSUB))
                 HandleNode(subsup->GetSubSup(CSUB), nLevel + 1);
         m_pBuffer->append("}"); // mlim
@@ -403,14 +403,14 @@ void SmRtfExport::HandleBrace(const SmBraceNode* pNode, int nLevel)
     m_pBuffer->append(mathSymbolToString(pNode->OpeningBrace(), m_nEncoding));
     m_pBuffer->append("}"); // mbegChr
     std::vector< const SmNode* > subnodes;
-    if (pNode->Body()->GetType() == NBRACEBODY)
+    if (pNode->Body()->GetType() == SmNodeType::Bracebody)
     {
         auto body = static_cast<const SmBracebodyNode*>(pNode->Body());
         bool separatorWritten = false; // assume all separators are the same
         for (int i = 0; i < body->GetNumSubNodes(); ++i)
         {
             const SmNode* subnode = body->GetSubNode(i);
-            if (subnode->GetType() == NMATH || subnode->GetType() == NMATHIDENT)
+            if (subnode->GetType() == SmNodeType::Math || subnode->GetType() == SmNodeType::MathIdent)
             {
                 // do not write, but write what separator it is
                 auto math = static_cast<const SmMathSymbolNode*>(subnode);
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 724b9f0ee64d..0174b53a486d 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -524,9 +524,9 @@ SmSetSelectionVisitor::SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos en
     , mbSelecting(false)
 {
     //Assume that pTree is a SmTableNode
-    SAL_WARN_IF(pTree->GetType() != NTABLE, "starmath", "pTree should be a SmTableNode!");
+    SAL_WARN_IF(pTree->GetType() != SmNodeType::Table, "starmath", "pTree should be a SmTableNode!");
     //Visit root node, this is special as this node cannot be selected, but its children can!
-    if(pTree->GetType() == NTABLE){
+    if(pTree->GetType() == SmNodeType::Table){
         //Change state if maStartPos is in front of this node
         if( maStartPos.pSelectedNode == pTree && maStartPos.nIndex == 0 )
             mbSelecting = !mbSelecting;
@@ -605,9 +605,9 @@ void SmSetSelectionVisitor::DefaultVisit( SmNode* pNode ) {
     {
         //Select this node and all of its children
         //(Make exception for SmBracebodyNode)
-        if( pNode->GetType() != NBRACEBODY ||
+        if( pNode->GetType() != SmNodeType::Bracebody ||
             !pNode->GetParent() ||
-            pNode->GetParent()->GetType() != NBRACE )
+            pNode->GetParent()->GetType() != SmNodeType::Brace )
             SetSelectedOnAll( pNode );
         else
             SetSelectedOnAll( pNode->GetParent() );
@@ -736,9 +736,9 @@ SmCaretPosGraphBuildingVisitor::SmCaretPosGraphBuildingVisitor( SmNode* pRootNod
     , mpGraph(new SmCaretPosGraph)
 {
     //pRootNode should always be a table
-    SAL_WARN_IF( pRootNode->GetType( ) != NTABLE, "starmath", "pRootNode must be a table node");
-    //Handle the special case where NTABLE is used a rootnode
-    if( pRootNode->GetType( ) == NTABLE ){
+    SAL_WARN_IF( pRootNode->GetType( ) != SmNodeType::Table, "starmath", "pRootNode must be a table node");
+    //Handle the special case where SmNodeType::Table is used a rootnode
+    if( pRootNode->GetType( ) == SmNodeType::Table ){
         //Children are SmLineNodes
         //Or so I thought... Apparently, the children can be instances of SmExpression
         //especially if there's a error in the formula... So he we go, a simple work around.
@@ -977,7 +977,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
     bodyRight->SetRight( right );
 
     //Get subsup pNode if any
-    SmSubSupNode* pSubSup = pOper->GetType( ) == NSUBSUP ? static_cast<SmSubSupNode*>(pOper) : nullptr;
+    SmSubSupNode* pSubSup = pOper->GetType( ) == SmNodeType::SubSup ? static_cast<SmSubSupNode*>(pOper) : nullptr;
 
     SmNode* pChild;
     SmCaretPosGraphEntry *childLeft;
@@ -1491,7 +1491,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmBraceNode* pNode )
     SmCaretPosGraphEntry  *left = mpRightMost,
                         *right = mpGraph->Add( SmCaretPos( pNode, 1 ) );
 
-    if( pBody->GetType() != NBRACEBODY ) {
+    if( pBody->GetType() != SmNodeType::Bracebody ) {
         mpRightMost = mpGraph->Add( SmCaretPos( pBody, 0 ), left );
         left->SetRight( mpRightMost );
     }else
@@ -2004,12 +2004,12 @@ void SmNodeToTextVisitor::Visit( SmOperNode* pNode )
     Separate( );
     if( pNode->GetToken( ).eType == TOPER ){
         //There's an SmGlyphSpecialNode if eType == TOPER
-        if( pNode->GetSubNode( 0 )->GetType( ) == NSUBSUP )
+        if( pNode->GetSubNode( 0 )->GetType( ) == SmNodeType::SubSup )
             Append( pNode->GetSubNode( 0 )->GetSubNode( 0 )->GetToken( ).aText );
         else
             Append( pNode->GetSubNode( 0 )->GetToken( ).aText );
     }
-    if( pNode->GetSubNode( 0 )->GetType( ) == NSUBSUP ) {
+    if( pNode->GetSubNode( 0 )->GetType( ) == SmNodeType::SubSup ) {
         SmSubSupNode *pSubSup = static_cast<SmSubSupNode*>( pNode->GetSubNode( 0 ) );
         SmNode* pChild = pSubSup->GetSubSup( LSUP );
         if( pChild ) {
@@ -2190,7 +2190,7 @@ void SmNodeToTextVisitor::Visit( SmUnHorNode* pNode )
 void SmNodeToTextVisitor::Visit( SmBinHorNode* pNode )
 {
     const SmNode *pParent = pNode->GetParent();
-    bool bBraceNeeded = pParent && pParent->GetType() == NFONT;
+    bool bBraceNeeded = pParent && pParent->GetType() == SmNodeType::Font;
     SmNode *pLeft  = pNode->LeftOperand(),
            *pOper  = pNode->Symbol(),
            *pRight = pNode->RightOperand();
@@ -2361,15 +2361,15 @@ void SmNodeToTextVisitor::Visit( SmLineNode* pNode )
 
 void SmNodeToTextVisitor::Visit( SmExpressionNode* pNode )
 {
-    bool bracketsNeeded = pNode->GetNumSubNodes() != 1 || pNode->GetSubNode(0)->GetType() == NBINHOR;
+    bool bracketsNeeded = pNode->GetNumSubNodes() != 1 || pNode->GetSubNode(0)->GetType() == SmNodeType::BinHor;
     if (!bracketsNeeded)
     {
         const SmNode *pParent = pNode->GetParent();
         // nested subsups
         bracketsNeeded =
-            pParent && pParent->GetType() == NSUBSUP &&
+            pParent && pParent->GetType() == SmNodeType::SubSup &&
             pNode->GetNumSubNodes() == 1 &&
-            pNode->GetSubNode(0)->GetType() == NSUBSUP;
+            pNode->GetSubNode(0)->GetType() == SmNodeType::SubSup;
     }
 
     if (bracketsNeeded) {
diff --git a/starmath/source/wordexportbase.cxx b/starmath/source/wordexportbase.cxx
index a5136a729220..66bec0c2d3fa 100644
--- a/starmath/source/wordexportbase.cxx
+++ b/starmath/source/wordexportbase.cxx
@@ -22,34 +22,34 @@ void SmWordExportBase::HandleNode(const SmNode* pNode, int nLevel)
     SAL_INFO("starmath.wordbase", "Node: " << nLevel << " " << int(pNode->GetType()) << " " << pNode->GetNumSubNodes());
     switch (pNode->GetType())
     {
-    case NATTRIBUT:
+    case SmNodeType::Attribut:
         HandleAttribute(static_cast< const SmAttributNode* >(pNode), nLevel);
         break;
-    case NTEXT:
+    case SmNodeType::Text:
         HandleText(pNode,nLevel);
         break;
-    case NVERTICAL_BRACE:
+    case SmNodeType::VerticalBrace:
         HandleVerticalBrace(static_cast< const SmVerticalBraceNode* >(pNode), nLevel);
         break;
-    case NBRACE:
+    case SmNodeType::Brace:
         HandleBrace(static_cast< const SmBraceNode* >(pNode), nLevel);
         break;
-    case NOPER:
+    case SmNodeType::Oper:
         HandleOperator(static_cast< const SmOperNode* >(pNode), nLevel);
         break;
-    case NUNHOR:
+    case SmNodeType::UnHor:
         HandleUnaryOperation(static_cast< const SmUnHorNode* >(pNode), nLevel);
         break;
-    case NBINHOR:
+    case SmNodeType::BinHor:
         HandleBinaryOperation(static_cast< const SmBinHorNode* >(pNode), nLevel);
         break;
-    case NBINVER:
+    case SmNodeType::BinVer:
         HandleFractions(pNode,nLevel,nullptr);
         break;
-    case NROOT:
+    case SmNodeType::Root:
         HandleRoot(static_cast< const SmRootNode* >(pNode), nLevel);
         break;
-    case NSPECIAL:
+    case SmNodeType::Special:
     {
         auto pText= static_cast<const SmTextNode*>(pNode);
         //if the token str and the result text are the same then this
@@ -60,38 +60,38 @@ void SmWordExportBase::HandleNode(const SmNode* pNode, int nLevel)
             HandleMath(pText,nLevel);
         break;
     }
-    case NMATH:
-    case NMATHIDENT:
+    case SmNodeType::Math:
+    case SmNodeType::MathIdent:
         HandleMath(pNode,nLevel);
         break;
-    case NSUBSUP:
+    case SmNodeType::SubSup:
         HandleSubSupScript(static_cast< const SmSubSupNode* >(pNode), nLevel);
         break;
-    case NEXPRESSION:
+    case SmNodeType::Expression:
         HandleAllSubNodes(pNode, nLevel);
         break;
-    case NTABLE:
+    case SmNodeType::Table:
         //Root Node, PILE equivalent, i.e. vertical stack
         HandleTable(pNode,nLevel);
         break;
-    case NMATRIX:
+    case SmNodeType::Matrix:
         HandleMatrix(static_cast< const SmMatrixNode* >(pNode), nLevel);
         break;
-    case NLINE:
+    case SmNodeType::Line:
     {
 // TODO
         HandleAllSubNodes(pNode, nLevel);
     }
     break;
 #if 0
-    case NALIGN:
+    case SmNodeType::Align:
         HandleMAlign(pNode,nLevel);
         break;
 #endif
-    case NPLACE:
+    case SmNodeType::Place:
         // explicitly do nothing, MSOffice treats that as a placeholder if item is missing
         break;
-    case NBLANK:
+    case SmNodeType::Blank:
         HandleBlank();
         break;
     default:


More information about the Libreoffice-commits mailing list